I think it's working out but I do get some traceback errors. Here is the code:
Code:
def onmousedown(button):
global i
if button == viz.MOUSEBUTTON_LEFT:
node = viz.pick() #Get object that was clicked
if node in avatars: #Check if object is one of the avatars
node.clear(viz.ALL)
node.clear(viz.CURRENT_ACTION)
node.execute(7) #Execute the "shot" animation
#Create action to wait for the animation duration then freeeze the avatar
WaitThenFreeze = vizact.sequence( vizact.waittime(node.getduration(7)-.14), vizact.speed_node(0))
#vizact.sequence(vizact.waittime(2),avatars.remove(male),1)
node.clear(viz.ALL)
node.clear(viz.CURRENT_ACTION)
node.add(WaitThenFreeze) #Add the action to the avatar
node.clear(viz.ALL)
node.clear(viz.CURRENT_ACTION)
fadeReset = vizact.sequence(vizact.waittime(1),vizact.call(node.remove))
node.add(fadeReset)
i = 2;
Here are the traceback errors. I'm not sure what they all mean.
Code:
Traceback (most recent call last):
File "C:\Program Files\Vizard25\viz.py", line 5916, in mytimer
curAction.update(elaps,curAction._obj_)
File "C:\Program Files\Vizard25\vizact.py", line 653, in update
self.checkaction(object)
File "C:\Program Files\Vizard25\vizact.py", line 629, in checkaction
__endAction__(object,self.curAction)
File "C:\Program Files\Vizard25\vizact.py", line 219, in __endAction__
object._action.notifyEndAction(action._obj_,action._actiondata_.callbackData,action._pool_)
AttributeError: 'int' object has no attribute 'notifyEndAction'