Motion

Struct Motion 

Source
pub struct Motion {
    pub annotations: HashMap<String, String>,
    pub target_model_name: String,
    pub accessory_keyframes: MotionTrack<MotionAccessoryKeyframe>,
    pub camera_keyframes: MotionTrack<MotionCameraKeyframe>,
    pub light_keyframes: MotionTrack<MotionLightKeyframe>,
    pub model_keyframes: MotionTrack<MotionModelKeyframe>,
    pub self_shadow_keyframes: MotionTrack<MotionSelfShadowKeyframe>,
    pub local_bone_motion_track_bundle: MotionTrackBundle<MotionBoneKeyframe>,
    pub local_morph_motion_track_bundle: MotionTrackBundle<MotionMorphKeyframe>,
    pub global_motion_track_bundle: MotionTrackBundle<()>,
    pub typ: MotionFormatType,
    pub preferred_fps: f32,
}

Fields§

§annotations: HashMap<String, String>§target_model_name: String§accessory_keyframes: MotionTrack<MotionAccessoryKeyframe>§camera_keyframes: MotionTrack<MotionCameraKeyframe>§light_keyframes: MotionTrack<MotionLightKeyframe>§model_keyframes: MotionTrack<MotionModelKeyframe>§self_shadow_keyframes: MotionTrack<MotionSelfShadowKeyframe>§local_bone_motion_track_bundle: MotionTrackBundle<MotionBoneKeyframe>§local_morph_motion_track_bundle: MotionTrackBundle<MotionMorphKeyframe>§global_motion_track_bundle: MotionTrackBundle<()>§typ: MotionFormatType§preferred_fps: f32

Implementations§

Source§

impl Motion

Source

pub fn empty() -> Self

Source

pub fn load_from_buffer( buffer: &mut Buffer<'_>, offset: u32, ) -> Result<Self, NanoemError>

Source

pub fn save_to_buffer( &self, buffer: &mut MutableBuffer, ) -> Result<(), NanoemError>

Source§

impl Motion

Source

pub fn get_format_type(&self) -> MotionFormatType

Source

pub fn get_target_model_name(&self) -> &String

Source

pub fn max_frame_index(&self) -> u32

Source

pub fn get_annotation(&self, key: &str) -> Option<&String>

Source

pub fn get_all_accessory_keyframe_objects( &self, ) -> impl Iterator<Item = &MotionAccessoryKeyframe>

Source

pub fn get_all_bone_keyframe_objects( &self, ) -> impl Iterator<Item = (&MotionBoneKeyframe, String)>

Source

pub fn get_all_camera_keyframe_objects( &self, ) -> impl Iterator<Item = &MotionCameraKeyframe>

Source

pub fn get_all_light_keyframe_objects( &self, ) -> impl Iterator<Item = &MotionLightKeyframe>

Source

pub fn get_all_motion_keyframe_objects( &self, ) -> impl Iterator<Item = &MotionModelKeyframe>

Source

pub fn get_all_morph_keyframe_objects( &self, ) -> impl Iterator<Item = (&MotionMorphKeyframe, String)>

Source

pub fn get_all_self_shadow_keyframe_objects( &self, ) -> impl Iterator<Item = &MotionSelfShadowKeyframe>

Source

pub fn extract_bone_track_keyframes( &self, name: &str, ) -> Option<impl Iterator<Item = &MotionBoneKeyframe>>

Source

pub fn extract_morph_track_keyframes( &self, name: &str, ) -> Option<impl Iterator<Item = &MotionMorphKeyframe>>

Source

pub fn find_accessory_keyframe_object( &self, index: u32, ) -> Option<&MotionAccessoryKeyframe>

Source

pub fn find_bone_keyframe_object( &self, name: &str, index: u32, ) -> Option<&MotionBoneKeyframe>

Source

pub fn find_camera_keyframe_object( &self, frame_index: u32, ) -> Option<&MotionCameraKeyframe>

Source

pub fn remove_camera_keyframe_object( &mut self, frame_index: u32, ) -> Option<MotionCameraKeyframe>

Source

pub fn find_light_keyframe_object( &self, frame_index: u32, ) -> Option<&MotionLightKeyframe>

Source

pub fn remove_light_keyframe_object( &mut self, frame_index: u32, ) -> Option<MotionLightKeyframe>

Source

pub fn find_model_keyframe_object( &self, frame_index: u32, ) -> Option<&MotionModelKeyframe>

Source

pub fn remove_model_keyframe_object( &mut self, frame_index: u32, ) -> Option<MotionModelKeyframe>

Source

pub fn find_morph_keyframe_object( &self, name: &str, index: u32, ) -> Option<&MotionMorphKeyframe>

Source

pub fn find_self_shadow_keyframe_object( &self, frame_index: u32, ) -> Option<&MotionSelfShadowKeyframe>

Source

pub fn remove_self_shadow_keyframe_object( &mut self, frame_index: u32, ) -> Option<MotionSelfShadowKeyframe>

Source

pub fn search_closest_accessory_keyframes( &self, base_index: u32, ) -> (Option<&MotionAccessoryKeyframe>, Option<&MotionAccessoryKeyframe>)

Source

pub fn search_closest_camera_keyframes( &self, base_index: u32, ) -> (Option<&MotionCameraKeyframe>, Option<&MotionCameraKeyframe>)

Source

pub fn search_closest_light_keyframes( &self, base_index: u32, ) -> (Option<&MotionLightKeyframe>, Option<&MotionLightKeyframe>)

Source

pub fn search_closest_model_keyframes( &self, base_index: u32, ) -> (Option<&MotionModelKeyframe>, Option<&MotionModelKeyframe>)

Source

pub fn search_closest_self_shadow_model_keyframes( &self, base_index: u32, ) -> (Option<&MotionSelfShadowKeyframe>, Option<&MotionSelfShadowKeyframe>)

Source

pub fn search_closest_bone_keyframes( &self, track_name: &str, frame_index: u32, ) -> (Option<&MotionBoneKeyframe>, Option<&MotionBoneKeyframe>)

Source

pub fn search_closest_morph_keyframes( &self, track_name: &str, frame_index: u32, ) -> (Option<&MotionMorphKeyframe>, Option<&MotionMorphKeyframe>)

Source

pub fn add_accessory_keyframe( &mut self, keyframe: MotionAccessoryKeyframe, ) -> Option<MotionAccessoryKeyframe>

Source

pub fn add_camera_keyframe( &mut self, keyframe: MotionCameraKeyframe, ) -> Option<MotionCameraKeyframe>

Source

pub fn add_light_keyframe( &mut self, keyframe: MotionLightKeyframe, ) -> Option<MotionLightKeyframe>

Source

pub fn add_model_keyframe( &mut self, keyframe: MotionModelKeyframe, ) -> Option<MotionModelKeyframe>

Source

pub fn add_self_shadow_keyframe( &mut self, keyframe: MotionSelfShadowKeyframe, ) -> Option<MotionSelfShadowKeyframe>

Trait Implementations§

Source§

impl Clone for Motion

Source§

fn clone(&self) -> Motion

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Motion

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Motion

§

impl RefUnwindSafe for Motion

§

impl Send for Motion

§

impl Sync for Motion

§

impl Unpin for Motion

§

impl UnwindSafe for Motion

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.