Code Monkey home page Code Monkey logo

maya2gltf's Issues

Optimize nodes with a single shape

Currently a Maya transform node with child shape is exported as two glTF nodes (eg pCube1 and pCubeShape1). However, if the Maya transform only has a single shape (the common case), the second glTF node is redundant.

Document exporting animation clips and setup pose at frame 0

Update the README, frame 0 (or the frame specified with the -ivt argument) should contain a setup pose, Maya2glTF is not using Maya's skin binding pose information, since that turns out to be unreliable (can be locked, so going to the binding pose is not always possible unless modifying the scene)

backface visibility

I didnt find any option to make the backface visible in maya gltf shader, can you help

maya2glTF.mel invalid encoding

The <FileUpdate> MSBuild task for updating the version in the mel script uses UTF-8 with BOM encoding when I believe Maya expects UTF8.

I see this error when attempting to load the MEL script:

source "C:/Users/robertlong/Documents/maya/2018/scripts/maya2glTF_UI.mel";
// Error: proc string _quoted(string $text)
 // 
// Error: "C:/Users/robertlong/Documents/maya/2018/scripts/maya2glTF_UI.mel" line 1.2: Syntax error // 

I can't make a PR right now because of the LFS quota (see #31) but here's the fix.

In Maya2glTF.vcxproj change this:

<FileUpdate Files="$(ProjectDir)\maya\scripts\maya2glTF_UI.mel" Multiline="true" Singleline="false" Regex="\$maya2glTF_version\s*\=\s*&quot;(.+)&quot;" ReplacementText="$maya2glTF_version = &quot;$(GIT_Tag) $(GIT_Hash)&quot;" />

to:

 <FileUpdate Files="$(ProjectDir)\maya\scripts\maya2glTF_UI.mel" Multiline="true" Singleline="false" Regex="\$maya2glTF_version\s*\=\s*&quot;(.+)&quot;" ReplacementText="$maya2glTF_version = &quot;$(GIT_Tag) $(GIT_Hash)&quot;" Encoding="utf-8-without-bom" />

Implement logical parents

This allows overriding the actual parent to be used, using e.g. a custom attribute.

Like this a completely different hierarchy can be exported without having to create and maintain two different rigs in Maya.

Error: No object matches name: GLSLShader1.u_BaseColorTexture on Mac

I was able to succesfully build and install the script on Mac, however I am getting the error below, when assigning PBR shader to selection

// Error: line 0: No object matches name: GLSLShader1.u_BaseColorTexture

Using Maya 2018, I am simply creating a simple cube, then trying to assign the PBR shader using maya2glTF_UI.

Adding opacity map to glTF_PBR.ogsfx shader?

I found that you can change the glTF_PBR.ogsfx's technique to transparent, but I'm unable to find a slot to input an opacity map. How would you go about doing this/is it even possible?

Implement segment scale compensation

Investigate if this can be handled by adding one/two extra joints before/after each joint that requires segment scale compensation, and that actually has a non-uniformly scaling parent (taking all animation into account)

BaseColorFactor inside the glTF_PBR.ogsfx shader is not being exported

STEPS:

  1. Create new maya scene
  2. Click CREATE -> Polygon Primitives -> Cube
  3. Launch maya2glTF UI and click ASSIGN PBR SHADER TO SELECTION
  4. Modify BASE COLOR FACTOR to any RGB value other than 255, 255, 255
  5. Select the Cube mesh in the viewport
  6. Inside the maya2glTF UI click EXPORT SELECTED MESHES
  7. Import exported GLTF into a GLTF viewer or ThreeJS editor

RESULT:
BASE COLOR FACTOR value is not exported.

As an artist I expect this value to directly correlated to COLOR attribute inside of THREEjs editor. Even though I modify this value inside the material in Maya, the COLOR attribute inside of THREEjs editor defaults to 255, 255, 255.

image

image

MacOS High Sierra 10.13.6 error

Hey there,

I get the following error when trying to compile on MacOS Sierra 10.13.6:

