Closed enzyme69 closed 6 years ago
@enzyme69 @kcoley My guess is gltf2usd.py may not handle this exception. I've tried numerous bone based animations, building the source glTF with either the COLLADA2glTF or FBX2glTF tool. The animations may load and work as expected in sandbox.babylonjs.com, but the glTF is converting to USD with distorted or broken animations that won't even load in xcode as usda or safari as a usdz. I've only successfully converted 2 bone animations so far.... and may have tried a dozen or so models to date. Even my newton_cradle model isn't converting correctly, but works fine in the glTF sandbox. The static pose meshes seem fine in most cases you can check these using the older beta 5 xcode, but the animation conversion fails in all beta versions I've tried including 6. I think the bone naming issues can be easily fixed for all cases, but different animation exceptions will require more testing and debugging. For example if you have a morph target with weight, the program will hang with an exception currently. Another issue is you take the same animation and save it as either a dae or fbx, and use the respective tools to build each glTF file, these glTF files can be widely different in node structure even though they run similar animations in the sandbox.babylonjs.com. I also performed diff operations comparing the resulting usda files and they are very different in many respects. IMHO it will take considerable time to work through some of these issues. Personally I'm unfamiliar with glTF orUSD schema to tackle some of these problems in a timely fashion. I think it would be helpful to know definitely what cases the tool will work for in its current state, and the glTF converter or exporter used to create the glTF input file. I can put together a list of what in currently hasn't worked for, but @kcoley be in a much better position to know the cases it was designed to work for.
Its only a guess based on the error. “dict object has no attribute “GetRestTransformAttr”. It seems that maybe USD schema is looking for a Rest pose that may be missing?
the USD schema for GetRestTransformAttr
A blender user had flagged this issue with glTF exporter... missing rest pose on glTF export in respect to the Armature. (July 2018)
@enzyme69 As a workaround you could try exporting as a dae file and using the COLLADA2glTF command tool to see if fixes the missing rest pose error.
@wave-electron @enzyme69 I have some time tonight to look into this. I suspect it is related to glTF node animations that are attached to joints and transferring to USD, or essentially attaching meshes to joint nodes. I believe this case was not handled for certain meshes exported from the Blender exporter, so I will see if I can get that working. Any sample models you can provide would be great
@wave-electron @enzyme69 I just merged a change to master that may help with this issue. The bug was on my side with an API change I had made earlier. I was able to get the loopingnoise gltf converted to usda and working on iOS.
Feel free to try pulling from master and let me know if you run into other issues.
@kcoley Thanks for the update, looks like only 1 Torus is animating, but at least no error this time 👍 I will investigate this from the USDA...
I will try again using simpler bone and animation. All I have here is just a bunch of mesh torus, joined into a single surface, and each of this torus got skinned into bones and animated randomly using nose.
Previously I thought that maybe bone naming or my hierarchy is the issue... 1) bunch of free bones animating does not work 2) parent those bones under a single root bone still does not work 3) rename bone hierarchy does not work 4) maybe giving each bone a different name works, instead of bone_00, bone_01, bone_02 ? not sure, will check.
PS: I am slowly reading your code to do this conversion. Ideally it should just work from Blender export to USDA, but then Blender is Python 3 hit head into Mac but anyhow, I really quite like this GLTF2USD workflow.
@enzyme69 interesting, I was able to get all the toruses to animate on iOS, though it doe look different in XCode Beta 6. This could be another difference in behavior between Mac OS and iOS. I made a screen recording on my phone for reference. IMG_1338.TRIM.MOV.zip
@kcoley You are right!! It's also working and animating on my side on iPhone and iPad.
I guess we can send bug report to Apple. MacOS and iOS USDZ has different behaviour. Sometimes it works on MacOS and not on iOS... at least this works on iOS!!
Thanks!
I basically have bunch of joints, animated, under Armature, exported from Blender.
loopingnoise.zip
Error Message:
I don't have root of this bones, wondering if this is an issue?