@nice2dev/ui-3d 1.3.15 → 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 +9 -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,34 +1,361 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var ui = require('@nice2dev/ui');
5
- var React = require('react');
6
- var i18n = require('../core/i18n.js');
7
- var ModelEditor_module = require('./ModelEditor.module.css.js');
8
-
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const ui = require("@nice2dev/ui");
5
+ const React = require("react");
6
+ const i18n = require("../core/i18n.js");
7
+ const ModelEditor_module = require("./ModelEditor.module.css.js");
9
8
  const ModelEditorMenuBar = /* @__PURE__ */ Object.assign(
10
- /* @__PURE__ */ React.memo(({ api, hasOnSaveToLibrary }) => {
9
+ /* @__PURE__ */ React.memo(({ api, hasOnSaveToLibrary }) => {
11
10
  const { t } = i18n.useNiceTranslation();
12
- const { editorMode, setEditorMode, fileInputRef, mergeInputRef, addMenuOpen, setAddMenuOpen, addPrimitive, addSceneLight, addCameraObject, addEmpty, selectedNode, duplicateSelected, deleteSelected, exportGLTF, exportOBJ, exportSTL, exportPLY, exportUSDZ, saveToLibrary, clearScene, showGrid, setShowGrid, showAxes, setShowAxes, wireframe, setWireframe, showSkeleton, setShowSkeleton, showLightHelpers, setShowLightHelpers, bgColor, setBgColor, } = api;
13
- return (jsxRuntime.jsxs("div", { className: ModelEditor_module.menuBar, children: [jsxRuntime.jsx(ui.NiceSelect, { className: ModelEditor_module.modeSelect, value: editorMode, onChange: (val) => setEditorMode(val), options: [
14
- { value: 'object', label: t('modelEditorMenuBar.objectMode', 'Object Mode') },
15
- { value: 'edit', label: t('modelEditorMenuBar.editMode', 'Edit Mode') },
16
- { value: 'pose', label: t('modelEditorMenuBar.poseMode', 'Pose Mode') },
17
- ] }), jsxRuntime.jsx("div", { className: ModelEditor_module.menuSep }), jsxRuntime.jsxs(ui.NiceButton, { className: ModelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: () => { var _a; return (_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click(); }, children: [jsxRuntime.jsx(ui.NiceIcon, { name: "folder", size: 14 }), " ", t('modelEditorMenuBar.open', 'Open')] }), jsxRuntime.jsxs(ui.NiceButton, { className: ModelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: () => { var _a; return (_a = mergeInputRef.current) === null || _a === void 0 ? void 0 : _a.click(); }, title: t('modelEditorMenuBar.mergeAnimationsFromFbxGltf', 'Merge animations from FBX/GLTF onto current model'), children: [jsxRuntime.jsx(ui.NiceIcon, { name: "plus", size: 14 }), " ", t('modelEditorMenuBar.mergeAnim', 'Merge Anim')] }), jsxRuntime.jsx("div", { className: ModelEditor_module.menuSep }), jsxRuntime.jsxs("div", { className: ModelEditor_module.menuDropdownWrap, children: [jsxRuntime.jsxs(ui.NiceButton, { className: ModelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: () => setAddMenuOpen(addMenuOpen ? null : 'mesh'), children: [jsxRuntime.jsx(ui.NiceIcon, { name: "plus", size: 14 }), " ", t('modelEditorMenuBar.add', 'Add'), ' ', jsxRuntime.jsx(ui.NiceIcon, { name: "chevron-down", size: 14 })] }), addMenuOpen && (jsxRuntime.jsxs("div", { className: ModelEditor_module.dropdownMenu, children: [jsxRuntime.jsx("div", { className: ModelEditor_module.dropdownTitle, children: t('modelEditorMenuBar.mesh', 'Mesh') }), [
18
- 'cube',
19
- 'sphere',
20
- 'cylinder',
21
- 'cone',
22
- 'torus',
23
- 'plane',
24
- 'circle',
25
- 'ring',
26
- 'dodecahedron',
27
- 'icosahedron',
28
- 'octahedron',
29
- 'tetrahedron',
30
- 'torusKnot',
31
- ].map((t) => (jsxRuntime.jsx("div", { role: "button", tabIndex: 0, onKeyDown: ui.clickOnActivationKey, className: ModelEditor_module.dropdownItem, onClick: () => addPrimitive(t), children: t.charAt(0).toUpperCase() + t.slice(1) }, t))), jsxRuntime.jsx("div", { className: ModelEditor_module.dropdownSep }), jsxRuntime.jsx("div", { className: ModelEditor_module.dropdownTitle, children: t('modelEditorMenuBar.light', 'Light') }), ['point', 'spot', 'directional', 'hemisphere'].map((t) => (jsxRuntime.jsxs("div", { role: "button", tabIndex: 0, onKeyDown: ui.clickOnActivationKey, className: ModelEditor_module.dropdownItem, onClick: () => addSceneLight(t), children: [jsxRuntime.jsx(ui.NiceIcon, { name: "lightbulb", size: 14 }), " ", t.charAt(0).toUpperCase() + t.slice(1)] }, t))), jsxRuntime.jsx("div", { className: ModelEditor_module.dropdownSep }), jsxRuntime.jsx("div", { className: ModelEditor_module.dropdownTitle, children: t('modelEditorMenuBar.other', 'Other') }), jsxRuntime.jsxs("div", { role: "button", tabIndex: 0, onKeyDown: ui.clickOnActivationKey, className: ModelEditor_module.dropdownItem, onClick: addCameraObject, children: [jsxRuntime.jsx(ui.NiceIcon, { name: "camera", size: 14 }), " ", t('modelEditorMenuBar.camera', 'Camera')] }), jsxRuntime.jsxs("div", { role: "button", tabIndex: 0, onKeyDown: ui.clickOnActivationKey, className: ModelEditor_module.dropdownItem, onClick: () => addEmpty('arrows'), children: [jsxRuntime.jsx(ui.NiceIcon, { name: "move", size: 14 }), ' ', t('modelEditorMenuBar.emptyArrows', 'Empty (Arrows)')] })] }))] }), jsxRuntime.jsxs(ui.NiceButton, { className: ModelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: duplicateSelected, disabled: !selectedNode, title: t('modelEditorMenuBar.duplicateSelectedShiftD', 'Duplicate selected (Shift+D)'), children: [jsxRuntime.jsx(ui.NiceIcon, { name: "clipboard", size: 14 }), " ", t('modelEditorMenuBar.duplicate', 'Duplicate')] }), jsxRuntime.jsxs(ui.NiceButton, { className: ModelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: deleteSelected, disabled: !selectedNode, title: t('modelEditorMenuBar.deleteSelectedDelete', 'Delete selected (Delete)'), children: [jsxRuntime.jsx(ui.NiceIcon, { name: "close", size: 14 }), " ", t('modelEditorMenuBar.delete', 'Delete')] }), jsxRuntime.jsx("div", { className: ModelEditor_module.menuSep }), jsxRuntime.jsxs(ui.NiceButton, { className: ModelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: () => exportGLTF(true), children: [jsxRuntime.jsx(ui.NiceIcon, { name: "save", size: 14 }), " ", t('modelEditorMenuBar.exportGlb', 'Export GLB')] }), jsxRuntime.jsxs(ui.NiceButton, { className: ModelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: () => exportGLTF(false), children: [jsxRuntime.jsx(ui.NiceIcon, { name: "file", size: 14 }), " ", t('modelEditorMenuBar.exportGltf', 'Export GLTF')] }), jsxRuntime.jsxs(ui.NiceButton, { className: ModelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: exportOBJ, children: [jsxRuntime.jsx(ui.NiceIcon, { name: "file", size: 14 }), " ", t('modelEditorMenuBar.exportObj', 'Export OBJ')] }), jsxRuntime.jsxs(ui.NiceButton, { className: ModelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: () => exportSTL(true), children: [jsxRuntime.jsx(ui.NiceIcon, { name: "file", size: 14 }), " ", t('modelEditorMenuBar.exportStl', 'Export STL')] }), jsxRuntime.jsxs(ui.NiceButton, { className: ModelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: () => exportPLY(true), children: [jsxRuntime.jsx(ui.NiceIcon, { name: "file", size: 14 }), " ", t('modelEditorMenuBar.exportPly', 'Export PLY')] }), jsxRuntime.jsxs(ui.NiceButton, { className: ModelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: exportUSDZ, children: [jsxRuntime.jsx(ui.NiceIcon, { name: "file", size: 14 }), " ", t('modelEditorMenuBar.exportUsdz', 'Export USDZ')] }), hasOnSaveToLibrary && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: ModelEditor_module.menuSep }), jsxRuntime.jsxs(ui.NiceButton, { className: ModelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: saveToLibrary, children: [jsxRuntime.jsx(ui.NiceIcon, { name: "box", size: 14 }), ' ', t('modelEditorMenuBar.saveToLibrary', 'Save to Library')] })] })), jsxRuntime.jsx("div", { className: ModelEditor_module.menuSep }), jsxRuntime.jsxs(ui.NiceButton, { className: ModelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: clearScene, children: [jsxRuntime.jsx(ui.NiceIcon, { name: "trash", size: 14 }), " ", t('modelEditorMenuBar.clear', 'Clear')] }), jsxRuntime.jsx("div", { className: ModelEditor_module.menuSep }), jsxRuntime.jsx(ui.NiceCheckbox, { checked: showGrid, onChange: () => setShowGrid((v) => !v), label: t('modelEditorMenuBar.grid', 'Grid') }), jsxRuntime.jsx(ui.NiceCheckbox, { checked: showAxes, onChange: () => setShowAxes((v) => !v), label: t('modelEditorMenuBar.axes', 'Axes') }), jsxRuntime.jsx(ui.NiceCheckbox, { checked: wireframe, onChange: () => setWireframe((v) => !v), label: t('modelEditorMenuBar.wire', 'Wire') }), jsxRuntime.jsx(ui.NiceCheckbox, { checked: showSkeleton, onChange: () => setShowSkeleton((v) => !v), label: t('modelEditorMenuBar.skel', 'Skel') }), jsxRuntime.jsx(ui.NiceCheckbox, { checked: showLightHelpers, onChange: () => setShowLightHelpers((v) => !v), label: t('modelEditorMenuBar.helpers', 'Helpers') }), jsxRuntime.jsxs("div", { className: ModelEditor_module.menuRight, children: [jsxRuntime.jsx("label", { className: ModelEditor_module.menuLabel, children: t('modelEditorMenuBar.bg', 'BG') }), jsxRuntime.jsx(ui.NiceColorPicker, { value: bgColor, onChange: (c) => setBgColor(c) })] })] }));
32
- }), { displayName: 'ModelEditorMenuBar' });
33
-
34
- module.exports = ModelEditorMenuBar;
11
+ const {
12
+ editorMode,
13
+ setEditorMode,
14
+ fileInputRef,
15
+ mergeInputRef,
16
+ addMenuOpen,
17
+ setAddMenuOpen,
18
+ addPrimitive,
19
+ addSceneLight,
20
+ addCameraObject,
21
+ addEmpty,
22
+ selectedNode,
23
+ duplicateSelected,
24
+ deleteSelected,
25
+ exportGLTF,
26
+ exportOBJ,
27
+ exportSTL,
28
+ exportPLY,
29
+ exportUSDZ,
30
+ saveToLibrary,
31
+ clearScene,
32
+ showGrid,
33
+ setShowGrid,
34
+ showAxes,
35
+ setShowAxes,
36
+ wireframe,
37
+ setWireframe,
38
+ showSkeleton,
39
+ setShowSkeleton,
40
+ showLightHelpers,
41
+ setShowLightHelpers,
42
+ bgColor,
43
+ setBgColor
44
+ } = api;
45
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.menuBar, children: [
46
+ /* @__PURE__ */ jsxRuntime.jsx(
47
+ ui.NiceSelect,
48
+ {
49
+ className: ModelEditor_module.default.modeSelect,
50
+ value: editorMode,
51
+ onChange: (val) => setEditorMode(val),
52
+ options: [
53
+ { value: "object", label: t("modelEditorMenuBar.objectMode", "Object Mode") },
54
+ { value: "edit", label: t("modelEditorMenuBar.editMode", "Edit Mode") },
55
+ { value: "pose", label: t("modelEditorMenuBar.poseMode", "Pose Mode") }
56
+ ]
57
+ }
58
+ ),
59
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: ModelEditor_module.default.menuSep }),
60
+ /* @__PURE__ */ jsxRuntime.jsxs(
61
+ ui.NiceButton,
62
+ {
63
+ className: ModelEditor_module.default.menuBtn,
64
+ variant: "ghost",
65
+ size: "sm",
66
+ onClick: () => fileInputRef.current?.click(),
67
+ children: [
68
+ /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: "folder", size: 14 }),
69
+ " ",
70
+ t("modelEditorMenuBar.open", "Open")
71
+ ]
72
+ }
73
+ ),
74
+ /* @__PURE__ */ jsxRuntime.jsxs(
75
+ ui.NiceButton,
76
+ {
77
+ className: ModelEditor_module.default.menuBtn,
78
+ variant: "ghost",
79
+ size: "sm",
80
+ onClick: () => mergeInputRef.current?.click(),
81
+ title: t(
82
+ "modelEditorMenuBar.mergeAnimationsFromFbxGltf",
83
+ "Merge animations from FBX/GLTF onto current model"
84
+ ),
85
+ children: [
86
+ /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: "plus", size: 14 }),
87
+ " ",
88
+ t("modelEditorMenuBar.mergeAnim", "Merge Anim")
89
+ ]
90
+ }
91
+ ),
92
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: ModelEditor_module.default.menuSep }),
93
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.menuDropdownWrap, children: [
94
+ /* @__PURE__ */ jsxRuntime.jsxs(
95
+ ui.NiceButton,
96
+ {
97
+ className: ModelEditor_module.default.menuBtn,
98
+ variant: "ghost",
99
+ size: "sm",
100
+ onClick: () => setAddMenuOpen(addMenuOpen ? null : "mesh"),
101
+ children: [
102
+ /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: "plus", size: 14 }),
103
+ " ",
104
+ t("modelEditorMenuBar.add", "Add"),
105
+ " ",
106
+ /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: "chevron-down", size: 14 })
107
+ ]
108
+ }
109
+ ),
110
+ addMenuOpen && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.dropdownMenu, children: [
111
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: ModelEditor_module.default.dropdownTitle, children: t("modelEditorMenuBar.mesh", "Mesh") }),
112
+ [
113
+ "cube",
114
+ "sphere",
115
+ "cylinder",
116
+ "cone",
117
+ "torus",
118
+ "plane",
119
+ "circle",
120
+ "ring",
121
+ "dodecahedron",
122
+ "icosahedron",
123
+ "octahedron",
124
+ "tetrahedron",
125
+ "torusKnot"
126
+ ].map((t2) => /* @__PURE__ */ jsxRuntime.jsx(
127
+ "div",
128
+ {
129
+ role: "button",
130
+ tabIndex: 0,
131
+ onKeyDown: ui.clickOnActivationKey,
132
+ className: ModelEditor_module.default.dropdownItem,
133
+ onClick: () => addPrimitive(t2),
134
+ children: t2.charAt(0).toUpperCase() + t2.slice(1)
135
+ },
136
+ t2
137
+ )),
138
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: ModelEditor_module.default.dropdownSep }),
139
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: ModelEditor_module.default.dropdownTitle, children: t("modelEditorMenuBar.light", "Light") }),
140
+ ["point", "spot", "directional", "hemisphere"].map((t2) => /* @__PURE__ */ jsxRuntime.jsxs(
141
+ "div",
142
+ {
143
+ role: "button",
144
+ tabIndex: 0,
145
+ onKeyDown: ui.clickOnActivationKey,
146
+ className: ModelEditor_module.default.dropdownItem,
147
+ onClick: () => addSceneLight(t2),
148
+ children: [
149
+ /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: "lightbulb", size: 14 }),
150
+ " ",
151
+ t2.charAt(0).toUpperCase() + t2.slice(1)
152
+ ]
153
+ },
154
+ t2
155
+ )),
156
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: ModelEditor_module.default.dropdownSep }),
157
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: ModelEditor_module.default.dropdownTitle, children: t("modelEditorMenuBar.other", "Other") }),
158
+ /* @__PURE__ */ jsxRuntime.jsxs(
159
+ "div",
160
+ {
161
+ role: "button",
162
+ tabIndex: 0,
163
+ onKeyDown: ui.clickOnActivationKey,
164
+ className: ModelEditor_module.default.dropdownItem,
165
+ onClick: addCameraObject,
166
+ children: [
167
+ /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: "camera", size: 14 }),
168
+ " ",
169
+ t("modelEditorMenuBar.camera", "Camera")
170
+ ]
171
+ }
172
+ ),
173
+ /* @__PURE__ */ jsxRuntime.jsxs(
174
+ "div",
175
+ {
176
+ role: "button",
177
+ tabIndex: 0,
178
+ onKeyDown: ui.clickOnActivationKey,
179
+ className: ModelEditor_module.default.dropdownItem,
180
+ onClick: () => addEmpty("arrows"),
181
+ children: [
182
+ /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: "move", size: 14 }),
183
+ " ",
184
+ t("modelEditorMenuBar.emptyArrows", "Empty (Arrows)")
185
+ ]
186
+ }
187
+ )
188
+ ] })
189
+ ] }),
190
+ /* @__PURE__ */ jsxRuntime.jsxs(
191
+ ui.NiceButton,
192
+ {
193
+ className: ModelEditor_module.default.menuBtn,
194
+ variant: "ghost",
195
+ size: "sm",
196
+ onClick: duplicateSelected,
197
+ disabled: !selectedNode,
198
+ title: t("modelEditorMenuBar.duplicateSelectedShiftD", "Duplicate selected (Shift+D)"),
199
+ children: [
200
+ /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: "clipboard", size: 14 }),
201
+ " ",
202
+ t("modelEditorMenuBar.duplicate", "Duplicate")
203
+ ]
204
+ }
205
+ ),
206
+ /* @__PURE__ */ jsxRuntime.jsxs(
207
+ ui.NiceButton,
208
+ {
209
+ className: ModelEditor_module.default.menuBtn,
210
+ variant: "ghost",
211
+ size: "sm",
212
+ onClick: deleteSelected,
213
+ disabled: !selectedNode,
214
+ title: t("modelEditorMenuBar.deleteSelectedDelete", "Delete selected (Delete)"),
215
+ children: [
216
+ /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: "close", size: 14 }),
217
+ " ",
218
+ t("modelEditorMenuBar.delete", "Delete")
219
+ ]
220
+ }
221
+ ),
222
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: ModelEditor_module.default.menuSep }),
223
+ /* @__PURE__ */ jsxRuntime.jsxs(
224
+ ui.NiceButton,
225
+ {
226
+ className: ModelEditor_module.default.menuBtn,
227
+ variant: "ghost",
228
+ size: "sm",
229
+ onClick: () => exportGLTF(true),
230
+ children: [
231
+ /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: "save", size: 14 }),
232
+ " ",
233
+ t("modelEditorMenuBar.exportGlb", "Export GLB")
234
+ ]
235
+ }
236
+ ),
237
+ /* @__PURE__ */ jsxRuntime.jsxs(
238
+ ui.NiceButton,
239
+ {
240
+ className: ModelEditor_module.default.menuBtn,
241
+ variant: "ghost",
242
+ size: "sm",
243
+ onClick: () => exportGLTF(false),
244
+ children: [
245
+ /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: "file", size: 14 }),
246
+ " ",
247
+ t("modelEditorMenuBar.exportGltf", "Export GLTF")
248
+ ]
249
+ }
250
+ ),
251
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.NiceButton, { className: ModelEditor_module.default.menuBtn, variant: "ghost", size: "sm", onClick: exportOBJ, children: [
252
+ /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: "file", size: 14 }),
253
+ " ",
254
+ t("modelEditorMenuBar.exportObj", "Export OBJ")
255
+ ] }),
256
+ /* @__PURE__ */ jsxRuntime.jsxs(
257
+ ui.NiceButton,
258
+ {
259
+ className: ModelEditor_module.default.menuBtn,
260
+ variant: "ghost",
261
+ size: "sm",
262
+ onClick: () => exportSTL(true),
263
+ children: [
264
+ /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: "file", size: 14 }),
265
+ " ",
266
+ t("modelEditorMenuBar.exportStl", "Export STL")
267
+ ]
268
+ }
269
+ ),
270
+ /* @__PURE__ */ jsxRuntime.jsxs(
271
+ ui.NiceButton,
272
+ {
273
+ className: ModelEditor_module.default.menuBtn,
274
+ variant: "ghost",
275
+ size: "sm",
276
+ onClick: () => exportPLY(true),
277
+ children: [
278
+ /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: "file", size: 14 }),
279
+ " ",
280
+ t("modelEditorMenuBar.exportPly", "Export PLY")
281
+ ]
282
+ }
283
+ ),
284
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.NiceButton, { className: ModelEditor_module.default.menuBtn, variant: "ghost", size: "sm", onClick: exportUSDZ, children: [
285
+ /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: "file", size: 14 }),
286
+ " ",
287
+ t("modelEditorMenuBar.exportUsdz", "Export USDZ")
288
+ ] }),
289
+ hasOnSaveToLibrary && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
290
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: ModelEditor_module.default.menuSep }),
291
+ /* @__PURE__ */ jsxRuntime.jsxs(
292
+ ui.NiceButton,
293
+ {
294
+ className: ModelEditor_module.default.menuBtn,
295
+ variant: "ghost",
296
+ size: "sm",
297
+ onClick: saveToLibrary,
298
+ children: [
299
+ /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: "box", size: 14 }),
300
+ " ",
301
+ t("modelEditorMenuBar.saveToLibrary", "Save to Library")
302
+ ]
303
+ }
304
+ )
305
+ ] }),
306
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: ModelEditor_module.default.menuSep }),
307
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.NiceButton, { className: ModelEditor_module.default.menuBtn, variant: "ghost", size: "sm", onClick: clearScene, children: [
308
+ /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: "trash", size: 14 }),
309
+ " ",
310
+ t("modelEditorMenuBar.clear", "Clear")
311
+ ] }),
312
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: ModelEditor_module.default.menuSep }),
313
+ /* @__PURE__ */ jsxRuntime.jsx(
314
+ ui.NiceCheckbox,
315
+ {
316
+ checked: showGrid,
317
+ onChange: () => setShowGrid((v) => !v),
318
+ label: t("modelEditorMenuBar.grid", "Grid")
319
+ }
320
+ ),
321
+ /* @__PURE__ */ jsxRuntime.jsx(
322
+ ui.NiceCheckbox,
323
+ {
324
+ checked: showAxes,
325
+ onChange: () => setShowAxes((v) => !v),
326
+ label: t("modelEditorMenuBar.axes", "Axes")
327
+ }
328
+ ),
329
+ /* @__PURE__ */ jsxRuntime.jsx(
330
+ ui.NiceCheckbox,
331
+ {
332
+ checked: wireframe,
333
+ onChange: () => setWireframe((v) => !v),
334
+ label: t("modelEditorMenuBar.wire", "Wire")
335
+ }
336
+ ),
337
+ /* @__PURE__ */ jsxRuntime.jsx(
338
+ ui.NiceCheckbox,
339
+ {
340
+ checked: showSkeleton,
341
+ onChange: () => setShowSkeleton((v) => !v),
342
+ label: t("modelEditorMenuBar.skel", "Skel")
343
+ }
344
+ ),
345
+ /* @__PURE__ */ jsxRuntime.jsx(
346
+ ui.NiceCheckbox,
347
+ {
348
+ checked: showLightHelpers,
349
+ onChange: () => setShowLightHelpers((v) => !v),
350
+ label: t("modelEditorMenuBar.helpers", "Helpers")
351
+ }
352
+ ),
353
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.menuRight, children: [
354
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: ModelEditor_module.default.menuLabel, children: t("modelEditorMenuBar.bg", "BG") }),
355
+ /* @__PURE__ */ jsxRuntime.jsx(ui.NiceColorPicker, { value: bgColor, onChange: (c) => setBgColor(c) })
356
+ ] })
357
+ ] });
358
+ }),
359
+ { displayName: "ModelEditorMenuBar" }
360
+ );
361
+ exports.default = ModelEditorMenuBar;