[ 46%] Building CXX object CMakeFiles/maya2glTF.dir/src/MeshVertices.cpp.o
/Users/davnelso/Documents/Maya2glTF/src/MeshVertices.cpp:422:39: error: no member named 'clamp' in namespace 'std'
const auto assignmentCount = std::clamp(assignmentsSize - componentOffset, 0, vertexJointAssignmentElementSize);
~~~~~^
/Users/davnelso/Documents/Maya2glTF/src/MeshVertices.cpp:422:48: error: expected '(' for function-style cast or type construction
const auto assignmentCount = std::clamp(assignmentsSize - componentOffset, 0, vertexJointAssignmentElementSize);
~~~^
/Users/davnelso/Documents/Maya2glTF/src/MeshVertices.cpp:422:66: warning: expression result unused [-Wunused-value]
const auto assignmentCount = std::clamp(assignmentsSize - componentOffset, 0, vertexJointAssignmentElementSize);
~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~
/Users/davnelso/Documents/Maya2glTF/src/MeshVertices.cpp:423:39: error: no member named 'clamp' in namespace 'std'
const auto assignmentIndex = std::clamp(componentOffset, 0, assignmentsSize - assignmentCount);
~~~~~^
/Users/davnelso/Documents/Maya2glTF/src/MeshVertices.cpp:423:48: error: expected '(' for function-style cast or type construction
const auto assignmentIndex = std::clamp(componentOffset, 0, assignmentsSize - assignmentCount);
~~~^
/Users/davnelso/Documents/Maya2glTF/src/MeshVertices.cpp:423:50: warning: expression result unused [-Wunused-value]
const auto assignmentIndex = std::clamp(componentOffset, 0, assignmentsSize - assignmentCount);
^~~~~~~~~~~~~~~
2 warnings and 4 errors generated.
make[2]: *** [CMakeFiles/maya2glTF.dir/src/MeshVertices.cpp.o] Error 1
make[1]: *** [CMakeFiles/maya2glTF.dir/all] Error 2
make: *** [all] Error 2

Got any quick solutions I may be missing to compile this?

Thanks,
-David.

implement mesh instancing

Currently each instanced maya shape is exported as a new mesh. Most code should be in place to deal with instances.

Support place2dTexture nodes

This might be difficult since glTF doesn't have a notion of this, meaning we should bake the UV transformations in the UV coordinates...

PBR material is being imported as standard material in THREEjs

Hello,

Sorry in advance if this is a feature request and not a bug. Currently when I import a model into THREEjs editor its material is set to MESHSTANDARDMATERIAL. I am using the PBR material provided along with the exporter. The behavior I would expect is for the material to be set as MESHPHYSICALMATERIAL upon import.

One of the big reasons we use MESHPHYSICALMATERIAL over standard is because ambient lights and hemisphere lights only affect MESHPHYSICALMATERIAL. We use these lights all the time and they play a key role in our artist toolset.

Again this could be a feature request or possibly a bug with the maya material. Thanks in advance!

Basecolor and emissive color picker is confusing

When picking colors in the PBR shader for the base color and emissive color, the artist expect these to be in sRGB space, just as typical textures.

However, in GLTF, these factors are in linear space. We need to add options to indicate the intended color space of these diffuse and colors, which should be sRGB by default. This will unfortunately break existing models...

Adding support for Maya 2014

It would be awesome if older versions of Maya, like Maya 2014 could be supported. The main reason is that Maya 2014 was one of the last version of Maya before AutoDesk switched to a subscription model.

Exporting without animation uses wrong binding pose

When exporting a single frame, the skin binding pose is baked at that frame, even when passing the initialValuesTime parameter.

When passing initialValuesTime, the skin binding pose from that frame must be used instead.

Obviously the transformation from the current frame must be stored inside the nodes, it is only the binding pose that must change.

The same can apply to morphing, but that might already work correctly.

UI not refreshing

In v0.9.4, the UI is not updating when a new scene is loaded, or the current scene is modified.

Either add a refresh button, or subscribe to change events

Maya "reshade" bug.

Hey There! First, thank you for this plugin. It works great so far, the flow from Substance to Maya and out to glTF is fantastic.

I was experiencing this small issue. I have a model I wanted to test with 3 different sized maps. I assign the PBR, the window pops up asking for all the "textures" I select them and perfectly it exports the mapped model as a glTF.

When I go back to "change the maps" in the shader I experience odd things such as, "Roughness" appears to have "Normal" mapped to it, yet "Normal" also has a "Normal" mapped to it. Seeing that, my instinct was to delete the shader and start over (which is fine with me). What happens now though is the new assigned shader comes in and assigns but we don't get the dialogue to "select" maps anymore.

My solution as of now has been to quit Maya and restart all from the top and it works that way just fine.

Also one small detail, is there any way the extension can write out as "gltf" instead of "glTF"? some viewers are rejecting the files as "glTF" and it's got to be renamed to "gltf".

Again thank you for these scripts!

-Patrick

Maya2GLTF PBR Material - Environment maps not being exported

Hello!

I am having an issue with the maya PBR material. While applying maps to my car body, I have applied the following texture:
t_cityblock_env

...to the Environment fields outlined below:
image

I export the object out of maya, but unfortunately, when I import my object into the threejs editor my environment map is empty.
image

