Browse Source

Inspector : Hide debug objects on the mesh hierarchy. Clamp color values to 3 decimals.

Jaskar 7 years ago
parent
commit
48420d73f8

+ 5 - 2
dist/preview release/inspector/babylon.inspector.css

@@ -283,6 +283,8 @@
           background-color: #242424; }
           background-color: #242424; }
         .insp-wrapper .insp-tree .line .line-content .line:hover:first-child {
         .insp-wrapper .insp-tree .line .line-content .line:hover:first-child {
           background-color: #383838; }
           background-color: #383838; }
+    .insp-wrapper .insp-tree .line_invisible {
+      display: none; }
   .insp-wrapper .insp-details {
   .insp-wrapper .insp-details {
     background-color: #242424;
     background-color: #242424;
     overflow-y: auto;
     overflow-y: auto;
@@ -303,7 +305,7 @@
         width: 35%; }
         width: 35%; }
       .insp-wrapper .insp-details .base-row .prop-value, .insp-wrapper .insp-details .row .prop-value, .insp-wrapper .insp-details .header-row .prop-value {
       .insp-wrapper .insp-details .base-row .prop-value, .insp-wrapper .insp-details .row .prop-value, .insp-wrapper .insp-details .header-row .prop-value {
         width: 59%;
         width: 59%;
-        padding-left: 10px; }
+        padding-left: 5px; }
         .insp-wrapper .insp-details .base-row .prop-value.clickable, .insp-wrapper .insp-details .row .prop-value.clickable, .insp-wrapper .insp-details .header-row .prop-value.clickable {
         .insp-wrapper .insp-details .base-row .prop-value.clickable, .insp-wrapper .insp-details .row .prop-value.clickable, .insp-wrapper .insp-details .header-row .prop-value.clickable {
           cursor: pointer; }
           cursor: pointer; }
           .insp-wrapper .insp-details .base-row .prop-value.clickable:hover, .insp-wrapper .insp-details .row .prop-value.clickable:hover, .insp-wrapper .insp-details .header-row .prop-value.clickable:hover {
           .insp-wrapper .insp-details .base-row .prop-value.clickable:hover, .insp-wrapper .insp-details .row .prop-value.clickable:hover, .insp-wrapper .insp-details .header-row .prop-value.clickable:hover {
@@ -340,7 +342,8 @@
       display: inline-block;
       display: inline-block;
       margin-left: 5px; }
       margin-left: 5px; }
     .insp-wrapper .insp-details .color-element {
     .insp-wrapper .insp-details .color-element {
-      top: 2px; }
+      width: 20px;
+      height: 15px; }
     .insp-wrapper .insp-details .texture-element {
     .insp-wrapper .insp-details .texture-element {
       color: #f29766;
       color: #f29766;
       margin-left: 10px; }
       margin-left: 10px; }

+ 13 - 2
dist/preview release/inspector/babylon.inspector.js

@@ -383,7 +383,7 @@ var INSPECTOR;
         },
         },
         'Color3': {
         'Color3': {
             type: BABYLON.Color3,
             type: BABYLON.Color3,
-            format: function (color) { return "R:" + color.r + ", G:" + color.g + ", B:" + color.b; },
+            format: function (color) { return "R:" + color.r.toPrecision(2) + ", G:" + color.g.toPrecision(2) + ", B:" + color.b.toPrecision(2); },
             slider: {
             slider: {
                 r: { min: 0, max: 1, step: 0.01 },
                 r: { min: 0, max: 1, step: 0.01 },
                 g: { min: 0, max: 1, step: 0.01 },
                 g: { min: 0, max: 1, step: 0.01 },
@@ -4568,7 +4568,18 @@ var INSPECTOR;
         };
         };
         /** Build the HTML of this item */
         /** Build the HTML of this item */
         TreeItem.prototype._build = function () {
         TreeItem.prototype._build = function () {
-            this._div.className = 'line';
+            /**
+             *  Hide the debug objects :
+             * - Axis : xline, yline, zline
+             * */
+            var adapterId = this._adapter.id();
+            if (adapterId == "xline"
+                || adapterId == "yline"
+                || adapterId == "zline") {
+                this._div.className = "line_invisible";
+            }
+            else
+                this._div.className = 'line';
             // special class for transform node ONLY
             // special class for transform node ONLY
             if (this.adapter instanceof INSPECTOR.MeshAdapter) {
             if (this.adapter instanceof INSPECTOR.MeshAdapter) {
                 var obj = this.adapter.object;
                 var obj = this.adapter.object;

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


+ 3 - 2
inspector/sass/_detailPanel.scss

@@ -31,7 +31,7 @@
     .prop-value {
     .prop-value {
         @extend .base-property;
         @extend .base-property;
         width:59%;
         width:59%;
-        padding-left:10px;
+        padding-left:5px;
         &.clickable {
         &.clickable {
             cursor:pointer;
             cursor:pointer;
             &:hover {
             &:hover {
@@ -113,7 +113,8 @@
   // The div displaying a color
   // The div displaying a color
   .color-element {
   .color-element {
       @extend .element-viewer;
       @extend .element-viewer;
-      top: 2px;
+      width: 20px;
+      height: 15px;
   }
   }
 
 
   // The div displaying a texture element
   // The div displaying a texture element

+ 3 - 0
inspector/sass/_tree.scss

@@ -65,4 +65,7 @@
             
             
         }
         }
     }
     }
+    .line_invisible {
+        display: none;
+    }
 }
 }

+ 1 - 1
inspector/src/properties.ts

@@ -28,7 +28,7 @@ module INSPECTOR {
         },
         },
         'Color3': {
         'Color3': {
             type: BABYLON.Color3,
             type: BABYLON.Color3,
-            format: (color: BABYLON.Color3) => { return `R:${color.r}, G:${color.g}, B:${color.b}` },
+            format: (color: BABYLON.Color3) => { return `R:${color.r.toPrecision(2)}, G:${color.g.toPrecision(2)}, B:${color.b.toPrecision(2)}` },
             slider: {
             slider: {
                 r: { min: 0, max: 1, step: 0.01 },
                 r: { min: 0, max: 1, step: 0.01 },
                 g: { min: 0, max: 1, step: 0.01 },
                 g: { min: 0, max: 1, step: 0.01 },

+ 12 - 1
inspector/src/tree/TreeItem.ts

@@ -80,7 +80,18 @@ module INSPECTOR {
 
 
         /** Build the HTML of this item */
         /** Build the HTML of this item */
         protected _build() {
         protected _build() {
-            this._div.className = 'line';
+
+            /**
+             *  Hide the debug objects :
+             * - Axis : xline, yline, zline
+             * */
+            let adapterId = this._adapter.id();
+            if (adapterId == "xline"
+                || adapterId == "yline"
+                || adapterId == "zline") {
+                this._div.className = "line_invisible";
+            }
+            else this._div.className = 'line';
 
 
             // special class for transform node ONLY
             // special class for transform node ONLY
             if (this.adapter instanceof MeshAdapter) {
             if (this.adapter instanceof MeshAdapter) {