@nice2dev/ui-3d 1.3.14 → 1.3.16

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.
Files changed (108) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/collaborative/collaborativeScene.js +160 -206
  3. package/dist/cjs/core/editorAsk.js +51 -41
  4. package/dist/cjs/core/i18n.js +13 -14
  5. package/dist/cjs/core/threeCompat.js +29 -42
  6. package/dist/cjs/dance/DanceBridge.js +148 -177
  7. package/dist/cjs/dance/DanceScoreEngine.js +209 -221
  8. package/dist/cjs/dance/PoseDetector.js +302 -275
  9. package/dist/cjs/index.js +110 -113
  10. package/dist/cjs/material/MaterialEditor.module.css.js +242 -5
  11. package/dist/cjs/material/NiceMaterialEditor.js +1213 -757
  12. package/dist/cjs/material/materialEditorTypes.js +35 -49
  13. package/dist/cjs/material/materialEditorUtils.js +684 -747
  14. package/dist/cjs/material/materialNodeDefinitions.js +1411 -1459
  15. package/dist/cjs/model/ModelEditor.js +90 -40
  16. package/dist/cjs/model/ModelEditor.module.css.js +257 -5
  17. package/dist/cjs/model/ModelEditorLeftPanel.js +126 -47
  18. package/dist/cjs/model/ModelEditorMenuBar.js +359 -32
  19. package/dist/cjs/model/ModelEditorRightPanel.js +647 -131
  20. package/dist/cjs/model/ModelEditorSubComponents.js +277 -112
  21. package/dist/cjs/model/ModelEditorTimeline.js +232 -34
  22. package/dist/cjs/model/ModelEditorToolbar.js +170 -14
  23. package/dist/cjs/model/ModelEditorViewport.js +231 -39
  24. package/dist/cjs/model/ModelViewer.js +388 -63
  25. package/dist/cjs/model/ModelViewer.module.css.js +77 -5
  26. package/dist/cjs/model/NiceArmatureEditor.js +473 -274
  27. package/dist/cjs/model/NiceMorphTargetEditor.js +333 -227
  28. package/dist/cjs/model/NiceOctree.js +372 -320
  29. package/dist/cjs/model/NicePhysicsSimulation.js +528 -298
  30. package/dist/cjs/model/NiceProceduralGeometry.js +673 -300
  31. package/dist/cjs/model/NiceTerrainEditor.js +595 -385
  32. package/dist/cjs/model/NiceWeightPainter.js +384 -261
  33. package/dist/cjs/model/NiceXRPreview.js +385 -308
  34. package/dist/cjs/model/cadModeUtils.js +103 -106
  35. package/dist/cjs/model/editorShortcuts.js +171 -194
  36. package/dist/cjs/model/modelEditorTypes.js +100 -118
  37. package/dist/cjs/model/modelEditorUtils.js +1061 -1146
  38. package/dist/cjs/model/simsModeUtils.js +1023 -1053
  39. package/dist/cjs/model/useModelEditor.js +1977 -1933
  40. package/dist/cjs/model/useModelViewer.js +633 -665
  41. package/dist/cjs/nice2dev-ui-3d.css +1 -1
  42. package/dist/cjs/particle/NiceParticleEditor.js +1186 -571
  43. package/dist/cjs/particle/ParticleEditor.module.css.js +122 -5
  44. package/dist/cjs/particle/particleEditorTypes.js +62 -70
  45. package/dist/cjs/particle/particleEditorUtils.js +998 -1013
  46. package/dist/cjs/rendering/NiceCascadedShadows.js +381 -259
  47. package/dist/cjs/rendering/NiceRenderExport.js +424 -337
  48. package/dist/cjs/rendering/NiceSSAO.js +454 -337
  49. package/dist/cjs/rendering/NiceSSR.js +387 -261
  50. package/dist/cjs/rendering/NiceWebGPURenderer.js +359 -230
  51. package/dist/cjs/uv/NiceUVEditor.js +787 -550
  52. package/dist/cjs/uv/UVEditor.module.css.js +53 -5
  53. package/dist/cjs/uv/uvEditorTypes.js +59 -76
  54. package/dist/cjs/uv/uvEditorUtils.js +501 -575
  55. package/dist/esm/collaborative/collaborativeScene.js +163 -205
  56. package/dist/esm/core/editorAsk.js +53 -40
  57. package/dist/esm/core/i18n.js +15 -13
  58. package/dist/esm/core/threeCompat.js +18 -26
  59. package/dist/esm/dance/DanceBridge.js +151 -176
  60. package/dist/esm/dance/DanceScoreEngine.js +211 -220
  61. package/dist/esm/dance/PoseDetector.js +304 -274
  62. package/dist/esm/index.js +258 -36
  63. package/dist/esm/material/MaterialEditor.module.css.js +242 -3
  64. package/dist/esm/material/NiceMaterialEditor.js +1215 -756
  65. package/dist/esm/material/materialEditorTypes.js +45 -48
  66. package/dist/esm/material/materialEditorUtils.js +713 -746
  67. package/dist/esm/material/materialNodeDefinitions.js +1415 -1458
  68. package/dist/esm/model/ModelEditor.js +91 -39
  69. package/dist/esm/model/ModelEditor.module.css.js +257 -3
  70. package/dist/esm/model/ModelEditorLeftPanel.js +126 -45
  71. package/dist/esm/model/ModelEditorMenuBar.js +359 -30
  72. package/dist/esm/model/ModelEditorRightPanel.js +634 -114
  73. package/dist/esm/model/ModelEditorSubComponents.js +265 -94
  74. package/dist/esm/model/ModelEditorTimeline.js +232 -32
  75. package/dist/esm/model/ModelEditorToolbar.js +170 -12
  76. package/dist/esm/model/ModelEditorViewport.js +231 -37
  77. package/dist/esm/model/ModelViewer.js +389 -62
  78. package/dist/esm/model/ModelViewer.module.css.js +77 -3
  79. package/dist/esm/model/NiceArmatureEditor.js +462 -258
  80. package/dist/esm/model/NiceMorphTargetEditor.js +322 -211
  81. package/dist/esm/model/NiceOctree.js +361 -304
  82. package/dist/esm/model/NicePhysicsSimulation.js +517 -282
  83. package/dist/esm/model/NiceProceduralGeometry.js +667 -284
  84. package/dist/esm/model/NiceTerrainEditor.js +584 -369
  85. package/dist/esm/model/NiceWeightPainter.js +373 -245
  86. package/dist/esm/model/NiceXRPreview.js +374 -292
  87. package/dist/esm/model/cadModeUtils.js +95 -88
  88. package/dist/esm/model/editorShortcuts.js +172 -193
  89. package/dist/esm/model/modelEditorTypes.js +90 -100
  90. package/dist/esm/model/modelEditorUtils.js +1056 -1128
  91. package/dist/esm/model/simsModeUtils.js +1021 -1035
  92. package/dist/esm/model/useModelEditor.js +1946 -1920
  93. package/dist/esm/model/useModelViewer.js +619 -647
  94. package/dist/esm/nice2dev-ui-3d.css +1 -1
  95. package/dist/esm/particle/NiceParticleEditor.js +1188 -570
  96. package/dist/esm/particle/ParticleEditor.module.css.js +122 -3
  97. package/dist/esm/particle/particleEditorTypes.js +69 -69
  98. package/dist/esm/particle/particleEditorUtils.js +1027 -1012
  99. package/dist/esm/rendering/NiceCascadedShadows.js +370 -243
  100. package/dist/esm/rendering/NiceRenderExport.js +413 -321
  101. package/dist/esm/rendering/NiceSSAO.js +450 -328
  102. package/dist/esm/rendering/NiceSSR.js +383 -252
  103. package/dist/esm/rendering/NiceWebGPURenderer.js +326 -214
  104. package/dist/esm/uv/NiceUVEditor.js +788 -549
  105. package/dist/esm/uv/UVEditor.module.css.js +53 -3
  106. package/dist/esm/uv/uvEditorTypes.js +68 -75
  107. package/dist/esm/uv/uvEditorUtils.js +515 -557
  108. package/package.json +7 -12
