Browse Source

SceneEditor: revert to refreshing only elements instead of parents in case of reparent, because it caused large slowdowns when moving objects to/from the scene root. This will cause problems with Models, which make() differently based on how many children they have

trethaller 6 năm trước cách đây
mục cha
commit
b29a794efc
1 tập tin đã thay đổi với 5 bổ sung6 xóa
  1. 5 6
      hide/comp/SceneEditor.hx

+ 5 - 6
hide/comp/SceneEditor.hx

@@ -1408,9 +1408,8 @@ class SceneEditor {
 					if(obj3d != null && newState != null)
 						obj3d.loadTransform(newState);
 				};
-				// Refresh PARENTS, because some objects (eg Model) make themselves differently based on their children
-				if(toRefresh.indexOf(elt.parent) < 0)
-					toRefresh.push(elt.parent);
+				if(toRefresh.indexOf(elt) < 0)
+					toRefresh.push(elt);
 				return refresh;
 			});
 		}
@@ -1422,9 +1421,9 @@ class SceneEditor {
 					refresh = true;
 			}
 			if(!refresh) {
-				for(parent in toRefresh) {
-					removeInstance(parent);
-					makeInstance(parent);
+				for(elt in toRefresh) {
+					removeInstance(elt);
+					makeInstance(elt);
 				}
 			}
 			return refresh;