@babylonjs/inspector 6.6.0 → 6.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -46267,6 +46267,12 @@ class MeshPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Compo
46267
46267
  }
46268
46268
  return "Unknown";
46269
46269
  }
46270
+ _getIdForDisplay(id) {
46271
+ if (typeof id === "string") {
46272
+ return id;
46273
+ }
46274
+ return "[INVALID ID]";
46275
+ }
46270
46276
  render() {
46271
46277
  const mesh = this.props.mesh;
46272
46278
  const scene = mesh.getScene();
@@ -46313,7 +46319,7 @@ class MeshPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Compo
46313
46319
  };
46314
46320
  })
46315
46321
  : [];
46316
- return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_10__.CustomPropertyGridComponent, { globalState: this.props.globalState, target: mesh, lockObject: this.props.lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "GENERAL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "ID", value: mesh.id }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_15__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Name", target: mesh, propertyName: "name", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Unique ID", value: mesh.uniqueId.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Class", value: mesh.getClassName() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Vertices", value: mesh.getTotalVertices().toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Faces", value: (mesh.getTotalIndices() / 3).toFixed(0) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Sub-meshes", value: mesh.subMeshes ? mesh.subMeshes.length.toString() : "0" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_parentPropertyGridComponent__WEBPACK_IMPORTED_MODULE_22__.ParentPropertyGridComponent, { globalState: this.props.globalState, node: mesh, lockObject: this.props.lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), mesh.skeleton && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Skeleton", value: mesh.skeleton.name, onLink: () => this.onSkeletonLink() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Is enabled", isSelected: () => mesh.isEnabled(), onSelect: (value) => {
46322
+ return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_10__.CustomPropertyGridComponent, { globalState: this.props.globalState, target: mesh, lockObject: this.props.lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "GENERAL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "ID", value: this._getIdForDisplay(mesh.id) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_15__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Name", target: mesh, propertyName: "name", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Unique ID", value: mesh.uniqueId.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Class", value: mesh.getClassName() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Vertices", value: mesh.getTotalVertices().toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Faces", value: (mesh.getTotalIndices() / 3).toFixed(0) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Sub-meshes", value: mesh.subMeshes ? mesh.subMeshes.length.toString() : "0" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_parentPropertyGridComponent__WEBPACK_IMPORTED_MODULE_22__.ParentPropertyGridComponent, { globalState: this.props.globalState, node: mesh, lockObject: this.props.lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), mesh.skeleton && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Skeleton", value: mesh.skeleton.name, onLink: () => this.onSkeletonLink() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Is enabled", isSelected: () => mesh.isEnabled(), onSelect: (value) => {
46317
46323
  const prevValue = mesh.isEnabled();
46318
46324
  mesh.setEnabled(value);
46319
46325
  this.props.onPropertyChangedObservable?.notifyObservers({
@@ -46956,7 +46962,7 @@ class ParentPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Com
46956
46962
  constructor(props) {
46957
46963
  super(props);
46958
46964
  }
46959
- _getNameForSorting(node) {
46965
+ _getNameForSortingAndDisplay(node) {
46960
46966
  return typeof node.name === "string" ? node.name : "no name";
46961
46967
  }
46962
46968
  render() {
@@ -46966,11 +46972,11 @@ class ParentPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Com
46966
46972
  .getNodes()
46967
46973
  .filter((n) => n !== node)
46968
46974
  .sort((a, b) => {
46969
- return this._getNameForSorting(a).localeCompare(this._getNameForSorting(b));
46975
+ return this._getNameForSortingAndDisplay(a).localeCompare(this._getNameForSortingAndDisplay(b));
46970
46976
  });
46971
46977
  const nodeOptions = sortedNodes.map((m, i) => {
46972
46978
  return {
46973
- label: m.name || "no name",
46979
+ label: this._getNameForSortingAndDisplay(m),
46974
46980
  value: i,
46975
46981
  };
46976
46982
  });