@operato/scene-visualizer 9.2.2 → 10.0.0-beta.10
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.
- package/dist/carrier.d.ts +263 -0
- package/dist/carrier.js +272 -0
- package/dist/carrier.js.map +1 -0
- package/dist/desk.d.ts +238 -3
- package/dist/desk.js +1 -2
- package/dist/desk.js.map +1 -1
- package/dist/editors/index.d.ts +3 -0
- package/dist/editors/index.js +15 -0
- package/dist/editors/index.js.map +1 -1
- package/dist/editors/property-editor-gltf-fill-targets.d.ts +20 -0
- package/dist/editors/property-editor-gltf-fill-targets.js +313 -0
- package/dist/editors/property-editor-gltf-fill-targets.js.map +1 -0
- package/dist/editors/property-editor-gltf-info.d.ts +25 -3
- package/dist/editors/property-editor-gltf-info.js +333 -73
- package/dist/editors/property-editor-gltf-info.js.map +1 -1
- package/dist/editors/property-editor-gltf-play-targets.d.ts +25 -0
- package/dist/editors/property-editor-gltf-play-targets.js +388 -0
- package/dist/editors/property-editor-gltf-play-targets.js.map +1 -0
- package/dist/editors/property-editor-location-increase-pattern.js +87 -95
- package/dist/editors/property-editor-location-increase-pattern.js.map +1 -1
- package/dist/editors/property-editor-stocker-location.d.ts +13 -0
- package/dist/editors/property-editor-stocker-location.js +151 -0
- package/dist/editors/property-editor-stocker-location.js.map +1 -0
- package/dist/editors/property-editor-stocker-ports.d.ts +8 -0
- package/dist/editors/property-editor-stocker-ports.js +112 -0
- package/dist/editors/property-editor-stocker-ports.js.map +1 -0
- package/dist/effects/outline.js +1 -1
- package/dist/effects/outline.js.map +1 -1
- package/dist/index.d.ts +8 -17
- package/dist/index.js +10 -17
- package/dist/index.js.map +1 -1
- package/dist/rack-table-3d.d.ts +16 -0
- package/dist/rack-table-3d.js +95 -0
- package/dist/rack-table-3d.js.map +1 -0
- package/dist/rack-table-cell.d.ts +238 -3
- package/dist/rack-table-cell.js +44 -51
- package/dist/rack-table-cell.js.map +1 -1
- package/dist/rack-table-location.d.ts +37 -0
- package/dist/rack-table-location.js +227 -0
- package/dist/rack-table-location.js.map +1 -0
- package/dist/rack-table.d.ts +13 -29
- package/dist/rack-table.js +121 -380
- package/dist/rack-table.js.map +1 -1
- package/dist/rack.d.ts +16 -5
- package/dist/rack.js +106 -19
- package/dist/rack.js.map +1 -1
- package/dist/signal-tower.d.ts +492 -0
- package/dist/signal-tower.js +275 -0
- package/dist/signal-tower.js.map +1 -0
- package/dist/stock-hub.d.ts +25 -0
- package/dist/stock-hub.js +147 -0
- package/dist/stock-hub.js.map +1 -0
- package/dist/stock.d.ts +52 -8
- package/dist/stock.js +223 -120
- package/dist/stock.js.map +1 -1
- package/dist/stocker-3d.d.ts +23 -0
- package/dist/stocker-3d.js +352 -0
- package/dist/stocker-3d.js.map +1 -0
- package/dist/stocker-port-3d.d.ts +14 -0
- package/dist/stocker-port-3d.js +80 -0
- package/dist/stocker-port-3d.js.map +1 -0
- package/dist/stocker-port.d.ts +254 -0
- package/dist/stocker-port.js +123 -0
- package/dist/stocker-port.js.map +1 -0
- package/dist/stocker.d.ts +340 -0
- package/dist/stocker.js +370 -0
- package/dist/stocker.js.map +1 -0
- package/dist/tank.d.ts +492 -0
- package/dist/tank.js +312 -0
- package/dist/tank.js.map +1 -0
- package/dist/templates/carrier.d.ts +19 -0
- package/dist/templates/carrier.js +20 -0
- package/dist/templates/carrier.js.map +1 -0
- package/dist/templates/cube.js +1 -1
- package/dist/templates/cube.js.map +1 -1
- package/dist/templates/cylinder.js +3 -3
- package/dist/templates/cylinder.js.map +1 -1
- package/dist/templates/index.d.ts +38 -38
- package/dist/templates/index.js +15 -1
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/rack-table.d.ts +2 -0
- package/dist/templates/rack-table.js +4 -2
- package/dist/templates/rack-table.js.map +1 -1
- package/dist/templates/signal-tower.d.ts +21 -0
- package/dist/templates/signal-tower.js +22 -0
- package/dist/templates/signal-tower.js.map +1 -0
- package/dist/templates/sphere.d.ts +1 -0
- package/dist/templates/sphere.js +5 -4
- package/dist/templates/sphere.js.map +1 -1
- package/dist/templates/stock-hub.d.ts +14 -0
- package/dist/templates/stock-hub.js +15 -0
- package/dist/templates/stock-hub.js.map +1 -0
- package/dist/templates/stocker-port.d.ts +17 -0
- package/dist/templates/stocker-port.js +17 -0
- package/dist/templates/stocker-port.js.map +1 -0
- package/dist/templates/stocker.d.ts +27 -0
- package/dist/templates/stocker.js +38 -0
- package/dist/templates/stocker.js.map +1 -0
- package/dist/templates/tank.d.ts +21 -0
- package/dist/templates/tank.js +22 -0
- package/dist/templates/tank.js.map +1 -0
- package/dist/templates/vehicle.d.ts +19 -0
- package/dist/templates/vehicle.js +20 -0
- package/dist/templates/vehicle.js.map +1 -0
- package/dist/templates/visualizer.js +1 -1
- package/dist/templates/visualizer.js.map +1 -1
- package/dist/vehicle.d.ts +248 -0
- package/dist/vehicle.js +133 -0
- package/dist/vehicle.js.map +1 -0
- package/dist/visualizer.d.ts +5 -5
- package/dist/visualizer.js +72 -68
- package/dist/visualizer.js.map +1 -1
- package/icons/carrier.png +0 -0
- package/icons/signal-tower.png +0 -0
- package/icons/stock-hub.png +0 -0
- package/icons/tank.png +0 -0
- package/icons/vehicle.png +0 -0
- package/package.json +16 -18
- package/translations/en.json +6 -0
- package/translations/ja.json +5 -0
- package/translations/ko.json +6 -1
- package/translations/ms.json +5 -0
- package/translations/zh.json +5 -0
- package/dist/banner.d.ts +0 -15
- package/dist/banner.js +0 -76
- package/dist/banner.js.map +0 -1
- package/dist/camera.d.ts +0 -20
- package/dist/camera.js +0 -108
- package/dist/camera.js.map +0 -1
- package/dist/cube.d.ts +0 -13
- package/dist/cube.js +0 -38
- package/dist/cube.js.map +0 -1
- package/dist/cylinder.d.ts +0 -11
- package/dist/cylinder.js +0 -38
- package/dist/cylinder.js.map +0 -1
- package/dist/ellipse.d.ts +0 -5
- package/dist/ellipse.js +0 -22
- package/dist/ellipse.js.map +0 -1
- package/dist/gltf-object.d.ts +0 -20
- package/dist/gltf-object.js +0 -104
- package/dist/gltf-object.js.map +0 -1
- package/dist/html-overlay-element.d.ts +0 -1
- package/dist/html-overlay-element.js +0 -12
- package/dist/html-overlay-element.js.map +0 -1
- package/dist/light.d.ts +0 -15
- package/dist/light.js +0 -135
- package/dist/light.js.map +0 -1
- package/dist/polygon.d.ts +0 -17
- package/dist/polygon.js +0 -64
- package/dist/polygon.js.map +0 -1
- package/dist/rect.d.ts +0 -5
- package/dist/rect.js +0 -36
- package/dist/rect.js.map +0 -1
- package/dist/scene/component.d.ts +0 -1
- package/dist/scene/component.js +0 -29
- package/dist/scene/component.js.map +0 -1
- package/dist/sphere.d.ts +0 -11
- package/dist/sphere.js +0 -38
- package/dist/sphere.js.map +0 -1
- package/dist/sprite.d.ts +0 -9
- package/dist/sprite.js +0 -28
- package/dist/sprite.js.map +0 -1
- package/dist/text.d.ts +0 -1
- package/dist/text.js +0 -9
- package/dist/text.js.map +0 -1
- package/dist/three-container-editor.d.ts +0 -22
- package/dist/three-container-editor.js +0 -132
- package/dist/three-container-editor.js.map +0 -1
- package/dist/three-container.d.ts +0 -85
- package/dist/three-container.js +0 -565
- package/dist/three-container.js.map +0 -1
- package/dist/three-controls.d.ts +0 -11
- package/dist/three-controls.js +0 -616
- package/dist/three-controls.js.map +0 -1
- package/dist/three-layout.d.ts +0 -8
- package/dist/three-layout.js +0 -20
- package/dist/three-layout.js.map +0 -1
- package/dist/three-space.d.ts +0 -85
- package/dist/three-space.js +0 -570
- package/dist/three-space.js.map +0 -1
- package/dist/threed/common.d.ts +0 -22
- package/dist/threed/common.js +0 -19
- package/dist/threed/common.js.map +0 -1
- package/dist/threed/floor/floor.d.ts +0 -3
- package/dist/threed/floor/floor.js +0 -51
- package/dist/threed/floor/floor.js.map +0 -1
- package/dist/threed/html/elements.d.ts +0 -2
- package/dist/threed/html/elements.js +0 -21
- package/dist/threed/html/elements.js.map +0 -1
- package/dist/threed/index.d.ts +0 -15
- package/dist/threed/index.js +0 -16
- package/dist/threed/index.js.map +0 -1
- package/dist/threed/real-object-camera-meshed.d.ts +0 -12
- package/dist/threed/real-object-camera-meshed.js +0 -49
- package/dist/threed/real-object-camera-meshed.js.map +0 -1
- package/dist/threed/real-object-camera.d.ts +0 -9
- package/dist/threed/real-object-camera.js +0 -31
- package/dist/threed/real-object-camera.js.map +0 -1
- package/dist/threed/real-object-dom-element.d.ts +0 -9
- package/dist/threed/real-object-dom-element.js +0 -40
- package/dist/threed/real-object-dom-element.js.map +0 -1
- package/dist/threed/real-object-dummy.d.ts +0 -6
- package/dist/threed/real-object-dummy.js +0 -11
- package/dist/threed/real-object-dummy.js.map +0 -1
- package/dist/threed/real-object-extrude.d.ts +0 -21
- package/dist/threed/real-object-extrude.js +0 -173
- package/dist/threed/real-object-extrude.js.map +0 -1
- package/dist/threed/real-object-gltf.d.ts +0 -16
- package/dist/threed/real-object-gltf.js +0 -101
- package/dist/threed/real-object-gltf.js.map +0 -1
- package/dist/threed/real-object-group.d.ts +0 -5
- package/dist/threed/real-object-group.js +0 -11
- package/dist/threed/real-object-group.js.map +0 -1
- package/dist/threed/real-object-mesh.d.ts +0 -13
- package/dist/threed/real-object-mesh.js +0 -75
- package/dist/threed/real-object-mesh.js.map +0 -1
- package/dist/threed/real-object-plane.d.ts +0 -5
- package/dist/threed/real-object-plane.js +0 -22
- package/dist/threed/real-object-plane.js.map +0 -1
- package/dist/threed/real-object-scene.d.ts +0 -21
- package/dist/threed/real-object-scene.js +0 -67
- package/dist/threed/real-object-scene.js.map +0 -1
- package/dist/threed/real-object-sprite-2d.d.ts +0 -14
- package/dist/threed/real-object-sprite-2d.js +0 -45
- package/dist/threed/real-object-sprite-2d.js.map +0 -1
- package/dist/threed/real-object-sprite.d.ts +0 -11
- package/dist/threed/real-object-sprite.js +0 -50
- package/dist/threed/real-object-sprite.js.map +0 -1
- package/dist/threed/real-object-text.d.ts +0 -15
- package/dist/threed/real-object-text.js +0 -64
- package/dist/threed/real-object-text.js.map +0 -1
- package/dist/threed/real-object.d.ts +0 -64
- package/dist/threed/real-object.js +0 -260
- package/dist/threed/real-object.js.map +0 -1
- package/dist/threed/texture/canvas-texture.d.ts +0 -4
- package/dist/threed/texture/canvas-texture.js +0 -49
- package/dist/threed/texture/canvas-texture.js.map +0 -1
- package/dist/threed/texture/text-texture.d.ts +0 -8
- package/dist/threed/texture/text-texture.js +0 -79
- package/dist/threed/texture/text-texture.js.map +0 -1
- package/dist/threed/three-dimensional-container.d.ts +0 -8
- package/dist/threed/three-dimensional-container.js +0 -2
- package/dist/threed/three-dimensional-container.js.map +0 -1
- package/dist/threed/utils/bound-uv-generator.d.ts +0 -16
- package/dist/threed/utils/bound-uv-generator.js +0 -42
- package/dist/threed/utils/bound-uv-generator.js.map +0 -1
- package/dist/wall.d.ts +0 -13
- package/dist/wall.js +0 -45
- package/dist/wall.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-editor-gltf-fill-targets.js","sourceRoot":"","sources":["../../src/editors/property-editor-gltf-fill-targets.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkC,OAAO,EAAE,MAAM,KAAK,CAAA;AACxE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,gBAAgB,EAAgB,MAAM,0BAA0B,CAAA;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AASrE,SAAS,OAAO,CAAC,KAAU;IACzB,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,KAAK,CAAA;IAC/B,IAAI,KAAK,KAAK,MAAM,IAAI,CAAC,KAAK;QAAE,OAAO,MAAM,CAAA;IAC7C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,QAAQ,CAAA;IAC7D,2CAA2C;IAC3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AE,WAAW,EAAE,eAAe,IAAI,SAAS,EAAE,gBAAgB,EAAE,eAAe,IAAI,IAAI,CAAA;IACxG,CAAC;;AAnMmC;IAAnC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAgC;AAElC;IAAxB,KAAK,EAAE;yDAAqC;AACpB;IAAxB,KAAK,EAAE;oDAAgC;AA1GrB,qBAAqB;IADzC,aAAa,CAAC,mCAAmC,CAAC;GAC9B,qBAAqB,CA2SzC;eA3SoB,qBAAqB","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n *\n * GLTF fillStyle 타겟 노드 선택 에디터.\n * All / None / Custom 모드로 명시적 설정.\n * Custom 모드에서 개별 Mesh 체크박스 선택.\n */\n\nimport '@operato/i18n/ox-i18n.js'\n\nimport { css, html, PropertyValues, TemplateResult, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { OxPropertyEditor, PropertySpec } from '@operato/property-editor'\nimport { ScrollbarStyles } from '@operato/styles/scrollbar-styles.js'\n\n// fillStyleTargets 값 규칙:\n// undefined 또는 미설정 → None (적용 안 함, 기본값)\n// '*' → All (전체 메시 적용)\n// ['mesh_0', ...] → Custom (선택 메시만 적용)\n\ntype FillMode = 'all' | 'none' | 'custom'\n\nfunction getMode(value: any): FillMode {\n if (value === '*') return 'all'\n if (value === 'none' || !value) return 'none'\n if (Array.isArray(value) && value.length > 0) return 'custom'\n // [] (빈 배열) = custom with nothing selected\n if (Array.isArray(value)) return 'custom'\n return 'none'\n}\n\n@customElement('property-editor-gltf-fill-targets')\nexport default class GLTFFillTargetsEditor extends OxPropertyEditor {\n static styles = [\n ...OxPropertyEditor.styles,\n ScrollbarStyles,\n css`\n .mode-selector {\n display: flex;\n gap: 0;\n margin-bottom: 6px;\n border: 1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, 0.15));\n border-radius: 6px;\n overflow: hidden;\n }\n\n .mode-btn {\n flex: 1;\n padding: 5px 0;\n font-size: 11px;\n font-weight: 500;\n text-align: center;\n cursor: pointer;\n background: var(--md-sys-color-surface-container, #f3edf7);\n color: var(--md-sys-color-on-surface, #1c1b1f);\n border: none;\n border-right: 1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, 0.1));\n transition: all 0.15s;\n }\n\n .mode-btn:last-child {\n border-right: none;\n }\n\n .mode-btn:hover {\n background: var(--md-sys-color-surface-container-highest, #e6e0e9);\n }\n\n .mode-btn[active] {\n background: var(--md-sys-color-primary, #6750a4);\n color: var(--md-sys-color-on-primary, #fff);\n }\n\n .node-list {\n display: flex;\n flex-direction: column;\n gap: 1px;\n max-height: 200px;\n overflow-y: auto;\n font-size: 12px;\n }\n\n .node-item {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 4px 8px;\n cursor: pointer;\n border-radius: 4px;\n transition: background 0.1s;\n }\n\n .node-item:hover {\n background: var(--md-sys-color-primary-container, rgba(103, 80, 164, 0.12));\n }\n\n .node-item input[type='checkbox'] {\n margin: 0;\n accent-color: var(--md-sys-color-primary, #6750a4);\n }\n\n .node-item span {\n font-size: 12px;\n color: var(--md-sys-color-on-surface, #1c1b1f);\n }\n\n .mode-desc {\n font-size: 11px;\n color: var(--md-sys-color-on-surface-variant, #666);\n padding: 4px 0;\n }\n\n .mini-btn {\n font-size: 10px;\n padding: 2px 8px;\n border: 1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, 0.15));\n border-radius: 4px;\n background: var(--md-sys-color-surface-container, #f3edf7);\n color: var(--md-sys-color-on-surface, #1c1b1f);\n cursor: pointer;\n }\n\n .mini-btn:hover {\n background: var(--md-sys-color-surface-container-highest, #e6e0e9);\n }\n\n .empty {\n color: var(--md-sys-color-on-surface-variant, #999);\n font-size: 11px;\n padding: 8px;\n text-align: center;\n }\n `\n ]\n\n @property({ type: String }) declare src: string | undefined\n\n @state() declare private _meshNames: string[]\n @state() declare private _mode: FillMode\n\n private _component: any = null\n private _lastExternalValue: any = undefined\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('src')) {\n this.dispatchEvent(\n new CustomEvent('i-need-selected', {\n bubbles: true,\n composed: true,\n detail: {\n callback: (selected: any[]) => {\n this._component = selected?.[0]\n this._refreshMeshNames()\n }\n }\n })\n )\n }\n }\n\n private _refreshMeshNames() {\n if (!this._component) {\n this._meshNames = []\n return\n }\n\n const ro = this._component.realObject as any\n if (!ro?.getNode) {\n this._meshNames = []\n return\n }\n\n this._meshNames = ((this._component.nodeNames as string[]) ?? []).filter((name: string) => {\n const node = ro.getNode(name)\n return node?.isMesh\n })\n }\n\n editorTemplate(value: any, _spec: PropertySpec): TemplateResult {\n if (!this._meshNames?.length) {\n this._refreshMeshNames()\n }\n\n // 외부 value가 변경되면 모드 동기화\n if (value !== this._lastExternalValue) {\n this._lastExternalValue = value\n this._mode = getMode(value)\n }\n\n const mode = this._mode\n const meshCount = this._meshNames?.length ?? 0\n const targets: string[] = Array.isArray(this.value) ? this.value : (Array.isArray(value) ? value : [])\n\n return html`\n <fieldset fullwidth>\n ${meshCount > 0\n ? html`\n <div class=\"mode-selector\">\n <div class=\"mode-btn\" ?active=${mode === 'all'} @click=${() => this._setMode('all')}>All</div>\n <div class=\"mode-btn\" ?active=${mode === 'none'} @click=${() => this._setMode('none')}>None</div>\n <div class=\"mode-btn\" ?active=${mode === 'custom'} @click=${() => this._setMode('custom')}>Custom</div>\n </div>\n\n ${mode === 'all'\n ? html`<div class=\"mode-desc\">${meshCount} meshes — fillStyle applies to all</div>`\n : nothing}\n ${mode === 'none'\n ? html`<div class=\"mode-desc\">fillStyle not applied to any mesh</div>`\n : nothing}\n ${mode === 'custom'\n ? html`\n <div style=\"display:flex;align-items:center;gap:6px\">\n <div class=\"mode-desc\" style=\"flex:1\">${targets.length} / ${meshCount} selected</div>\n <button class=\"mini-btn\" @click=${() => this._applyValue([...(this._meshNames ?? [])])}>All</button>\n <button class=\"mini-btn\" @click=${() => this._applyValue([])}>Clear</button>\n </div>\n <div class=\"node-list\">\n ${(this._meshNames ?? []).map(\n name => html`\n <label\n class=\"node-item\"\n @mouseenter=${() => this._highlightNode(name)}\n @mouseleave=${() => this._clearHighlight()}\n >\n <input\n type=\"checkbox\"\n .checked=${targets.includes(name)}\n @change=${(e: Event) => {\n e.stopPropagation()\n this._onToggle(name, (e.target as HTMLInputElement).checked, targets)\n }}\n />\n <span>${name}</span>\n </label>\n `\n )}\n </div>\n `\n : nothing}\n `\n : html`<div class=\"empty\">\n <ox-i18n msgid=\"label.no-gltf-meshes\">No meshes available</ox-i18n>\n </div>`}\n </fieldset>\n `\n }\n\n private _setMode(mode: FillMode) {\n const prevMode = this._mode\n this._mode = mode\n\n let newValue: any\n switch (mode) {\n case 'all':\n newValue = '*'\n break\n case 'none':\n newValue = 'none'\n break\n case 'custom':\n // 이전 상태에 따라: All → 전체 선택, None → 전체 해제\n if (prevMode === 'all') {\n newValue = [...(this._meshNames ?? [])]\n } else if (prevMode === 'none') {\n newValue = []\n } else {\n // 이미 custom이면 현재 값 유지\n newValue = Array.isArray(this.value) ? this.value : []\n }\n break\n }\n\n this._applyValue(newValue)\n }\n\n private _onToggle(name: string, checked: boolean, current: string[]) {\n const list = [...current]\n if (checked) {\n if (!list.includes(name)) list.push(name)\n } else {\n const idx = list.indexOf(name)\n if (idx >= 0) list.splice(idx, 1)\n }\n\n this._applyValue(list)\n }\n\n private _applyValue(newValue: any) {\n // 로컬 value 즉시 반영 (re-render)\n this.value = newValue\n this.requestUpdate()\n\n this.dispatchEvent(\n new CustomEvent('i-need-selected', {\n bubbles: true,\n composed: true,\n detail: {\n callback: (selected: any[]) => {\n selected[0].set('fillStyleTargets', newValue)\n }\n }\n })\n )\n }\n\n // --- Outline 강조 ---\n\n private _highlightNode(name: string) {\n const ro = this._component?.realObject as any\n if (!ro?.getNode) return\n\n const node = ro.getNode(name)\n if (!node) return\n\n this._getRendererManager()?.setOutlineObjects([node])\n this._component?.invalidate()\n }\n\n private _clearHighlight() {\n const ro = this._component?.realObject as any\n if (!ro) return\n\n this._getRendererManager()?.setOutlineObjects(ro.object3d ? [ro.object3d] : [])\n this._component?.invalidate()\n }\n\n private _getRendererManager(): any {\n const ro = this._component?.realObject as any\n const container = ro?.threeContainer as any\n return container?._capability?.rendererManager ?? container?._threeCapability?.rendererManager ?? null\n }\n}\n"]}
|
|
@@ -1,16 +1,38 @@
|
|
|
1
1
|
import '@material/web/icon/icon.js';
|
|
2
|
-
import '@material/web/button/elevated-button.js';
|
|
3
2
|
import '@operato/i18n/ox-i18n.js';
|
|
4
3
|
import { PropertyValues, TemplateResult } from 'lit';
|
|
5
4
|
import { OxPropertyEditor, PropertySpec } from '@operato/property-editor';
|
|
6
5
|
import { Component } from '@hatiolab/things-scene';
|
|
7
6
|
export default class GLTFInfoEditor extends OxPropertyEditor {
|
|
8
7
|
static styles: import("lit").CSSResult[];
|
|
9
|
-
src
|
|
8
|
+
src: string | undefined;
|
|
9
|
+
private _component;
|
|
10
10
|
width: number;
|
|
11
11
|
height: number;
|
|
12
12
|
depth: number;
|
|
13
|
+
currentWidth: number;
|
|
14
|
+
currentHeight: number;
|
|
15
|
+
currentDepth: number;
|
|
16
|
+
meshCount: number;
|
|
17
|
+
vertexCount: number;
|
|
18
|
+
animationCount: number;
|
|
19
|
+
materialCount: number;
|
|
20
|
+
constructor();
|
|
13
21
|
editorTemplate(value: any, spec: PropertySpec): TemplateResult;
|
|
22
|
+
private _formatNumber;
|
|
23
|
+
private _isProportional;
|
|
24
|
+
private _applyAction;
|
|
25
|
+
/**
|
|
26
|
+
* W, H 중 짧은 쪽을 기준으로 원래 모델의 비율에 맞게 치수를 조절한다.
|
|
27
|
+
* (contain 방식 — 모델이 컴포넌트 영역 안에 들어감)
|
|
28
|
+
*/
|
|
29
|
+
private _applyProportional;
|
|
30
|
+
private _getRatioLock;
|
|
31
|
+
private _setRatioLock;
|
|
32
|
+
private _refreshCurrentSize;
|
|
14
33
|
updated(changes: PropertyValues<this>): void;
|
|
15
|
-
|
|
34
|
+
private _pollTimer?;
|
|
35
|
+
fetchSourceInfo(component: Component, src: string): Promise<void>;
|
|
36
|
+
private _tryReadFromRealObject;
|
|
37
|
+
disconnectedCallback(): void;
|
|
16
38
|
}
|
|
@@ -1,58 +1,281 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import '@material/web/icon/icon.js';
|
|
3
|
-
import '@material/web/button/elevated-button.js';
|
|
4
3
|
import '@operato/i18n/ox-i18n.js';
|
|
5
4
|
import { css, html } from 'lit';
|
|
6
5
|
import { customElement, property, state } from 'lit/decorators.js';
|
|
7
6
|
import { OxPropertyEditor } from '@operato/property-editor';
|
|
8
|
-
import
|
|
9
|
-
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
7
|
+
import { ScrollbarStyles } from '@operato/styles/scrollbar-styles.js';
|
|
10
8
|
let GLTFInfoEditor = class GLTFInfoEditor extends OxPropertyEditor {
|
|
9
|
+
static styles = [
|
|
10
|
+
...OxPropertyEditor.styles,
|
|
11
|
+
ScrollbarStyles,
|
|
12
|
+
css `
|
|
13
|
+
[info-panel] {
|
|
14
|
+
font-size: 12px;
|
|
15
|
+
padding: 4px 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.dim-row {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: 6px;
|
|
22
|
+
padding: 3px 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.dim-label {
|
|
26
|
+
min-width: 65px;
|
|
27
|
+
font-size: 11px;
|
|
28
|
+
color: var(--md-sys-color-on-surface-variant, #666);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.dim-value {
|
|
32
|
+
font-family: monospace;
|
|
33
|
+
font-size: 12px;
|
|
34
|
+
font-weight: 500;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.dim-value.mismatch {
|
|
38
|
+
color: var(--md-sys-color-error, #b3261e);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.dim-value.match {
|
|
42
|
+
color: var(--md-sys-color-primary, #6750a4);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.ratio-info {
|
|
46
|
+
font-size: 10px;
|
|
47
|
+
color: var(--md-sys-color-on-surface-variant, #888);
|
|
48
|
+
padding: 2px 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.button-row {
|
|
52
|
+
display: flex;
|
|
53
|
+
gap: 4px;
|
|
54
|
+
margin-top: 6px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.action-btn {
|
|
58
|
+
flex: 1;
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
gap: 4px;
|
|
63
|
+
padding: 6px 8px;
|
|
64
|
+
border: 1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, 0.2));
|
|
65
|
+
border-radius: 6px;
|
|
66
|
+
background: var(--md-sys-color-surface-container, #f3edf7);
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
font-size: 11px;
|
|
69
|
+
color: var(--md-sys-color-on-surface, #1c1b1f);
|
|
70
|
+
transition: background 0.15s;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.action-btn:hover {
|
|
74
|
+
background: var(--md-sys-color-surface-container-highest, #e6e0e9);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.action-btn md-icon {
|
|
78
|
+
--md-icon-size: 16px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.ratio-lock-toggle {
|
|
82
|
+
display: flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
gap: 4px;
|
|
85
|
+
font-size: 11px;
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
color: var(--md-sys-color-on-surface, #1c1b1f);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.ratio-lock-toggle input[type='checkbox'] {
|
|
91
|
+
accent-color: var(--md-sys-color-primary, #6750a4);
|
|
92
|
+
margin: 0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.stats-row {
|
|
96
|
+
display: flex;
|
|
97
|
+
gap: 12px;
|
|
98
|
+
padding: 4px 0;
|
|
99
|
+
margin-top: 4px;
|
|
100
|
+
border-top: 1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, 0.1));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.stat-item {
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
gap: 3px;
|
|
107
|
+
font-size: 11px;
|
|
108
|
+
color: var(--md-sys-color-on-surface-variant, #666);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.stat-item md-icon {
|
|
112
|
+
--md-icon-size: 13px;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.stat-value {
|
|
116
|
+
font-weight: 600;
|
|
117
|
+
color: var(--md-sys-color-on-surface, #1c1b1f);
|
|
118
|
+
}
|
|
119
|
+
`
|
|
120
|
+
];
|
|
121
|
+
_component = null;
|
|
11
122
|
constructor() {
|
|
12
|
-
super(
|
|
123
|
+
super();
|
|
13
124
|
this.width = 0;
|
|
14
125
|
this.height = 0;
|
|
15
126
|
this.depth = 0;
|
|
127
|
+
this.currentWidth = 0;
|
|
128
|
+
this.currentHeight = 0;
|
|
129
|
+
this.currentDepth = 0;
|
|
130
|
+
this.meshCount = 0;
|
|
131
|
+
this.vertexCount = 0;
|
|
132
|
+
this.animationCount = 0;
|
|
133
|
+
this.materialCount = 0;
|
|
16
134
|
}
|
|
17
135
|
editorTemplate(value, spec) {
|
|
18
136
|
const valid = this.width && this.height && this.depth;
|
|
19
137
|
var property = spec.property || {};
|
|
20
138
|
var { action } = property;
|
|
139
|
+
const isProportional = valid && this._isProportional();
|
|
21
140
|
return html `
|
|
22
141
|
<fieldset fullwidth>
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
142
|
+
<div info-panel>
|
|
143
|
+
${valid
|
|
144
|
+
? html `
|
|
145
|
+
<div class="dim-row">
|
|
146
|
+
<span class="dim-label">Model</span>
|
|
147
|
+
<span class="dim-value">${this.width} × ${this.height} × ${this.depth}</span>
|
|
148
|
+
</div>
|
|
149
|
+
<div class="dim-row">
|
|
150
|
+
<span class="dim-label">Current</span>
|
|
151
|
+
<span class="dim-value ${isProportional ? 'match' : 'mismatch'}">
|
|
152
|
+
${this.currentWidth} × ${this.currentHeight} × ${this.currentDepth}
|
|
153
|
+
</span>
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
<div class="stats-row">
|
|
157
|
+
<span class="stat-item"><md-icon>view_in_ar</md-icon> <span class="stat-value">${this.meshCount}</span> meshes</span>
|
|
158
|
+
<span class="stat-item"><md-icon>scatter_plot</md-icon> <span class="stat-value">${this._formatNumber(this.vertexCount)}</span> verts</span>
|
|
159
|
+
<span class="stat-item"><md-icon>palette</md-icon> <span class="stat-value">${this.materialCount}</span> mats</span>
|
|
160
|
+
${this.animationCount > 0
|
|
161
|
+
? html `<span class="stat-item"><md-icon>animation</md-icon> <span class="stat-value">${this.animationCount}</span> anims</span>`
|
|
162
|
+
: ''}
|
|
163
|
+
</div>
|
|
164
|
+
|
|
165
|
+
<div class="button-row">
|
|
166
|
+
<div
|
|
167
|
+
class="action-btn"
|
|
168
|
+
title="W,H 중 짧은 쪽 기준으로 원본 비율 적용"
|
|
169
|
+
@click=${() => this._applyProportional(action)}
|
|
47
170
|
>
|
|
48
|
-
<md-icon>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
171
|
+
<md-icon>aspect_ratio</md-icon>
|
|
172
|
+
<ox-i18n msgid="label.fit-ratio">Fit Ratio</ox-i18n>
|
|
173
|
+
</div>
|
|
174
|
+
<label class="ratio-lock-toggle">
|
|
175
|
+
<input
|
|
176
|
+
type="checkbox"
|
|
177
|
+
.checked=${this._getRatioLock()}
|
|
178
|
+
@change=${(e) => {
|
|
179
|
+
e.stopPropagation();
|
|
180
|
+
this._setRatioLock(e.target.checked);
|
|
181
|
+
}}
|
|
182
|
+
/>
|
|
183
|
+
<md-icon style="--md-icon-size:14px">lock</md-icon>
|
|
184
|
+
Ratio Lock
|
|
185
|
+
</label>
|
|
186
|
+
</div>
|
|
187
|
+
`
|
|
188
|
+
: html `<div class="dim-row"><span class="dim-label">Loading...</span></div>`}
|
|
52
189
|
</div>
|
|
53
190
|
</fieldset>
|
|
54
191
|
`;
|
|
55
192
|
}
|
|
193
|
+
_formatNumber(n) {
|
|
194
|
+
if (n >= 1000000)
|
|
195
|
+
return (n / 1000000).toFixed(1) + 'M';
|
|
196
|
+
if (n >= 1000)
|
|
197
|
+
return (n / 1000).toFixed(1) + 'K';
|
|
198
|
+
return String(n);
|
|
199
|
+
}
|
|
200
|
+
_isProportional() {
|
|
201
|
+
if (!this.width || !this.height || !this.depth)
|
|
202
|
+
return true;
|
|
203
|
+
if (!this.currentWidth || !this.currentHeight || !this.currentDepth)
|
|
204
|
+
return true;
|
|
205
|
+
const rw = this.currentWidth / this.width;
|
|
206
|
+
const rh = this.currentHeight / this.height;
|
|
207
|
+
const rd = this.currentDepth / this.depth;
|
|
208
|
+
const avg = (rw + rh + rd) / 3;
|
|
209
|
+
const tolerance = 0.05;
|
|
210
|
+
return Math.abs(rw - avg) / avg < tolerance && Math.abs(rh - avg) / avg < tolerance && Math.abs(rd - avg) / avg < tolerance;
|
|
211
|
+
}
|
|
212
|
+
_applyAction(action, dimension) {
|
|
213
|
+
this.dispatchEvent(new CustomEvent('i-need-selected', {
|
|
214
|
+
bubbles: true,
|
|
215
|
+
composed: true,
|
|
216
|
+
detail: {
|
|
217
|
+
callback: (selected) => {
|
|
218
|
+
typeof action === 'function' && action(selected[0], dimension);
|
|
219
|
+
this._refreshCurrentSize(selected[0]);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}));
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* W, H 중 짧은 쪽을 기준으로 원래 모델의 비율에 맞게 치수를 조절한다.
|
|
226
|
+
* (contain 방식 — 모델이 컴포넌트 영역 안에 들어감)
|
|
227
|
+
*/
|
|
228
|
+
_applyProportional(action) {
|
|
229
|
+
this.dispatchEvent(new CustomEvent('i-need-selected', {
|
|
230
|
+
bubbles: true,
|
|
231
|
+
composed: true,
|
|
232
|
+
detail: {
|
|
233
|
+
callback: (selected) => {
|
|
234
|
+
const component = selected[0];
|
|
235
|
+
if (!component || typeof action !== 'function')
|
|
236
|
+
return;
|
|
237
|
+
const { width: cw = 1, height: ch = 1, depth: cd = 1 } = component.state;
|
|
238
|
+
const { width: ow, height: oh, depth: od } = this; // 원래 모델 치수
|
|
239
|
+
if (!ow || !oh || !od)
|
|
240
|
+
return;
|
|
241
|
+
// 이미 비율이 맞으면 스킵
|
|
242
|
+
if (this._isProportional())
|
|
243
|
+
return;
|
|
244
|
+
// W, H 중 ratio가 작은 축을 기준
|
|
245
|
+
const scale = Math.min(cw / ow, ch / oh);
|
|
246
|
+
action(component, {
|
|
247
|
+
width: Math.round(ow * scale),
|
|
248
|
+
height: Math.round(oh * scale),
|
|
249
|
+
depth: Math.round(od * scale)
|
|
250
|
+
});
|
|
251
|
+
this._refreshCurrentSize(component);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}));
|
|
255
|
+
}
|
|
256
|
+
_getRatioLock() {
|
|
257
|
+
return !!this._component?.state?.ratioLock;
|
|
258
|
+
}
|
|
259
|
+
_setRatioLock(value) {
|
|
260
|
+
this.dispatchEvent(new CustomEvent('i-need-selected', {
|
|
261
|
+
bubbles: true,
|
|
262
|
+
composed: true,
|
|
263
|
+
detail: {
|
|
264
|
+
callback: (selected) => {
|
|
265
|
+
selected[0].set('ratioLock', value);
|
|
266
|
+
this.requestUpdate();
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}));
|
|
270
|
+
}
|
|
271
|
+
_refreshCurrentSize(component) {
|
|
272
|
+
if (!component)
|
|
273
|
+
return;
|
|
274
|
+
const state = component.state || {};
|
|
275
|
+
this.currentWidth = Math.round(state.width || 0);
|
|
276
|
+
this.currentHeight = Math.round(state.height || 0);
|
|
277
|
+
this.currentDepth = Math.round(state.depth || 0);
|
|
278
|
+
}
|
|
56
279
|
updated(changes) {
|
|
57
280
|
if (changes.has('src')) {
|
|
58
281
|
this.dispatchEvent(new CustomEvent('i-need-selected', {
|
|
@@ -60,60 +283,76 @@ let GLTFInfoEditor = class GLTFInfoEditor extends OxPropertyEditor {
|
|
|
60
283
|
composed: true,
|
|
61
284
|
detail: {
|
|
62
285
|
callback: async (selected) => {
|
|
63
|
-
|
|
286
|
+
const component = selected[0];
|
|
287
|
+
this._component = component;
|
|
288
|
+
this._refreshCurrentSize(component);
|
|
289
|
+
await this.fetchSourceInfo(component, this.src);
|
|
64
290
|
}
|
|
65
291
|
}
|
|
66
292
|
}));
|
|
67
293
|
}
|
|
68
294
|
}
|
|
295
|
+
_pollTimer;
|
|
69
296
|
async fetchSourceInfo(component, src) {
|
|
70
297
|
if (!src || !src.trim()) {
|
|
71
298
|
return;
|
|
72
299
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
let gltfLoader = new GLTFLoader();
|
|
76
|
-
gltfLoader.setCrossOrigin('use-credentials');
|
|
77
|
-
return new Promise((resolve) => {
|
|
78
|
-
gltfLoader.load(path, gltf => {
|
|
79
|
-
var box = new THREE.Box3().setFromObject(gltf.scene);
|
|
80
|
-
var { x, y, z } = box.getSize(new THREE.Vector3());
|
|
81
|
-
this.width = Math.floor(x);
|
|
82
|
-
this.depth = Math.floor(y);
|
|
83
|
-
this.height = Math.floor(z);
|
|
84
|
-
resolve();
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
catch (e) {
|
|
89
|
-
console.error(e);
|
|
300
|
+
// 이미 로드된 realObject에서 직접 정보를 읽는다
|
|
301
|
+
if (this._tryReadFromRealObject(component)) {
|
|
90
302
|
return;
|
|
91
303
|
}
|
|
304
|
+
// GLTF 비동기 로드 중이면 폴링 (최대 20회 = 10초)
|
|
305
|
+
if (this._pollTimer)
|
|
306
|
+
clearInterval(this._pollTimer);
|
|
307
|
+
let retries = 0;
|
|
308
|
+
this._pollTimer = window.setInterval(() => {
|
|
309
|
+
if (this._tryReadFromRealObject(component) || ++retries >= 20) {
|
|
310
|
+
clearInterval(this._pollTimer);
|
|
311
|
+
this._pollTimer = undefined;
|
|
312
|
+
}
|
|
313
|
+
}, 500);
|
|
314
|
+
}
|
|
315
|
+
_tryReadFromRealObject(component) {
|
|
316
|
+
const ro = component?.realObject;
|
|
317
|
+
if (!ro?.objectSize)
|
|
318
|
+
return false;
|
|
319
|
+
const { x = 0, y = 0, z = 0 } = ro.objectSize;
|
|
320
|
+
this.width = Math.round(x * 100) / 100;
|
|
321
|
+
this.depth = Math.round(y * 100) / 100;
|
|
322
|
+
this.height = Math.round(z * 100) / 100;
|
|
323
|
+
// 통계: pivot 또는 object3d에서 수집
|
|
324
|
+
const root = ro.pivot || ro.object3d;
|
|
325
|
+
if (root) {
|
|
326
|
+
let meshes = 0;
|
|
327
|
+
let vertices = 0;
|
|
328
|
+
const materials = new Set();
|
|
329
|
+
root.traverse((node) => {
|
|
330
|
+
if (node.isMesh) {
|
|
331
|
+
meshes++;
|
|
332
|
+
if (node.geometry) {
|
|
333
|
+
const pos = node.geometry.getAttribute('position');
|
|
334
|
+
if (pos)
|
|
335
|
+
vertices += pos.count;
|
|
336
|
+
}
|
|
337
|
+
if (node.material) {
|
|
338
|
+
const mats = Array.isArray(node.material) ? node.material : [node.material];
|
|
339
|
+
mats.forEach((m) => materials.add(m.uuid));
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
this.meshCount = meshes;
|
|
344
|
+
this.vertexCount = vertices;
|
|
345
|
+
this.materialCount = materials.size;
|
|
346
|
+
}
|
|
347
|
+
this.animationCount = ro._animationActions?.size || 0;
|
|
348
|
+
return true;
|
|
349
|
+
}
|
|
350
|
+
disconnectedCallback() {
|
|
351
|
+
super.disconnectedCallback();
|
|
352
|
+
if (this._pollTimer)
|
|
353
|
+
clearInterval(this._pollTimer);
|
|
92
354
|
}
|
|
93
355
|
};
|
|
94
|
-
GLTFInfoEditor.styles = [
|
|
95
|
-
...OxPropertyEditor.styles,
|
|
96
|
-
css `
|
|
97
|
-
div[info] {
|
|
98
|
-
display: flex;
|
|
99
|
-
flex-direction: row;
|
|
100
|
-
font-size: 12px;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
div[info] * {
|
|
104
|
-
align-self: center;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
div[info] title {
|
|
108
|
-
font-weight: bold;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
div[info] md-elevated-button {
|
|
112
|
-
margin-left: auto;
|
|
113
|
-
--md-icon-size: 24px;
|
|
114
|
-
}
|
|
115
|
-
`
|
|
116
|
-
];
|
|
117
356
|
__decorate([
|
|
118
357
|
property({ type: String })
|
|
119
358
|
], GLTFInfoEditor.prototype, "src", void 0);
|
|
@@ -126,6 +365,27 @@ __decorate([
|
|
|
126
365
|
__decorate([
|
|
127
366
|
state()
|
|
128
367
|
], GLTFInfoEditor.prototype, "depth", void 0);
|
|
368
|
+
__decorate([
|
|
369
|
+
state()
|
|
370
|
+
], GLTFInfoEditor.prototype, "currentWidth", void 0);
|
|
371
|
+
__decorate([
|
|
372
|
+
state()
|
|
373
|
+
], GLTFInfoEditor.prototype, "currentHeight", void 0);
|
|
374
|
+
__decorate([
|
|
375
|
+
state()
|
|
376
|
+
], GLTFInfoEditor.prototype, "currentDepth", void 0);
|
|
377
|
+
__decorate([
|
|
378
|
+
state()
|
|
379
|
+
], GLTFInfoEditor.prototype, "meshCount", void 0);
|
|
380
|
+
__decorate([
|
|
381
|
+
state()
|
|
382
|
+
], GLTFInfoEditor.prototype, "vertexCount", void 0);
|
|
383
|
+
__decorate([
|
|
384
|
+
state()
|
|
385
|
+
], GLTFInfoEditor.prototype, "animationCount", void 0);
|
|
386
|
+
__decorate([
|
|
387
|
+
state()
|
|
388
|
+
], GLTFInfoEditor.prototype, "materialCount", void 0);
|
|
129
389
|
GLTFInfoEditor = __decorate([
|
|
130
390
|
customElement('property-editor-gltf-info')
|
|
131
391
|
], GLTFInfoEditor);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-editor-gltf-info.js","sourceRoot":"","sources":["../../src/editors/property-editor-gltf-info.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,yCAAyC,CAAA;AAChD,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkC,MAAM,KAAK,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,gBAAgB,EAAgB,MAAM,0BAA0B,CAAA;AAGzE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAA;AAGtD,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,gBAAgB;IAA7C;;QA2BJ,UAAK,GAAW,CAAC,CAAA;QACjB,WAAM,GAAW,CAAC,CAAA;QAClB,UAAK,GAAW,CAAC,CAAA;IA2F5B,CAAC;IAzFC,cAAc,CAAC,KAAU,EAAE,IAAkB;QAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAA;QAErD,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAA;QAClC,IAAI,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/B;IAAR,KAAK,EAAE;6CAAkB;AACjB;IAAR,KAAK,EAAE;8CAAmB;AAClB;IAAR,KAAK,EAAE;6CAAkB;AA7BP,cAAc;IADlC,aAAa,CAAC,2BAA2B,CAAC;GACtB,cAAc,CAwHlC;eAxHoB,cAAc","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/button/elevated-button.js'\nimport '@operato/i18n/ox-i18n.js'\n\nimport { css, html, PropertyValues, TemplateResult } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { OxPropertyEditor, PropertySpec } from '@operato/property-editor'\nimport { Component } from '@hatiolab/things-scene'\n\nimport * as THREE from 'three'\nimport { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js'\n\n@customElement('property-editor-gltf-info')\nexport default class GLTFInfoEditor extends OxPropertyEditor {\n static styles = [\n ...OxPropertyEditor.styles,\n css`\n div[info] {\n display: flex;\n flex-direction: row;\n font-size: 12px;\n }\n\n div[info] * {\n align-self: center;\n }\n\n div[info] title {\n font-weight: bold;\n }\n\n div[info] md-elevated-button {\n margin-left: auto;\n --md-icon-size: 24px;\n }\n `\n ]\n\n @property({ type: String }) src?: string\n\n @state() width: number = 0\n @state() height: number = 0\n @state() depth: number = 0\n\n editorTemplate(value: any, spec: PropertySpec): TemplateResult {\n const valid = this.width && this.height && this.depth\n\n var property = spec.property || {}\n var { action } = property\n\n return html`\n <fieldset fullwidth>\n <legend><ox-i18n msgid=\"label.gltf-info\">GLTF info.</ox-i18n></legend>\n\n <div>\n <div info>\n <div label>[W x H x D] :</div>\n ${valid\n ? html` <div value>${this.width} x ${this.height} x ${this.depth}</div>\n <md-elevated-button\n @click=${(e: MouseEvent) => {\n this.dispatchEvent(\n new CustomEvent('i-need-selected', {\n bubbles: true,\n composed: true,\n detail: {\n callback: (selected: any[]) => {\n typeof action === 'function' &&\n action(selected[0], {\n width: this.width,\n height: this.height,\n depth: this.depth\n })\n }\n }\n })\n )\n }}\n >\n <md-icon>autorenew</md-icon>\n </md-elevated-button>`\n : html` <div></div> `}\n </div>\n </div>\n </fieldset>\n `\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('src')) {\n this.dispatchEvent(\n new CustomEvent('i-need-selected', {\n bubbles: true,\n composed: true,\n detail: {\n callback: async (selected: any[]) => {\n await this.fetchSourceInfo(selected[0], this.src!)\n }\n }\n })\n )\n }\n }\n\n async fetchSourceInfo(component: Component, src: string) {\n if (!src || !src.trim()) {\n return\n }\n\n try {\n const path = component.app.url(src)\n\n let gltfLoader = new GLTFLoader()\n\n gltfLoader.setCrossOrigin('use-credentials')\n\n return new Promise((resolve: any) => {\n gltfLoader.load(path, gltf => {\n var box = new THREE.Box3().setFromObject(gltf.scene)\n var { x, y, z } = box.getSize(new THREE.Vector3())\n\n this.width = Math.floor(x)\n this.depth = Math.floor(y)\n this.height = Math.floor(z)\n\n resolve()\n })\n })\n } catch (e) {\n console.error(e)\n return\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"property-editor-gltf-info.js","sourceRoot":"","sources":["../../src/editors/property-editor-gltf-info.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkC,MAAM,KAAK,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,gBAAgB,EAAgB,MAAM,0BAA0B,CAAA;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAItD,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,gBAAgB;IAC1D,MAAM,CAAC,MAAM,GAAG;QACd,GAAG,gBAAgB,CAAC,MAAM;QAC1B,eAAe;QACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C;IAAnC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAgC;AAI1C;IAAhB,KAAK,EAAE;6CAAsB;AACb;IAAhB,KAAK,EAAE;8CAAuB;AACd;IAAhB,KAAK,EAAE;6CAAsB;AACb;IAAhB,KAAK,EAAE;oDAA6B;AACpB;IAAhB,KAAK,EAAE;qDAA8B;AACrB;IAAhB,KAAK,EAAE;oDAA6B;AACpB;IAAhB,KAAK,EAAE;iDAA0B;AACjB;IAAhB,KAAK,EAAE;mDAA4B;AACnB;IAAhB,KAAK,EAAE;sDAA+B;AACtB;IAAhB,KAAK,EAAE;qDAA8B;AA/HnB,cAAc;IADlC,aAAa,CAAC,2BAA2B,CAAC;GACtB,cAAc,CAsYlC;eAtYoB,cAAc","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/i18n/ox-i18n.js'\n\nimport { css, html, PropertyValues, TemplateResult } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { OxPropertyEditor, PropertySpec } from '@operato/property-editor'\nimport { ScrollbarStyles } from '@operato/styles/scrollbar-styles.js'\nimport { Component } from '@hatiolab/things-scene'\n\n@customElement('property-editor-gltf-info')\nexport default class GLTFInfoEditor extends OxPropertyEditor {\n static styles = [\n ...OxPropertyEditor.styles,\n ScrollbarStyles,\n css`\n [info-panel] {\n font-size: 12px;\n padding: 4px 0;\n }\n\n .dim-row {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 3px 0;\n }\n\n .dim-label {\n min-width: 65px;\n font-size: 11px;\n color: var(--md-sys-color-on-surface-variant, #666);\n }\n\n .dim-value {\n font-family: monospace;\n font-size: 12px;\n font-weight: 500;\n }\n\n .dim-value.mismatch {\n color: var(--md-sys-color-error, #b3261e);\n }\n\n .dim-value.match {\n color: var(--md-sys-color-primary, #6750a4);\n }\n\n .ratio-info {\n font-size: 10px;\n color: var(--md-sys-color-on-surface-variant, #888);\n padding: 2px 0;\n }\n\n .button-row {\n display: flex;\n gap: 4px;\n margin-top: 6px;\n }\n\n .action-btn {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n padding: 6px 8px;\n border: 1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, 0.2));\n border-radius: 6px;\n background: var(--md-sys-color-surface-container, #f3edf7);\n cursor: pointer;\n font-size: 11px;\n color: var(--md-sys-color-on-surface, #1c1b1f);\n transition: background 0.15s;\n }\n\n .action-btn:hover {\n background: var(--md-sys-color-surface-container-highest, #e6e0e9);\n }\n\n .action-btn md-icon {\n --md-icon-size: 16px;\n }\n\n .ratio-lock-toggle {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 11px;\n cursor: pointer;\n color: var(--md-sys-color-on-surface, #1c1b1f);\n }\n\n .ratio-lock-toggle input[type='checkbox'] {\n accent-color: var(--md-sys-color-primary, #6750a4);\n margin: 0;\n }\n\n .stats-row {\n display: flex;\n gap: 12px;\n padding: 4px 0;\n margin-top: 4px;\n border-top: 1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, 0.1));\n }\n\n .stat-item {\n display: flex;\n align-items: center;\n gap: 3px;\n font-size: 11px;\n color: var(--md-sys-color-on-surface-variant, #666);\n }\n\n .stat-item md-icon {\n --md-icon-size: 13px;\n }\n\n .stat-value {\n font-weight: 600;\n color: var(--md-sys-color-on-surface, #1c1b1f);\n }\n `\n ]\n\n @property({ type: String }) declare src: string | undefined\n\n private _component: any = null\n\n @state() declare width: number\n @state() declare height: number\n @state() declare depth: number\n @state() declare currentWidth: number\n @state() declare currentHeight: number\n @state() declare currentDepth: number\n @state() declare meshCount: number\n @state() declare vertexCount: number\n @state() declare animationCount: number\n @state() declare materialCount: number\n\n constructor() {\n super()\n this.width = 0\n this.height = 0\n this.depth = 0\n this.currentWidth = 0\n this.currentHeight = 0\n this.currentDepth = 0\n this.meshCount = 0\n this.vertexCount = 0\n this.animationCount = 0\n this.materialCount = 0\n }\n\n editorTemplate(value: any, spec: PropertySpec): TemplateResult {\n const valid = this.width && this.height && this.depth\n\n var property = spec.property || {}\n var { action } = property\n\n const isProportional = valid && this._isProportional()\n\n return html`\n <fieldset fullwidth>\n <div info-panel>\n ${valid\n ? html`\n <div class=\"dim-row\">\n <span class=\"dim-label\">Model</span>\n <span class=\"dim-value\">${this.width} × ${this.height} × ${this.depth}</span>\n </div>\n <div class=\"dim-row\">\n <span class=\"dim-label\">Current</span>\n <span class=\"dim-value ${isProportional ? 'match' : 'mismatch'}\">\n ${this.currentWidth} × ${this.currentHeight} × ${this.currentDepth}\n </span>\n </div>\n\n <div class=\"stats-row\">\n <span class=\"stat-item\"><md-icon>view_in_ar</md-icon> <span class=\"stat-value\">${this.meshCount}</span> meshes</span>\n <span class=\"stat-item\"><md-icon>scatter_plot</md-icon> <span class=\"stat-value\">${this._formatNumber(this.vertexCount)}</span> verts</span>\n <span class=\"stat-item\"><md-icon>palette</md-icon> <span class=\"stat-value\">${this.materialCount}</span> mats</span>\n ${this.animationCount > 0\n ? html`<span class=\"stat-item\"><md-icon>animation</md-icon> <span class=\"stat-value\">${this.animationCount}</span> anims</span>`\n : ''}\n </div>\n\n <div class=\"button-row\">\n <div\n class=\"action-btn\"\n title=\"W,H 중 짧은 쪽 기준으로 원본 비율 적용\"\n @click=${() => this._applyProportional(action)}\n >\n <md-icon>aspect_ratio</md-icon>\n <ox-i18n msgid=\"label.fit-ratio\">Fit Ratio</ox-i18n>\n </div>\n <label class=\"ratio-lock-toggle\">\n <input\n type=\"checkbox\"\n .checked=${this._getRatioLock()}\n @change=${(e: Event) => {\n e.stopPropagation()\n this._setRatioLock((e.target as HTMLInputElement).checked)\n }}\n />\n <md-icon style=\"--md-icon-size:14px\">lock</md-icon>\n Ratio Lock\n </label>\n </div>\n `\n : html`<div class=\"dim-row\"><span class=\"dim-label\">Loading...</span></div>`}\n </div>\n </fieldset>\n `\n }\n\n private _formatNumber(n: number): string {\n if (n >= 1000000) return (n / 1000000).toFixed(1) + 'M'\n if (n >= 1000) return (n / 1000).toFixed(1) + 'K'\n return String(n)\n }\n\n private _isProportional(): boolean {\n if (!this.width || !this.height || !this.depth) return true\n if (!this.currentWidth || !this.currentHeight || !this.currentDepth) return true\n\n const rw = this.currentWidth / this.width\n const rh = this.currentHeight / this.height\n const rd = this.currentDepth / this.depth\n const avg = (rw + rh + rd) / 3\n const tolerance = 0.05\n\n return Math.abs(rw - avg) / avg < tolerance && Math.abs(rh - avg) / avg < tolerance && Math.abs(rd - avg) / avg < tolerance\n }\n\n private _applyAction(action: any, dimension: { width: number; height: number; depth: number }) {\n this.dispatchEvent(\n new CustomEvent('i-need-selected', {\n bubbles: true,\n composed: true,\n detail: {\n callback: (selected: any[]) => {\n typeof action === 'function' && action(selected[0], dimension)\n this._refreshCurrentSize(selected[0])\n }\n }\n })\n )\n }\n\n /**\n * W, H 중 짧은 쪽을 기준으로 원래 모델의 비율에 맞게 치수를 조절한다.\n * (contain 방식 — 모델이 컴포넌트 영역 안에 들어감)\n */\n private _applyProportional(action: any) {\n this.dispatchEvent(\n new CustomEvent('i-need-selected', {\n bubbles: true,\n composed: true,\n detail: {\n callback: (selected: any[]) => {\n const component = selected[0]\n if (!component || typeof action !== 'function') return\n\n const { width: cw = 1, height: ch = 1, depth: cd = 1 } = component.state\n const { width: ow, height: oh, depth: od } = this // 원래 모델 치수\n\n if (!ow || !oh || !od) return\n\n // 이미 비율이 맞으면 스킵\n if (this._isProportional()) return\n\n // W, H 중 ratio가 작은 축을 기준\n const scale = Math.min(cw / ow, ch / oh)\n\n action(component, {\n width: Math.round(ow * scale),\n height: Math.round(oh * scale),\n depth: Math.round(od * scale)\n })\n\n this._refreshCurrentSize(component)\n }\n }\n })\n )\n }\n\n private _getRatioLock(): boolean {\n return !!this._component?.state?.ratioLock\n }\n\n private _setRatioLock(value: boolean) {\n this.dispatchEvent(\n new CustomEvent('i-need-selected', {\n bubbles: true,\n composed: true,\n detail: {\n callback: (selected: any[]) => {\n selected[0].set('ratioLock', value)\n this.requestUpdate()\n }\n }\n })\n )\n }\n\n private _refreshCurrentSize(component: any) {\n if (!component) return\n const state = component.state || {}\n this.currentWidth = Math.round(state.width || 0)\n this.currentHeight = Math.round(state.height || 0)\n this.currentDepth = Math.round(state.depth || 0)\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('src')) {\n this.dispatchEvent(\n new CustomEvent('i-need-selected', {\n bubbles: true,\n composed: true,\n detail: {\n callback: async (selected: any[]) => {\n const component = selected[0]\n this._component = component\n this._refreshCurrentSize(component)\n await this.fetchSourceInfo(component, this.src!)\n }\n }\n })\n )\n }\n }\n\n private _pollTimer?: number\n\n async fetchSourceInfo(component: Component, src: string) {\n if (!src || !src.trim()) {\n return\n }\n\n // 이미 로드된 realObject에서 직접 정보를 읽는다\n if (this._tryReadFromRealObject(component)) {\n return\n }\n\n // GLTF 비동기 로드 중이면 폴링 (최대 20회 = 10초)\n if (this._pollTimer) clearInterval(this._pollTimer)\n let retries = 0\n this._pollTimer = window.setInterval(() => {\n if (this._tryReadFromRealObject(component) || ++retries >= 20) {\n clearInterval(this._pollTimer)\n this._pollTimer = undefined\n }\n }, 500)\n }\n\n private _tryReadFromRealObject(component: any): boolean {\n const ro = component?.realObject\n if (!ro?.objectSize) return false\n\n const { x = 0, y = 0, z = 0 } = ro.objectSize\n this.width = Math.round(x * 100) / 100\n this.depth = Math.round(y * 100) / 100\n this.height = Math.round(z * 100) / 100\n\n // 통계: pivot 또는 object3d에서 수집\n const root = ro.pivot || ro.object3d\n if (root) {\n let meshes = 0\n let vertices = 0\n const materials = new Set()\n\n root.traverse((node: any) => {\n if (node.isMesh) {\n meshes++\n if (node.geometry) {\n const pos = node.geometry.getAttribute('position')\n if (pos) vertices += pos.count\n }\n if (node.material) {\n const mats = Array.isArray(node.material) ? node.material : [node.material]\n mats.forEach((m: any) => materials.add(m.uuid))\n }\n }\n })\n\n this.meshCount = meshes\n this.vertexCount = vertices\n this.materialCount = materials.size\n }\n\n this.animationCount = ro._animationActions?.size || 0\n\n return true\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n if (this._pollTimer) clearInterval(this._pollTimer)\n }\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js';
|
|
2
|
+
import '@operato/i18n/ox-i18n.js';
|
|
3
|
+
import { PropertyValues, TemplateResult } from 'lit';
|
|
4
|
+
import { OxPropertyEditor, PropertySpec } from '@operato/property-editor';
|
|
5
|
+
export default class GLTFPlayTargetsEditor extends OxPropertyEditor {
|
|
6
|
+
static styles: import("lit").CSSResult[];
|
|
7
|
+
src: string | undefined;
|
|
8
|
+
private _animNames;
|
|
9
|
+
private _mode;
|
|
10
|
+
private _playingAnim;
|
|
11
|
+
private _component;
|
|
12
|
+
private _lastExternalValue;
|
|
13
|
+
updated(changes: PropertyValues<this>): void;
|
|
14
|
+
private _refreshAnimNames;
|
|
15
|
+
private _pollTimer?;
|
|
16
|
+
connectedCallback(): void;
|
|
17
|
+
disconnectedCallback(): void;
|
|
18
|
+
editorTemplate(value: any, _spec: PropertySpec): TemplateResult;
|
|
19
|
+
private _setMode;
|
|
20
|
+
private _onToggle;
|
|
21
|
+
private _applyValue;
|
|
22
|
+
private _getPlayState;
|
|
23
|
+
private _setPlay;
|
|
24
|
+
private _togglePreview;
|
|
25
|
+
}
|