Can someone tell me the process for turning a Maya animation into an animation egg file? First, I don’t even know how to do this with a rigged character (which seems to be the most common occurrence). But, second, I would like to animate doors opening in a level and reference those as animations through an Actor that I’ll call terrainActor. Doors don’t have bones like characters so I wasn’t sure how to approach that.
Focusing on the doors issue, I have animated them in Maya to open and close, I then used the maya2egg converter to create an animation file specifically. I used the command:
maya2egg8 -a chan -o myEggFile.egg myMayaFile.mb
I get an egg file out and I tried loading up my terrain as an Actor with the addition of that door opening animation. When I run my application I get the following warning:
:Actor(warning): ../../assets/eggFiles/levels/lobby/Lobby_Test3 is not a character!
When I try playing the animation anyways, I get a true error that ends with:
File "C:\Panda3D-1.7.0\direct\actor\Actor.py", line 2341, in __bindAnimToPart
bundle = self.__commonBundleHandles[subpartDef.truePartName].getBundle()
Can anyone explain this error to me? Seems like some kind of geometry/grouping structure is expected by Panda but I don’t know what this structure is. I’ve searched for the character warning and found a couple posts, but they did not seem to answer this question.
An “animation” file is just a table of animation data, which is used to apply animation to a “model” file. The actual geometry is contained in the “model” file, not in the “animation” file.
To create an animated model, you need both types. You get the model file with -a model, and the animation file with -a chan.
Doors should work just fine. Any animated node in the Maya scene (such as an animated door) is implicitly turned into a bone by the converter. However, you may have some challenges in using the resulting animation files to animate the doors in a programmatic way, because the animation files will animate all the doors at once. You’ll probably need to use partial-body animation at runtime to apply an animation to only the door(s) you wish at any given time.
Note, by the way, that the Panda default is to collapse all geometry in an animated model into a single node, which is optimal for things like characters moving around in a scene, but can be suboptimal when you apply it to your entire environment. One easy way to disable this optimization is to pass the resulting model file through egg-optchar with the “-dart structured” flag.
Thanks for the information. Do you have any idea what is causing the issue I’m having with the terrain Actor mentioned above?
I have both a model and animation file and I load them in via the Actor constructor. Based on your explanation it seems to me like it should work…but for some reason it doesn’t. When Panda says “X is not a character!” do you know why it says that? Do you know what Panda sees or doesn’t see in the model/animation file to cause that warning?
Actually, it looks like the problem was a result of exporting the model without “-a model” in the command. I was trying to apply an animation to a model that was exported the normal way - and apparently that breaks things. Therefore, the original error has been solved.