remap node handle in properties
//! just by linking nodes to each other. Good example of this is skeleton which
//! is used in skinning (animating 3d model by set of bones).
+use crate::scene::base::PropertyValue;
use crate::{
asset::ResourceState,
core::{
@@ -89,6 +90,14 @@ fn remap_handles(old_new_mapping: &FxHashMap<Handle<Node>, Handle<Node>>, dest_g
}
}
+ for property in new_node.properties.iter_mut() {
+ if let PropertyValue::NodeHandle(ref mut handle) = property.value {
+ if let Some(new_handle) = old_new_mapping.get(handle) {
+ *handle = *new_handle;
+ }
+ }
+ }
+
// LODs also have handles that must be remapped too.
if let Some(lod_group) = new_node.lod_group_mut() {
for level in lod_group.levels.iter_mut() {
