WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   "reverting" between animations & linking objects to bones (https://forum.worldviz.com/showthread.php?t=3851)

Lithium 07-26-2011 03:05 PM

"reverting" between animations & linking objects to bones
 
Hi all,
I am having a little issue with avatar animation I'm hoping you can help me solve. When I have multiple animations following one another (just using multiple avatar.addAction(vizact.animation(n)) calls ) the avatar "reverts" back to the state position between different animations. (i.e. between an animation of clapping and dancing for example, her arms move very quickly back toward her side as in the idle state before moving into the dancing animation).

Is there a way to avoid this?

Another problem I am encountering is that I get an "ERROR: Link failed (source linkable is invalid)" when attempting to link an object to a complete character (non-HD) 's Bip01 R Hand bone. I am not sure why this is as the exact same code runs fine if I replace the character with vcc_female.cfg and the bones are named the same.

Thanks in advance for any help!

Jeff 07-26-2011 06:04 PM

You could remove the current state and then add it back just before the actions are done with a timer. That way the avatar won't revert to any state between actions:
Code:

import viz
import vizact

viz.go()

avatar = viz.addAvatar('vcc_female.cfg',pos=[0,0,5],euler=[180,0,0])
avatar.state(1)

def animateAvatar():
       
        #remove current state
        avatar.state(-1)
       
        #add a series of actions
        avatar.addAction(vizact.animation(4))
        avatar.addAction(vizact.animation(5))
        avatar.addAction(vizact.animation(6))
       
        actionsDuration = avatar.getDuration(4) + avatar.getDuration(5) + avatar.getDuration(6) - 0.1
       
        #set state before animations finish
        vizact.ontimer2(actionsDuration,0,avatar.state,1)

vizact.onkeydown(' ',animateAvatar)


Please create a new thread for the linking question and post some example code that replicates the problem for you.

sleiN13 07-27-2011 12:35 AM

In my own projects I set the idlepose/state to a "neutral" 1 frame animation that doesn't make my avatars jump between animation switches. For example if the avatar is sitting -> sitting looking around -> sitting talking -> sitting I will give it a base state of a sitting avatar. That way you don't have to do tricks with timers and most of the times you already have that one frame position that is equal to all animations begin and end states to make the animation go more fluently.

You could also try the fade-in en fade-out values (or setting them on 0):
.animation(
number
delay_in = viz.AVATAR_DELAY
delay_out = viz.AVATAR_DELAY
freeze = False

)

or set freeze on true. But setting freeze on true will not end the animation and start the next one so you will need to start the next one your self. with timers again ;)

Lithium 08-08-2011 11:01 AM

Thanks! I'll keep those suggestions in mind :]


All times are GMT -7. The time now is 09:57 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC