Vizard 8 » Command Index » Vizard objects » node3d » <node3d:avatar>.forceAnimationLoad
8.0

<node3d:avatar>.forceAnimationLoad

Force a delay-loaded animation to load now

<node3d:avatar>.forceAnimationLoad(  
animation  
)  
animation
Animation number

Remarks

This command can be used to force a delay-loaded animation to load.

Delay loaded animations can be enabled through the avatar cfg file using the delay_load option or by specifying the viz.AVATAR_DELAY_LOAD flag when calling <viz>.addAvatar. A delay loaded animation will only read the animation from file when it is played for the first time. This is useful for specifying many animations within the cfg file, but only loading the ones that are actually used.

Here is an example of how to use the delay_load option within the avatar cfg file:

# Frequently used animations to always load
animation = male_idle.cafx
animation = male_walk.cafx

# Rarely used animations to delay load
delay_load = 1
animation = male_run.cafx
animation = male_talk.cafx
animation = male_dance.cafx
animation = male_sit_chair.cafx

Return Value

True/False indicating whether the animation has been successfully loaded.

Example

avatar = viz.add('vcc_male2.cfg', flags=viz.AVATAR_DELAY_LOAD)
avatar.forceAnimationLoad(4)