Skip to content

Commit 26d7260

Browse files
committed
feat: support morph weight animation again
1 parent 03bac4f commit 26d7260

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

crates/bevy_animation_graph_builtin_nodes/src/clip_node.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::any::TypeId;
22

33
use bevy::{
4+
animation::animation_curves::WeightsCurveSample,
45
asset::Handle,
56
math::{Quat, Vec3},
67
platform::hash::Hashed,
@@ -358,9 +359,16 @@ fn sample_animation_curve(curve: &VariableCurve, time: f32) -> Option<CurveValue
358359
*curve.0.sample_clamped(time).downcast_ref()?,
359360
))
360361
} else {
361-
todo!()
362+
None
362363
}
363364
}
364-
EvaluatorId::Type(_id) => todo!(),
365+
EvaluatorId::Type(_id) => Some(CurveValue::BoneWeights(
366+
(*curve
367+
.0
368+
.sample_clamped(time)
369+
.downcast::<WeightsCurveSample>()
370+
.ok()?)
371+
.0,
372+
)),
365373
}
366374
}

0 commit comments

Comments
 (0)