iimachines / maya2gltf Goto Github PK
View Code? Open in Web Editor NEWMaya to glTF 2.0 exporter
License: MIT License
Maya to glTF 2.0 exporter
License: MIT License
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
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...
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.
STEPS:
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.
Is there any way to add or fake refraction in shaders.
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?
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.
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.
Currently texture coordinates are only exported when a mesh has textures.
But texture coordinates are also needed to generate tangents on the fly.
The default behavior should be to export texture coordinates if the mesh has these, unless explicitly disabled with a flag
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!
:/
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.
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?
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
λ 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'
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.
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.
Some viewers (like https://gltf-viewer.donmccurdy.com/) seem to require a lower-case gltf
file extension.
This might break other viewers of-course.
By default we will use gltf
lower-case, and add an argument for tweaking this.
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 . . .
When opening the zip file in Windows it shows an error message: "The Compressed (zipped) folder is invalid".
Hello!
I am having an issue with the maya PBR material. While applying maps to my car body, I have applied the following texture:
...to the Environment fields outlined below:
I export the object out of maya, but unfortunately, when I import my object into the threejs editor my environment map is empty.
Am I using the environment properties incorrectly or is this a bug?
But should be, we can just leave out setting the skeleton
property in the GLTF skin.
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.
The material properties inside of ThreeJS editor provides me with option of rendering the FRONT, BACK, or DOUBLE.
I need this option to be set to DOUBLE. Is there a way to do this with the PBR material?
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.
The pattern cannot be made lowercase
It both matches normal
and orm
, need to match a seperator first
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)
My model is not displayed in the viewer below.
https://gltf-viewer.donmccurdy.com/
Because ambient color is not applied?
How can I solve it?
When playing back the skinning animated clips, both ThreeJS and BabylonJS twist the cube incorrectly.
Might be because of the shifted pivot point (incorrect inverse-bind-pose)?
This might be difficult since glTF doesn't have a notion of this, meaning we should bake the UV transformations in the UV coordinates...
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?
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!
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.
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.
When trying to export semi-transparent lambert or phong material, the exporter drops the setting leaving the material opaque on import.
Complex characters with morphing and skinning don't export correctly when applying a scale factor
When exporting an object twice to the same folder all the files are overwritten but the combined occlusion/roughness/metallic map, since the exporter gives this file a unique GUID name. This might result in unreferenced generated files piling up in the export folder.
in any case, if you need help, we can test your work with Godot as soon as you have something going.
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
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.
Exporting a combined object results in wrong texture coordinate semantics, like TEXCOORD_1
instead of TEXCOORD_0
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?
Is there some test on Maya 2016 x64 ?
Currently each instanced maya shape is exported as a new mesh. Most code should be in place to deal with instances.
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)
Is there any way to add maps as alpha.
When passing multiple -acn "clipX"
flags, Maya2glTF fails with the error
// Error: line 1: Invalid flag '-acn (animationClipName): (kFailure): Unexpected Internal Failure
I didnt find any option to make the backface visible in maya gltf shader, can you help
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*"(.+)"" ReplacementText="$maya2glTF_version = "$(GIT_Tag) $(GIT_Hash)"" />
to:
<FileUpdate Files="$(ProjectDir)\maya\scripts\maya2glTF_UI.mel" Multiline="true" Singleline="false" Regex="\$maya2glTF_version\s*\=\s*"(.+)"" ReplacementText="$maya2glTF_version = "$(GIT_Tag) $(GIT_Hash)"" Encoding="utf-8-without-bom" />
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.