Maybe I can help clarify coop’s question. We’re actually working on the same project. He has a maya rig that has several layers of joints. Some joints actually represent the joints that animations are applied to and ultimatly will be used in the game. Some joints are just a “helper” control rig he uses to animate the character more easily within maya.
When we export his file using maya2egg the resulting egg file contains all of the skeleton joints and the helper joints. Ideally we would like to strip out the extra “helper” joints and leave the core skeleton joints.
We are using “controlJoint” and “exposeJoint” in a few instances. Namely to attach objects/items to our characters and to control morph targets. We are also making use of actor.makeSubPart(…) to allow us to play different animations on various parts of our actors. All of these methods require there to be some named joints in the actor file that we can get out at run time.
However, when I run egg-optchar on the .egg file and it’s associated animation files it seems to get rid of all our joints including the ones that are part of the heirarchy we want. For example:
Before Optimization:
>egg-optchar model.egg -ls
Character: MON_bind
MON:CON
MON:CONjo_PROP_L_HandINH
MON:jo_PROP_L_HandCON_GRP
MON:CONjo_PROP_R_HandINH
MON:jo_PROP_R_HandCON_GRP
MON:CONjo_PROP_R_ShoulderINH
MON:jo_PROP_R_ShoulderCON_GRP
....<LOTS OF JOINTS> ....
MON:world
MON:facialshapes.0
MON:facialshapes.1
MON:facialshapes.14
MON:facialshapes.15
MON:facialshapes.3
MON:facialshapes.5
MON:facialshapes.7
MON:facialshapes.9
MON:facialshapes.10
MON:facialshapes.11
MON:facialshapes.12
MON:facialshapes.13
MON:facialshapes.4
MON:facialshapes.6
MON:facialshapes.2
MON:facialshapes.8
175 joints.
Then I run the optimization on this model and an animation that will be applied to it:
>egg-optchar -d testdir model.egg anim.egg
MON_bind has 191 components.
MON_Walk has 221 components.
175 original joints in MON_bind
26 identity joints
149 unanimated joints
----
0 joints remaining
205 original joints in MON_Walk
26 identity joints
116 unanimated joints
63 empty joints
----
0 joints remaining
Writing testdir/model.egg
Writing testdir/anim.egg
The new joint heirarchy for the model becomes:
>egg-optchar model.egg -ls
<NOTHING>
That is no heirarchy seems to exist anymore
The joint heirarchy for the animation becomes:
>egg-optchar anim.egg -ls
Character: MON_Walk
MON:facialshapes.0
MON:facialshapes.1
MON:facialshapes.10
MON:facialshapes.11
MON:facialshapes.12
MON:facialshapes.13
MON:facialshapes.14
MON:facialshapes.15
MON:facialshapes.2
MON:facialshapes.3
MON:facialshapes.4
MON:facialshapes.5
MON:facialshapes.6
MON:facialshapes.7
MON:facialshapes.8
MON:facialshapes.9
0 joints.
When I try to play back this animation on our model, it doesn’t work (not suprising because it doesn’t have any joints.
It seems to me that either egg-opchar’s default behavior is too aggressive for us in how it removes joints, or it doesn’t support animations being in seperate files from models or I’m simply using it wrong.
At any rate, I think the root of the problem is that our models have a whole bunch of joints, some we want to see in the game and some we don’t. We’re looking for a simple way to export the ones we want and not export the ones we don’t.
My current solution plan is to write a simple mel script that allows our animators to tag the joints that should and should not be exported so we can pass this info to egg-optchar to get rid of or keep various joints using its “-keep” and “-drop” commands.
The other idea is to put the control joints and the skeleton joints in some kind of “selection set” so that during export time we only export the selection set that has the skeleton heirarchy that we actually want in the game.
Naturally, if anyone knows of a better solution for this problem within panda we’d be happy to hear it.
Thanks,
Aaron