Animation is not applying

Hey,

I used to use these board a long long time ago, but I stopped for a while and I’ve tried to start getting into working with Panda3D again.

I’m having issues with applying animations to an actor. I run the script using the panda model / animation file and it works great, but when i just switch out the file names to my model, it seems to stop working. It just shows my model standing in the standard pose position in the non-animation file.

This is my custom class assignment…

self._tmp = DCharacter.DCharacter(.033,"human_male")
self.dA_List[0] = self._tmp

This is the code to make the character animate…

dA_ID = 0
if self.dA_List[dA_ID].control["isMoving"] and not self.dA_List[dA_ID].control["isFalling"]:
  if self.dA_List[dA_ID].Model.getCurrentAnim() != "walk":
    self.dA_List[dA_ID].Model.loop("walk")
    self.dA_List[dA_ID].aniControl["walk"].setPlayRate((1 - (2 * self.dA_List[dA_ID].control["Move_Backward"])) * (1 - (.25 * self.dA_List[dA_ID].control["Move_Backward"])))
  elif self.dA_List[dA_ID].Model.getCurrentAnim() == "walk":
    self.dA_List[dA_ID].Model.stop()
    self.dA_List[dA_ID].Model.pose("walk",5)

and here is the actor/animation declaration in my class file…

import direct.directbase.DirectStart
from direct.actor import Actor
class DCharacter():

    aniControl = {}
    control = {"Move_Forward":0,
               "Move_Backward":0,
               "isFalling":False,
               "isMoving":False }

    def __init__(self, _scale = .005, _model = "panda",  ):

        self.Model = Actor.Actor( "models/d_"+_model+"-model.egg", {"walk":"models/d_"+_model+"-jog.egg"})
        self.aniControl["walk"] = self.Model.getAnimControl("walk")

Like I said, if I declare my character without specifying another file, it just defaults to the panda one that comes with the panda3d engine, and it all works beautifully, however trying to use my human male character, it just shows the static pose view.

Files:

models/d_human_male-model.egg
models/d_human_male-jog.egg

models/d_panda-model.egg.ez
models/d_panda-jog.egg.ez

The only difference I can see is mine don’t end in .ez whatever that is, but I saw no mention of it in the panda3d manual.

If the .egg’s are needed I can post those, they are rather large.

my egg exection:
maya2egg2008 -p -a chan -sf 1 -ef 48 d_human_male-jog.mb d_human_male-jog.egg

Thanks.

So I re-egg’d both my files a few times in a row and suddenly it started working… no idea why

Though my animation is being umm… -crushed-. The model seems to get vertically crushed when the animation plays, though it seems to be trying to follow the key frames.

Am I using the incorrect execution command to egg my animation file?

Both files have the rigged model in it, one without any key frames, the other with the key frames for the jog cycle.

I’ve tried…

maya2egg2008 -a chan d_human_male-jog.mb d_human_male-jog.egg
maya2egg2008 -p -a chan -sf 1 -ef 48 d_human_male-jog.mb d_human_male-jog.egg

and they both ‘crush’ the model during animation.

Just thought I’d add that it seems to be more of an issue of over exaggerated movement. Instead of the knee lifting to about hip height, it lifts up over the characters head and extends out about 4 ft in front of the character.

Only thing I can think of is that i scaled my model by .033 and it’s almost like the skeleton didn’t scale with it, but the frame 1 pose is still correct, it’s just the movement from frame 1 through the rest of the animation that is over exaggerated. Also, the panda model is scaled to .005 and it’s animation plays fine, so I don’t think its that.

I made a simple moving plane that bends to one side then the other to see if it’s movement would also exaggerate, but it did not, the animation played as it should.

It’s clearly some type of modeling problem, but does anyone have any ideas, or has anyone run across this? I’m using a smooth bind on the body to the skeleton, painted weights & IK handles. Basic setup.

Very Peculiar, Thanks.

For reference.

The bendy square in the background is the simple plane animation I made, it works fine, just like the panda. The other two however… I’m at a loss

It does look rather like a scale problem. I’ve seen this sort of thing happen when a scale is applied to a model but not to its animation, or vice-versa. When you say you “scaled your model”, do you mean in Maya, or in Panda? If you applied the scale in Panda, then there is no danger, but if you applied it in Maya, there might be a possibility of something going wrong.

