2
0
Эх сурвалжийг харах

[prefab] Properly rebuild Model if tree change to handle defaultTransform

Clément Espeute 11 сар өмнө
parent
commit
63b04261b4
1 өөрчлөгдсөн 9 нэмэгдсэн , 0 устгасан
  1. 9 0
      hrt/prefab/Model.hx

+ 9 - 0
hrt/prefab/Model.hx

@@ -90,6 +90,15 @@ class Model extends Object3D {
 		boundingSphere = null;
 	}
 
+	override function onEditorTreeChanged(child:Prefab):hrt.prefab.Prefab.TreeChangedResult {
+
+		// Correctly handle changes in hierachy in case the model has a default transform
+		if (Std.downcast(child, Object3D) != null) {
+			return Rebuild;
+		}
+		return super.onEditorTreeChanged(child);
+	}
+
     var polys3D = null;
     var boundingSphere = null;
     override function localRayIntersection(ray : h3d.col.Ray ) : Float {