@@ -1,125 +1,290 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var ui = require('@nice2dev/ui');
5
- var React = require('react');
6
- var THREE = require('three');
7
- var i18n = require('../core/i18n.js');
8
- var ModelEditor_module = require('./ModelEditor.module.css.js');
9
- var modelEditorTypes = require('./modelEditorTypes.js');
10
-
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const ui = require("@nice2dev/ui");
5
+ const React = require("react");
6
+ const THREE = require("three");
7
+ const i18n = require("../core/i18n.js");
8
+ const ModelEditor_module = require("./ModelEditor.module.css.js");
9
+ const modelEditorTypes = require("./modelEditorTypes.js");
11
10
  function _interopNamespaceDefault(e) {
12
- var n = Object.create(null);
13
- if (e) {
14
- Object.keys(e).forEach(function (k) {
15
- if (k !== 'default') {
16
- var d = Object.getOwnPropertyDescriptor(e, k);
17
- Object.defineProperty(n, k, d.get ? d : {
18
- enumerable: true,
19
- get: function () { return e[k]; }
20
- });
21
- }
22
- });
23
- }
24
- n.default = e;
25
- return Object.freeze(n);
11
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
12
+ if (e) {
13
+ for (const k in e) {
14
+ if (k !== "default") {
15
+ const d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: () => e[k]
19
+ });
20
+ }
21
+ }
22
+ }
23
+ n.default = e;
24
+ return Object.freeze(n);
26
25
  }
