Struct rin::blender::scene_data::model::Model [−][src]
pub struct Model { /* fields omitted */ }
Model holds the original blender Mesh for an object with data of Mesh type
It also contains:
- references to a skeleton if the original object referenced one
- vertex groups (used to apply skinning)
- flattened trimeshes
- original material name for each flattened trimesh
The original blender mesh format can specify materials per face this class flattens that into several trimeshes which can be of 2 types:
- One buffer of vertices accesible through original_vertices() or submeshes()[0] plus several submesh indices groups accesible thorugh submeshes_indices
- Several buffers of vertices accesible through submeshes() without indices
To check which type the model provides check if submeshes_indices is Some/None respectively
The flattened meshes can also be accessed using submeshes which return an iterator of SubMesh with vertices, indices (if any) and material. In this case when the flattened trimesh is one buffer of vertices + indices the returned vertices in each Submesh will be always the same
For skinning all vertices in the mesh you can access original_vertices() which contains all the vertices in the correct order
Implementations
impl Model
[src]
impl Model
[src]pub fn parse(
obj: &Object<'_>,
library_id: LibraryId,
blend_mesh: &Object<'_>,
visible: bool,
scene_data: &mut SceneData,
libraries: &HashMap<LibraryId, File, RandomState>
) -> Result<Model, Error>
[src]
obj: &Object<'_>,
library_id: LibraryId,
blend_mesh: &Object<'_>,
visible: bool,
scene_data: &mut SceneData,
libraries: &HashMap<LibraryId, File, RandomState>
) -> Result<Model, Error>
pub fn skeleton(&self) -> Option<&ObjectId>
[src]
pub fn default_action(&self) -> Option<&ObjectId>
[src]
pub fn name(&self) -> &ObjectId
[src]
pub fn mesh(&self) -> &ObjectId
[src]
pub fn rigid_body(&self) -> Option<&RigidBody>
[src]
pub fn is_selectable(&self) -> bool
[src]
pub fn is_visible(&self) -> bool
[src]
pub fn animated_vertices(&self) -> &[Vertex]ⓘ
[src]
pub fn transformations(&self) -> &Transformations
[src]
pub fn vertex_groups(&self) -> &[String]ⓘ
[src]
pub fn default_group(&self) -> Option<&String>
[src]
pub fn custom_properties(&self) -> &[Property]ⓘ
[src]
pub fn drivers(&self) -> &[FCurve]ⓘ
[src]
pub fn skeleton_deformflag(&self) -> ArmatureDeformFlag
[src]
Trait Implementations
impl<'de> Deserialize<'de> for Model
[src]
impl<'de> Deserialize<'de> for Model
[src]pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Model, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<Model, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl Serialize for Model
[src]
impl Serialize for Model
[src]pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Auto Trait Implementations
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnwindSafe for Model
Blanket Implementations
impl<T> DowncastSync for T where
T: Any + Send + Sync,
[src]
impl<T> DowncastSync for T where
T: Any + Send + Sync,
[src]impl<T> Serialize for T where
T: Serialize + ?Sized,
[src]
impl<T> Serialize for T where
T: Serialize + ?Sized,
[src]pub fn erased_serialize(
&self,
serializer: &mut dyn Serializer
) -> Result<Ok, Error>
[src]
&self,
serializer: &mut dyn Serializer
) -> Result<Ok, Error>
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,