Are you using the same Maya file for both the model and its animation? If they are different, are you sure they both have the same scales? If they are the same file, you might try to “freeze transforms”, and see if that helps.

The .pz extension (not .ez), by the way, is just used by Panda to compress egg files and other files. The models distributed with Panda are compressed so they take up less space on your hard disk.

David

I rigged my model and did the painted weights and such, then saved 2 copies, one with -model suffix, the other with -jog suffix. Then I animated the -jog file and saved it again, and egg’d both .mb files.

The animation is being scaled in panda3d, the first code section in my first post,

DCharacter.DCharacter( .033, "human_male" )

The first parameter is the scaling. (interesting that panda uses centimeters for units, anyway to change this?)

Before saving a copy of my -model file to start animating with, I grabbed the mesh and froze transformations, as well as deleted the history.

Panda doesn’t, but Maya does. You can convert to whatever unit you like on the maya2egg command line, for instance to convert to feet use “-uo ft”. Be sure you specify the same option on both model and animation, or we’re back to the dissimilar scaling problem again.

Try extracting the model from the -jog file, to see if that makes a difference. If it solves the problem, then there’s something different between your two files.

David

Sorry, do you mean to delete the mesh and leave the animated skeleton?

Is it a better practice to have all the animations and static pose in the same file to ensure compatability, and then specify frames to export each individual animation?

No, no, I mean to use a command like this:

maya2egg2008 -a model d_human_male-jog.mb d_human_male-model.egg 

No, not really. I’m not telling you to change the way you’re creating your models; I’m just proposing the above experiment to track down where the problem is. This will test if something went wrong with the compatibility of the skeletons. If it turns out that something did go wrong here, then you can track it down further and fix it; if it turns out that the problem is somewhere else, then we’ll have to keep looking.

David

Gave it a go, extracted the model from the same jog file as my animation, and still getting the same stretching effect… I can send you the .mb if you think that would help.

Hmm, I’m not sure how much that would help–I’m not very experienced with Maya itself. I can take a look, I guess.

Does anyone else on these forums with Maya experience recognize this?

David

I received the Maya files, and I concur that they are not converting properly. :frowning:

But I can’t tell what is it about them that’s not working. Other Maya files do convert properly, so whatever it is, it’s something subtle. It appears to be something to do with the vertex skinning, perhaps? The joints seem to be converting properly, but the vertices are going crazy.

Are you using any exotic systems to control the vertex skinning? No envelopes or anything like that, right? Can you try with a simpler model to see if we can narrow down what it is that’s making it go awry?

David

No special features other then the standard maya modeling. Created a mesh, deleted it’s history, created a skeleton, soft bind skin (I don’t suppose panda only allows rigid bind or something like that?), painted skin weights, and animated.

In the picture above the square was my simpler model test, which was a success, I’ll try something a little more complex but not quite so much as a full anatomy.

So I tried making a stick figure and putting it on a skeleton to animate to see if I’d have the same problems with a simpler mesh…

Thinking maybe I should just make a game called “Attack of the squid-people”…

Interestingly enough, the bottom part of the stick figure animation is working just fine, the legs move as expected, but everything from the waist up is all messed up. Didn’t notice this at first, but I’m not seeing anything that was done differently about the top half from the bottom…

OK so I figured out what was doing it…

I’m not a modeler / Animator, so if this is common knowledge not to do this, I had no idea. The problem was that I was using locators as handles to animate my rig. The hands and feet were fine, because I was parenting the locator to IK handles.

However, on the character’s spine, I parented a locator to a joint node, to control the models overall position / back movement. I deleted these, and now everything looks and works beautifully. The stick figure had the locator parented to a joint that was just above the root node, which is why the legs worked fine. The human however, had it parented to the root node, which I guess is why everything went haywire I suppose.

So the question is, how do you make a handle for moving the model? From what I understand, it’s kind of a necessity for animating things that involve moving the whole rig.

Any thoughts? Or does anyone have any experience with this, now knowing what is causing it?

Hmm, interesting. Does it have to be a locator? Can you use an empty node for the same purpose instead?

David