Skip to content

Commit

Permalink
Mesh vertex attributes for skinning and animation (bevyengine#1831)
Browse files Browse the repository at this point in the history
Required by bevyengine#1429,

- Adds the `Ushort4` vertex attribute for joint indices
- `Mesh::ATTRIBUTE_JOINT_WEIGHT` and `Mesh::ATTRIBUTE_JOINT_INDEX` to import vertex attributes related to skinning from GLTF
- impl `Default` for `Mesh` a empty triangle mesh is created (needed by reflect)
- impl `Reflect` for `Mesh` all attributes are ignored (needed by the animation system)
  • Loading branch information
lassade committed May 6, 2021
1 parent cf8ef76 commit 41d9122
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/bevy_render/src/mesh/mesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ impl Mesh {
/// Texture coordinates for the vertex. Use in conjunction with [`Mesh::set_attribute`]
pub const ATTRIBUTE_UV_0: &'static str = "Vertex_Uv";

/// Per vertex joint transform matrix weight. Use in conjunction with [`Mesh::set_attribute`]
pub const ATTRIBUTE_JOINT_WEIGHT: &'static str = "Vertex_JointWeight";
/// Per vertex joint transform matrix index. Use in conjunction with [`Mesh::set_attribute`]
pub const ATTRIBUTE_JOINT_INDEX: &'static str = "Vertex_JointIndex";

/// Construct a new mesh. You need to provide a PrimitiveTopology so that the
/// renderer knows how to treat the vertex data. Most of the time this will be
/// `PrimitiveTopology::TriangleList`.
Expand Down

0 comments on commit 41d9122

Please sign in to comment.