Closed enzyme69 closed 5 years ago
Another example I am testing is this Two Tentacles animation.
Originally I have 2 separate armatures for each tentacle. It does not export correctly from Blender to GLTF. So I ensure armature are joined into a single armature with many branches.
GLTF works correctly at GLTF online viewer.
When I am converting the result is this weirdness:
Hi @enzyme69 ! The tool has expanded into separate files. If you want to copy-paste, you would have to include all the files in the gltf2
directory, gltf2loader.py
, gltf2usd.py
gltf2usdUtils.py
usd_material.py
and gltf2UsdMaterialHelper.py
.
Though, I will make an update where you would only have to set your PATH
environment variable to the gltf2usd Source
directory, and then things should just work from command line.
As for the error you are hitting, it's because shutil
is trying to copy a file onto itself. This would happen if the source gltf file is in the same directory where you are writing out the usd file. I'll add some additional logic to prevent that from happening. In the meantime, you can export to a subdirectory within the same directory so the textures won't overlap.
Thanks for providing this model. I've been chasing down this issue and will look into that too.
Even when converted: -- and the texture also seems to get copied into the folder of the tool.
Thanks @kcoley for continuing updates~
Yep, this model is the issue I have been chasing down for a few weeks. I think your simpler model may help with troubleshooting as the walking animation is quite complex to analyze.
Hi @enzyme69 do you have the original .blend file for the ori model?
@enzyme69 actually, I was able to create a similar model in Maya and can now reproduce the issue. I think I know what is happening now and am working on a fix. Thanks again for the reference model!
@kcoley Glad it is useful :) Your tools become defacto GLTF to USDZ conversion! two_tentacles_002.blend.zip
NOTE: Maybe use Blender 2.79 (most stable). Sometimes in near future, when Blender 2.8 is official, we can use Blender 2.8.
Hi @enzyme69 . This took a while for me to get my copy of the Maya USD exporter to work, but now I know what I have to fix in the exporter to support multiple meshes sharing the same skeleton. Unfortunately, it looks like multiple skeletons currently do not animate on iOS or Mac OS, as alluded to by @wave-electron in this issue: https://github.com/kcoley/gltf2usd/issues/49
The only way to view the model would be through usdview, the Maya, or Houdini USD importers. @wave-electron mentioned a workaround by combining the meshes into one and sharing the same uv map to get it to work on iOS on that issue.
Here is a version of your model with two meshes in usdz (converted to fbx, imported to maya and exported as usd): two_tentacles_002.usdz.zip
Hopefully an upcoming iOS/Mac OS update will get this file to work.
@enzyme69 I did some reorganization of the project in the lastest merge, so now you just need gltf2usd.py
, __init__.py
, and the _usdz
folder. Hopefully that makes things easier to move around.
Closing this for now
I'm wondering what's the best way to install the Python module. In the past, I simply copy paste all the files in the source into the folder where the gltf asset is, and then run the Python tool:
But in the latest update the tools have grown and when I tested a conversion using the tests asset, I keep getting weird error:
UPDATE: Regarding me being dumb copy pasting the script into the folder, I just realized I can keep the original Tool, then open terminal inside the source tool folder and then drag and drop the GLTF file to be converted and then simply just output the result inside any folder. I am still getting familiar with commands and terminal.
For example: