Browse Source

Apply material list in CreateModelWithStaticModel() & CreateModelWithAnimatedModel(). Closes #1018.

Lasse Öörni 10 years ago
parent
commit
cb0e6caa24
1 changed files with 4 additions and 0 deletions
  1. 4 0
      bin/Data/Scripts/Editor/EditorScene.as

+ 4 - 0
bin/Data/Scripts/Editor/EditorScene.as

@@ -1425,6 +1425,8 @@ void CreateModelWithStaticModel(String filepath, Node@ parent)
 
 
     StaticModel@ staticModel = parent.GetOrCreateComponent("StaticModel");
     StaticModel@ staticModel = parent.GetOrCreateComponent("StaticModel");
     staticModel.model = model;
     staticModel.model = model;
+    if (applyMaterialList)
+        staticModel.ApplyMaterialList();
     CreateLoadedComponent(staticModel);
     CreateLoadedComponent(staticModel);
 }
 }
 
 
@@ -1442,6 +1444,8 @@ void CreateModelWithAnimatedModel(String filepath, Node@ parent)
 
 
     AnimatedModel@ animatedModel = parent.GetOrCreateComponent("AnimatedModel");
     AnimatedModel@ animatedModel = parent.GetOrCreateComponent("AnimatedModel");
     animatedModel.model = model;
     animatedModel.model = model;
+    if (applyMaterialList)
+        animatedModel.ApplyMaterialList();
     CreateLoadedComponent(animatedModel);
     CreateLoadedComponent(animatedModel);
 }
 }