Gltf handle missing bindposes (#18419)
# Objective correctly load gltfs without explicit bindposes ## Solution use identity matrices if bindposes are not found. note: currently does nothing, as gltfs without explicit bindposes fail to load, see <https://github.com/gltf-rs/gltf/pull/449> --------- Co-authored-by: François Mockers <francois.mockers@vleue.com>
This commit is contained in:
parent
28907ae171
commit
655ee4b120
@ -740,9 +740,10 @@ async fn load_gltf<'a, 'b, 'c>(
|
||||
let reader = gltf_skin.reader(|buffer| Some(&buffer_data[buffer.index()]));
|
||||
let local_to_bone_bind_matrices: Vec<Mat4> = reader
|
||||
.read_inverse_bind_matrices()
|
||||
.unwrap()
|
||||
.map(|mat| Mat4::from_cols_array_2d(&mat))
|
||||
.collect();
|
||||
.map(|mats| mats.map(|mat| Mat4::from_cols_array_2d(&mat)).collect())
|
||||
.unwrap_or_else(|| {
|
||||
core::iter::repeat_n(Mat4::IDENTITY, gltf_skin.joints().len()).collect()
|
||||
});
|
||||
|
||||
load_context
|
||||
.add_labeled_asset(
|
||||
|
Loading…
Reference in New Issue
Block a user