27
-
28
- var THREE__namespace = /*#__PURE__*/_interopNamespaceDefault(THREE);
29
-
30
- /* ═══════════════════════════════════════════
31
- Sub-components
32
- ═══════════════════════════════════════════ */
33
- /** Vec3 input row for position/scale */
26
+ const THREE__namespace = /* @__PURE__ */ _interopNamespaceDefault(THREE);
34
27
  const Vec3Row = ({ label, value, onChange }) => {
35
- const [, forceUpdate] = React.useState(0);
36
- const set = (axis, v) => {
37
- const n = parseFloat(v);
38
- if (!isNaN(n)) {
39
- value[axis] = n;
40
- forceUpdate((x) => x + 1);
41
- onChange();
28
+ const [, forceUpdate] = React.useState(0);
29
+ const set = (axis, v) => {
30
+ const n = parseFloat(v);
31
+ if (!isNaN(n)) {
32
+ value[axis] = n;
33
+ forceUpdate((x) => x + 1);
34
+ onChange();
35
+ }
36
+ };
37
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.propRow, children: [
38
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: ModelEditor_module.default.propLabel, children: label }),
39
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.propVec3, children: [
40
+ /* @__PURE__ */ jsxRuntime.jsx(
41
+ ui.NiceTextInput,
42
+ {
43
+ className: ModelEditor_module.default.propVec3X,
44
+ value: value.x.toFixed(3),
45
+ onChange: (val) => set("x", val)
42
46
  }
43
- };
44
- return (jsxRuntime.jsxs("div", { className: ModelEditor_module.propRow, children: [jsxRuntime.jsx("span", { className: ModelEditor_module.propLabel, children: label }), jsxRuntime.jsxs("div", { className: ModelEditor_module.propVec3, children: [jsxRuntime.jsx(ui.NiceTextInput, { className: ModelEditor_module.propVec3X, value: value.x.toFixed(3), onChange: (val) => set('x', val) }), jsxRuntime.jsx(ui.NiceTextInput, { className: ModelEditor_module.propVec3Y, value: value.y.toFixed(3), onChange: (val) => set('y', val) }), jsxRuntime.jsx(ui.NiceTextInput, { className: ModelEditor_module.propVec3Z, value: value.z.toFixed(3), onChange: (val) => set('z', val) })] })] }));
47
+ ),
48
+ /* @__PURE__ */ jsxRuntime.jsx(
49
+ ui.NiceTextInput,
50
+ {
51
+ className: ModelEditor_module.default.propVec3Y,
52
+ value: value.y.toFixed(3),
53
+ onChange: (val) => set("y", val)
54
+ }
55
+ ),
56
+ /* @__PURE__ */ jsxRuntime.jsx(
57
+ ui.NiceTextInput,
58
+ {
59
+ className: ModelEditor_module.default.propVec3Z,
60
+ value: value.z.toFixed(3),
61
+ onChange: (val) => set("z", val)
62
+ }
63
+ )
64
+ ] })
65
+ ] });
45
66
  };
46
- /** Vec3 input row for rotation (shows degrees) */
47
67
  const Vec3RowDeg = ({ label, value, onChange }) => {
48
- const [, forceUpdate] = React.useState(0);
49
- const set = (axis, v) => {
50
- const n = parseFloat(v);
51
- if (!isNaN(n)) {
52
- value[axis] = n / modelEditorTypes.DEG;
53
- forceUpdate((x) => x + 1);
54
- onChange();
68
+ const [, forceUpdate] = React.useState(0);
69
+ const set = (axis, v) => {
70
+ const n = parseFloat(v);
71
+ if (!isNaN(n)) {
72
+ value[axis] = n / modelEditorTypes.DEG;
73
+ forceUpdate((x) => x + 1);
74
+ onChange();
75
+ }
76
+ };
77
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.propRow, children: [
78
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: ModelEditor_module.default.propLabel, children: label }),
79
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.propVec3, children: [
80
+ /* @__PURE__ */ jsxRuntime.jsx(
81
+ ui.NiceTextInput,
82
+ {
83
+ className: ModelEditor_module.default.propVec3X,
84
+ value: (value.x * modelEditorTypes.DEG).toFixed(1),
85
+ onChange: (val) => set("x", val)
86
+ }
87
+ ),
88
+ /* @__PURE__ */ jsxRuntime.jsx(
89
+ ui.NiceTextInput,
90
+ {
91
+ className: ModelEditor_module.default.propVec3Y,
92
+ value: (value.y * modelEditorTypes.DEG).toFixed(1),
93
+ onChange: (val) => set("y", val)
55
94
  }
56
- };
57
- return (jsxRuntime.jsxs("div", { className: ModelEditor_module.propRow, children: [jsxRuntime.jsx("span", { className: ModelEditor_module.propLabel, children: label }), jsxRuntime.jsxs("div", { className: ModelEditor_module.propVec3, children: [jsxRuntime.jsx(ui.NiceTextInput, { className: ModelEditor_module.propVec3X, value: (value.x * modelEditorTypes.DEG).toFixed(1), onChange: (val) => set('x', val) }), jsxRuntime.jsx(ui.NiceTextInput, { className: ModelEditor_module.propVec3Y, value: (value.y * modelEditorTypes.DEG).toFixed(1), onChange: (val) => set('y', val) }), jsxRuntime.jsx(ui.NiceTextInput, { className: ModelEditor_module.propVec3Z, value: (value.z * modelEditorTypes.DEG).toFixed(1), onChange: (val) => set('z', val) })] })] }));
95
+ ),
96
+ /* @__PURE__ */ jsxRuntime.jsx(
97
+ ui.NiceTextInput,
98
+ {
99
+ className: ModelEditor_module.default.propVec3Z,
100
+ value: (value.z * modelEditorTypes.DEG).toFixed(1),
101
+ onChange: (val) => set("z", val)
102
+ }
103
+ )
104
+ ] })
105
+ ] });
58
106
  };
