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.