PDA

View Full Version : animation sequence


Andy
09-29-2009, 04:29 AM
If I have a node3d object and call an animation state, is it possible to stop the action on the last position and start a new action state on this position (like a sequence of animations)?

I my application I would like to move a robotic gripper in a close position and open position.


#add robiGrip - default position is closed
robiGrip = viz.add("gripper.cfg")

def onkeydown(key):
if key == 'o':
print 'open'
robiGrip.setAnimationSpeed(0,1)
robiGrip.state(1)
elif key == 'c':
print 'close'
robiGrip.setAnimationSpeed(0,1)
robiGrip.state(2)
elif key == 'p':
print 'pause'
robiGrip.setAnimationSpeed(0,0)
elif key == 'r'
print 'resume'
robiGrip.setAnimationSpeed(0,1)

Jeff
10-01-2009, 10:42 AM
You can freeze an animation on the last frame, for example.
female = viz.add('vcc_female.cfg', pos = [0,0,5], euler = [180,0,0])
female.execute(5, freeze = True)
Then if the second animation starts at that same point the first one stopped it should work.