59
- /** Material card with editable properties */
60
107
  const MaterialCard = ({ material, active, onClick, onUpdate }) => {
61
- var _a, _b, _c, _d;
62
- const { t } = i18n.useNiceTranslation();
63
- const mat = material;
64
- const hasColor = 'color' in mat;
65
- const hasMetalness = 'metalness' in mat;
66
- const hasRoughness = 'roughness' in mat;
67
- const hasEmissive = 'emissive' in mat;
68
- const hasMap = 'map' in mat;
69
- const hasNormalMap = 'normalMap' in mat;
70
- const setColor = (hex) => {
71
- if (hasColor) {
72
- mat.color.set(hex);
73
- mat.needsUpdate = true;
74
- onUpdate();
75
- }
76
- };
77
- const setNum = (prop, val) => {
78
- mat[prop] = val;
79
- mat.needsUpdate = true;
80
- onUpdate();
81
- };
82
- return (jsxRuntime.jsxs("div", { role: "button", tabIndex: 0, onKeyDown: ui.clickOnActivationKey, className: `${ModelEditor_module.materialCard} ${active ? ModelEditor_module.materialCardActive : ''}`, onClick: onClick, children: [jsxRuntime.jsx("div", { className: ModelEditor_module.materialHeader, children: jsxRuntime.jsx("span", { className: ModelEditor_module.materialName, children: mat.name || mat.type }) }), hasColor && (jsxRuntime.jsxs("div", { className: ModelEditor_module.propRow, children: [jsxRuntime.jsx("span", { className: ModelEditor_module.propLabel, children: t('modelEditorSubComponents.color', 'Color') }), jsxRuntime.jsx(ui.NiceColorPicker, { value: `#${mat.color.getHexString()}`, onChange: (c) => setColor(c) }), jsxRuntime.jsxs("span", { style: { fontSize: 10, color: 'var(--nice-text-secondary, #888)' }, children: ["#", mat.color.getHexString()] })] })), hasMetalness && (jsxRuntime.jsxs("div", { className: ModelEditor_module.propRow, children: [jsxRuntime.jsx("span", { className: ModelEditor_module.propLabel, children: t('modelEditorSubComponents.metal', 'Metal') }), jsxRuntime.jsx(ui.NiceSlider, { min: 0, max: 1, step: 0.01, value: mat.metalness, onChange: (val) => setNum('metalness', val), style: { flex: 1 } }), jsxRuntime.jsx("span", { style: {
83
- fontSize: 9,
84
- color: 'var(--nice-text-secondary, #888)',
85
- width: 28,
86
- textAlign: 'right',
87
- }, children: mat.metalness.toFixed(2) })] })), hasRoughness && (jsxRuntime.jsxs("div", { className: ModelEditor_module.propRow, children: [jsxRuntime.jsx("span", { className: ModelEditor_module.propLabel, children: t('modelEditorSubComponents.rough', 'Rough') }), jsxRuntime.jsx(ui.NiceSlider, { min: 0, max: 1, step: 0.01, value: mat.roughness, onChange: (val) => setNum('roughness', val), style: { flex: 1 } }), jsxRuntime.jsx("span", { style: {
88
- fontSize: 9,
89
- color: 'var(--nice-text-secondary, #888)',
90
- width: 28,
91
- textAlign: 'right',
92
- }, children: mat.roughness.toFixed(2) })] })), hasEmissive && mat.emissive && (jsxRuntime.jsxs("div", { className: ModelEditor_module.propRow, children: [jsxRuntime.jsx("span", { className: ModelEditor_module.propLabel, children: t('modelEditorSubComponents.emissive', 'Emissive') }), jsxRuntime.jsx(ui.NiceColorPicker, { value: `#${mat.emissive.getHexString()}`, onChange: (c) => {
93
- mat.emissive.set(c);
94
- mat.needsUpdate = true;
95
- onUpdate();
96
- } })] })), jsxRuntime.jsxs("div", { className: ModelEditor_module.propRow, children: [jsxRuntime.jsx("span", { className: ModelEditor_module.propLabel, children: t('modelEditorSubComponents.opacity', 'Opacity') }), jsxRuntime.jsx(ui.NiceSlider, { min: 0, max: 1, step: 0.01, value: mat.opacity, onChange: (val) => {
97
- mat.opacity = val;
98
- mat.transparent = val < 1;
99
- mat.needsUpdate = true;
100
- onUpdate();
101
- }, style: { flex: 1 } }), jsxRuntime.jsx("span", { style: {
102
- fontSize: 9,
103
- color: 'var(--nice-text-secondary, #888)',
104
- width: 28,
105
- textAlign: 'right',
106
- }, children: mat.opacity.toFixed(2) })] }), jsxRuntime.jsxs("div", { className: ModelEditor_module.propRow, children: [jsxRuntime.jsx("span", { className: ModelEditor_module.propLabel, children: t('modelEditorSubComponents.side', 'Side') }), jsxRuntime.jsx(ui.NiceSelect, { className: ModelEditor_module.propSelect, value: String(mat.side), onChange: (val) => {
107
- mat.side = parseInt(val);
108
- mat.needsUpdate = true;
109
- onUpdate();
110
- }, options: [
111
- {
112
- value: String(THREE__namespace.FrontSide),
113
- label: t('modelEditorSubComponents.front', 'Front'),
114
- },
115
- { value: String(THREE__namespace.BackSide), label: t('modelEditorSubComponents.back', 'Back') },
116
- {
117
- value: String(THREE__namespace.DoubleSide),
118
- label: t('modelEditorSubComponents.double', 'Double'),
119
- },
120
- ] })] }), hasMap && mat.map && (jsxRuntime.jsxs("div", { className: ModelEditor_module.textureSlot, children: [jsxRuntime.jsx("div", { className: ModelEditor_module.textureThumb, children: mat.map.image != null && (jsxRuntime.jsx("img", { src: (_a = mat.map.image.src) !== null && _a !== void 0 ? _a : '', alt: "diffuse" })) }), jsxRuntime.jsxs("div", { className: ModelEditor_module.textureInfo, children: [jsxRuntime.jsx("div", { className: ModelEditor_module.textureName, children: t('modelEditorSubComponents.diffuseMap', 'Diffuse Map') }), jsxRuntime.jsxs("div", { style: { fontSize: 9, color: 'var(--nice-text-secondary, #666)' }, children: [(_b = mat.map.image) === null || _b === void 0 ? void 0 : _b.width, "\u00D7", (_c = mat.map.image) === null || _c === void 0 ? void 0 : _c.height] })] })] })), hasNormalMap && mat.normalMap && (jsxRuntime.jsxs("div", { className: ModelEditor_module.textureSlot, children: [jsxRuntime.jsx("div", { className: ModelEditor_module.textureThumb, children: mat.normalMap.image != null && (jsxRuntime.jsx("img", { src: (_d = mat.normalMap.image.src) !== null && _d !== void 0 ? _d : '', alt: "normal" })) }), jsxRuntime.jsx("div", { className: ModelEditor_module.textureInfo, children: jsxRuntime.jsx("div", { className: ModelEditor_module.textureName, children: t('modelEditorSubComponents.normalMap', 'Normal Map') }) })] }))] }));
108
+ const { t } = i18n.useNiceTranslation();
109
+ const mat = material;
110
+ const hasColor = "color" in mat;
111
+ const hasMetalness = "metalness" in mat;
112
+ const hasRoughness = "roughness" in mat;
113
+ const hasEmissive = "emissive" in mat;
114
+ const hasMap = "map" in mat;
115
+ const hasNormalMap = "normalMap" in mat;
116
+ const setColor = (hex) => {
117
+ if (hasColor) {
118
+ mat.color.set(hex);
119
+ mat.needsUpdate = true;
120
+ onUpdate();
121
+ }
122
+ };
123
+ const setNum = (prop, val) => {
124
+ mat[prop] = val;
125
+ mat.needsUpdate = true;
126
+ onUpdate();
127
+ };
128
+ return /* @__PURE__ */ jsxRuntime.jsxs(
129
+ "div",
130
+ {
131
+ role: "button",
132
+ tabIndex: 0,
133
+ onKeyDown: ui.clickOnActivationKey,
134
+ className: `${ModelEditor_module.default.materialCard} ${active ? ModelEditor_module.default.materialCardActive : ""}`,
135
+ onClick,
136
+ children: [
137
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: ModelEditor_module.default.materialHeader, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: ModelEditor_module.default.materialName, children: mat.name || mat.type }) }),
138
+ hasColor && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.propRow, children: [
139
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: ModelEditor_module.default.propLabel, children: t("modelEditorSubComponents.color", "Color") }),
140
+ /* @__PURE__ */ jsxRuntime.jsx(ui.NiceColorPicker, { value: `#${mat.color.getHexString()}`, onChange: (c) => setColor(c) }),
141
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: 10, color: "var(--nice-text-secondary, #888)" }, children: [
142
+ "#",
143
+ mat.color.getHexString()
144
+ ] })
145
+ ] }),
146
+ hasMetalness && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.propRow, children: [
147
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: ModelEditor_module.default.propLabel, children: t("modelEditorSubComponents.metal", "Metal") }),
148
+ /* @__PURE__ */ jsxRuntime.jsx(
149
+ ui.NiceSlider,
150
+ {
151
+ min: 0,
152
+ max: 1,
153
+ step: 0.01,
154
+ value: mat.metalness,
155
+ onChange: (val) => setNum("metalness", val),
156
+ style: { flex: 1 }
157
+ }
158
+ ),
159
+ /* @__PURE__ */ jsxRuntime.jsx(
160
+ "span",
161
+ {
162
+ style: {
163
+ fontSize: 9,
164
+ color: "var(--nice-text-secondary, #888)",
165
+ width: 28,
166
+ textAlign: "right"
167
+ },
168
+ children: mat.metalness.toFixed(2)
169
+ }
170
+ )
171
+ ] }),
172
+ hasRoughness && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.propRow, children: [
173
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: ModelEditor_module.default.propLabel, children: t("modelEditorSubComponents.rough", "Rough") }),
174
+ /* @__PURE__ */ jsxRuntime.jsx(
175
+ ui.NiceSlider,
176
+ {
177
+ min: 0,
178
+ max: 1,
179
+ step: 0.01,
180
+ value: mat.roughness,
181
+ onChange: (val) => setNum("roughness", val),
182
+ style: { flex: 1 }
183
+ }
184
+ ),
185
+ /* @__PURE__ */ jsxRuntime.jsx(
186
+ "span",
187
+ {
188
+ style: {
189
+ fontSize: 9,
190
+ color: "var(--nice-text-secondary, #888)",
191
+ width: 28,
192
+ textAlign: "right"
193
+ },
194
+ children: mat.roughness.toFixed(2)
195
+ }
196
+ )
197
+ ] }),
198
+ hasEmissive && mat.emissive && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.propRow, children: [
199
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: ModelEditor_module.default.propLabel, children: t("modelEditorSubComponents.emissive", "Emissive") }),
200
+ /* @__PURE__ */ jsxRuntime.jsx(
201
+ ui.NiceColorPicker,
202
+ {
203
+ value: `#${mat.emissive.getHexString()}`,
204
+ onChange: (c) => {
205
+ mat.emissive.set(c);
206
+ mat.needsUpdate = true;
207
+ onUpdate();
208
+ }
209
+ }
210
+ )
211
+ ] }),
212
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.propRow, children: [
213
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: ModelEditor_module.default.propLabel, children: t("modelEditorSubComponents.opacity", "Opacity") }),
214
+ /* @__PURE__ */ jsxRuntime.jsx(
215
+ ui.NiceSlider,
216
+ {
217
+ min: 0,
218
+ max: 1,
219
+ step: 0.01,
220
+ value: mat.opacity,
221
+ onChange: (val) => {
222
+ mat.opacity = val;
223
+ mat.transparent = val < 1;
224
+ mat.needsUpdate = true;
225
+ onUpdate();
226
+ },
227
+ style: { flex: 1 }
228
+ }
229
+ ),
230
+ /* @__PURE__ */ jsxRuntime.jsx(
231
+ "span",
232
+ {
233
+ style: {
234
+ fontSize: 9,
235
+ color: "var(--nice-text-secondary, #888)",
236
+ width: 28,
237
+ textAlign: "right"
238
+ },
239
+ children: mat.opacity.toFixed(2)
240
+ }
241
+ )
242
+ ] }),
243
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.propRow, children: [
244
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: ModelEditor_module.default.propLabel, children: t("modelEditorSubComponents.side", "Side") }),
245
+ /* @__PURE__ */ jsxRuntime.jsx(
246
+ ui.NiceSelect,
247
+ {
248
+ className: ModelEditor_module.default.propSelect,
249
+ value: String(mat.side),
250
+ onChange: (val) => {
251
+ mat.side = parseInt(val);
252
+ mat.needsUpdate = true;
253
+ onUpdate();
254
+ },
255
+ options: [
256
+ {
257
+ value: String(THREE__namespace.FrontSide),
258
+ label: t("modelEditorSubComponents.front", "Front")
259
+ },
260
+ { value: String(THREE__namespace.BackSide), label: t("modelEditorSubComponents.back", "Back") },
261
+ {
262
+ value: String(THREE__namespace.DoubleSide),
263
+ label: t("modelEditorSubComponents.double", "Double")
264
+ }
265
+ ]
266
+ }
267
+ )
268
+ ] }),
269
+ hasMap && mat.map && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.textureSlot, children: [
270
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: ModelEditor_module.default.textureThumb, children: mat.map.image != null && /* @__PURE__ */ jsxRuntime.jsx("img", { src: mat.map.image.src ?? "", alt: "diffuse" }) }),
271
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.textureInfo, children: [
272
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: ModelEditor_module.default.textureName, children: t("modelEditorSubComponents.diffuseMap", "Diffuse Map") }),
273
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 9, color: "var(--nice-text-secondary, #666)" }, children: [
274
+ mat.map.image?.width,
275
+ "×",
276
+ mat.map.image?.height
277
+ ] })
278
+ ] })
279
+ ] }),
280
+ hasNormalMap && mat.normalMap && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.textureSlot, children: [
281
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: ModelEditor_module.default.textureThumb, children: mat.normalMap.image != null && /* @__PURE__ */ jsxRuntime.jsx("img", { src: mat.normalMap.image.src ?? "", alt: "normal" }) }),
282
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: ModelEditor_module.default.textureInfo, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: ModelEditor_module.default.textureName, children: t("modelEditorSubComponents.normalMap", "Normal Map") }) })
283
+ ] })
284
+ ]
285
+ }
286
+ );
121
287
  };
122
-
123
288
  exports.MaterialCard = MaterialCard;
124
289
  exports.Vec3Row = Vec3Row;
125
290
  exports.Vec3RowDeg = Vec3RowDeg;