From 41d91227405a9d071fa54b245ad05325722edfa1 Mon Sep 17 00:00:00 2001 From: Felipe Jorge Date: Thu, 6 May 2021 03:31:20 +0000 Subject: [PATCH] Mesh vertex attributes for skinning and animation (#1831) Required by #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) --- crates/bevy_render/src/mesh/mesh.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/bevy_render/src/mesh/mesh.rs b/crates/bevy_render/src/mesh/mesh.rs index 4c460976bd..42043038bc 100644 --- a/crates/bevy_render/src/mesh/mesh.rs +++ b/crates/bevy_render/src/mesh/mesh.rs @@ -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`.