Hello everyone and animations don't work (maya)

Hi everyone! I’m new to this and just recently started playing around with this.

Ok so I created a scene and imported my model which I made in maya which is just a box with a texture.

What I am trying to do is figure out how to animate the object.

Here is what I have tried:

I made one of the vertices in the box go up and down a few times using keyframes. The animation works in maya. Ok all good here. Then I export it as a .mb. Next I tried the command “maya2egg2008 -a chan -o mybox.egg mybox.mb” to make an egg file with just the animation. I then attached it to my object… here is my code

import direct.directbase.DirectStart
from pandac.PandaModules import *

from direct.task import Task
from direct.actor import Actor
from direct.interval.IntervalGlobal import *
import math

#Load the first environment model
myImport = Actor.Actor("models/yura/box", {"morphbox" : "models/yura/boxanim2"})
myImport.reparentTo(render)
myImport.setScale(2, 2, 2)
myImport.setPos(-8, 42, 0)
#myImport.setColor(0.5, 0.3, 0.1)
myImport.loop("morphbox")
print myImport.getActorInfo()

#Run the tutorial
run()

No luck… I run it and the box loads but the animation itself is nowere to be found. Its just a still box.

I also tried the convert command line “maya2egg2008 -a both -o mybox.egg mybox.mb” to get an egg file with a combination of the model and animation

here was my code for that:

import direct.directbase.DirectStart
from pandac.PandaModules import *

from direct.task import Task
from direct.actor import Actor
from direct.interval.IntervalGlobal import *
import math

#Load the first environment model
myImport = Actor.Actor("models/yura/boxwanim")
myImport.reparentTo(render)
myImport.setScale(2, 2, 2)
myImport.setPos(-8, 42, 0)
#myImport.setColor(0.5, 0.3, 0.1)
myImport.loop("morphbox")
print myImport.getActorInfo()

#Run the tutorial
run()

Still no luck with that either!

Please help! I really want to get past this so I can move on! Thanks

can I please get some help here it seems like I am the only one with this problem. I have looked everywere and can’t find a solution!

It might be a problem with the rigging. You’re only moving one vertex? How are you moving it? Try moving entire nodes at a time, like moving the whole box.

David

Thanks for answering! I’m going crazy here looking for solutions.

Moving the entire box was actually the first thing I tried. That didn’t work however and I thought maybe the engine didn’t like when I moved a whole object and that you should write code if you want to move the whole object instead of stuffing it into an animation file… So I tried morphing it instead by stretching on vertex.

So no, moving the box didn’t work either.

And to answer how I was moving the vertex… I just select one and used the move tool and created an animation using keyframes. And like I said before, the object animates in maya when I hit the play button.

The .egg files that come with the engine all work… like I tried the hello panda tutorial and the animations work. Something must be wrong while I am exporting or in the maya file itself hmmm.

Well, it does sound like you are doing things right. If you post the egg file you are producing I can confirm whether it does or does not contain any animation primitives.

David

ok that would great!

Here is a .egg file. ***I converted this with the -both comand line so it contains the model and animation together.

2shared.com/file/6874951/9c8 … rkall.html

let me know how it goes!

OK. So although I see that the -both flag was indeed used, and that it created a entry correctly indicating that it is intended to be an animated model, there are no joints in the egg file. This means that maya2egg did not locate any nodes that it thought were intended to be joints.

Are there any bones in your model?

David

omg there are supposed to be bones? No i did not use any… is this the reason?

So you need to use bones for even the simplest animations?

Yes i think you do.

ahhh thats what it was all along. drwr thanks for checking the file. Thanks for the help guys!

ok… this is getting interesting.

I created an animation with the bones. I created a box and binded bones to it to make it wiggle. The animation works fine in maya but in panda still no animation

here is the .egg file… again it was converted using -both command.

2shared.com/file/6876785/8ed … work2.html

btw how do you check for errors like that drwr?

Looks animated to me. The box appears to be rotating and twisting (you can see this happen in pview).

I just open the egg file in a text editor and look at it. The new egg file does indeed have several entries, which define the joint structure, and several matching

entries, which define the actual animation data. The original egg file lacked both of these.

David