Struct blender_mesh::BlenderMesh [−][src]
All of the data about a mesh
TODO: Rename crate to MeshIr
Implementations
impl BlenderMesh
[src]
pub fn combine_vertex_indices(
&mut self,
config: &CreateSingleIndexConfig
) -> SingleIndexedVertexAttributes
[src]
&mut self,
config: &CreateSingleIndexConfig
) -> SingleIndexedVertexAttributes
We store our exported Blender mesh with indices for positions, normals and uvs because
-
Easier because we we can unit test that here vs. a blender python script that’s much trickier to test.
-
Smaller to store the fields indexed than to expand them.
Most rendering pipelines only supports one index buffer, so here we convert our vertex data from having three indices to having one.
This typically requires some duplication of vertex data - we duplicate the minimum amount of vertex data necessary.
TODO: Need to continue refactoring
TODO: Make this function set BlenderMesh.vertex_attributes = VertexData::SingleIndexVertexData
TODO: Don’t work on additionally functionality until we’ve broken up these tests and implementation into smaller, specific pieces.
TODO: There are unexpected (based on the method’s name) mutations in here such as triangulation. Lot’s to refactor in this crate.
impl BlenderMesh
[src]
pub fn interleave_vertex_data(&self) -> Vec<u8>ⓘ
[src]
impl BlenderMesh
[src]
pub fn y_up(&mut self)
[src]
Blender meshes get exported with a Z up coordinate system. Here we flip our coordinate system to be y up
@see https://gamedev.stackexchange.com/a/7932
TODO: When we have bone data we’ll need to change them to port change-mat4-coordinate-system into here. https://github.com/chinedufn/change-mat4-coordinate-system/blob/master/change-mat4-coordinate-system.js
impl BlenderMesh
[src]
pub fn pbr_cube_without_textures() -> Self
[src]
Create a default Blender cube with uniform PBR texture inputs.
A 2x2x2 cube centered about the origin.
impl BlenderMesh
[src]
pub fn armature_name(&self) -> Option<&String>
[src]
The name of this mesh’s parent armature
pub fn set_armature_name(&mut self, armature_name: Option<String>)
[src]
Set the name of this mesh’s parent armature
pub fn materials(&self) -> &HashMap<String, PrincipledBSDF>
[src]
A map of material name to the material’s data
pub fn materials_mut(&mut self) -> &mut HashMap<String, PrincipledBSDF>
[src]
A mutable map of material name to the material’s data
pub fn custom_properties(&self) -> &HashMap<String, CustomProperty>
[src]
Custom properties for this mesh
i.e. in Blender this might be found with bpy.context.view_layer.objects.active.keys()
pub fn bounding_box(&self) -> BoundingBox
[src]
The smallest box that contains the entire mesh
pub fn set_bounding_box(&mut self, bounding_box: BoundingBox)
[src]
Set the mesh’s bounding box.
pub fn name(&self) -> &String
[src]
The name of the mesh
pub fn set_name(&mut self, name: String)
[src]
Set the name of the mesh
Trait Implementations
impl Clone for BlenderMesh
[src]
fn clone(&self) -> BlenderMesh
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for BlenderMesh
[src]
impl Default for BlenderMesh
[src]
fn default() -> BlenderMesh
[src]
impl<'de> Deserialize<'de> for BlenderMesh
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialEq<BlenderMesh> for BlenderMesh
[src]
fn eq(&self, other: &BlenderMesh) -> bool
[src]
fn ne(&self, other: &BlenderMesh) -> bool
[src]
impl Serialize for BlenderMesh
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for BlenderMesh
[src]
Auto Trait Implementations
impl RefUnwindSafe for BlenderMesh
impl Send for BlenderMesh
impl Sync for BlenderMesh
impl Unpin for BlenderMesh
impl UnwindSafe for BlenderMesh
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,