Forráskód Böngészése

Initialize parseScope.groupObject even when !LDRAW_ORG is not specified (#23076)

Garrett Johnson 3 éve
szülő
commit
5c18248d02
1 módosított fájl, 9 hozzáadás és 9 törlés
  1. 9 9
      examples/jsm/loaders/LDrawLoader.js

+ 9 - 9
examples/jsm/loaders/LDrawLoader.js

@@ -967,6 +967,7 @@ class LDrawLoader extends Loader {
 			currentMatrix: new Matrix4(),
 			matrix: new Matrix4(),
 			type: 'Model',
+			groupObject: null,
 
 			// If false, it is a root material scope previous to parse
 			isFromParse: true,
@@ -1439,15 +1440,6 @@ class LDrawLoader extends Loader {
 
 								currentParseScope.type = type;
 
-								const isRoot = ! parentParseScope.isFromParse;
-								if ( isRoot || scope.separateObjects && ! isPrimitiveType( type ) ) {
-
-									currentParseScope.groupObject = new Group();
-
-									currentParseScope.groupObject.userData.startingConstructionStep = currentParseScope.startingConstructionStep;
-
-								}
-
 								// If the scale of the object is negated then the triangle winding order
 								// needs to be flipped.
 								if (
@@ -1817,6 +1809,14 @@ class LDrawLoader extends Loader {
 		currentParseScope.numSubobjects = subobjects.length;
 		currentParseScope.subobjectIndex = 0;
 
+		const isRoot = ! parentParseScope.isFromParse;
+		if ( isRoot || scope.separateObjects && ! isPrimitiveType( type ) ) {
+
+			currentParseScope.groupObject = new Group();
+			currentParseScope.groupObject.userData.startingConstructionStep = currentParseScope.startingConstructionStep;
+
+		}
+
 	}
 
 	computeConstructionSteps( model ) {