View Full Version : freeze problem
Hello,
a user called 'vduckie' w/ subject 'avatar animations' asked a question on how to freeze an avatar once it finishes an action.
I have the same problem, except my animation is NOT a numbered animation.
I.e my animation is 'movehead=avatar.headto(90,0,0)'
the problem is when i issue the command:
'viz.starttimer(FREEZE_AVATAR,male.getduration(mov ehead))'
the getduration method wants an integer as a parameter.
is there a way to get over this?
tnx
farshizzo
11-29-2004, 10:58 AM
Hi,
The headto action should already stay frozen when it finishes. Is this not happening in your case? The getduration command will only return the duration of a certain animation number, it will not work on actions.
okay, here's the thing:
I'm currently looping on my own custom made sit idle animation
which basically has the avatar moving slightly while it is sitting (on a chair.)
Now, when I call my avatar.act(headmove) it moves the head to
the right, as it's sitting, but when it finishes it, it aborts my
sit idle animation and what I get is an avatar that is standing
and has its head turned.
so what i want is for vizard to move the avatar's head. but to KEEP sitting...
is there any way to do this?
farshizzo
11-29-2004, 04:17 PM
Hi,
Which version of Vizard are you using?
oh, and when i send "looping" my sit idle animation i meant the avatar is in a certain state.
(the sitting i made in 3dsmax, and i'm playing that cal3d animation.)
(it's basically a person with his thighs horizontal in a sitting position and i put that person on a chair)
farshizzo
11-29-2004, 04:52 PM
Hi,
To prevent the avatar from changing animations after turning its head, set its idle pose to -1. Here is how to do it for version 2.17a and below:avatar.cal.pose(-1)For version 2.50 and above, the previous code will not work. You will have to do the following:avatar.idlepose(-1)
still didn't work :'(
note: when i do avatar.idle(4) it doesn't do it right either. (it makes the avatar stand each time it finishes an animation)
but anyway, this following code still makes the man stand up when finished with the head animation:
any ideas?
(btw, state(4) is my custom sitting animation.)
--------------------------------------------------------------
import viz
viz.go()
avatar=viz.add('objects/Male.cfg')
avatar.state(4)
avatar.cal.pose(-1)
def mykey(key):
if key == 't':
movehead=avatar.headto(90,0,0)
avatar.act(movehead)
viz.callback(viz.KEYBOARD_EVENT, 'mykey')
farshizzo
11-30-2004, 10:02 AM
Hi,
Try setting the idle pose to 4, so that it will continue using that animation when it finishes the head turning action.
worked like a charm--
tnx man!
vBulletin® v3.8.7, Copyright ©2000-2024, vBulletin Solutions, Inc.