Skip to content

Commit 52dc263

Browse files
lassadesetzer22
authored andcommitted
Mesh vertex attributes for skinning and animation (bevyengine#1831)
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)
1 parent 97d8e4e commit 52dc263

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

crates/bevy_render/src/mesh/mesh.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,11 @@ impl Mesh {
245245
/// Texture coordinates for the vertex. Use in conjunction with [`Mesh::set_attribute`]
246246
pub const ATTRIBUTE_UV_0: &'static str = "Vertex_Uv";
247247

248+
/// Per vertex joint transform matrix weight. Use in conjunction with [`Mesh::set_attribute`]
249+
pub const ATTRIBUTE_JOINT_WEIGHT: &'static str = "Vertex_JointWeight";
250+
/// Per vertex joint transform matrix index. Use in conjunction with [`Mesh::set_attribute`]
251+
pub const ATTRIBUTE_JOINT_INDEX: &'static str = "Vertex_JointIndex";
252+
248253
/// Construct a new mesh. You need to provide a PrimitiveTopology so that the
249254
/// renderer knows how to treat the vertex data. Most of the time this will be
250255
/// `PrimitiveTopology::TriangleList`.

0 commit comments

Comments
 (0)