Browse Source

Little fix for materials

Temechon 8 years ago
parent
commit
eec554e0e9

File diff suppressed because it is too large
+ 2 - 2
dist/preview release/inspector/babylon.inspector.bundle.js


+ 8 - 1
dist/preview release/inspector/babylon.inspector.js

@@ -557,7 +557,14 @@ var INSPECTOR;
         /** Returns the list of properties to be displayed for this adapter */
         MaterialAdapter.prototype.getProperties = function () {
             var propertiesLines = [];
-            var propToDisplay = INSPECTOR.PROPERTIES[this.type()].properties;
+            var propToDisplay = [];
+            // The if is there to work with the min version of babylon
+            if (this._obj instanceof BABYLON.StandardMaterial) {
+                propToDisplay = INSPECTOR.PROPERTIES['StandardMaterial'].properties;
+            }
+            else if (this._obj instanceof BABYLON.PBRMaterial) {
+                propToDisplay = INSPECTOR.PROPERTIES['PBRMaterial'].properties;
+            }
             for (var _i = 0, propToDisplay_1 = propToDisplay; _i < propToDisplay_1.length; _i++) {
                 var dirty = propToDisplay_1[_i];
                 var infos = new INSPECTOR.Property(dirty, this._obj);

File diff suppressed because it is too large
+ 2 - 2
dist/preview release/inspector/babylon.inspector.min.js


+ 7 - 1
inspector/src/adapters/MaterialAdapter.ts

@@ -24,7 +24,13 @@ module INSPECTOR {
         /** Returns the list of properties to be displayed for this adapter */
         public getProperties() : Array<PropertyLine> {
             let propertiesLines : Array<PropertyLine> = [];
-            let propToDisplay =  PROPERTIES[this.type()].properties;
+            let propToDisplay = [];
+            // The if is there to work with the min version of babylon
+            if (this._obj instanceof BABYLON.StandardMaterial) {
+                propToDisplay =  PROPERTIES['StandardMaterial'].properties;
+            } else if (this._obj instanceof BABYLON.PBRMaterial) {
+                propToDisplay =  PROPERTIES['PBRMaterial'].properties;
+            }
 
             for (let dirty of propToDisplay) {
                 let infos = new Property(dirty, this._obj);