So, I have a simple model and animation that I have put through optchar, and flagged the sphere as a separate object so I can manipulate it a la the “Manipulating a Piece of a Model” manual page. After assigning it in the program, I can move it, hide it, etc, but I cannot animate it separately. This is really the only thing I wanted it for, so I was wondering if it’s not for animation purposes or if I’m just doing something wrong in the code. For reference:
import direct.directbase.DirectStart
from direct.actor.Actor import Actor
myChar = Actor()
myChar.loadModel("pend/pendulumModel.egg")
myCharBall = myChar.find("**/Ball")
print myCharBall
myChar.loadAnims({"anim":"pend/pendulumAnimation.egg"})
myChar.reparentTo(render)
myChar.loop("anim")
myChar.setPos(0,100,-10)
myChar.setScale(0.4,0.4,0.4)
myCharBall.setPos(50,100,-10)
run()
If I try to use myCharBall.loop(), it crashes and I get an error that the node has no attribute “loop”. I also can’t separately load its animations using loadAnims. Do I have to use multi-part actors for this (which I am willing to do, but would rather not), or am I just missing something here?