Am I using the environment properties incorrectly or is this a bug?

PBR OpenGL shader does not exist

As stated above I do not see the PBR OpenGL shader inside of this directory:
\Documents\maya\Maya2glTF\PBR\shaders\glTF_PBR.ogsfx

I did not attempt to compile my own version of the plugin. I downloaded the v0.9.4 BETA release. Perhaps that is the reason why. I also do not see it inside of the Maya2GLTF repo either.

Could you provide me with some direction here to obtain the shader or could you add it to the repo?

does not deploy on win10 maya2017/18

Copying "D:\Users\xxx\Desktop\Maya2glTF-master\maya\maya" to "D:\Users\xxx\Documents\maya"...
File not found - maya
0 File(s) copied
Done. Press ENTER to exit.
Press any key to continue . . .

PBR maya material does not support double-sided rendering

Hello!

I have an object that requires double-sided rendering. I do not see an option inside the Maya2GLTF material that provides that functionality. My materials are set to FRONT upon inspection inside of ThreeJS Editor. This option seems to be stored within the THREE.material.
image

The material properties inside of ThreeJS editor provides me with option of rendering the FRONT, BACK, or DOUBLE.
image

I need this option to be set to DOUBLE. Is there a way to do this with the PBR material?

How to export multiple animation clips

OS: Windows 10
Maya Version: 2017
Plugin Version: v0.9.4 BETA

After looking at your instructions I cant seem to find a way to export multiple animation clips via the UI. Ive tried to add multiple animation clips to the same track using the TRAX editor but it exports all animations into a single clip and not their own unique clips.

Could you please provide a solid example for how to export multiple animation clips? Thanks in advance!

Number of vertices

I have a question for you. I have made a simple polySphere to export to learn a bit more about the glTF format.

I have 382 vertices into my scene, but when I use your exporter, the accessor has a count of 439. Even the accessor for the indices has a a maz of 438 (the biggest index).

I would like to know since it means there's a difference in the file size at the end.

Rotate pivot group

First, thanks for your awesome plugin, it is really easy to use!

I have a problem regarding the mesh pivot point and not sure if it is an issue with this plugin or Three.JS (or probably with me). Maybe you can point me to the right direction and the right Maya setup I should use?

I am basically trying to rotate the hand of a model (with the fingers nested inside it) and keep it somehow attached to the arm, but I can't manage to. Here is the full question on threejs forum.

Transparent base-color-texture does not change material alphaMode to BLEND

Currently the only way to set the alphaMode of a material to BLEND is by setting the base color opacity to something < 1.

We should either expose the alphaMode as an attribute, scan all the pixels of the base-color-texture, or provide both

When the Technique is set to Transparent, the alphaMode must be set to BLEND

Pivot Freezed Transform

First of all, thanks for this wonderful job !

I have seen that the pivot that I have set in Maya doesn't export in the glTF file. I always setup my pivot and freeze all my transforms at the end of my asset's editing. What's the best way to export with the pivot? I'm thinking about scripting a pivot group creator that will stand at the pivot place a offset the mesh inside.

Am I wrong?

Lights

Hey guys. Thanks for your hard work! Using your fantastic plug-in for work now, I was wondering if lights could be added. I need to animate flickering lights for a scene and have to do some weird export workarounds to get lights working.

Ability to export materials with names

Currently materials are exported without their names; however, it can be useful to reference materials by names in other renderers. How possible would it be to add this functionality to Maya2glTF?

Repository over GitHub's data quota

λ git clone https://github.com/Ziriax/Maya2glTF.git
Cloning into 'Maya2glTF'...
remote: Counting objects: 2240, done.
remote: Compressing objects: 100% (169/169), done.
remote: Total 2240 (delta 148), reused 116 (delta 57), pack-reused 2013
Receiving objects: 100% (2240/2240), 54.72 MiB | 26.94 MiB/s, done.
Resolving deltas: 100% (1640/1640), done.
Downloading img/logo.png (122.79 KB)
Error downloading object: img/logo.png (10b86c0): Smudge error: Error downloading img/logo.png (10b86c0df51f756494f6d33baf6701fee6a4589d388073e0ddba9f2a121d8210): batch response: This repository is over its data quota. Purchase more data packs to restore access.

Errors logged to C:\Users\robertlong\workspace\Maya2glTF\.git\lfs\objects\logs\20180622T114433.3992671.log
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: img/logo.png: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

macOS Support

I'm interested in getting work started on macOS support. Does anyone have an idea of what is currently needed to add macOS support. Besides moving everything to CMAKE, are there other dependencies that are Windows specific right now? @donmccurdy mentioned COLLADA2GLTF may not have macOS support yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.