Struct ambient_api::animation::PlayClipFromUrlNodeRef
source · pub struct PlayClipFromUrlNodeRef(pub AnimationNodeRef);
Expand description
Play clip from url animation node. This is an animation node which can be plugged into an animation player or other animation nodes.
This is just a reference to an entity which lives in the ecs. You need to call despawn
to
remove it.
Tuple Fields§
§0: AnimationNodeRef
Implementations§
source§impl PlayClipFromUrlNodeRef
impl PlayClipFromUrlNodeRef
sourcepub fn new(url: impl Into<String>) -> PlayClipFromUrlNodeRef
pub fn new(url: impl Into<String>) -> PlayClipFromUrlNodeRef
Create a new node.
sourcepub fn from_entity(entity: EntityId) -> PlayClipFromUrlNodeRef
pub fn from_entity(entity: EntityId) -> PlayClipFromUrlNodeRef
Use an existing node
sourcepub fn set_play_mode(&self, mode: PlayMode)
pub fn set_play_mode(&self, mode: PlayMode)
Set how the animation is played
sourcepub fn set_retargeting(&self, retargeting: AnimationRetargeting)
pub fn set_retargeting(&self, retargeting: AnimationRetargeting)
Set up retargeting
sourcepub fn apply_base_pose(&self, value: bool)
pub fn apply_base_pose(&self, value: bool)
If true, the base pose from the model of the animation clip will be applied to the animation
Some animations will only work if the base pose of the character is the same as the animations base pose, so we apply the pose from the animations model to make sure they correspond
This exists mostly because some FBX animations have pre-rotations, and to apply them to character models which don’t have the same pre-rotations we need to make sure they’re up to sync
I.e. this is mostly relevant for retargeting
sourcepub fn peek_clip_duration(&self) -> Option<f32>
pub fn peek_clip_duration(&self) -> Option<f32>
Returns None if the duration hasn’t been loaded yet
sourcepub async fn clip_duration(&self) -> f32
pub async fn clip_duration(&self) -> f32
Returns the duration of this clip. This is async because it needs to wait for the clip to load before the duration can be returned.
sourcepub fn peek_bind_ids(&self) -> Option<Vec<String>>
pub fn peek_bind_ids(&self) -> Option<Vec<String>>
Returns None if the clip hasn’t been loaded yet
sourcepub async fn bind_ids(&self) -> Vec<String>
pub async fn bind_ids(&self) -> Vec<String>
Returns the bind ids of this clip. This is async because it needs to wait for the clip to load before the bind ids can be returned.
sourcepub async fn wait_for_load(&self)
pub async fn wait_for_load(&self)
Wait until the clip has been loaded
Trait Implementations§
source§impl AsRef<AnimationNodeRef> for PlayClipFromUrlNodeRef
impl AsRef<AnimationNodeRef> for PlayClipFromUrlNodeRef
source§fn as_ref(&self) -> &AnimationNodeRef
fn as_ref(&self) -> &AnimationNodeRef
source§impl Clone for PlayClipFromUrlNodeRef
impl Clone for PlayClipFromUrlNodeRef
source§fn clone(&self) -> PlayClipFromUrlNodeRef
fn clone(&self) -> PlayClipFromUrlNodeRef
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more