Browse Source

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

Conflicts:
	Babylon/Materials/textures/Procedurals/babylon.standardProceduralTexture.js
	Babylon/Materials/textures/Procedurals/babylon.standardProceduralTexture.ts
	Babylon/Math/babylon.math.js
	Babylon/Math/babylon.math.ts
	Babylon/Shaders/grass.fragment.fx
	Babylon/Shaders/rock.fragment.fx
	babylon.2.0-alpha.debug.js
	babylon.2.0-alpha.js
	babylon.2.0.d.ts
David Catuhe 10 years ago
parent
commit
b48472c684
1 changed files with 13 additions and 0 deletions
  1. 13 0
      Babylon/Loading/Plugins/babylon.babylonFileLoader.ts

+ 13 - 0
Babylon/Loading/Plugins/babylon.babylonFileLoader.ts

@@ -333,6 +333,11 @@
         if (parsedLight.excludedMeshesIds) {
             light._excludedMeshesIds = parsedLight.excludedMeshesIds;
         }
+		
+		// Parent
+        if (parsedLight.parentId) {
+            light._waitingParentId = parsedLight.parentId;
+        }
 
         // Parent
         if (parsedLight.parentId) {
@@ -1217,6 +1222,14 @@
                     camera._waitingParentId = undefined;
                 }
             }
+			
+			for (index = 0; index < scene.lights.length; index++) {
+                var light = scene.lights[index];
+                if (light._waitingParentId) {
+                    light.parent = scene.getLastEntryByID(light._waitingParentId);
+                    light._waitingParentId = undefined;
+                }
+            }
 
             for (index = 0; index < scene.lights.length; index++) {
                 var light = scene.lights[index];