@volter/game-editor 0.5.97 → 0.5.99

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 (300) hide show
  1. package/BUNDLED_NOTICES +22 -22
  2. package/catalog/entries/blender.json +2 -2
  3. package/catalog/entries/music.json +2 -2
  4. package/dist/.vite/manifest.json +2161 -2161
  5. package/dist/assets/{AssetBudgetPanel-Cep5NyGP.js → AssetBudgetPanel-CthKzi_f.js} +3 -3
  6. package/dist/assets/{AudioViewer-DQ8lKD5j.js → AudioViewer-BZZyeUuv.js} +1 -1
  7. package/dist/assets/{CanvasBoardDocument-CkEMY2-8.js → CanvasBoardDocument-DsOmtEv_.js} +1 -1
  8. package/dist/assets/{CanvasSceneViewport-C9Nml0t3.js → CanvasSceneViewport-CJdc6428.js} +1 -1
  9. package/dist/assets/{ColorInput-BWuKy9BY.js → ColorInput-CjG1OnhE.js} +1 -1
  10. package/dist/assets/{ColorPicker-BxPSgfhZ.js → ColorPicker-D_HLZ-fK.js} +1 -1
  11. package/dist/assets/{EntityModelDocument-C0hTFUFP.js → EntityModelDocument-ihLmZ24x.js} +1 -1
  12. package/dist/assets/{EnvironmentAssetDocument-CjpIe39H.js → EnvironmentAssetDocument-D_Bzffyf.js} +1 -1
  13. package/dist/assets/{GameplaySessionTimeline-BfFggWCg.js → GameplaySessionTimeline-BR_MkPph.js} +1 -1
  14. package/dist/assets/{ImageViewer-CyWAuVIw.js → ImageViewer-D6MXEkV3.js} +1 -1
  15. package/dist/assets/InspectorObjectPreview-DniTSdEo.js +1 -0
  16. package/dist/assets/{JsonAssetDocument-DLNpN-9s.js → JsonAssetDocument-CH_BKqf0.js} +1 -1
  17. package/dist/assets/{LiveModuleDocument-Cg7hoB29.js → LiveModuleDocument-ocL5mdBG.js} +1 -1
  18. package/dist/assets/{LutAssetDocument-CAEKbWBM.js → LutAssetDocument-BP62BLXq.js} +1 -1
  19. package/dist/assets/{ModelAssetDocument-B47tDDCW.js → ModelAssetDocument-Ckz3Rcef.js} +1 -1
  20. package/dist/assets/{NonThreeAuthoringBootstrap-Cg_D_UEM.js → NonThreeAuthoringBootstrap-n1OV7f1Q.js} +1 -1
  21. package/dist/assets/{Object3DDocumentToolbar-B1LvvIG_.js → Object3DDocumentToolbar-BU5h7jhX.js} +1 -1
  22. package/dist/assets/Object3DDocumentViewport-Dr7XBnEa.js +2 -0
  23. package/dist/assets/{Object3DPreview-Dw20Z-tF.js → Object3DPreview-C4k5T1-3.js} +1 -1
  24. package/dist/assets/{OnlineAssetDetail-Chbdfi-N.js → OnlineAssetDetail-bodZxlM3.js} +1 -1
  25. package/dist/assets/{PlayBar-DGiKoFHe.js → PlayBar-D-SgnHBi.js} +1 -1
  26. package/dist/assets/{QuarksAssetDocument-UBzM9NpW.js → QuarksAssetDocument-B2Wrpxi-.js} +1 -1
  27. package/dist/assets/{ReactCanvasControls-2BcDqh92.js → ReactCanvasControls-BXjlNIcc.js} +1 -1
  28. package/dist/assets/{RootSelectionOverlay-Te-Oqem5.js → RootSelectionOverlay-BETMJphO.js} +1 -1
  29. package/dist/assets/{ShaderAssetDocument-Bl6VyA1O.js → ShaderAssetDocument-C3FvHS-L.js} +1 -1
  30. package/dist/assets/{ShadowEditor-DB3WW1uY.js → ShadowEditor-CmWSVBKW.js} +1 -1
  31. package/dist/assets/{SourceAssetViewer-aoCN7FVl.js → SourceAssetViewer-syIRglSD.js} +1 -1
  32. package/dist/assets/{StageHost-nRksZrQ1.js → StageHost-BqIe86Q5.js} +2 -2
  33. package/dist/assets/{StoryPreviewMount-BFTHe553.js → StoryPreviewMount-SXtYJsNy.js} +1 -1
  34. package/dist/assets/{ThreeBoardDocument-Df2V85ot.js → ThreeBoardDocument-BP554gCu.js} +2 -2
  35. package/dist/assets/{ThreeIsolationSceneContent-52RSbh1g.js → ThreeIsolationSceneContent-75-LDtL9.js} +1 -1
  36. package/dist/assets/{ToolObject3DPreview-Cyai9vr_.js → ToolObject3DPreview-DLinAx-k.js} +1 -1
  37. package/dist/assets/{Toolbar-DVjCZQkK.js → Toolbar-CextQHWh.js} +1 -1
  38. package/dist/assets/{TransientHint-WQMEBkuO.js → TransientHint-gxsw0fPN.js} +1 -1
  39. package/dist/assets/{VideoViewer-DpaWicwU.js → VideoViewer-Cqzfzdfp.js} +1 -1
  40. package/dist/assets/{ViewportShadingMenu-CFR6zenE.js → ViewportShadingMenu--caGAzBB.js} +1 -1
  41. package/dist/assets/{active-ingest-ZOiV0Jtk.js → active-ingest-h6X9yZNA.js} +2 -2
  42. package/dist/assets/{animation-clock-Dr4EnNrV.js → animation-clock-Btrvho_Y.js} +1 -1
  43. package/dist/assets/{animation-mixers.service-DuBOR3FM.js → animation-mixers.service-DQGz57nx.js} +1 -1
  44. package/dist/assets/{animation-timeline.utility-rpFN_NKQ.js → animation-timeline.utility-rdAc4tsU.js} +1 -1
  45. package/dist/assets/{asset-budget-asset.menu-Dpd-65_s.js → asset-budget-asset.menu-CpuPF12Q.js} +1 -1
  46. package/dist/assets/{asset-budget.action-BbWPZf9p.js → asset-budget.action-mwOpjij5.js} +1 -1
  47. package/dist/assets/{asset-budget.document-BR8rdZj1.js → asset-budget.document-D8rrDeVQ.js} +1 -1
  48. package/dist/assets/{asset-budget.menu-H5o9EU1g.js → asset-budget.menu-BilRjTLw.js} +1 -1
  49. package/dist/assets/{asset-editor-persistence-Byrmam_8.js → asset-editor-persistence-B40nssGV.js} +1 -1
  50. package/dist/assets/{asset-loaders-C5hSuF5w.js → asset-loaders-BWWEqlVb.js} +1 -1
  51. package/dist/assets/{asset-preview-Clo8SaV6.js → asset-preview-DyRWJUUG.js} +1 -1
  52. package/dist/assets/{audio-unlock.service-BMTPpNST.js → audio-unlock.service-WemVBvpc.js} +1 -1
  53. package/dist/assets/{audio.utility-7rJdsZRs.js → audio.utility-VDcYPSfS.js} +1 -1
  54. package/dist/assets/autoplay.service-BvEb13A3.js +1 -0
  55. package/dist/assets/{babylon-authoring-adapter-Ba6K8LSs.js → babylon-authoring-adapter-BkvAcVX0.js} +1 -1
  56. package/dist/assets/{binding-resolver-DCeGebRY.js → binding-resolver-BWRRdIaX.js} +2 -2
  57. package/dist/assets/{blender-emscripten-engine-CbHHZuUu.js → blender-emscripten-engine-DnpXL9Lg.js} +1 -1
  58. package/dist/assets/{blender-node-editor.document-DYj1pEzm.js → blender-node-editor.document-CAYFyrk5.js} +1 -1
  59. package/dist/assets/{blender-properties-tab-_UQryjaE.js → blender-properties-tab-XAVNmU6S.js} +1 -1
  60. package/dist/assets/blender-runtime-host-Byw4o_u0.js +7 -0
  61. package/dist/assets/{blender-runtime-skin-B1bWYvLx.js → blender-runtime-skin-Cw3ptNmu.js} +9 -9
  62. package/dist/assets/blender-runtime.document-CKAnLpO6.js +13 -0
  63. package/dist/assets/{blender-screenshot.menu-BOm0A_fs.js → blender-screenshot.menu-CKSZoP6R.js} +1 -1
  64. package/dist/assets/{blender-timeline.document-uc9n3IzF.js → blender-timeline.document-BKDpuGev.js} +1 -1
  65. package/dist/assets/{blender-uv-editor.document-hrolGRvl.js → blender-uv-editor.document-V9Aevjga.js} +1 -1
  66. package/dist/assets/{blender-version.status-CtulscU0.js → blender-version.status-_RwyILn-.js} +1 -1
  67. package/dist/assets/{blender-wali-engine-uH9q2l3f.js → blender-wali-engine-CAscERoY.js} +1 -1
  68. package/dist/assets/{blender.command-C1fW4kWp.js → blender.command-DJR8Bj0V.js} +1 -1
  69. package/dist/assets/{board-guides-B_1dNBxX.js → board-guides-CC1g9px4.js} +1 -1
  70. package/dist/assets/{bridge.command-D6A8A9ri.js → bridge.command-D66l3OeA.js} +3 -3
  71. package/dist/assets/{browserAll-CR6_j2mp.js → browserAll-vy6h2mrl.js} +1 -1
  72. package/dist/assets/{build-player.document-DYclYzh2.js → build-player.document-CLTpej_N.js} +1 -1
  73. package/dist/assets/{build-profiles.document-PzCjWvqU.js → build-profiles.document-Ct6vaGZ3.js} +1 -1
  74. package/dist/assets/{build-progress.status-CP9C8cb9.js → build-progress.status-BDtP48NR.js} +1 -1
  75. package/dist/assets/{build-session-D5w-r4Be.js → build-session-CPbAgpR7.js} +1 -1
  76. package/dist/assets/{build.action-C-dnDeEj.js → build.action-Cksw2yXV.js} +1 -1
  77. package/dist/assets/{build.command-Cy08-IxS.js → build.command-DJD84TEp.js} +1 -1
  78. package/dist/assets/{build.header-CfKLqqNW.js → build.header-Cm2Anxw1.js} +1 -1
  79. package/dist/assets/{build.menu-CJWutH9z.js → build.menu-DuHTf3oU.js} +1 -1
  80. package/dist/assets/{build.service-D8uj_jPB.js → build.service-C7Yy66yy.js} +1 -1
  81. package/dist/assets/{camera-DBA2Hsqv.js → camera-B1iisdjC.js} +1 -1
  82. package/dist/assets/{camera-runtime.inspector-f4N1iCDF.js → camera-runtime.inspector-Dtblf3c7.js} +1 -1
  83. package/dist/assets/{canvas-design-mount-C0NaIyI3.js → canvas-design-mount-pHgkSjhG.js} +3 -3
  84. package/dist/assets/{canvas-entry-runtime-BLPKpqpp.js → canvas-entry-runtime-CRWe-Gxi.js} +2 -2
  85. package/dist/assets/{canvas-preview-frames-BFYpLtLK.js → canvas-preview-frames-CJtaubgV.js} +1 -1
  86. package/dist/assets/{canvas-story-capture.service--waamjqh.js → canvas-story-capture.service-BKibUqPU.js} +2 -2
  87. package/dist/assets/{capability-coverage-NcL3fdGj.js → capability-coverage-CRb3vmWs.js} +1 -1
  88. package/dist/assets/{collaboration-presence-CypC1OHn.js → collaboration-presence-C3pKLb3J.js} +1 -1
  89. package/dist/assets/{collider-D2vJA2Dp.js → collider-BsrUCJlt.js} +1 -1
  90. package/dist/assets/{component-board.service-D2McY2BT.js → component-board.service-BkOA1vLP.js} +2 -2
  91. package/dist/assets/{component-board.service-w9Wkqe28.js → component-board.service-DcLu6a6a.js} +2 -2
  92. package/dist/assets/{component-board.service-BM4e9DXU.js → component-board.service-Dgg20que.js} +2 -2
  93. package/dist/assets/{component-contracts.service-Tfu5yfN-.js → component-contracts.service-LvrwyMpk.js} +1 -1
  94. package/dist/assets/{component-instance-root-4o-HMx39.js → component-instance-root-BaRyIQ5L.js} +1 -1
  95. package/dist/assets/{component-verbs.command-CCabdRwc.js → component-verbs.command-stK20FK5.js} +1 -1
  96. package/dist/assets/{component-verbs.service-CsnI9V_a.js → component-verbs.service-DKnWNncI.js} +1 -1
  97. package/dist/assets/{config-CTi5HVQk.js → config-Oi6wS579.js} +2 -2
  98. package/dist/assets/{configurations-DQXyouVq.js → configurations-Dr0vG1VD.js} +1 -1
  99. package/dist/assets/{connection.status-CXQvtUky.js → connection.status-BusVsqEQ.js} +1 -1
  100. package/dist/assets/{constraints.inspector-BnaTP-f_.js → constraints.inspector-CtClCM7N.js} +1 -1
  101. package/dist/assets/{content-bounds-C6Nb8vJK.js → content-bounds-CSAlBN5N.js} +1 -1
  102. package/dist/assets/{contract-system-adapters-CJXxexZO.js → contract-system-adapters-BuU4GKY2.js} +1 -1
  103. package/dist/assets/{coverage.service-B6mSdaKu.js → coverage.service-BAip9f-s.js} +1 -1
  104. package/dist/assets/{create-runtime-BcW4ljbo.js → create-runtime-D7OGGNf7.js} +1 -1
  105. package/dist/assets/{curve-Ds2-liNe.js → curve-DoTlJl0S.js} +1 -1
  106. package/dist/assets/{data-asset-CWl5bb8W.js → data-asset-CHJT7Vn8.js} +1 -1
  107. package/dist/assets/{data-ref-jOa7Hw5q.js → data-ref-DrCMI-nl.js} +1 -1
  108. package/dist/assets/{debug-bridge-s2ipjHbl.js → debug-bridge-CAOTUmkq.js} +1 -1
  109. package/dist/assets/{debug-registry-B0UtXvgn.js → debug-registry-B-T_4soJ.js} +1 -1
  110. package/dist/assets/{deferred-ingest-play-BpPZrTLz.js → deferred-ingest-play-BhS77VgZ.js} +2 -2
  111. package/dist/assets/{design-time-canvas-mount-9GhEUOXN.js → design-time-canvas-mount-CvPR0mQ0.js} +2 -2
  112. package/dist/assets/{design-time-layers-BtxJATJe.js → design-time-layers-BePiGKet.js} +1 -1
  113. package/dist/assets/{design-time-mount.service-DsMz9KB0.js → design-time-mount.service-CCjJjAki.js} +2 -2
  114. package/dist/assets/{design-time-mount.service-B3TlKaZf.js → design-time-mount.service-Ck3FvIte.js} +2 -2
  115. package/dist/assets/{design-time-react-mount-Dh-IMbR8.js → design-time-react-mount-DN9CnR9f.js} +1 -1
  116. package/dist/assets/{document-preview-three-DgyEGb7g.js → document-preview-three-CZp-b29j.js} +1 -1
  117. package/dist/assets/{dom-authoring-adapter-DzKucjZ1.js → dom-authoring-adapter-Cd8kfaSd.js} +1 -1
  118. package/dist/assets/{draco3d-CtGZleeO.js → draco3d-4p7oaG69.js} +1 -1
  119. package/dist/assets/{edit-mode-audio.service-CyxFaDyl.js → edit-mode-audio.service-3hR1ciDO.js} +1 -1
  120. package/dist/assets/{edit-mode-authoring-8eqT4Ah6.js → edit-mode-authoring-euM9VW6K.js} +1 -1
  121. package/dist/assets/{edit-mode-networking.service-t3CgKERU.js → edit-mode-networking.service-BDdYK8Ig.js} +1 -1
  122. package/dist/assets/{editor-api-CnMI4ri9.js → editor-api-BtXmMNSR.js} +1 -1
  123. package/dist/assets/{editor-layers-TtgYYi_s.js → editor-layers-BadrAIuA.js} +1 -1
  124. package/dist/assets/{editor-shell-store-C9QYXDRr.js → editor-shell-store-BRi8Vv17.js} +1 -1
  125. package/dist/assets/{entity-object-CTha2dPd.js → entity-object-DgmLa7_T.js} +1 -1
  126. package/dist/assets/{extend-DScgOkqm.js → extend-n0wDgaI-.js} +1 -1
  127. package/dist/assets/{fork-menu-CW0fvp_-.js → fork-menu-DWzwL7ae.js} +1 -1
  128. package/dist/assets/{frame-debugger-store-Ovblcz2s.js → frame-debugger-store-YlccB0mY.js} +1 -1
  129. package/dist/assets/{game-contract-seams-BhjR536D.js → game-contract-seams-l_8ZaYZ3.js} +1 -1
  130. package/dist/assets/{game-css-scope-transform-DhmUzNg4.js → game-css-scope-transform-MiqomK8_.js} +1 -1
  131. package/dist/assets/{game-document.service-DpYuC6EA.js → game-document.service-D5HOvWgk.js} +1 -1
  132. package/dist/assets/{game-eval.command-CZjgr-Ux.js → game-eval.command-DA-QR5L4.js} +1 -1
  133. package/dist/assets/{game-module-access-BBoEY2IL.js → game-module-access-CttGzVCj.js} +1 -1
  134. package/dist/assets/{game-network-BoP-iKCC.js → game-network-BexquSG7.js} +3 -3
  135. package/dist/assets/{gameplay-export-D6ZefP6y.js → gameplay-export-A2_wxmzQ.js} +1 -1
  136. package/dist/assets/{gameplay-replay-BhWtcNfn.js → gameplay-replay-C01NK7_R.js} +1 -1
  137. package/dist/assets/{gameplay.command-DFDve9iS.js → gameplay.command-53pBlywA.js} +1 -1
  138. package/dist/assets/{generation-jobs-RBppjmZm.js → generation-jobs-BZ1uNuym.js} +1 -1
  139. package/dist/assets/{generation.service-CYlKPuNC.js → generation.service-fiLdgX9K.js} +1 -1
  140. package/dist/assets/{generations-BX9sRTpt.js → generations-Cs4ZEXOW.js} +1 -1
  141. package/dist/assets/{generations.status-D78fiCZN.js → generations.status-DVhipG_g.js} +1 -1
  142. package/dist/assets/{hierarchy-marks-DMWVKCJa.js → hierarchy-marks-Bz6FH5xl.js} +1 -1
  143. package/dist/assets/{hosted-asset-materialization-B7uBOJtr.js → hosted-asset-materialization-CLh_Fkf5.js} +1 -1
  144. package/dist/assets/{index-CpXy7sdX.js → index-BXp6J271.js} +1 -1
  145. package/dist/assets/{index-BErRsnP9.js → index-Bz10-Rzi.js} +1 -1
  146. package/dist/assets/{index-sFzW-AhX.js → index-CGWnVcy5.js} +1 -1
  147. package/dist/assets/{index-BVSm448e.js → index-CnQxsRjG.js} +2 -2
  148. package/dist/assets/{index-D8czczMc.js → index-Cxz8Qysl.js} +1 -1
  149. package/dist/assets/{index-R6-13mGN.js → index-DKlVAXbF.js} +1 -1
  150. package/dist/assets/{index-C_gLrIvk.js → index-Dji-5Ngh.js} +7 -7
  151. package/dist/assets/{index-Q2PKxvts.js → index-ucHKPhjL.js} +1 -1
  152. package/dist/assets/{index-bXjpWEn9.js → index-yEWxcp4Z.js} +1 -1
  153. package/dist/assets/{inference-diagnostics-CSTitz6Y.js → inference-diagnostics-BJUcoifD.js} +1 -1
  154. package/dist/assets/{ingest-boot-viewport-ClRh-m5Z.js → ingest-boot-viewport-B2KxD-oi.js} +1 -1
  155. package/dist/assets/{ingest-siblings-C4yJ-pFC.js → ingest-siblings-DHwK8q_i.js} +1 -1
  156. package/dist/assets/{ingest-source-persistence-Cxv-xcnT.js → ingest-source-persistence-BQ3VwPMh.js} +1 -1
  157. package/dist/assets/{ingest.service-BnUZe4K0.js → ingest.service-Dr2uWmcO.js} +1 -1
  158. package/dist/assets/{inspect-DybkUNPY.js → inspect-DZInhjtn.js} +1 -1
  159. package/dist/assets/instances.command-B9SndOqS.js +1 -0
  160. package/dist/assets/{json-history-resource-BReCXsj2.js → json-history-resource-CIxXZ9Kl.js} +1 -1
  161. package/dist/assets/{layered-pick-BJfI6PwU.js → layered-pick-DfTP1-Cr.js} +1 -1
  162. package/dist/assets/{light-CdIUgmeK.js → light-B6J4lQur.js} +1 -1
  163. package/dist/assets/{live-project-verbs-DBGzvsy3.js → live-project-verbs-D4cO2mDW.js} +1 -1
  164. package/dist/assets/{machine.document-DUy8aZD2.js → machine.document-DziDBmsa.js} +1 -1
  165. package/dist/assets/{machines.finder-C9I3Zbhn.js → machines.finder-BzSmJC05.js} +1 -1
  166. package/dist/assets/{material-CDL3cxMn.js → material-BYffxFoI.js} +1 -1
  167. package/dist/assets/{material-factory-C0OAYJZ6.js → material-factory-C8x9nW40.js} +1 -1
  168. package/dist/assets/{mesh-CGLhemJl.js → mesh-OD-8cCPF.js} +1 -1
  169. package/dist/assets/{model-asset-sections.service-CGVR9EhV.js → model-asset-sections.service-D2XhLBki.js} +1 -1
  170. package/dist/assets/{model-inspection-CwGBMSvf.js → model-inspection-CPrGFWhU.js} +1 -1
  171. package/dist/assets/{model-thumbnail-zIoZC1z2.js → model-thumbnail-DrHjLgzh.js} +1 -1
  172. package/dist/assets/{models.finder-BDhWOMcl.js → models.finder-kOiLPr6p.js} +1 -1
  173. package/dist/assets/{module-mode-BHeWNrkN.js → module-mode-COpZ8HPQ.js} +2 -2
  174. package/dist/assets/{mount-canvas-ingest-root-Dbycoo4l.js → mount-canvas-ingest-root-Dn8zfXCs.js} +2 -2
  175. package/dist/assets/{mount-dom-ingest-root-DhCiXBw0.js → mount-dom-ingest-root-Q69QIXJU.js} +2 -2
  176. package/dist/assets/{mount-ingest-root-Dn5SOQdS.js → mount-ingest-root-tvezSUW2.js} +2 -2
  177. package/dist/assets/{mount-manifest-BFwCVGaC.js → mount-manifest-B6nhuOOp.js} +1 -1
  178. package/dist/assets/{mount-three-ingest-root-7bNuxm9b.js → mount-three-ingest-root-B7CbPqYg.js} +1 -1
  179. package/dist/assets/{mounted-authoring-DI-dfAS5.js → mounted-authoring-DBEo6Vnv.js} +1 -1
  180. package/dist/assets/{mounted-story-viewport-source-BBOTgZEy.js → mounted-story-viewport-source-CVbawnaF.js} +1 -1
  181. package/dist/assets/{native-debug-module-Dvzh4rev.js → native-debug-module-D2m1zyhH.js} +1 -1
  182. package/dist/assets/{navigation-j17GvlMl.js → navigation-BVNWk7NC.js} +1 -1
  183. package/dist/assets/{navmesh.menu-II20NCGk.js → navmesh.menu-BSqsnclN.js} +1 -1
  184. package/dist/assets/{navmesh.service-DDiQLjFE.js → navmesh.service-Bd8zoGEc.js} +1 -1
  185. package/dist/assets/network-observer.service-COlyC1Vn.js +1 -0
  186. package/dist/assets/{network.utility-vkLvhGPx.js → network.utility-B_g_GTxH.js} +1 -1
  187. package/dist/assets/{object3d-document-session-registry-Bt76KtzL.js → object3d-document-session-registry-CatZ54tz.js} +2 -2
  188. package/dist/assets/{oid-transform-DMPczBkS.js → oid-transform-BDgEBytJ.js} +1 -1
  189. package/dist/assets/{particles-CtEtOqNM.js → particles-DR6A_2v6.js} +1 -1
  190. package/dist/assets/{pixi-authoring-adapter-CXve0GKc.js → pixi-authoring-adapter-B60Kh9IK.js} +1 -1
  191. package/dist/assets/{pixi-live-write-target-tfgZy1iB.js → pixi-live-write-target-DJUjy31J.js} +1 -1
  192. package/dist/assets/{play.command-CGlPKbny.js → play.command-Erf3N5VD.js} +2 -2
  193. package/dist/assets/{presentation-DBDrAo3B.js → presentation-BxwfX5Wf.js} +1 -1
  194. package/dist/assets/{product-iSAUcCl9.js → product-DVszYDSF.js} +1 -1
  195. package/dist/assets/{profiler.action-BpOx2gla.js → profiler.action-CiZCcZ-R.js} +1 -1
  196. package/dist/assets/{profiler.menu-Ds4Dm2T9.js → profiler.menu-T0cOPUfK.js} +1 -1
  197. package/dist/assets/{profiler.utility-o6cOubd_.js → profiler.utility-Dq4GRV6G.js} +1 -1
  198. package/dist/assets/{project-authoring-session-Dekk2e3o.js → project-authoring-session-1_gSjCtF.js} +2 -2
  199. package/dist/assets/{properties-bone-constraints.inspector-4zktkkvC.js → properties-bone-constraints.inspector-CNSbpQ-3.js} +1 -1
  200. package/dist/assets/{properties-bone.inspector-BisMKVWS.js → properties-bone.inspector-MrF2CQuv.js} +1 -1
  201. package/dist/assets/{properties-collection.inspector-By43HF5s.js → properties-collection.inspector-BVPyC4UE.js} +1 -1
  202. package/dist/assets/{properties-constraints.inspector-C5Dv4nTl.js → properties-constraints.inspector-CA8RTE35.js} +1 -1
  203. package/dist/assets/{properties-data.inspector-Cp8_hP_J.js → properties-data.inspector-wiB8xicC.js} +1 -1
  204. package/dist/assets/{properties-material.inspector-BNYKbXo2.js → properties-material.inspector-Bf_ji3wn.js} +1 -1
  205. package/dist/assets/{properties-modifiers.inspector-Dri9d_7u.js → properties-modifiers.inspector-6FFdw9AY.js} +1 -1
  206. package/dist/assets/{properties-object.inspector-Zsa_Rkjh.js → properties-object.inspector-DE3pesUS.js} +1 -1
  207. package/dist/assets/{properties-output.inspector-DlV8p-bH.js → properties-output.inspector-Be-knw0k.js} +1 -1
  208. package/dist/assets/{properties-particles.inspector-C5RLi4IV.js → properties-particles.inspector-DlqHoQAV.js} +1 -1
  209. package/dist/assets/{properties-physics.inspector-BC0P-uli.js → properties-physics.inspector-BG0VrR6B.js} +1 -1
  210. package/dist/assets/{properties-render.inspector-DUQSvvhk.js → properties-render.inspector-CU9OT414.js} +1 -1
  211. package/dist/assets/{properties-scene.inspector-LY_7pIIZ.js → properties-scene.inspector-C42oTts_.js} +1 -1
  212. package/dist/assets/{properties-texture.inspector-YlJ6eiXy.js → properties-texture.inspector-DKDV0xVi.js} +1 -1
  213. package/dist/assets/{properties-view-layer.inspector-k9TDa2BK.js → properties-view-layer.inspector-F-09o7Wu.js} +1 -1
  214. package/dist/assets/{properties-world.inspector-Lrl6vogA.js → properties-world.inspector-CDUzzoDL.js} +1 -1
  215. package/dist/assets/{r3f-design-session-CNjz1_AF.js → r3f-design-session-B7g85Ubb.js} +2 -2
  216. package/dist/assets/{r3f-physics-binding-B0M0RByC.js → r3f-physics-binding-Cnq-NbcK.js} +1 -1
  217. package/dist/assets/{r3f-source-authoring-adapter-DYp48abR.js → r3f-source-authoring-adapter-CyPyqkM2.js} +1 -1
  218. package/dist/assets/{react-canvas-navigation-BPHMARV3.js → react-canvas-navigation-DmOr9odR.js} +1 -1
  219. package/dist/assets/{react-inspector.service-DgLj6yGA.js → react-inspector.service-DwcaF9IG.js} +1 -1
  220. package/dist/assets/{react-story-board-B9_ZSGGT.js → react-story-board-CV_xdGh1.js} +1 -1
  221. package/dist/assets/{react-three-rapier.esm-CZ8fWAw-.js → react-three-rapier.esm-DQRNQwIJ.js} +1 -1
  222. package/dist/assets/{react-world-authoring-adapter-C9fTSu6u.js → react-world-authoring-adapter-BxVhWmgw.js} +1 -1
  223. package/dist/assets/{realm-services-CyH5yTHN.js → realm-services-Cg17rNWu.js} +1 -1
  224. package/dist/assets/{reflection-probe-capture.inspector-B5Ken3Wv.js → reflection-probe-capture.inspector-CSe75rUr.js} +1 -1
  225. package/dist/assets/{registry-YEJktf-K.js → registry-DkuVtOoX.js} +1 -1
  226. package/dist/assets/{relative-import-specifier-Dg5O2O1R.js → relative-import-specifier-KuoBpIGI.js} +1 -1
  227. package/dist/assets/{render-env-5rmrHmGC.js → render-env-DdgiL0G1.js} +1 -1
  228. package/dist/assets/{render-features-BPb6UG8u.js → render-features-BNRGwsS3.js} +1 -1
  229. package/dist/assets/{render-settings-DBqv2yw8.js → render-settings-Cvt-UEn5.js} +1 -1
  230. package/dist/assets/{resolve-three-7CthO8aC.js → resolve-three-B_SlmwYz.js} +3 -3
  231. package/dist/assets/{root-seam-contract-Bf_WRD_z.js → root-seam-contract-CBnI5fSF.js} +1 -1
  232. package/dist/assets/{run-selection-CbwxS453.js → run-selection-D8BpmvGy.js} +1 -1
  233. package/dist/assets/{scene-capture-D5ooN1dC.js → scene-capture-Cj_ovCK0.js} +1 -1
  234. package/dist/assets/{scene-document.service-vDIQM-_L.js → scene-document.service-Kpmmzat3.js} +2 -2
  235. package/dist/assets/{scene-framing-DeMlXIgX.js → scene-framing-C5vUXepb.js} +1 -1
  236. package/dist/assets/{seeded-random-CilWrQ9p.js → seeded-random-B_ZVFnMw.js} +1 -1
  237. package/dist/assets/{session-kTroQqmY.js → session-Diu2gkDJ.js} +30 -6
  238. package/dist/assets/{setup-renderer-D4rh83E5.js → setup-renderer-CeDRVovn.js} +1 -1
  239. package/dist/assets/{source-object3d-authoring-adapter-Ci6EfWDG.js → source-object3d-authoring-adapter-CkrMfTNh.js} +1 -1
  240. package/dist/assets/{source-persistence-backend-CpNTlQ6r.js → source-persistence-backend-Dxv1DyQP.js} +1 -1
  241. package/dist/assets/{stage-keyboard-DffZ_2Js.js → stage-keyboard-DYIzheZc.js} +1 -1
  242. package/dist/assets/{stage-overlay-set-HW84K0WL.js → stage-overlay-set-CGSRG4Aj.js} +1 -1
  243. package/dist/assets/{stage-presence-markers-BhBXzQaB.js → stage-presence-markers-BJz57Ct3.js} +1 -1
  244. package/dist/assets/{stage-transform-tools-Bt248CuV.js → stage-transform-tools-C8-lHfXY.js} +1 -1
  245. package/dist/assets/{standard-viewport-dressing-CtIrUH9V.js → standard-viewport-dressing-BVichQxX.js} +1 -1
  246. package/dist/assets/{state-watch.action-BWSHqM8G.js → state-watch.action-DKzRIy3J.js} +1 -1
  247. package/dist/assets/{state-watch.menu-DZw8R4P9.js → state-watch.menu-CXJ9I-HV.js} +1 -1
  248. package/dist/assets/{state-watch.utility-DfZzhxLI.js → state-watch.utility-DiB9QOcK.js} +1 -1
  249. package/dist/assets/{story-capture-BkC82-C6.js → story-capture-P6zeIG5J.js} +1 -1
  250. package/dist/assets/{story-documents-BgenKklm.js → story-documents-DfvomvsX.js} +1 -1
  251. package/dist/assets/{story-documents.service-DcIPA1V2.js → story-documents.service-DR9ets4q.js} +1 -1
  252. package/dist/assets/{story-documents.service-vCX0ua3i.js → story-documents.service-ink5SQ1C.js} +1 -1
  253. package/dist/assets/{story-media-presence-CEkAUR-5.js → story-media-presence-DRy56PNr.js} +1 -1
  254. package/dist/assets/{story-pixi-preview-C-VALVuE.js → story-pixi-preview-D56zGWQH.js} +1 -1
  255. package/dist/assets/{story-presentation-DJtDDykU.js → story-presentation-Buq-pvYC.js} +1 -1
  256. package/dist/assets/{story-three-preview-RAf4-fEE.js → story-three-preview-8i3UHSR1.js} +2 -2
  257. package/dist/assets/{studio-environment-CjfDi6Xs.js → studio-environment-D6JkSE7Q.js} +1 -1
  258. package/dist/assets/{surface-state-DqslrBdu.js → surface-state-CPApGJAw.js} +1 -1
  259. package/dist/assets/{syntactic-prop-specs-_CzMqIxq.js → syntactic-prop-specs-kZ8ukBIu.js} +1 -1
  260. package/dist/assets/{team-playtest.service-BX6fYsMy.js → team-playtest.service-CGxQ8XaR.js} +1 -1
  261. package/dist/assets/{three-BWA441zQ.js → three-BeNC5ULQ.js} +1 -1
  262. package/dist/assets/{three-authoring-adapter-cWKLa6xe.js → three-authoring-adapter-BC0M_LjK.js} +1 -1
  263. package/dist/assets/three-authoring.service-DRxwcnXA.js +2 -0
  264. package/dist/assets/{three-ingest-runtime-B09tYa9n.js → three-ingest-runtime-QR_mSA3s.js} +1 -1
  265. package/dist/assets/{three-integration-BXyJZy9c.js → three-integration-B0Pips-D.js} +2 -2
  266. package/dist/assets/three-integration.service-sYOQoXd6.js +1 -0
  267. package/dist/assets/{three-projection-core-BAHKdNuj.js → three-projection-core-CktgE3qZ.js} +1 -1
  268. package/dist/assets/{three-state-CR9QYeCl.js → three-state-Jjh8RKmv.js} +1 -1
  269. package/dist/assets/{three-story-capture.service-DUmB30Hg.js → three-story-capture.service-D4GsyMao.js} +2 -2
  270. package/dist/assets/{three-story-model-sxgG2OGG.js → three-story-model-CcSkyEHD.js} +1 -1
  271. package/dist/assets/{three-viewport-presentation-CbOERA2i.js → three-viewport-presentation-DMl9pRzL.js} +1 -1
  272. package/dist/assets/{transform-mode-request-BOVxBX4f.js → transform-mode-request-BrnHasM9.js} +1 -1
  273. package/dist/assets/{transport-strip-CJFVXvxI.js → transport-strip-B_-5H4dc.js} +1 -1
  274. package/dist/assets/transport.header-Dvkippp-.js +1 -0
  275. package/dist/assets/{tuples-B44o6m5b.js → tuples-DT5W38h7.js} +1 -1
  276. package/dist/assets/{ui-board-document-CS2m1uLf.js → ui-board-document-DWKA2ffR.js} +2 -2
  277. package/dist/assets/{user-data-BS92dOsI.js → user-data-BIoZkgOJ.js} +1 -1
  278. package/dist/assets/{utility-view-state-B66E09an.js → utility-view-state-CVfqfr1o.js} +1 -1
  279. package/dist/assets/{viewport-door-CN3_JGfc.js → viewport-door-DkrIQ3Lf.js} +1 -1
  280. package/dist/assets/{viewport-root-presentation-CV9AuiRe.js → viewport-root-presentation-CBBdlbEP.js} +1 -1
  281. package/dist/assets/{viewport-surface-status-tLC5uoTr.js → viewport-surface-status-DD1DHTG4.js} +1 -1
  282. package/dist/assets/{webworkerAll-CJN_8ry7.js → webworkerAll-Dz3U-k_j.js} +1 -1
  283. package/dist/assets/{worker-DLnISz0i.js → worker-Df5OJQKy.js} +1 -1
  284. package/dist/assets/{workspace-arrangement-BTINexHg.js → workspace-arrangement-BrA73ntW.js} +1 -1
  285. package/dist/assets/{world-documents-DqDkHGRk.js → world-documents-D0S4TvKh.js} +1 -1
  286. package/dist/assets/{world-root-stage-binding-CgTjfy6y.js → world-root-stage-binding-Da5R7yq2.js} +1 -1
  287. package/dist/assets/{xstate-animation-binding-BMH7CiRL.js → xstate-animation-binding-yMMgYROj.js} +1 -1
  288. package/dist/assets/{xstate-animation-meta-DJjcEqI3.js → xstate-animation-meta-DVb9it2u.js} +1 -1
  289. package/dist-node/cli.js +16 -16
  290. package/package.json +16 -16
  291. package/dist/assets/InspectorObjectPreview-DONT8JtA.js +0 -1
  292. package/dist/assets/Object3DDocumentViewport-D5wFHIjC.js +0 -2
  293. package/dist/assets/autoplay.service-DgBeAZF0.js +0 -1
  294. package/dist/assets/blender-runtime-host-D_JU34fx.js +0 -7
  295. package/dist/assets/blender-runtime.document-CwtzTYN0.js +0 -13
  296. package/dist/assets/instances.command-DJhsMELC.js +0 -1
  297. package/dist/assets/network-observer.service-CwdeMEvO.js +0 -1
  298. package/dist/assets/three-authoring.service-DwRqwTgP.js +0 -2
  299. package/dist/assets/three-integration.service-B87Ig6eN.js +0 -1
  300. package/dist/assets/transport.header-CT9_8prP.js +0 -1
@@ -1 +1 @@
1
- import{a as i}from"./jsx-runtime-DPjLkJKQ.js";import{EDITOR_LAYER as Ke}from"./editor-layers-TtgYYi_s.js";import{df as Oe,a7 as V,bN as Ye,aL as te,bw as $,aM as G,kJ as Je,bM as Ze,bP as et,a6 as Q,h1 as tt,hF as rt,j_ as nt,kK as ot,Z as j,K as st,ci as at,kL as Se,cx as it,kM as ct,kN as lt,kO as ut,kP as Ce,kQ as xe,aD as x,cU as dt,kR as mt,cq as pt,cv as ft,kS as Pe,kT as Ee,kU as je,kV as ht,al as gt,kW as bt,kX as ke,dI as vt,kY as wt,kZ as yt,j3 as St,iV as Ct,iW as xt,gM as Pt,gN as Et,j1 as jt,g4 as kt,g5 as Tt,g6 as At,g7 as Rt}from"./index-C_gLrIvk.js";import{s as Mt,o as Vt}from"./object3d-document-session-registry-Bt76KtzL.js";import{R as Ot}from"./RootSelectionOverlay-Te-Oqem5.js";import{e as Lt,S as Ft}from"./surface-state-DqslrBdu.js";import{r as f}from"./index-nmcBqr7Y.js";import{t as It}from"./surface-content-Dg9Kkazf.js";import"./index-CtzuWnCS.js";import{s as zt,d as Te,c as U,t as Wt,p as Le,v as Ae,b as Nt,e as _t,l as Dt,i as Qt}from"./camera-authoring-DYjhU5Zp.js";import{c as $t}from"./performance-profiler-CMbwGBuk.js";import{m as Gt}from"./renderer-ownership-BovSEcLv.js";import{applyWorldRendererConfig as Ut}from"./renderer-config-CaPR4dB_.js";import{getUserData as Fe}from"./user-data-CODoGZqA.js";import{detectKtx2Support as Bt}from"./loader-BTUKnX5Q.js";import{resolveRenderSettings as Ht}from"./render-settings-DBqv2yw8.js";import{createSoftParticleDepthPass as qt}from"./soft-particle-depth-DNGwWJ8c.js";import{ViewportShadingRenderer as Xt}from"./viewport-shading-D9BMDb1N.js";import{applyRendererSettings as Kt,applySceneRenderPipeline as Yt}from"./setup-renderer-D4rh83E5.js";import{EffectComposer as Jt,EffectPass as Zt,BlendFunction as er,KernelSize as tr,OutlineEffect as rr}from"./index-DHhMOs_s.js";import{W as nr,T as or}from"./three.module-BLhyNg0e.js";import{d as sr}from"./design-time-mount-registry-DUpXCg1U.js";import{a as ar}from"./project-authoring-session-Dekk2e3o.js";import"./three-integration-BXyJZy9c.js";import{registerPresentedCanvasFrame as ir}from"./canvas-preview-frames-BFYpLtLK.js";import{i as cr}from"./editor-presentation-activity-CqJH4G9t.js";import{E as lr,s as ur,a as dr,t as mr,b as pr,c as fr,d as hr,r as gr,i as br}from"./three-viewport-presentation-CbOERA2i.js";import{a as Z}from"./entity-object-CTha2dPd.js";import{w as vr}from"./editor-shell-store-C9QYXDRr.js";import{p as wr}from"./viewport-root-presentation-CV9AuiRe.js";import{d as yr}from"./asset-editor-persistence-Byrmam_8.js";import{bindStagePresenceMarkers as Sr}from"./stage-presence-markers-BhBXzQaB.js";import{el as Cr,_ as ee,fo as D,d7 as xr,dp as Re}from"./three.core-3arARmh6.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./workspace-arrangement-BTINexHg.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./eyedropper-session-bjPXnfeX.js";import"./layered-pick-BJfI6PwU.js";import"./root-stacking-BEd9ZvxC.js";import"./react-story-board-B9_ZSGGT.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./inspect-DybkUNPY.js";import"./inference-diagnostics-CSTitz6Y.js";import"./object-marks-BnvSuCTt.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./render-features-BPb6UG8u.js";import"./matcap-texture-Dm2c-VQa.js";import"./defaults-DKiBJCPN.js";import"./edit-mode-authoring-8eqT4Ah6.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./preview-renderer-BrYNFV1p.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./user-data-BS92dOsI.js";import"./model-thumbnail-zIoZC1z2.js";import"./studio-environment-CjfDi6Xs.js";import"./three-state-CR9QYeCl.js";import"./hierarchy-marks-DMWVKCJa.js";import"./component-instance-root-4o-HMx39.js";import"./three-contract-Dkt6PmWY.js";import"./viewport-door-CN3_JGfc.js";import"./content-bounds-C6Nb8vJK.js";import"./asset-preview-Clo8SaV6.js";import"./bitmap-label-Ct4k6ehY.js";import"./index-BVSm448e.js";import"./standard-viewport-dressing-CtIrUH9V.js";import"./clip-planes-CnAI6DZn.js";import"./three-BWA441zQ.js";import"./model-inspection-CwGBMSvf.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./live-gesture-lock-DJbrjOqf.js";import"./scene-framing-DeMlXIgX.js";import"./live-mixers-B-bwLZ7c.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./mounted-authoring-DI-dfAS5.js";import"./collaboration-presence-CypC1OHn.js";function Pr({previewRef:r}){const{preview:e,previewPinned:s}=U(),[o,c]=f.useState(!1),a=f.useRef(null);if(f.useEffect(()=>{if(!o)return;const u=E=>{a.current?.contains(E.target)||c(!1)};return document.addEventListener("pointerdown",u),()=>document.removeEventListener("pointerdown",u)},[o]),!e)return null;const m=e.camera.isPerspectiveCamera&&Number.isFinite(e.camera.aspect)?e.camera.aspect:16/9;return i.jsxs("div",{className:"volter-camera-preview","data-testid":"camera-preview",children:[i.jsxs(Oe,{className:"volter-camera-preview-header",gap:4,align:"center",children:[i.jsx(V,{icon:Ye,size:"sm"}),i.jsx(te,{variant:"label",truncate:!0,className:"volter-camera-preview-title",title:`${e.name} · ${e.lens}`,children:e.name}),i.jsx($,{text:s?"Unpin camera preview":"Pin camera preview",children:i.jsx(G,{"aria-label":s?"Unpin camera preview":"Pin camera preview","aria-pressed":s,size:"compact",onClick:Wt,children:i.jsx(V,{icon:Je,size:"sm"})})}),i.jsxs("div",{ref:a,className:"volter-camera-preview-menu-anchor",children:[i.jsx($,{text:"Camera actions",children:i.jsx(G,{"aria-label":"Camera actions","aria-expanded":o,size:"compact",onClick:()=>c(u=>!u),children:i.jsx(V,{icon:Ze,size:"sm"})})}),o?i.jsxs(et,{className:"volter-camera-preview-menu",children:[i.jsx(Q,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),Le(e)},children:"Pilot Camera"}),i.jsx(Q,{variant:"ghost",size:"compact",onClick:()=>{c(!1),Ae(e)},children:"View Through Camera"}),i.jsx(Q,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),Nt(e)},children:"Align Camera to Current View"})]}):null]})]}),i.jsx("div",{ref:r,className:"volter-camera-preview-image",style:{aspectRatio:String(Math.max(.5,Math.min(3,m)))},role:"img","aria-label":`Live view through ${e.name}`,onDoubleClick:()=>Ae(e)})]})}function Er(){return i.jsxs("div",{className:"volter-camera-guides","aria-hidden":"true",children:[i.jsx("div",{className:"volter-camera-guide volter-camera-guide-v1"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-v2"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-h1"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-h2"}),i.jsx("div",{className:"volter-camera-safe-frame"}),i.jsx("div",{className:"volter-camera-center-mark"})]})}function jr(){const{view:r,guidesVisible:e}=U();if(!r)return null;const s=r.mode==="pilot";return i.jsxs(i.Fragment,{children:[e?i.jsx(Er,{}):null,i.jsx(tt,{variant:"overlay",border:!0,className:"volter-camera-view-banner volter-chrome-island volter-glass-island","data-testid":"camera-view-banner",children:i.jsxs(Oe,{gap:6,align:"center",children:[i.jsx(rt,{children:s?"PILOTING":"CAMERA VIEW"}),i.jsx(te,{variant:"label",children:r.subject.name}),i.jsx(te,{variant:"caption",tone:"muted",children:"Exact camera view"}),i.jsx($,{text:e?"Hide composition guides":"Show composition guides",children:i.jsx(G,{"aria-label":e?"Hide composition guides":"Show composition guides","aria-pressed":e,size:"compact",onClick:_t,children:i.jsx(V,{icon:nt,size:"sm"})})}),s?null:i.jsx(Q,{size:"compact",variant:"primary",disabled:!r.subject.canAuthorPose,title:r.subject.poseRefusal,onClick:()=>Le(r.subject),children:"Pilot"}),i.jsx($,{text:"Exit camera view",children:i.jsx(G,{"aria-label":"Exit camera view",size:"compact",onClick:Dt,children:i.jsx(V,{icon:ot,size:"sm"})})})]})})]})}function kr({previewRef:r}){return f.useSyncExternalStore(zt,Te,Te),i.jsxs(i.Fragment,{children:[i.jsx(Pr,{previewRef:r}),i.jsx(jr,{})]})}function Tr(r){const e=r,s=e.getExtension("EXT_disjoint_timer_query_webgl2"),o=s!==null&&typeof e.createQuery=="function",c=[];let a=null,m=null;return{begin(){!o||a||(a=e.createQuery(),a&&e.beginQuery(s.TIME_ELAPSED_EXT,a))},end(){!o||!a||(e.endQuery(s.TIME_ELAPSED_EXT),c.push(a),a=null)},poll(){if(!o)return null;if(e.getParameter(s.GPU_DISJOINT_EXT)){for(const u of c.splice(0))e.deleteQuery(u);return null}for(;c.length>0;){const u=c[0];if(!e.getQueryParameter(u,e.QUERY_RESULT_AVAILABLE))break;c.shift(),m=e.getQueryParameter(u,e.QUERY_RESULT)/1e6,e.deleteQuery(u)}return m},dispose(){a&&(e.endQuery(s.TIME_ELAPSED_EXT),e.deleteQuery(a),a=null);for(const u of c.splice(0))e.deleteQuery(u)}}}const Ar=2e4,Rr=250,Mr=5e3;class Vr{#e=0;#t=0;#r=0;#n;constructor(e){this.#n=e}get pending(){return this.#e>0||this.#t>0}begin(e,s){this.#e=e+Ar,this.#t=s?e+Mr:0,this.#r=0,this.tick(e)}tick(e){if(!(!this.pending||e<this.#r)){if(this.#r=e+Rr,this.#t>0&&this.#n.seedFromGameCamera()){this.cancel();return}this.#e>0&&this.#n.frameContent()&&(this.#e=0),e>=this.#e&&(this.#e=0),e>=this.#t&&(this.#t=0)}}cancel(){this.#e=0,this.#t=0}}const Me=new WeakMap;function Or(r,e){if(!r)return e(),!0;if(Me.has(r))return!1;try{return e(),!0}catch(s){const o=s instanceof Error?s.message:String(s);return Me.set(r,o),j.warn(`The Scene view cannot draw this world with the editor's own renderer, and has stopped trying: ${o}. This world was built by a copy of three the editor did not make (a vendored bundle pins its own revision), and the editor draws it with ITS three — across a wide enough revision gap the two disagree about the renderer/material contract. The game itself is unaffected and still drawing: its own canvas is what the Game tab and ${st("screenshot")} show, and hierarchy, selection and inspection all still read the live world. It closes when the game resolves \`three\` to the host's instance — a bare, un-rewritten \`import 'three'\` in its own source.`,"ingest"),!1}}function Lr(){const r=at();r.addEventListener("server-log",s=>{try{Se(JSON.parse(s.data))}catch{}});let e=!1;return(async()=>{try{const s=await it();if(e)return;for(const o of s)Se(o)}catch{}})(),()=>{e=!0,r.close()}}const Ie="viewportPose";function Fr(){const r=ct(Ie);return r&&Array.isArray(r.position)&&r.position.length===3&&r.position.every(Number.isFinite)&&Array.isArray(r.target)&&r.target.length===3&&r.target.every(Number.isFinite)?r:null}function Ir(r,e){lt(Ie,{position:[r.position.x,r.position.y,r.position.z],target:[e.x,e.y,e.z]})}const Ve={id:"world",title:"World",lights:[{color:"#ffffff",intensity:1,direction:[-10,-20,-10],space:"world"}],ambient:{color:"#ffffff",intensity:.5},environmentIntensity:0};yt(Ve),St("world",{all:{lighting:{source:"studio",studioPreset:Ve.id,auto:{takeover:["light"],overridable:!0}}}});function zr(r,e,s){const o=document.createElement("canvas");o.setAttribute("aria-label",`${s} authoring viewport`),o.setAttribute("data-testid","editor-canvas"),o.setAttribute("aria-hidden","true"),o.tabIndex=-1,o.style.width="100%",o.style.height="100%",o.style.display="block",o.style.pointerEvents="auto",r.appendChild(o);const c=Math.max(1,e.clientWidth),a=Math.max(1,e.clientHeight),m=Math.min(window.devicePixelRatio||1,2);o.width=Math.ceil(c*m),o.height=Math.ceil(a*m);const u=Gt(new nr({canvas:o,antialias:!!Ht(void 0).antialias,powerPreference:"high-performance"}));return Kt(u,void 0,m),u.setSize(c,a),u.shadowMap.type=xr,u.info.autoReset=!1,Bt(u),{canvas:o,renderer:u,lease:null}}async function Wr(r){const e=pt(r.source,r.id);if(e)return e;let s=r.url,o=r.format??"gltf",c=r.includes;if(!s){const u=(await ft(r.source,r.id))[0];if(!u)return j.error(`No downloadable files for ${r.name}.`,"asset"),null;s=u.url,o=u.format,c=u.includes}const a={source:r.source,id:r.id,name:r.name,url:s,format:o};c&&(a.includes=c);const m=await yr(a);return m.ok&&m.path?`/${m.path}`:(j.error(`Could not download ${r.name}.`,"asset"),null)}function Nr(r){if(r.isCamera)return r;const e=Fe(r,"_camera");return e?.isCamera?e:null}function _r(r){const e=r;if(e.isPerspectiveCamera)return`${e.fov.toFixed(0)}° perspective`;const s=r;return s.isOrthographicCamera?`Orthographic · ${s.zoom.toFixed(2)}×`:r.type}function Dr(r,e){const s=r.transforms;if(!s)return{canAuthorPose:!1,poseRefusal:"This camera has no transform authoring path."};const o=s.editability?.(e,"position")??{writable:!0},c=s.editability?.(e,"rotation")??{writable:!0};return o.writable&&c.writable?{canAuthorPose:!0}:{canAuthorPose:!1,poseRefusal:o.reason??c.reason??"This camera pose is read-only."}}function Qr(r,e,s){const o=e.get(s)??null;if(!o)return null;const c=Nr(o);return c?{id:s,name:o.name||c.name||"Camera",camera:c,lens:_r(c),...Dr(r,s)}:null}function $r(r){const e=new Map;for(const[s,o]of r.objectMap){const c=Fe(o,"tags");Array.isArray(c)&&c.length>0&&e.set(s,c)}return e}function Gr(r){const{store:e,documentId:s,container:o,canvas:c,renderer:a,stats:m}=r,u=new Jt(a),E=qt(),O=new Xt,g=$t(),L=Tr(a.getContext()),ze=t=>{g.enabled&&L.begin();try{t()}finally{L.end()}},We=()=>g.enabled?L.poll():null,Ne=ut({id:s,label:"Scene viewport",kind:"scene",profiler:g}),b=new Cr,re=11184810;let B=Ce(c).background??re;b.background=new ee(B);const _e=xe(c,()=>{const t=Ce(c).background??re,l=b.background;l instanceof ee&&l.getHex()===B&&(b.background=new ee(t)),B=t});e.bindScene(b,a);const n=new lr(c,b,e,o,{renderer:a,onlineAssetResolver:Wr,onProjectionChange:ur}),De=n.bindPresentation(s,"world");e.bindScene(b,a,n.batchedRenderer,n.camera),e.setOrbitTarget(n.orbitControls.target);const H=new D,F=new D,ne=new D,oe=()=>{const t=n.renderCamera;t.getWorldPosition(H),n.cameraViewMode==="pilot"?F.copy(n.orbitControls.target):n.cameraViewMode?(t.getWorldDirection(ne),F.copy(H).add(ne.multiplyScalar(10))):F.copy(n.orbitControls.target);const l=t.fov;return{position:H,target:F,fov:typeof l=="number"?l:0}},k=Sr({scene:b,store:e,documentId:s,container:o,canvas:c,viewport:n,readVisibleCameraPose:oe});let se="",q=null,h=null,S=null,I=null;const ae=()=>{h&&fr(h,ke(a.domElement))},Qe=xe(a.domElement,ae),ie=()=>{if(!h)return;const t=x(e.shell),l=[...e.shell.selectedEntityIds].filter(d=>t.hierarchy.node(d)!==null).map(d=>Z(t,e.objectMap,d)).filter(d=>d!==null);hr(h,l);const p=h.selection.size>0;S&&(S.enabled=p,S.renderToScreen=p),I&&(I.renderToScreen=!p)};function T(){bt(e.shell),q?.(),q=null,h&&gr(a,h,S),h=null,S=null,I=null,Yt(u,a,e.scene??b,n.renderCamera,void 0,{basePixelRatio:Math.min(window.devicePixelRatio||1,2),objectMap:e.objectMap,entityTags:$r(e)}),h=pr({BlendFunction:er,KernelSize:tr,OutlineEffect:rr},a,e.scene??b,n.renderCamera,ke(a.domElement)),ae(),I=u.passes.at(-1)??null,S=new Zt(n.renderCamera,h),S.enabled=!1,u.addPass(S),ie();const t=e.adoptedImageConfig;t&&(q=Ut(or,a,t))}const ce=()=>{n.setProjection(mr().projection),e.setViewportCamera(n.freeCamera),T()},$e=dr(ce);ce();const X=t=>Qr(x(e.shell),e.objectMap,t);let v=null;const A=()=>{v&&(je(x(e.shell),v),v=null)},le=()=>{const t=U().view;t?.mode!=="pilot"||!t.subject.canAuthorPose||(v=t.subject.id,Pe(x(e.shell),v))},ue=()=>{if(!v||n.cameraViewMode!=="pilot")return;const t=X(v),l=x(e.shell),p=l.transforms;if(!t||!p)return;let d;try{d=p.get(v)}catch(w){j.error(w instanceof Error?w.message:String(w),"camera-authoring"),A();return}Ee(l,v,{position:t.camera.position.toArray(),rotation:t.camera.quaternion.toArray(),scale:d.scale}),e.shell.notifyIngestEdit()};n.orbitControls.addEventListener("start",le),n.orbitControls.addEventListener("change",ue),n.orbitControls.addEventListener("end",A);const Ge=Qt({active:()=>e.shell.playState==="stopped"&&e.shell.activeViewportTab==="edit",selected:()=>{const t=e.shell.selectedEntityId;return t?X(t):null},resolve:X,showView:(t,l)=>{A(),n.setCameraView(t.camera,l),T(),k.reportCamera()},leaveView:()=>{A(),n.clearCameraView(),T(),k.reportCamera()},alignToViewport:t=>{const l=x(e.shell),p=l.transforms;if(!p||!t.canAuthorPose)return;const d=e.objectMap.get(t.id)??null;if(!d)return;const w=n.camera.getWorldPosition(new D),C=n.camera.getWorldQuaternion(new Re),y=w.clone(),R=C.clone();if(d.parent){d.parent.updateWorldMatrix(!0,!1),d.parent.worldToLocal(y);const M=d.parent.getWorldQuaternion(new Re);R.premultiply(M.invert())}let ye;try{ye=p.get(t.id)}catch(M){j.error(M instanceof Error?M.message:String(M),"camera-authoring");return}Pe(l,t.id),Ee(l,t.id,{position:y.toArray(),rotation:R.toArray(),scale:ye.scale}),e.shell.notifyIngestEdit(),je(l,t.id)},subscribe:e.shell.subscribe});let de=null;const me=()=>{const t=ht(e.shell);t!==de&&(de=t,c.style.opacity=t?"1":"0",o.style.backgroundColor=t?"":gt.surface.raised,o.style.backgroundImage=t?"":"linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%), linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%)",o.style.backgroundPosition=t?"":"0 0, 8px 8px",o.style.backgroundSize=t?"":"16px 16px")};me();let pe=e.composerVersion;const Ue=e.shell.subscribe(()=>{me();const t=e.scene;t&&t!==n.currentScene&&n.setScene(t),n.objectMap=e.objectMap,n.syncFromStore(),e.composerVersion!==pe?(pe=e.composerVersion,T()):ie()});let z=null;const K=new Vr({seedFromGameCamera:()=>{const t=z?.()??null;return!!t&&n.seedFromGameCamera(t)},frameContent:()=>n.focusOnScene()}),fe=()=>{K.cancel(),z=null};n.orbitControls.addEventListener("start",fe);const he=()=>Ir(n.camera,n.orbitControls.target);n.orbitControls.addEventListener("end",he);const Be=e.shell.onViewportAction(t=>{switch(t.type){case"focus-entity":{const l=Z(x(e.shell),e.objectMap,t.id);l&&n.focusOn(l);break}case"focus-scene":{{const l=Fr();if(l){n.camera.position.set(...l.position),n.orbitControls.target.set(...l.target),n.orbitControls.update();break}}z=e.sceneCameraLookup,K.begin(performance.now(),z!==null);break}case"focus-selection":{const l=x(e.shell),p=[...e.shell.selectedEntityIds].map(d=>Z(l,e.objectMap,d)).filter(d=>d!==null);n.focusOnMultiple(p);break}case"snap-selection-to-floor":n.snapSelectionToFloor();break;case"set-view-preset":n.setViewPreset(t.preset);break;case"step-view":n.stepView(t.step);break;case"frame-all":n.focusOnScene();break;case"zoom-view":n.zoomStep(t.direction);break;case"set-camera-pose":n.setPose(t.position,t.target,t.fov);break}});Lr();const ge=new ResizeObserver(()=>{const t=Math.max(1,o.clientWidth),l=Math.max(1,o.clientHeight);a.setSize(t,l),u.setSize(t,l),n.resize(t,l)});ge.observe(o);let W=performance.now(),N=!0,P=!1,be=!1;function ve(t){return Or(n.currentScene,()=>{E.render(a,n.currentScene,n.renderCamera),n.renderWithInfrastructure(()=>{vr(n.currentScene,()=>O.render(n.currentScene,e.shadingMode,()=>u.render(t),br)),n.renderViewCube(a),n.renderCameraPreview(a,U().preview?.camera??null,r.cameraPreview())})})}const He=ir(c,async()=>{if(P||!cr()||!o.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})||!ve(0))return null;const t=document.createElement("canvas");return t.width=c.width,t.height=c.height,t.getContext("2d").drawImage(c,0,0),t}),Y=()=>wt(e.shell)===e.shell;function qe(t,l){if(P)return;if(l&&(W=t),!o.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})){W=t,N=!0,n.resolvePresentation();return}g.beginFrame();const p=t-W,d=p/1e3;Y()&&(m.frameTime=p,m.fps=1e3/p),W=t,k.syncMarkers(d),K.tick(t),g.beginPhase(),n.update(d),r.runFrame(d),n.batchedRenderer.update(d),g.endPhase("editor"),g.beginPhase(),a.info.reset(),ze(()=>{ve(d)}),g.reportRender({gpuMs:We(),drawCalls:a.info.render.calls,triangles:a.info.render.triangles,geometries:a.info.memory.geometries,textures:a.info.memory.textures}),g.endPhase("render"),Y()&&(m.drawCalls=a.info.render.calls,m.triangles=a.info.render.triangles),N&&be&&(N=!1,vt(s)),g.endFrame();const w=oe(),C=w.position,y=w.target;Y()&&(m.cameraPosition.x=C.x,m.cameraPosition.y=C.y,m.cameraPosition.z=C.z,m.cameraTarget.x=y.x,m.cameraTarget.y=y.y,m.cameraTarget.z=y.z);const R=`${C.x},${C.y},${C.z},${y.x},${y.y},${y.z},${w.fov}`;R!==se&&(se=R,k.reportCamera())}n.objectMap=e.objectMap,n.syncFromStore(),T();let J,_;async function Xe(t){if(P)return;r.onMountStatus("mounting"),_?.(),_=void 0,J=t,r.onRootIds(t.childAdapters().filter(d=>d.role==="world"&&d.kind==="three").map(d=>d.worldId));const l=sr("three");if(P||J!==t)return;const p=l?await l.mountWorldRootSession({store:e,composite:t,renderer:a}):()=>{};if(P||J!==t){p();return}_=p,P||r.onMountStatus("ready")}const we=ar(e.shell,Xe);return we.ready.then(()=>dt(mt(e.shell))).catch(t=>{j.error(`Editor boot failed: ${t instanceof Error?t.message:String(t)}`,"scene"),r.onMountStatus("ready")}).finally(()=>{be=!0,N=!0}),{scene:b,viewport:n,frame:qe,present:t=>wr(e,t),setHelper:(t,l)=>n.setHelper(t,l),dispose:()=>{P=!0,Ne(),He(),ge.disconnect(),Ue(),Be(),Ge(),n.orbitControls.removeEventListener("start",le),n.orbitControls.removeEventListener("change",ue),n.orbitControls.removeEventListener("end",A),n.orbitControls.removeEventListener("start",fe),n.orbitControls.removeEventListener("end",he),we.dispose(),_?.(),k.dispose(),O.dispose(),L.dispose(),$e(),Qe(),_e(),De(),h?.selection.clear(),E.dispose(),u.dispose()}}}function Ur({store:r,rootIds:e,mountStatus:s}){f.useSyncExternalStore(r.shell.subscribe,r.shell.getSnapshot);const o=f.useSyncExternalStore(kt,Tt),c=f.useSyncExternalStore(At,Rt),a=r.scene?.background,m=a!==null&&!(a?.isColor===!0&&a.getHex()===11184810),u=f.useMemo(()=>!!(r.scene&&It(r.scene,{includeBackground:!1,ignoredLayer:Ke})),[r.scene,r.shell.contentVersion]),E=!!(r.scene&&(m||u)),O=Lt({surface:"Scene",rootIds:e,phase:s==="mounting"?"loading":"ready",content:E?"present":s==="mounting"?"unknown":"empty",readiness:o,failures:c});return i.jsx(Ft,{explanation:O,testId:"scene-viewport-status"})}function Br({store:r,documentId:e,cameraPreviewRef:s,mountStatus:o,rootIds:c}){f.useSyncExternalStore(r.shell.subscribe,r.shell.getShellSnapshot??r.shell.getSnapshot),f.useSyncExternalStore(Ct,xt),f.useSyncExternalStore(Mt,Vt),f.useSyncExternalStore(Pt,Et);const a=jt(r.shell,e,"document");return i.jsxs(i.Fragment,{children:[a.surface!==null?i.jsx(Ot,{}):null,a.surface==="three"?i.jsx(kr,{previewRef:s}):null,i.jsx(Ur,{store:r,rootIds:c,mountStatus:o})]})}const ko={mountWorldRootSurface:zr,installWorldRootStage:Gr,Overlays:Br};export{ko as worldRootStageBinding};
1
+ import{a as i}from"./jsx-runtime-DPjLkJKQ.js";import{EDITOR_LAYER as Ke}from"./editor-layers-BadrAIuA.js";import{df as Oe,a7 as V,bN as Ye,aL as te,bw as $,aM as G,kJ as Je,bM as Ze,bP as et,a6 as Q,h1 as tt,hF as rt,j_ as nt,kK as ot,Z as j,K as st,ci as at,kL as Se,cx as it,kM as ct,kN as lt,kO as ut,kP as Ce,kQ as xe,aD as x,cU as dt,kR as mt,cq as pt,cv as ft,kS as Pe,kT as Ee,kU as je,kV as ht,al as gt,kW as bt,kX as ke,dI as vt,kY as wt,kZ as yt,j3 as St,iV as Ct,iW as xt,gM as Pt,gN as Et,j1 as jt,g4 as kt,g5 as Tt,g6 as At,g7 as Rt}from"./index-Dji-5Ngh.js";import{s as Mt,o as Vt}from"./object3d-document-session-registry-CatZ54tz.js";import{R as Ot}from"./RootSelectionOverlay-BETMJphO.js";import{e as Lt,S as Ft}from"./surface-state-CPApGJAw.js";import{r as f}from"./index-nmcBqr7Y.js";import{t as It}from"./surface-content-Dg9Kkazf.js";import"./index-CtzuWnCS.js";import{s as zt,d as Te,c as U,t as Wt,p as Le,v as Ae,b as Nt,e as _t,l as Dt,i as Qt}from"./camera-authoring-DYjhU5Zp.js";import{c as $t}from"./performance-profiler-CMbwGBuk.js";import{m as Gt}from"./renderer-ownership-BovSEcLv.js";import{applyWorldRendererConfig as Ut}from"./renderer-config-CaPR4dB_.js";import{getUserData as Fe}from"./user-data-CODoGZqA.js";import{detectKtx2Support as Bt}from"./loader-BTUKnX5Q.js";import{resolveRenderSettings as Ht}from"./render-settings-Cvt-UEn5.js";import{createSoftParticleDepthPass as qt}from"./soft-particle-depth-DNGwWJ8c.js";import{ViewportShadingRenderer as Xt}from"./viewport-shading-D9BMDb1N.js";import{applyRendererSettings as Kt,applySceneRenderPipeline as Yt}from"./setup-renderer-CeDRVovn.js";import{EffectComposer as Jt,EffectPass as Zt,BlendFunction as er,KernelSize as tr,OutlineEffect as rr}from"./index-DHhMOs_s.js";import{W as nr,T as or}from"./three.module-BLhyNg0e.js";import{d as sr}from"./design-time-mount-registry-DUpXCg1U.js";import{a as ar}from"./project-authoring-session-1_gSjCtF.js";import"./three-integration-B0Pips-D.js";import{registerPresentedCanvasFrame as ir}from"./canvas-preview-frames-CJtaubgV.js";import{i as cr}from"./editor-presentation-activity-CqJH4G9t.js";import{E as lr,s as ur,a as dr,t as mr,b as pr,c as fr,d as hr,r as gr,i as br}from"./three-viewport-presentation-DMl9pRzL.js";import{a as Z}from"./entity-object-DgmLa7_T.js";import{w as vr}from"./editor-shell-store-BRi8Vv17.js";import{p as wr}from"./viewport-root-presentation-CBBdlbEP.js";import{d as yr}from"./asset-editor-persistence-B40nssGV.js";import{bindStagePresenceMarkers as Sr}from"./stage-presence-markers-BJz57Ct3.js";import{el as Cr,_ as ee,fo as D,d7 as xr,dp as Re}from"./three.core-3arARmh6.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./workspace-arrangement-BrA73ntW.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./eyedropper-session-bjPXnfeX.js";import"./layered-pick-DfTP1-Cr.js";import"./root-stacking-BEd9ZvxC.js";import"./react-story-board-CV_xdGh1.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./inspect-DZInhjtn.js";import"./inference-diagnostics-BJUcoifD.js";import"./object-marks-BnvSuCTt.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./render-features-BNRGwsS3.js";import"./matcap-texture-Dm2c-VQa.js";import"./defaults-DKiBJCPN.js";import"./edit-mode-authoring-euM9VW6K.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./preview-renderer-BrYNFV1p.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./user-data-BIoZkgOJ.js";import"./model-thumbnail-DrHjLgzh.js";import"./studio-environment-D6JkSE7Q.js";import"./three-state-Jjh8RKmv.js";import"./hierarchy-marks-Bz6FH5xl.js";import"./component-instance-root-BaRyIQ5L.js";import"./three-contract-Dkt6PmWY.js";import"./viewport-door-DkrIQ3Lf.js";import"./content-bounds-CSAlBN5N.js";import"./asset-preview-DyRWJUUG.js";import"./bitmap-label-Ct4k6ehY.js";import"./index-CnQxsRjG.js";import"./standard-viewport-dressing-BVichQxX.js";import"./clip-planes-CnAI6DZn.js";import"./three-BeNC5ULQ.js";import"./model-inspection-CPrGFWhU.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./live-gesture-lock-DJbrjOqf.js";import"./scene-framing-C5vUXepb.js";import"./live-mixers-B-bwLZ7c.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./mounted-authoring-DBEo6Vnv.js";import"./collaboration-presence-C3pKLb3J.js";function Pr({previewRef:r}){const{preview:e,previewPinned:s}=U(),[o,c]=f.useState(!1),a=f.useRef(null);if(f.useEffect(()=>{if(!o)return;const u=E=>{a.current?.contains(E.target)||c(!1)};return document.addEventListener("pointerdown",u),()=>document.removeEventListener("pointerdown",u)},[o]),!e)return null;const m=e.camera.isPerspectiveCamera&&Number.isFinite(e.camera.aspect)?e.camera.aspect:16/9;return i.jsxs("div",{className:"volter-camera-preview","data-testid":"camera-preview",children:[i.jsxs(Oe,{className:"volter-camera-preview-header",gap:4,align:"center",children:[i.jsx(V,{icon:Ye,size:"sm"}),i.jsx(te,{variant:"label",truncate:!0,className:"volter-camera-preview-title",title:`${e.name} · ${e.lens}`,children:e.name}),i.jsx($,{text:s?"Unpin camera preview":"Pin camera preview",children:i.jsx(G,{"aria-label":s?"Unpin camera preview":"Pin camera preview","aria-pressed":s,size:"compact",onClick:Wt,children:i.jsx(V,{icon:Je,size:"sm"})})}),i.jsxs("div",{ref:a,className:"volter-camera-preview-menu-anchor",children:[i.jsx($,{text:"Camera actions",children:i.jsx(G,{"aria-label":"Camera actions","aria-expanded":o,size:"compact",onClick:()=>c(u=>!u),children:i.jsx(V,{icon:Ze,size:"sm"})})}),o?i.jsxs(et,{className:"volter-camera-preview-menu",children:[i.jsx(Q,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),Le(e)},children:"Pilot Camera"}),i.jsx(Q,{variant:"ghost",size:"compact",onClick:()=>{c(!1),Ae(e)},children:"View Through Camera"}),i.jsx(Q,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),Nt(e)},children:"Align Camera to Current View"})]}):null]})]}),i.jsx("div",{ref:r,className:"volter-camera-preview-image",style:{aspectRatio:String(Math.max(.5,Math.min(3,m)))},role:"img","aria-label":`Live view through ${e.name}`,onDoubleClick:()=>Ae(e)})]})}function Er(){return i.jsxs("div",{className:"volter-camera-guides","aria-hidden":"true",children:[i.jsx("div",{className:"volter-camera-guide volter-camera-guide-v1"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-v2"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-h1"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-h2"}),i.jsx("div",{className:"volter-camera-safe-frame"}),i.jsx("div",{className:"volter-camera-center-mark"})]})}function jr(){const{view:r,guidesVisible:e}=U();if(!r)return null;const s=r.mode==="pilot";return i.jsxs(i.Fragment,{children:[e?i.jsx(Er,{}):null,i.jsx(tt,{variant:"overlay",border:!0,className:"volter-camera-view-banner volter-chrome-island volter-glass-island","data-testid":"camera-view-banner",children:i.jsxs(Oe,{gap:6,align:"center",children:[i.jsx(rt,{children:s?"PILOTING":"CAMERA VIEW"}),i.jsx(te,{variant:"label",children:r.subject.name}),i.jsx(te,{variant:"caption",tone:"muted",children:"Exact camera view"}),i.jsx($,{text:e?"Hide composition guides":"Show composition guides",children:i.jsx(G,{"aria-label":e?"Hide composition guides":"Show composition guides","aria-pressed":e,size:"compact",onClick:_t,children:i.jsx(V,{icon:nt,size:"sm"})})}),s?null:i.jsx(Q,{size:"compact",variant:"primary",disabled:!r.subject.canAuthorPose,title:r.subject.poseRefusal,onClick:()=>Le(r.subject),children:"Pilot"}),i.jsx($,{text:"Exit camera view",children:i.jsx(G,{"aria-label":"Exit camera view",size:"compact",onClick:Dt,children:i.jsx(V,{icon:ot,size:"sm"})})})]})})]})}function kr({previewRef:r}){return f.useSyncExternalStore(zt,Te,Te),i.jsxs(i.Fragment,{children:[i.jsx(Pr,{previewRef:r}),i.jsx(jr,{})]})}function Tr(r){const e=r,s=e.getExtension("EXT_disjoint_timer_query_webgl2"),o=s!==null&&typeof e.createQuery=="function",c=[];let a=null,m=null;return{begin(){!o||a||(a=e.createQuery(),a&&e.beginQuery(s.TIME_ELAPSED_EXT,a))},end(){!o||!a||(e.endQuery(s.TIME_ELAPSED_EXT),c.push(a),a=null)},poll(){if(!o)return null;if(e.getParameter(s.GPU_DISJOINT_EXT)){for(const u of c.splice(0))e.deleteQuery(u);return null}for(;c.length>0;){const u=c[0];if(!e.getQueryParameter(u,e.QUERY_RESULT_AVAILABLE))break;c.shift(),m=e.getQueryParameter(u,e.QUERY_RESULT)/1e6,e.deleteQuery(u)}return m},dispose(){a&&(e.endQuery(s.TIME_ELAPSED_EXT),e.deleteQuery(a),a=null);for(const u of c.splice(0))e.deleteQuery(u)}}}const Ar=2e4,Rr=250,Mr=5e3;class Vr{#e=0;#t=0;#r=0;#n;constructor(e){this.#n=e}get pending(){return this.#e>0||this.#t>0}begin(e,s){this.#e=e+Ar,this.#t=s?e+Mr:0,this.#r=0,this.tick(e)}tick(e){if(!(!this.pending||e<this.#r)){if(this.#r=e+Rr,this.#t>0&&this.#n.seedFromGameCamera()){this.cancel();return}this.#e>0&&this.#n.frameContent()&&(this.#e=0),e>=this.#e&&(this.#e=0),e>=this.#t&&(this.#t=0)}}cancel(){this.#e=0,this.#t=0}}const Me=new WeakMap;function Or(r,e){if(!r)return e(),!0;if(Me.has(r))return!1;try{return e(),!0}catch(s){const o=s instanceof Error?s.message:String(s);return Me.set(r,o),j.warn(`The Scene view cannot draw this world with the editor's own renderer, and has stopped trying: ${o}. This world was built by a copy of three the editor did not make (a vendored bundle pins its own revision), and the editor draws it with ITS three — across a wide enough revision gap the two disagree about the renderer/material contract. The game itself is unaffected and still drawing: its own canvas is what the Game tab and ${st("screenshot")} show, and hierarchy, selection and inspection all still read the live world. It closes when the game resolves \`three\` to the host's instance — a bare, un-rewritten \`import 'three'\` in its own source.`,"ingest"),!1}}function Lr(){const r=at();r.addEventListener("server-log",s=>{try{Se(JSON.parse(s.data))}catch{}});let e=!1;return(async()=>{try{const s=await it();if(e)return;for(const o of s)Se(o)}catch{}})(),()=>{e=!0,r.close()}}const Ie="viewportPose";function Fr(){const r=ct(Ie);return r&&Array.isArray(r.position)&&r.position.length===3&&r.position.every(Number.isFinite)&&Array.isArray(r.target)&&r.target.length===3&&r.target.every(Number.isFinite)?r:null}function Ir(r,e){lt(Ie,{position:[r.position.x,r.position.y,r.position.z],target:[e.x,e.y,e.z]})}const Ve={id:"world",title:"World",lights:[{color:"#ffffff",intensity:1,direction:[-10,-20,-10],space:"world"}],ambient:{color:"#ffffff",intensity:.5},environmentIntensity:0};yt(Ve),St("world",{all:{lighting:{source:"studio",studioPreset:Ve.id,auto:{takeover:["light"],overridable:!0}}}});function zr(r,e,s){const o=document.createElement("canvas");o.setAttribute("aria-label",`${s} authoring viewport`),o.setAttribute("data-testid","editor-canvas"),o.setAttribute("aria-hidden","true"),o.tabIndex=-1,o.style.width="100%",o.style.height="100%",o.style.display="block",o.style.pointerEvents="auto",r.appendChild(o);const c=Math.max(1,e.clientWidth),a=Math.max(1,e.clientHeight),m=Math.min(window.devicePixelRatio||1,2);o.width=Math.ceil(c*m),o.height=Math.ceil(a*m);const u=Gt(new nr({canvas:o,antialias:!!Ht(void 0).antialias,powerPreference:"high-performance"}));return Kt(u,void 0,m),u.setSize(c,a),u.shadowMap.type=xr,u.info.autoReset=!1,Bt(u),{canvas:o,renderer:u,lease:null}}async function Wr(r){const e=pt(r.source,r.id);if(e)return e;let s=r.url,o=r.format??"gltf",c=r.includes;if(!s){const u=(await ft(r.source,r.id))[0];if(!u)return j.error(`No downloadable files for ${r.name}.`,"asset"),null;s=u.url,o=u.format,c=u.includes}const a={source:r.source,id:r.id,name:r.name,url:s,format:o};c&&(a.includes=c);const m=await yr(a);return m.ok&&m.path?`/${m.path}`:(j.error(`Could not download ${r.name}.`,"asset"),null)}function Nr(r){if(r.isCamera)return r;const e=Fe(r,"_camera");return e?.isCamera?e:null}function _r(r){const e=r;if(e.isPerspectiveCamera)return`${e.fov.toFixed(0)}° perspective`;const s=r;return s.isOrthographicCamera?`Orthographic · ${s.zoom.toFixed(2)}×`:r.type}function Dr(r,e){const s=r.transforms;if(!s)return{canAuthorPose:!1,poseRefusal:"This camera has no transform authoring path."};const o=s.editability?.(e,"position")??{writable:!0},c=s.editability?.(e,"rotation")??{writable:!0};return o.writable&&c.writable?{canAuthorPose:!0}:{canAuthorPose:!1,poseRefusal:o.reason??c.reason??"This camera pose is read-only."}}function Qr(r,e,s){const o=e.get(s)??null;if(!o)return null;const c=Nr(o);return c?{id:s,name:o.name||c.name||"Camera",camera:c,lens:_r(c),...Dr(r,s)}:null}function $r(r){const e=new Map;for(const[s,o]of r.objectMap){const c=Fe(o,"tags");Array.isArray(c)&&c.length>0&&e.set(s,c)}return e}function Gr(r){const{store:e,documentId:s,container:o,canvas:c,renderer:a,stats:m}=r,u=new Jt(a),E=qt(),O=new Xt,g=$t(),L=Tr(a.getContext()),ze=t=>{g.enabled&&L.begin();try{t()}finally{L.end()}},We=()=>g.enabled?L.poll():null,Ne=ut({id:s,label:"Scene viewport",kind:"scene",profiler:g}),b=new Cr,re=11184810;let B=Ce(c).background??re;b.background=new ee(B);const _e=xe(c,()=>{const t=Ce(c).background??re,l=b.background;l instanceof ee&&l.getHex()===B&&(b.background=new ee(t)),B=t});e.bindScene(b,a);const n=new lr(c,b,e,o,{renderer:a,onlineAssetResolver:Wr,onProjectionChange:ur}),De=n.bindPresentation(s,"world");e.bindScene(b,a,n.batchedRenderer,n.camera),e.setOrbitTarget(n.orbitControls.target);const H=new D,F=new D,ne=new D,oe=()=>{const t=n.renderCamera;t.getWorldPosition(H),n.cameraViewMode==="pilot"?F.copy(n.orbitControls.target):n.cameraViewMode?(t.getWorldDirection(ne),F.copy(H).add(ne.multiplyScalar(10))):F.copy(n.orbitControls.target);const l=t.fov;return{position:H,target:F,fov:typeof l=="number"?l:0}},k=Sr({scene:b,store:e,documentId:s,container:o,canvas:c,viewport:n,readVisibleCameraPose:oe});let se="",q=null,h=null,S=null,I=null;const ae=()=>{h&&fr(h,ke(a.domElement))},Qe=xe(a.domElement,ae),ie=()=>{if(!h)return;const t=x(e.shell),l=[...e.shell.selectedEntityIds].filter(d=>t.hierarchy.node(d)!==null).map(d=>Z(t,e.objectMap,d)).filter(d=>d!==null);hr(h,l);const p=h.selection.size>0;S&&(S.enabled=p,S.renderToScreen=p),I&&(I.renderToScreen=!p)};function T(){bt(e.shell),q?.(),q=null,h&&gr(a,h,S),h=null,S=null,I=null,Yt(u,a,e.scene??b,n.renderCamera,void 0,{basePixelRatio:Math.min(window.devicePixelRatio||1,2),objectMap:e.objectMap,entityTags:$r(e)}),h=pr({BlendFunction:er,KernelSize:tr,OutlineEffect:rr},a,e.scene??b,n.renderCamera,ke(a.domElement)),ae(),I=u.passes.at(-1)??null,S=new Zt(n.renderCamera,h),S.enabled=!1,u.addPass(S),ie();const t=e.adoptedImageConfig;t&&(q=Ut(or,a,t))}const ce=()=>{n.setProjection(mr().projection),e.setViewportCamera(n.freeCamera),T()},$e=dr(ce);ce();const X=t=>Qr(x(e.shell),e.objectMap,t);let v=null;const A=()=>{v&&(je(x(e.shell),v),v=null)},le=()=>{const t=U().view;t?.mode!=="pilot"||!t.subject.canAuthorPose||(v=t.subject.id,Pe(x(e.shell),v))},ue=()=>{if(!v||n.cameraViewMode!=="pilot")return;const t=X(v),l=x(e.shell),p=l.transforms;if(!t||!p)return;let d;try{d=p.get(v)}catch(w){j.error(w instanceof Error?w.message:String(w),"camera-authoring"),A();return}Ee(l,v,{position:t.camera.position.toArray(),rotation:t.camera.quaternion.toArray(),scale:d.scale}),e.shell.notifyIngestEdit()};n.orbitControls.addEventListener("start",le),n.orbitControls.addEventListener("change",ue),n.orbitControls.addEventListener("end",A);const Ge=Qt({active:()=>e.shell.playState==="stopped"&&e.shell.activeViewportTab==="edit",selected:()=>{const t=e.shell.selectedEntityId;return t?X(t):null},resolve:X,showView:(t,l)=>{A(),n.setCameraView(t.camera,l),T(),k.reportCamera()},leaveView:()=>{A(),n.clearCameraView(),T(),k.reportCamera()},alignToViewport:t=>{const l=x(e.shell),p=l.transforms;if(!p||!t.canAuthorPose)return;const d=e.objectMap.get(t.id)??null;if(!d)return;const w=n.camera.getWorldPosition(new D),C=n.camera.getWorldQuaternion(new Re),y=w.clone(),R=C.clone();if(d.parent){d.parent.updateWorldMatrix(!0,!1),d.parent.worldToLocal(y);const M=d.parent.getWorldQuaternion(new Re);R.premultiply(M.invert())}let ye;try{ye=p.get(t.id)}catch(M){j.error(M instanceof Error?M.message:String(M),"camera-authoring");return}Pe(l,t.id),Ee(l,t.id,{position:y.toArray(),rotation:R.toArray(),scale:ye.scale}),e.shell.notifyIngestEdit(),je(l,t.id)},subscribe:e.shell.subscribe});let de=null;const me=()=>{const t=ht(e.shell);t!==de&&(de=t,c.style.opacity=t?"1":"0",o.style.backgroundColor=t?"":gt.surface.raised,o.style.backgroundImage=t?"":"linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%), linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%)",o.style.backgroundPosition=t?"":"0 0, 8px 8px",o.style.backgroundSize=t?"":"16px 16px")};me();let pe=e.composerVersion;const Ue=e.shell.subscribe(()=>{me();const t=e.scene;t&&t!==n.currentScene&&n.setScene(t),n.objectMap=e.objectMap,n.syncFromStore(),e.composerVersion!==pe?(pe=e.composerVersion,T()):ie()});let z=null;const K=new Vr({seedFromGameCamera:()=>{const t=z?.()??null;return!!t&&n.seedFromGameCamera(t)},frameContent:()=>n.focusOnScene()}),fe=()=>{K.cancel(),z=null};n.orbitControls.addEventListener("start",fe);const he=()=>Ir(n.camera,n.orbitControls.target);n.orbitControls.addEventListener("end",he);const Be=e.shell.onViewportAction(t=>{switch(t.type){case"focus-entity":{const l=Z(x(e.shell),e.objectMap,t.id);l&&n.focusOn(l);break}case"focus-scene":{{const l=Fr();if(l){n.camera.position.set(...l.position),n.orbitControls.target.set(...l.target),n.orbitControls.update();break}}z=e.sceneCameraLookup,K.begin(performance.now(),z!==null);break}case"focus-selection":{const l=x(e.shell),p=[...e.shell.selectedEntityIds].map(d=>Z(l,e.objectMap,d)).filter(d=>d!==null);n.focusOnMultiple(p);break}case"snap-selection-to-floor":n.snapSelectionToFloor();break;case"set-view-preset":n.setViewPreset(t.preset);break;case"step-view":n.stepView(t.step);break;case"frame-all":n.focusOnScene();break;case"zoom-view":n.zoomStep(t.direction);break;case"set-camera-pose":n.setPose(t.position,t.target,t.fov);break}});Lr();const ge=new ResizeObserver(()=>{const t=Math.max(1,o.clientWidth),l=Math.max(1,o.clientHeight);a.setSize(t,l),u.setSize(t,l),n.resize(t,l)});ge.observe(o);let W=performance.now(),N=!0,P=!1,be=!1;function ve(t){return Or(n.currentScene,()=>{E.render(a,n.currentScene,n.renderCamera),n.renderWithInfrastructure(()=>{vr(n.currentScene,()=>O.render(n.currentScene,e.shadingMode,()=>u.render(t),br)),n.renderViewCube(a),n.renderCameraPreview(a,U().preview?.camera??null,r.cameraPreview())})})}const He=ir(c,async()=>{if(P||!cr()||!o.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})||!ve(0))return null;const t=document.createElement("canvas");return t.width=c.width,t.height=c.height,t.getContext("2d").drawImage(c,0,0),t}),Y=()=>wt(e.shell)===e.shell;function qe(t,l){if(P)return;if(l&&(W=t),!o.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})){W=t,N=!0,n.resolvePresentation();return}g.beginFrame();const p=t-W,d=p/1e3;Y()&&(m.frameTime=p,m.fps=1e3/p),W=t,k.syncMarkers(d),K.tick(t),g.beginPhase(),n.update(d),r.runFrame(d),n.batchedRenderer.update(d),g.endPhase("editor"),g.beginPhase(),a.info.reset(),ze(()=>{ve(d)}),g.reportRender({gpuMs:We(),drawCalls:a.info.render.calls,triangles:a.info.render.triangles,geometries:a.info.memory.geometries,textures:a.info.memory.textures}),g.endPhase("render"),Y()&&(m.drawCalls=a.info.render.calls,m.triangles=a.info.render.triangles),N&&be&&(N=!1,vt(s)),g.endFrame();const w=oe(),C=w.position,y=w.target;Y()&&(m.cameraPosition.x=C.x,m.cameraPosition.y=C.y,m.cameraPosition.z=C.z,m.cameraTarget.x=y.x,m.cameraTarget.y=y.y,m.cameraTarget.z=y.z);const R=`${C.x},${C.y},${C.z},${y.x},${y.y},${y.z},${w.fov}`;R!==se&&(se=R,k.reportCamera())}n.objectMap=e.objectMap,n.syncFromStore(),T();let J,_;async function Xe(t){if(P)return;r.onMountStatus("mounting"),_?.(),_=void 0,J=t,r.onRootIds(t.childAdapters().filter(d=>d.role==="world"&&d.kind==="three").map(d=>d.worldId));const l=sr("three");if(P||J!==t)return;const p=l?await l.mountWorldRootSession({store:e,composite:t,renderer:a}):()=>{};if(P||J!==t){p();return}_=p,P||r.onMountStatus("ready")}const we=ar(e.shell,Xe);return we.ready.then(()=>dt(mt(e.shell))).catch(t=>{j.error(`Editor boot failed: ${t instanceof Error?t.message:String(t)}`,"scene"),r.onMountStatus("ready")}).finally(()=>{be=!0,N=!0}),{scene:b,viewport:n,frame:qe,present:t=>wr(e,t),setHelper:(t,l)=>n.setHelper(t,l),dispose:()=>{P=!0,Ne(),He(),ge.disconnect(),Ue(),Be(),Ge(),n.orbitControls.removeEventListener("start",le),n.orbitControls.removeEventListener("change",ue),n.orbitControls.removeEventListener("end",A),n.orbitControls.removeEventListener("start",fe),n.orbitControls.removeEventListener("end",he),we.dispose(),_?.(),k.dispose(),O.dispose(),L.dispose(),$e(),Qe(),_e(),De(),h?.selection.clear(),E.dispose(),u.dispose()}}}function Ur({store:r,rootIds:e,mountStatus:s}){f.useSyncExternalStore(r.shell.subscribe,r.shell.getSnapshot);const o=f.useSyncExternalStore(kt,Tt),c=f.useSyncExternalStore(At,Rt),a=r.scene?.background,m=a!==null&&!(a?.isColor===!0&&a.getHex()===11184810),u=f.useMemo(()=>!!(r.scene&&It(r.scene,{includeBackground:!1,ignoredLayer:Ke})),[r.scene,r.shell.contentVersion]),E=!!(r.scene&&(m||u)),O=Lt({surface:"Scene",rootIds:e,phase:s==="mounting"?"loading":"ready",content:E?"present":s==="mounting"?"unknown":"empty",readiness:o,failures:c});return i.jsx(Ft,{explanation:O,testId:"scene-viewport-status"})}function Br({store:r,documentId:e,cameraPreviewRef:s,mountStatus:o,rootIds:c}){f.useSyncExternalStore(r.shell.subscribe,r.shell.getShellSnapshot??r.shell.getSnapshot),f.useSyncExternalStore(Ct,xt),f.useSyncExternalStore(Mt,Vt),f.useSyncExternalStore(Pt,Et);const a=jt(r.shell,e,"document");return i.jsxs(i.Fragment,{children:[a.surface!==null?i.jsx(Ot,{}):null,a.surface==="three"?i.jsx(kr,{previewRef:s}):null,i.jsx(Ur,{store:r,rootIds:c,mountStatus:o})]})}const ko={mountWorldRootSurface:zr,installWorldRootStage:Gr,Overlays:Br};export{ko as worldRootStageBinding};
@@ -1 +1 @@
1
- import{collectMachineAnimationMeta as V,clipNamesOf as L,isBlendTreeAnimationMeta as S,asBlendTreeDef as z}from"./xstate-animation-meta-DJjcEqI3.js";import{cW as J,p as Z,c as _,cQ as ee,l as te,dk as ne,cf as ie,cd as oe}from"./three.core-3arARmh6.js";import"./index-C_gLrIvk.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";class M extends Error{constructor(i,c){super(i),this.stateId=c,this.name="AnimationBindingError"}}function ae(n){const i=n.logic;if(i?.root)return i;const c=n.getSnapshot();if(c?.machine?.root)return c.machine;throw new M("[bindXStateAnimation] the actor exposes no state machine — only a state-machine actor carries the `meta.animation` this binder reads")}const W=n=>n.layer??"base",B=n=>n.weight??1,I=n=>n.blendMode??"override";function T(n){try{return ne.parseTrackName(n.name).nodeName??""}catch{const i=n.name.indexOf(".");return i<0?n.name:n.name.slice(0,i)}}function C(n,i,c){const o=new Set,l=[];for(const f of i){let u=!1;n.traverse(m=>{m.name===f&&(u=!0,m.traverse(d=>{d.name&&o.add(d.name)}))}),c.has(f)&&(u=!0,o.add(f)),u||l.push(f)}return{names:o,missing:l}}function se(n,i,c,o){const l=new Set(n.tracks.map(T)),f=i.include?C(c,i.include,l):void 0,u=i.exclude?C(c,i.exclude,l):void 0,m=[...f?.missing??[],...u?.missing??[]];if(m.length)throw new M(`[bindXStateAnimation] state "${o}" boneMask names unknown bones/objects: ${m.join(", ")}`,o);const d=n.tracks.filter(p=>{const w=T(p);return(!f||f.names.has(w))&&!u?.names.has(w)});if(d.length===0)throw new M(`[bindXStateAnimation] state "${o}" boneMask removes every track from clip "${n.name}"`,o);return new te(n.name,n.duration,d.map(p=>p.clone()))}function re(n){return n.reduce((i,c)=>c.weight>i.weight?c:i,n[0])}function Se(n,i,c,o={}){const l=i.getRoot(),f=o.root??(l instanceof J?l:void 0);if(!f)throw new M("[bindXStateAnimation] a THREE.Object3D `root` option is required when the mixer uses AnimationObjectGroup");const u=ae(n).root,m=V(u),d=new Map(m.map(t=>[t.stateId,t.meta]));for(const t of m)for(const e of L(t.meta))if(!c.has(e))throw new M(`[bindXStateAnimation] state "${t.stateId}" references clip "${e}", which is not present in the supplied clips map. Known clips: ${[...c.keys()].join(", ")||"(none)"}`,t.stateId);const p=new Map;function w(t,e,s){return W(e)!=="base"||!!e.boneMask||I(e)==="additive"?`${t}\0${s}`:s}for(const{stateId:t,meta:e}of m)for(const s of L(e)){const a=w(t,e,s);if(p.has(a))continue;const r=c.get(s);let h=e.boneMask?se(r,e.boneMask,f,t):r;(h!==r||a!==s)&&(h===r&&(h=r.clone()),h.name=`${r.name}@${W(e)}:${t}`),I(e)==="additive"?(Z.makeClipAdditive(h),h.blendMode=_):h.blendMode=ee,p.set(a,h)}const g=new Map;function K(t,e,s,a){let r=g.get(t);if(!r){const h=p.get(t);if(!h)throw new M(`[bindXStateAnimation] prepared clip "${t}" not found`);const v=i.clipAction(h);v.setEffectiveWeight(0),v.play(),r={action:v,clip:h},g.set(t,r)}return r.action.setLoop(e?ie:oe,1/0),r.action.clampWhenFinished=!e,r.action.timeScale=s,r.action.weight=a,r.action}function N(t){const e=o.selectParameters?o.selectParameters(t):t;return new Map(Object.entries(e??{}))}function D(t,e,s){return(S(e)?ce(z(e.blendTree),N(s)):[{clip:e.clip,weight:1}]).map(({clip:r,weight:h})=>({clip:r,weight:h,actionKey:w(t,e,r)}))}const y=new Map;let O=!1;function R(t,e,s){for(const a of t){if(a.actionKey===e)continue;const r=g.get(a.actionKey)?.action;r&&(s>0?r.fadeOut(s):r.setEffectiveWeight(0))}}function k(t,e){if(!S(t.meta))return;t.natural=D(t.stateId,t.meta,e);const s=B(t.meta);for(const a of t.natural)g.get(a.actionKey)?.action.setEffectiveWeight(a.weight*s)}function P(t,e,s){const a=W(e),r=y.get(a)??null,h=D(t,e,s),v=re(h),H=S(e)?!0:e.loop,Q=S(e)?1:e.speed,x=B(e);for(const b of h)K(b.actionKey,H,Q,x);const $=g.get(v.actionKey).action;$.reset().setEffectiveWeight(x);for(const b of h)b.actionKey!==v.actionKey&&g.get(b.actionKey).action.reset().setEffectiveWeight(0);const A=e.crossfade?.duration??0,U=e.crossfade?.warp??!1;if(!r)A>0&&$.fadeIn(A);else{R(r.natural,r.dominantActionKey,A);const b=g.get(r.dominantActionKey)?.action;b&&A>0?b.crossFadeTo($,A,U):(b?.setEffectiveWeight(0),$.setEffectiveWeight(x))}const j={layer:a,stateId:t,meta:e,natural:h,dominantActionKey:v.actionKey,crossfadeRemaining:A};y.set(a,j),S(e)&&A<=0&&k(j,s)}function q(t){return Object.keys(t.getMeta()).filter(e=>d.has(e))}function X(t){const e=new Map;for(const s of q(t)){const a=d.get(s),r=W(a),h=e.get(r);if(h)throw new M(`[bindXStateAnimation] animated states "${h}" and "${s}" are both active on layer "${r}". Give parallel regions distinct meta.animation.layer names.`,s);e.set(r,s)}for(const[s,a]of y)e.has(s)||(R(a.natural,void 0,0),y.delete(s));for(const[s,a]of e)y.get(s)?.stateId!==a&&P(a,d.get(a),t.context)}const F=n.getSnapshot();X(F);const G=n.subscribe(t=>{O||X(t)});function E(t){if(O)return;const e=t,s=n.getSnapshot().context;for(const a of y.values())a.crossfadeRemaining>0?(a.crossfadeRemaining=Math.max(0,a.crossfadeRemaining-e),a.crossfadeRemaining<=0&&k(a,s)):k(a,s);i.update(e)}const Y={tick:E,actor:n,getParameters:()=>N(n.getSnapshot().context),getActiveLayers:()=>[...y.values()].map(t=>({layer:t.layer,stateId:t.stateId,clips:t.natural.map(e=>e.clip),clipWeights:t.natural.map(e=>({clip:e.clip,weight:g.get(e.actionKey)?.action.getEffectiveWeight()??0})),weight:B(t.meta),blendMode:I(t.meta),...t.meta.boneMask?{boneMask:t.meta.boneMask}:{}})),dispose(){if(!O){O=!0,o.systems?.remove("animation",E),G.unsubscribe();for(const{action:t,clip:e}of g.values())t.stop(),i.uncacheAction(e,t.getRoot());g.clear(),y.clear()}}};return o.systems?.add("animation",E),Y}function ce(n,i){switch(n.type){case"1D":return le(n,i);case"2D":return fe(n,i);case"direct":return de(n);default:return n.children.map(c=>({clip:c.clip,weight:1/n.children.length}))}}function le(n,i){const c=Number(i.get(n.parameter)??0),o=[...n.children].sort((f,u)=>f.threshold-u.threshold),l=o.map(f=>({clip:f.clip,weight:0}));if(o.length===0)return l;if(o.length===1||c<=o[0].threshold)return l[0].weight=1,l;if(c>=o[o.length-1].threshold)return l[l.length-1].weight=1,l;for(let f=0;f<o.length-1;f++){const u=o[f],m=o[f+1];if(c>=u.threshold&&c<=m.threshold){const d=m.threshold-u.threshold,p=d>0?(c-u.threshold)/d:0;return l[f].weight=1-p,l[f+1].weight=p,l}}return l}function fe(n,i){const c=Number(i.get(n.parameter)??0),o=Number(i.get(n.parameterY??"")??0),l=n.children,f=l.map(d=>({clip:d.clip,weight:0}));let u=0;const m=[];for(const d of l){const p=c-d.threshold,w=o-(d.thresholdY??0),g=Math.sqrt(p*p+w*w),K=g<.001?1e3:1/g;m.push(K),u+=K}if(u>0)for(let d=0;d<f.length;d++)f[d].weight=m[d]/u;return f}function de(n){const i=n.children.map(o=>({clip:o.clip,weight:o.weight??0})),c=i.reduce((o,l)=>o+l.weight,0);if(c>0)for(const o of i)o.weight/=c;return i}export{M as AnimationBindingError,Se as bindXStateAnimation,ce as evaluateBlendTree,ae as machineOfXStateActor};
1
+ import{collectMachineAnimationMeta as V,clipNamesOf as L,isBlendTreeAnimationMeta as S,asBlendTreeDef as z}from"./xstate-animation-meta-DVb9it2u.js";import{cW as J,p as Z,c as _,cQ as ee,l as te,dk as ne,cf as ie,cd as oe}from"./three.core-3arARmh6.js";import"./index-Dji-5Ngh.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";class M extends Error{constructor(i,c){super(i),this.stateId=c,this.name="AnimationBindingError"}}function ae(n){const i=n.logic;if(i?.root)return i;const c=n.getSnapshot();if(c?.machine?.root)return c.machine;throw new M("[bindXStateAnimation] the actor exposes no state machine — only a state-machine actor carries the `meta.animation` this binder reads")}const W=n=>n.layer??"base",B=n=>n.weight??1,I=n=>n.blendMode??"override";function T(n){try{return ne.parseTrackName(n.name).nodeName??""}catch{const i=n.name.indexOf(".");return i<0?n.name:n.name.slice(0,i)}}function C(n,i,c){const o=new Set,l=[];for(const f of i){let u=!1;n.traverse(m=>{m.name===f&&(u=!0,m.traverse(d=>{d.name&&o.add(d.name)}))}),c.has(f)&&(u=!0,o.add(f)),u||l.push(f)}return{names:o,missing:l}}function se(n,i,c,o){const l=new Set(n.tracks.map(T)),f=i.include?C(c,i.include,l):void 0,u=i.exclude?C(c,i.exclude,l):void 0,m=[...f?.missing??[],...u?.missing??[]];if(m.length)throw new M(`[bindXStateAnimation] state "${o}" boneMask names unknown bones/objects: ${m.join(", ")}`,o);const d=n.tracks.filter(p=>{const w=T(p);return(!f||f.names.has(w))&&!u?.names.has(w)});if(d.length===0)throw new M(`[bindXStateAnimation] state "${o}" boneMask removes every track from clip "${n.name}"`,o);return new te(n.name,n.duration,d.map(p=>p.clone()))}function re(n){return n.reduce((i,c)=>c.weight>i.weight?c:i,n[0])}function Se(n,i,c,o={}){const l=i.getRoot(),f=o.root??(l instanceof J?l:void 0);if(!f)throw new M("[bindXStateAnimation] a THREE.Object3D `root` option is required when the mixer uses AnimationObjectGroup");const u=ae(n).root,m=V(u),d=new Map(m.map(t=>[t.stateId,t.meta]));for(const t of m)for(const e of L(t.meta))if(!c.has(e))throw new M(`[bindXStateAnimation] state "${t.stateId}" references clip "${e}", which is not present in the supplied clips map. Known clips: ${[...c.keys()].join(", ")||"(none)"}`,t.stateId);const p=new Map;function w(t,e,s){return W(e)!=="base"||!!e.boneMask||I(e)==="additive"?`${t}\0${s}`:s}for(const{stateId:t,meta:e}of m)for(const s of L(e)){const a=w(t,e,s);if(p.has(a))continue;const r=c.get(s);let h=e.boneMask?se(r,e.boneMask,f,t):r;(h!==r||a!==s)&&(h===r&&(h=r.clone()),h.name=`${r.name}@${W(e)}:${t}`),I(e)==="additive"?(Z.makeClipAdditive(h),h.blendMode=_):h.blendMode=ee,p.set(a,h)}const g=new Map;function K(t,e,s,a){let r=g.get(t);if(!r){const h=p.get(t);if(!h)throw new M(`[bindXStateAnimation] prepared clip "${t}" not found`);const v=i.clipAction(h);v.setEffectiveWeight(0),v.play(),r={action:v,clip:h},g.set(t,r)}return r.action.setLoop(e?ie:oe,1/0),r.action.clampWhenFinished=!e,r.action.timeScale=s,r.action.weight=a,r.action}function N(t){const e=o.selectParameters?o.selectParameters(t):t;return new Map(Object.entries(e??{}))}function D(t,e,s){return(S(e)?ce(z(e.blendTree),N(s)):[{clip:e.clip,weight:1}]).map(({clip:r,weight:h})=>({clip:r,weight:h,actionKey:w(t,e,r)}))}const y=new Map;let O=!1;function R(t,e,s){for(const a of t){if(a.actionKey===e)continue;const r=g.get(a.actionKey)?.action;r&&(s>0?r.fadeOut(s):r.setEffectiveWeight(0))}}function k(t,e){if(!S(t.meta))return;t.natural=D(t.stateId,t.meta,e);const s=B(t.meta);for(const a of t.natural)g.get(a.actionKey)?.action.setEffectiveWeight(a.weight*s)}function P(t,e,s){const a=W(e),r=y.get(a)??null,h=D(t,e,s),v=re(h),H=S(e)?!0:e.loop,Q=S(e)?1:e.speed,x=B(e);for(const b of h)K(b.actionKey,H,Q,x);const $=g.get(v.actionKey).action;$.reset().setEffectiveWeight(x);for(const b of h)b.actionKey!==v.actionKey&&g.get(b.actionKey).action.reset().setEffectiveWeight(0);const A=e.crossfade?.duration??0,U=e.crossfade?.warp??!1;if(!r)A>0&&$.fadeIn(A);else{R(r.natural,r.dominantActionKey,A);const b=g.get(r.dominantActionKey)?.action;b&&A>0?b.crossFadeTo($,A,U):(b?.setEffectiveWeight(0),$.setEffectiveWeight(x))}const j={layer:a,stateId:t,meta:e,natural:h,dominantActionKey:v.actionKey,crossfadeRemaining:A};y.set(a,j),S(e)&&A<=0&&k(j,s)}function q(t){return Object.keys(t.getMeta()).filter(e=>d.has(e))}function X(t){const e=new Map;for(const s of q(t)){const a=d.get(s),r=W(a),h=e.get(r);if(h)throw new M(`[bindXStateAnimation] animated states "${h}" and "${s}" are both active on layer "${r}". Give parallel regions distinct meta.animation.layer names.`,s);e.set(r,s)}for(const[s,a]of y)e.has(s)||(R(a.natural,void 0,0),y.delete(s));for(const[s,a]of e)y.get(s)?.stateId!==a&&P(a,d.get(a),t.context)}const F=n.getSnapshot();X(F);const G=n.subscribe(t=>{O||X(t)});function E(t){if(O)return;const e=t,s=n.getSnapshot().context;for(const a of y.values())a.crossfadeRemaining>0?(a.crossfadeRemaining=Math.max(0,a.crossfadeRemaining-e),a.crossfadeRemaining<=0&&k(a,s)):k(a,s);i.update(e)}const Y={tick:E,actor:n,getParameters:()=>N(n.getSnapshot().context),getActiveLayers:()=>[...y.values()].map(t=>({layer:t.layer,stateId:t.stateId,clips:t.natural.map(e=>e.clip),clipWeights:t.natural.map(e=>({clip:e.clip,weight:g.get(e.actionKey)?.action.getEffectiveWeight()??0})),weight:B(t.meta),blendMode:I(t.meta),...t.meta.boneMask?{boneMask:t.meta.boneMask}:{}})),dispose(){if(!O){O=!0,o.systems?.remove("animation",E),G.unsubscribe();for(const{action:t,clip:e}of g.values())t.stop(),i.uncacheAction(e,t.getRoot());g.clear(),y.clear()}}};return o.systems?.add("animation",E),Y}function ce(n,i){switch(n.type){case"1D":return le(n,i);case"2D":return fe(n,i);case"direct":return de(n);default:return n.children.map(c=>({clip:c.clip,weight:1/n.children.length}))}}function le(n,i){const c=Number(i.get(n.parameter)??0),o=[...n.children].sort((f,u)=>f.threshold-u.threshold),l=o.map(f=>({clip:f.clip,weight:0}));if(o.length===0)return l;if(o.length===1||c<=o[0].threshold)return l[0].weight=1,l;if(c>=o[o.length-1].threshold)return l[l.length-1].weight=1,l;for(let f=0;f<o.length-1;f++){const u=o[f],m=o[f+1];if(c>=u.threshold&&c<=m.threshold){const d=m.threshold-u.threshold,p=d>0?(c-u.threshold)/d:0;return l[f].weight=1-p,l[f+1].weight=p,l}}return l}function fe(n,i){const c=Number(i.get(n.parameter)??0),o=Number(i.get(n.parameterY??"")??0),l=n.children,f=l.map(d=>({clip:d.clip,weight:0}));let u=0;const m=[];for(const d of l){const p=c-d.threshold,w=o-(d.thresholdY??0),g=Math.sqrt(p*p+w*w),K=g<.001?1e3:1/g;m.push(K),u+=K}if(u>0)for(let d=0;d<f.length;d++)f[d].weight=m[d]/u;return f}function de(n){const i=n.children.map(o=>({clip:o.clip,weight:o.weight??0})),c=i.reduce((o,l)=>o+l.weight,0);if(c>0)for(const o of i)o.weight/=c;return i}export{M as AnimationBindingError,Se as bindXStateAnimation,ce as evaluateBlendTree,ae as machineOfXStateActor};
@@ -1 +1 @@
1
- import{dZ as b,d_ as u,u as o,v as c,w as n,x as l,c6 as r,c5 as m,c4 as f}from"./index-C_gLrIvk.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const d=o({clip:n().min(1).describe("Animation clip name this child plays"),threshold:r().describe("1D/2D blend position on the primary parameter axis"),thresholdY:r().optional().describe("2D blend position on the secondary parameter axis (2D blend trees only)"),weight:r().min(0).optional().describe('Explicit weight for "direct" blend trees (ignored by 1D/2D)')}).strict(),y=o({type:l("1D").describe("Interpolates linearly between sorted children by threshold"),parameter:n().min(1).describe("Context/selector value driving the blend"),children:c(d).min(2,"1D blend tree needs at least 2 children to interpolate between")}).strict(),v=o({type:l("2D").describe("Inverse-distance-weights children by (parameter, parameterY) position"),parameter:n().min(1).describe("Primary axis context/selector value"),parameterY:n().min(1).describe("Secondary axis context/selector value"),children:c(d.extend({thresholdY:r()})).min(1,"2D blend tree needs at least 1 child")}).strict(),g=o({type:l("direct").describe("Each child has an explicit weight, normalized to sum to 1"),parameter:n().default(""),children:c(d.extend({weight:r().min(0)})).min(1,"direct blend tree needs at least 1 child")}).strict(),A=b("type",[y,v,g]);function Y(e){return e}const p=o({duration:r().min(0).default(0).describe("Seconds to blend from the previously active clip into this state on entry, applied via native `AnimationAction.crossFadeTo`/`fadeIn` (E2). 0 = instant activation, no fade."),warp:m().default(!1).describe("Passed through to AnimationAction.crossFadeTo's `warp` param — linearly warps timeScale across the two clips during the blend so differing clip lengths line up. Default false.")}).strict().describe("Blend-in/out/crossfade timing for entering this state"),x=o({include:c(n().min(1)).min(1).optional().describe("Bone/object names whose complete descendant subtrees are retained"),exclude:c(n().min(1)).min(1).optional().describe("Bone/object names whose complete descendant subtrees are removed")}).strict().refine(e=>!!(e.include?.length||e.exclude?.length),{message:"boneMask needs at least one include or exclude bone name"}).describe("Filters animation tracks by named Object3D/Bone subtrees"),h={layer:n().min(1).optional().describe("Composition layer name; omitted means the single base layer"),weight:r().min(0).max(1).optional().describe("Layer weight multiplier from 0 to 1; defaults to 1"),blendMode:f(["override","additive"]).optional().describe("Native Three normal/override or additive action blending; defaults to override"),boneMask:x.optional().describe("Optional include/exclude filter applied to every clip track in this state")},w=o({clip:n().min(1).describe("Single clip to play while this XState state is active"),loop:m().default(!0).describe("Loop the clip (THREE.LoopRepeat) vs play once (THREE.LoopOnce, clamped on last frame)"),speed:r().positive().default(1).describe("Playback speed multiplier (AnimationAction.timeScale)"),crossfade:p.optional(),...h}).strict(),S=o({blendTree:A.describe("Multiple clips blended by a live context/selector-driven parameter"),crossfade:p.optional(),...h}).strict(),D=u([w,S]);function M(e){return"clip"in e}function $(e){return"blendTree"in e}class T extends Error{constructor(a,i,t){super(a),this.stateId=i,this.issues=t,this.name="AnimationMetaValidationError"}}function B(e,a){const i=D.safeParse(a);if(!i.success){const t=i.error.issues.map(s=>`${s.path.length?s.path.join("."):"(root)"}: ${s.message}`).join("; ");throw new T(`[xstate-animation] invalid meta.animation for state "${e}": ${t}`,e,i.error.issues)}return i.data}function R(e){const a=[],i=t=>{t.meta&&"animation"in t.meta&&t.meta.animation!==void 0&&a.push({stateId:t.id,meta:B(t.id,t.meta.animation)});for(const s of Object.values(t.states??{}))i(s)};return i(e),a}function H(e){return M(e)?[e.clip]:e.blendTree.children.map(a=>a.clip)}export{A as AnimationBlendTreeSchema,T as AnimationMetaValidationError,D as StateAnimationMetaSchema,Y as asBlendTreeDef,H as clipNamesOf,R as collectMachineAnimationMeta,$ as isBlendTreeAnimationMeta,M as isClipAnimationMeta,B as parseStateAnimationMeta};
1
+ import{dZ as b,d_ as u,u as o,v as c,w as n,x as l,c6 as r,c5 as m,c4 as f}from"./index-Dji-5Ngh.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const d=o({clip:n().min(1).describe("Animation clip name this child plays"),threshold:r().describe("1D/2D blend position on the primary parameter axis"),thresholdY:r().optional().describe("2D blend position on the secondary parameter axis (2D blend trees only)"),weight:r().min(0).optional().describe('Explicit weight for "direct" blend trees (ignored by 1D/2D)')}).strict(),y=o({type:l("1D").describe("Interpolates linearly between sorted children by threshold"),parameter:n().min(1).describe("Context/selector value driving the blend"),children:c(d).min(2,"1D blend tree needs at least 2 children to interpolate between")}).strict(),v=o({type:l("2D").describe("Inverse-distance-weights children by (parameter, parameterY) position"),parameter:n().min(1).describe("Primary axis context/selector value"),parameterY:n().min(1).describe("Secondary axis context/selector value"),children:c(d.extend({thresholdY:r()})).min(1,"2D blend tree needs at least 1 child")}).strict(),g=o({type:l("direct").describe("Each child has an explicit weight, normalized to sum to 1"),parameter:n().default(""),children:c(d.extend({weight:r().min(0)})).min(1,"direct blend tree needs at least 1 child")}).strict(),A=b("type",[y,v,g]);function Y(e){return e}const p=o({duration:r().min(0).default(0).describe("Seconds to blend from the previously active clip into this state on entry, applied via native `AnimationAction.crossFadeTo`/`fadeIn` (E2). 0 = instant activation, no fade."),warp:m().default(!1).describe("Passed through to AnimationAction.crossFadeTo's `warp` param — linearly warps timeScale across the two clips during the blend so differing clip lengths line up. Default false.")}).strict().describe("Blend-in/out/crossfade timing for entering this state"),x=o({include:c(n().min(1)).min(1).optional().describe("Bone/object names whose complete descendant subtrees are retained"),exclude:c(n().min(1)).min(1).optional().describe("Bone/object names whose complete descendant subtrees are removed")}).strict().refine(e=>!!(e.include?.length||e.exclude?.length),{message:"boneMask needs at least one include or exclude bone name"}).describe("Filters animation tracks by named Object3D/Bone subtrees"),h={layer:n().min(1).optional().describe("Composition layer name; omitted means the single base layer"),weight:r().min(0).max(1).optional().describe("Layer weight multiplier from 0 to 1; defaults to 1"),blendMode:f(["override","additive"]).optional().describe("Native Three normal/override or additive action blending; defaults to override"),boneMask:x.optional().describe("Optional include/exclude filter applied to every clip track in this state")},w=o({clip:n().min(1).describe("Single clip to play while this XState state is active"),loop:m().default(!0).describe("Loop the clip (THREE.LoopRepeat) vs play once (THREE.LoopOnce, clamped on last frame)"),speed:r().positive().default(1).describe("Playback speed multiplier (AnimationAction.timeScale)"),crossfade:p.optional(),...h}).strict(),S=o({blendTree:A.describe("Multiple clips blended by a live context/selector-driven parameter"),crossfade:p.optional(),...h}).strict(),D=u([w,S]);function M(e){return"clip"in e}function $(e){return"blendTree"in e}class T extends Error{constructor(a,i,t){super(a),this.stateId=i,this.issues=t,this.name="AnimationMetaValidationError"}}function B(e,a){const i=D.safeParse(a);if(!i.success){const t=i.error.issues.map(s=>`${s.path.length?s.path.join("."):"(root)"}: ${s.message}`).join("; ");throw new T(`[xstate-animation] invalid meta.animation for state "${e}": ${t}`,e,i.error.issues)}return i.data}function R(e){const a=[],i=t=>{t.meta&&"animation"in t.meta&&t.meta.animation!==void 0&&a.push({stateId:t.id,meta:B(t.id,t.meta.animation)});for(const s of Object.values(t.states??{}))i(s)};return i(e),a}function H(e){return M(e)?[e.clip]:e.blendTree.children.map(a=>a.clip)}export{A as AnimationBlendTreeSchema,T as AnimationMetaValidationError,D as StateAnimationMetaSchema,Y as asBlendTreeDef,H as clipNamesOf,R as collectMachineAnimationMeta,$ as isBlendTreeAnimationMeta,M as isClipAnimationMeta,B as parseStateAnimationMeta};
package/dist-node/cli.js CHANGED
@@ -2317,7 +2317,7 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
2317
2317
  var package_default = {
2318
2318
  name: "@volter/game-editor",
2319
2319
  author: "Volter AI, Inc.",
2320
- version: "0.5.97",
2320
+ version: "0.5.99",
2321
2321
  publishConfig: {
2322
2322
  access: "public"
2323
2323
  },
@@ -2366,22 +2366,22 @@ var package_default = {
2366
2366
  }
2367
2367
  },
2368
2368
  dependencies: {
2369
- "@volter/editor-core": "0.5.97",
2370
- "@volter/editor-game": "0.5.97",
2371
- "@volter/editor-react": "0.5.97",
2372
- "@volter/editor-threejs": "0.5.97",
2373
- "@volter/editor-xstate": "0.5.97",
2374
- "@volter/editor-blender": "0.1.37",
2375
- "@volter/dawproject": "0.5.97",
2376
- "@volter/editor-dawproject": "0.5.97",
2377
- "@volter/blender-engine": "0.1.35",
2378
- "@volter/editor-project": "0.5.97",
2379
- "@volter/editor-sdk": "0.5.97",
2380
- "@volter/editor-live": "0.5.97",
2381
- "@volter/game-live": "0.5.97",
2369
+ "@volter/editor-core": "0.5.99",
2370
+ "@volter/editor-game": "0.5.99",
2371
+ "@volter/editor-react": "0.5.99",
2372
+ "@volter/editor-threejs": "0.5.99",
2373
+ "@volter/editor-xstate": "0.5.99",
2374
+ "@volter/editor-blender": "0.1.39",
2375
+ "@volter/dawproject": "0.5.99",
2376
+ "@volter/editor-dawproject": "0.5.99",
2377
+ "@volter/blender-engine": "0.1.37",
2378
+ "@volter/editor-project": "0.5.99",
2379
+ "@volter/editor-sdk": "0.5.99",
2380
+ "@volter/editor-live": "0.5.99",
2381
+ "@volter/game-live": "0.5.99",
2382
2382
  "@modelcontextprotocol/sdk": "1.30.0",
2383
- "@volter/game-runtime": "0.5.97",
2384
- "@volter/threejs-runtime": "0.5.97",
2383
+ "@volter/game-runtime": "0.5.99",
2384
+ "@volter/threejs-runtime": "0.5.99",
2385
2385
  undici: "7.29.1",
2386
2386
  typescript: "5.9.3",
2387
2387
  "@colyseus/schema": "^4.0.14",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@volter/game-editor",
3
3
  "author": "Volter AI, Inc.",
4
- "version": "0.5.97",
4
+ "version": "0.5.99",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -50,22 +50,22 @@
50
50
  }
51
51
  },
52
52
  "dependencies": {
53
- "@volter/editor-core": "0.5.97",
54
- "@volter/editor-game": "0.5.97",
55
- "@volter/editor-react": "0.5.97",
56
- "@volter/editor-threejs": "0.5.97",
57
- "@volter/editor-xstate": "0.5.97",
58
- "@volter/editor-blender": "0.1.37",
59
- "@volter/dawproject": "0.5.97",
60
- "@volter/editor-dawproject": "0.5.97",
61
- "@volter/blender-engine": "0.1.35",
62
- "@volter/editor-project": "0.5.97",
63
- "@volter/editor-sdk": "0.5.97",
64
- "@volter/editor-live": "0.5.97",
65
- "@volter/game-live": "0.5.97",
53
+ "@volter/editor-core": "0.5.99",
54
+ "@volter/editor-game": "0.5.99",
55
+ "@volter/editor-react": "0.5.99",
56
+ "@volter/editor-threejs": "0.5.99",
57
+ "@volter/editor-xstate": "0.5.99",
58
+ "@volter/editor-blender": "0.1.39",
59
+ "@volter/dawproject": "0.5.99",
60
+ "@volter/editor-dawproject": "0.5.99",
61
+ "@volter/blender-engine": "0.1.37",
62
+ "@volter/editor-project": "0.5.99",
63
+ "@volter/editor-sdk": "0.5.99",
64
+ "@volter/editor-live": "0.5.99",
65
+ "@volter/game-live": "0.5.99",
66
66
  "@modelcontextprotocol/sdk": "1.30.0",
67
- "@volter/game-runtime": "0.5.97",
68
- "@volter/threejs-runtime": "0.5.97",
67
+ "@volter/game-runtime": "0.5.99",
68
+ "@volter/threejs-runtime": "0.5.99",
69
69
  "undici": "7.29.1",
70
70
  "typescript": "5.9.3",
71
71
  "@colyseus/schema": "^4.0.14",
@@ -1 +0,0 @@
1
- import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import{Object3DSnapshotDocument as m}from"./EntityModelDocument-C0hTFUFP.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./editor-shell-store-C9QYXDRr.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./Pass-D1MRT672.js";import"./editor-layers-TtgYYi_s.js";import"./workspace-arrangement-BTINexHg.js";import"./index-C_gLrIvk.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./user-data-BS92dOsI.js";import"./entity-object-CTha2dPd.js";import"./three-contract-Dkt6PmWY.js";import"./live-mixers-B-bwLZ7c.js";import"./asset-preview-Clo8SaV6.js";import"./renderer-ownership-BovSEcLv.js";import"./hierarchy-marks-DMWVKCJa.js";import"./studio-environment-CjfDi6Xs.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./bitmap-label-Ct4k6ehY.js";import"./StageHost-nRksZrQ1.js";import"./three-state-CR9QYeCl.js";import"./standard-viewport-dressing-CtIrUH9V.js";import"./content-bounds-C6Nb8vJK.js";import"./preview-renderer-BrYNFV1p.js";import"./live-gesture-lock-DJbrjOqf.js";import"./three-integration-BXyJZy9c.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./layered-pick-BJfI6PwU.js";import"./root-stacking-BEd9ZvxC.js";import"./model-thumbnail-zIoZC1z2.js";import"./object3d-document-session-registry-Bt76KtzL.js";import"./component-instance-root-4o-HMx39.js";import"./viewport-door-CN3_JGfc.js";import"./model-inspection-CwGBMSvf.js";import"./three-viewport-presentation-CbOERA2i.js";import"./clip-planes-CnAI6DZn.js";import"./three-BWA441zQ.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./scene-framing-DeMlXIgX.js";import"./source-object3d-authoring-adapter-Ci6EfWDG.js";import"./three-projection-core-BAHKdNuj.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./transport-strip-CJFVXvxI.js";import"./viewport-surface-status-tLC5uoTr.js";function ut({previewKey:o,object:r,displayName:i,fill:p=!1}){return t.jsx("div",{"data-testid":"inspector-object-preview",style:p?{position:"absolute",inset:0,overflow:"hidden"}:{width:"100%",height:220,minHeight:220,borderBottom:"1px solid var(--volter-structural-divider)",overflow:"hidden",position:"relative"},children:t.jsx(m,{documentId:`inspector-preview:${o}`,source:r,displayName:i,active:!0,chromeless:!0})})}export{ut as InspectorObjectPreview};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/StageHost-nRksZrQ1.js","assets/index-C_gLrIvk.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/three-state-CR9QYeCl.js","assets/editor-shell-store-C9QYXDRr.js","assets/output-pass-HurwNl0G.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/Pass-D1MRT672.js","assets/editor-layers-TtgYYi_s.js","assets/workspace-arrangement-BTINexHg.js","assets/user-data-BS92dOsI.js","assets/entity-object-CTha2dPd.js","assets/three-contract-Dkt6PmWY.js","assets/standard-viewport-dressing-CtIrUH9V.js","assets/content-bounds-C6Nb8vJK.js","assets/hierarchy-marks-DMWVKCJa.js","assets/environment-Dg-YaLsA.js","assets/RoomEnvironment-BkknvS_I.js","assets/EXRLoader-CITMBvGd.js","assets/HDRLoader-BTGuGhVo.js","assets/preview-renderer-BrYNFV1p.js","assets/renderer-ownership-BovSEcLv.js","assets/live-mixers-B-bwLZ7c.js","assets/live-gesture-lock-DJbrjOqf.js","assets/three-integration-BXyJZy9c.js","assets/host-hierarchy-objects-BV3WqU2w.js","assets/layered-pick-BJfI6PwU.js","assets/root-stacking-BEd9ZvxC.js","assets/model-thumbnail-zIoZC1z2.js","assets/studio-environment-CjfDi6Xs.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/object3d-document-session-registry-Bt76KtzL.js","assets/component-instance-root-4o-HMx39.js","assets/viewport-door-CN3_JGfc.js","assets/asset-preview-Clo8SaV6.js","assets/bitmap-label-Ct4k6ehY.js","assets/model-inspection-CwGBMSvf.js","assets/three-viewport-presentation-CbOERA2i.js","assets/clip-planes-CnAI6DZn.js","assets/three-BWA441zQ.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/OrbitControls-B13MKuwC.js","assets/LineSegments2-DN9pUfWA.js","assets/three.quarks.esm-C_HmSKXo.js","assets/scene-framing-DeMlXIgX.js","assets/source-object3d-authoring-adapter-Ci6EfWDG.js","assets/three-projection-core-BAHKdNuj.js","assets/editor-presentation-activity-CqJH4G9t.js","assets/transport-strip-CJFVXvxI.js","assets/viewport-surface-status-tLC5uoTr.js"])))=>i.map(i=>d[i]);
2
- import{ak as r,_ as a}from"./index-C_gLrIvk.js";import{a as o}from"./jsx-runtime-DPjLkJKQ.js";import{r as n}from"./index-nmcBqr7Y.js";import{V as c,O as u}from"./viewport-surface-status-tLC5uoTr.js";const s=n.lazy(async()=>({default:(await a(()=>import("./StageHost-nRksZrQ1.js").then(e=>e.S),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60]))).Object3DDocumentViewport}));function l(t){return i(t.documentId,t.chromeless),o.jsx(n.Suspense,{fallback:o.jsx(c,{testId:"object3d-document-loading",children:u}),children:o.jsx(s,{...t})})}function i(t,e=!1){n.useEffect(()=>{if(!e)return r(t)},[t,e])}export{l as O};
@@ -1 +0,0 @@
1
- import{T as i,r as m}from"./index-C_gLrIvk.js";import{e as p}from"./game-network-BoP-iKCC.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-Dvzh4rev.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B0UtXvgn.js";import"./contract-system-adapters-CJXxexZO.js";import"./game-contract-seams-BhjR536D.js";import"./seeded-random-CilWrQ9p.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-DBGzvsy3.js";import"./capability-coverage-NcL3fdGj.js";import"./edit-mode-authoring-8eqT4Ah6.js";import"./json-history-resource-BReCXsj2.js";import"./binding-resolver-DCeGebRY.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-CyH5yTHN.js";import"./canvas-entry-runtime-BLPKpqpp.js";import"./three-ingest-runtime-B09tYa9n.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-ZOiV0Jtk.js";import"./ingest-source-persistence-Cxv-xcnT.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CV9AuiRe.js";import"./mounted-authoring-DI-dfAS5.js";import"./entity-object-CTha2dPd.js";import"./user-data-BS92dOsI.js";import"./workspace-arrangement-BTINexHg.js";import"./three-contract-Dkt6PmWY.js";import"./three-BWA441zQ.js";import"./editor-layers-TtgYYi_s.js";import"./component-instance-root-4o-HMx39.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-cWKLa6xe.js";import"./source-persistence-backend-CpNTlQ6r.js";import"./three-projection-core-BAHKdNuj.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-B0M0RByC.js";import"./deferred-ingest-play-BpPZrTLz.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-C9fTSu6u.js";import"./board-guides-B_1dNBxX.js";import"./relative-import-specifier-Dg5O2O1R.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-DybkUNPY.js";import"./inference-diagnostics-CSTitz6Y.js";import"./writer-tw6EcuVO.js";import"./three-state-CR9QYeCl.js";import"./editor-shell-store-C9QYXDRr.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-CN3_JGfc.js";import"./game-surface-defaults-D8S4cRxi.js";const Ut="workspace.service";function e(o){p().catch(t=>{m().console.error(`${o}: ${t instanceof Error?t.message:String(t)}`,"play")})}function bt(){let o,t=!1;const r=i(()=>{t||new URLSearchParams(window.location.search).get("play")==="1"&&(t=!0,o=window.setTimeout(()=>e("Could not enter requested Play mode"),0))});return()=>{o!==void 0&&window.clearTimeout(o),r()}}export{Ut as point,bt as start};
@@ -1,7 +0,0 @@
1
- import{r as x,li as pt}from"./index-C_gLrIvk.js";import{a as wt}from"./preview-renderer-BrYNFV1p.js";import{v as gt}from"./output-pass-HurwNl0G.js";import{_ as mt,fx as Ne,bi as De,aC as yt,d7 as bt,ej as Mt,cP as ge,el as vt,cm as xt,cl as Pe,fo as ie,ex as kt,d5 as Et,d9 as St,cJ as Bt,e as Ue}from"./three.core-3arARmh6.js";import{f as Ct}from"./clip-planes-CnAI6DZn.js";import{a as At}from"./content-bounds-C6Nb8vJK.js";class jt{#r;#s;#i=[];#n=new Map;#E=0;#u=null;#a=null;#d=!1;#b=!1;#M=t=>{!this.#b&&this.#n.size===0||(t.preventDefault(),t.returnValue="")};#h=new Map;#w=new Map;#f=null;#g=0;#v=0;#x=0;#l=null;#k=null;#m=null;constructor(t){this.#s=t,this.#r=new Worker(new URL("/assets/worker-DLnISz0i.js",import.meta.url),{type:"module",name:"blender"}),globalThis.addEventListener?.("beforeunload",this.#M),this.#r.onmessage=n=>void this.#S(n.data),this.#r.onerror=n=>{const r=n.error,a=n.filename?` at ${n.filename}:${n.lineno}:${n.colno}`:"",o=r?.stack??r?.message??n.message,s=this.#i.length>0?`
2
- Blender's last output:
3
- ${this.#i.join(`
4
- `)}`:"",i=new Error(`Blender worker failed: ${o||"the worker script did not load"}${a}${s}`);console.error(i.message);for(const c of[...this.#n.keys()])this.#p(c);for(const c of this.#n.values())c.reject(i);this.#n.clear()}}#o=null;#c=null;get project(){return this.#o}get document(){return this.#c}start(t,n){return this.#o!==null&&this.#o!==t?Promise.reject(new Error(`The Blender session is bound to ${this.#o}, not ${t}`)):n!==void 0&&this.#c!==null&&this.#c!==n?Promise.reject(new Error(`Blender resource conflict: the session holds ${this.#c}; cannot open ${n}`)):(this.#o=t,this.#c??=n??"models/model.blend",this.#u??=this.#e({op:"start",project:t,...n===void 0?{}:{document:n}}),this.#u)}#t(){return this.#o===null?Promise.reject(new Error("The Blender session has not been started with a project (blender-start)")):this.start(this.#o)}async execute(t,n=!0,r="Blender Python"){return await this.#t(),await this.#e({op:"execute",code:t,history:n,label:r})}async historyGesture(t){await this.#t(),await this.#e({op:t})}async historyStep(t,n){return await this.#t(),(await this.#e({op:"history-step",token:t,direction:n})).moved}async sceneInfo(){return await this.#t(),await this.#e({op:"scene-info"})}async objectInfo(t){return await this.#t(),await this.#e({op:"object-info",name:t})}async rna(t,n){return await this.#t(),await this.#e({op:"rna",path:t,...n===void 0?{}:{names:n}})}async rnaContext(t,n){return await this.#t(),await this.#e({op:"rna-context",...t===void 0?{}:{object:t},...n===void 0?{}:{collection:n}})}async rnaSet(t,n,r,a,o=!0){return await this.#t(),await this.#e({op:"rna-set",history:o,path:t,property:n,value:r,...a===void 0?{}:{index:a}})}async outliner(t){return await this.#t(),await this.#e({op:"outliner",...t===void 0?{}:{selected:t}})}async nodeTree(t){return await this.#t(),await this.#e({op:"node-tree",...t?.path===void 0?{}:{path:t.path},...t?.material===void 0?{}:{material:t.material}})}async uvLayout(t){return await this.#t(),await this.#e({op:"uv-layout",...t?.object===void 0?{}:{object:t.object},...t?.uvLayer===void 0?{}:{uvLayer:t.uvLayer}})}async rig(t){return await this.#t(),await this.#e({op:"rig",...t?.object===void 0?{}:{object:t.object}})}async actionClip(t){return await this.#t(),await this.#e({op:"action-clip",...t?.object===void 0?{}:{object:t.object},...t?.bake===void 0?{}:{bake:t.bake}})}async outlinerSet(t,n,r){return await this.#t(),await this.#e({op:"outliner-set",path:t,column:n,value:r})}async present(){await this.#t(),await this.#e({op:"present"})}async screenshotView(t){return await this.#t(),await this.#e({op:"screenshot-view",maxSize:t})}async readFile(t){return await this.#t(),await this.#e({op:"read-file",path:t})}async writeFile(t,n){await this.#t(),await this.#e({op:"write-file",path:t,bytes:n})}async listFiles(t){return await this.#t(),await this.#e({op:"list-files",path:t})}get presented(){return this.#k}stop(){return this.#d?Promise.resolve():this.#a?this.#a:(this.#a=(async()=>{(this.#u?await this.#u.then(()=>!0,()=>!1):!1)&&await this.#e({op:"flush-document"},!0),this.terminate()})().catch(t=>{throw this.#a=null,t}),this.#a)}terminate(){if(this.#d)return;this.#d=!0,globalThis.removeEventListener?.("beforeunload",this.#M);const t=this.#y("terminating worker");try{this.#r.terminate()}finally{t()}const n=new Error("The Blender session was terminated");for(const r of[...this.#n.keys()])this.#p(r);for(const r of this.#n.values())r.reject(n);this.#n.clear()}metrics(t=performance.now()){let n=null,r=this.#g,a=this.#v,o=this.#x;for(const s of this.#h.values()){const i=t-s;(n===null||i>n)&&(n=i),i>r&&(r=i),i>=5e3&&(a+=1),i>=3e4&&(o+=1)}return{inFlightMs:n===null?null:Math.round(n),lastCallMs:this.#f===null?null:Math.round(this.#f),maxCallMs:this.#f===null&&n===null?null:Math.round(r),callsOver5s:a,callsOver30s:o,lastCallWindow:this.#l,wasmMemoryMB:this.#m===null?null:Math.round(this.#m/1048576)}}#p(t){this.#w.get(t)?.(),this.#w.delete(t);const n=this.#h.get(t);if(n===void 0)return;this.#h.delete(t);const r=performance.now()-n;this.#f=r,r>this.#g&&(this.#g=r),r>=5e3&&(this.#v+=1),r>=3e4&&(this.#x+=1),this.#l!==null&&this.#l.start===n&&(this.#l={start:n,end:n+r})}#e(t,n=!1){if(this.#d||this.#a&&!n)return Promise.reject(new Error("The Blender session is stopping or terminated"));const r=++this.#E;return new Promise((a,o)=>{this.#n.set(r,{resolve:a,reject:o});const s=performance.now();this.#h.set(r,s),this.#l={start:s,end:null},this.#w.set(r,this.#y(`waiting for worker ${t.op}`));try{this.#r.postMessage({...t,id:r})}catch(i){this.#n.delete(r),this.#p(r),o(i instanceof Error?i:new Error(String(i)))}})}#y(t){try{const n=this.#s.work?.(t);return()=>{try{n?.()}catch{}}}catch{return()=>{}}}async#S(t){if("op"in t){if(t.op==="document-dirty"){this.#b=t.dirty;return}if(t.op==="history"){this.#s.history?.(t.entries);return}if(t.op==="log"){this.#i.push(t.text),this.#i.length>12&&this.#i.shift(),this.#s.log?.(t.level,t.text);return}if(t.op==="memory"){this.#m=t.bytes;return}const r=t.frame;typeof r?.session=="string"&&typeof r.revision=="number"&&(this.#k={session:r.session,revision:r.revision});const a=this.#y("presenting worker frame");try{const o=await this.#s.present(t.frame,t.description,t.capture);this.#r.postMessage({op:"present-result",id:t.id,...o?.capture===void 0?{}:{capture:o.capture},...o!=null&&"held"in o?{held:o.held}:{}})}catch(o){this.#r.postMessage({op:"present-result",id:t.id,error:o instanceof Error?o.message:String(o)})}finally{a()}return}const n=this.#n.get(t.id);n&&(this.#n.delete(t.id),this.#p(t.id),"error"in t?n.reject(new Error(t.error)):n.resolve(t.result))}}const It="/assets/agx-base-srgb-BjWZJgrZ.lut",Tt="/assets/agx-look-medium-high-contrast-D5F_ob1L.lut",_t="/assets/agx-look-punchy-dxsnycNs.lut",Lt="/assets/filmic-srgb-Ct35FIH6.lut",T=new Float64Array(12),Ve=[0,0,0],O=new Float64Array(3),q=new Float64Array(3),_=new Int8Array([1,0,0,1,1,0,0,1,2,1,0,0,1,0,1,0,2,1,0,0,1,1,0,1,2,0,1,0,0,1,0,1,1,2,1,0,0,1,0,0,1,1,1,2,0,0,1,0,1,1,0,1,0,2]);function Ft(e,t,n){return e>t?t>n?0:e>n?1:2:n>t?3:n>e?4:5}function Xe(e,t,n,r,a){const o=t*t,s=Math.min(1,Math.max(0,n))*(t-1),i=Math.min(1,Math.max(0,r))*(t-1),c=Math.min(1,Math.max(0,a))*(t-1),h=Math.min(Math.floor(s),t-2),l=Math.min(Math.floor(i),t-2),d=Math.min(Math.floor(c),t-2),b=s-h,M=i-l,B=c-d,w=(u,p,C,A)=>{const y=(h+p+(l+C)*t+(d+A)*o)*3;T[u]=e[y]/65535,T[u+1]=e[y+1]/65535,T[u+2]=e[y+2]/65535};w(0,0,0,0),w(9,1,1,1),O[0]=b,O[1]=M,O[2]=B;const g=Ft(b,M,B)*9;w(3,_[g],_[g+1],_[g+2]),w(6,_[g+3],_[g+4],_[g+5]);const E=O[_[g+6]],f=O[_[g+7]],m=O[_[g+8]];for(let u=0;u<3;u++){const p=T[u];Ve[u]=p+E*(T[3+u]-p)+f*(T[6+u]-T[3+u])+m*(T[9+u]-T[6+u])}return Ve}function H(e){const t=e&32768?-1:1,n=e>>10&31,r=e&1023;return n===0?t*2**-24*r:n===31?r?Number.NaN:t*Number.POSITIVE_INFINITY:t*2**(n-15)*(1+r/1024)}function Ae(e,t,n,r){const a=new Uint8ClampedArray(t*4);for(let o=0;o<t;o++){const s=o*4,i=H(e[s+3]),c=i===0?n:n/i;q[0]=H(e[s])*c,q[1]=H(e[s+1])*c,q[2]=H(e[s+2])*c;const h=r(q);a[s]=Math.round(h[0]*255),a[s+1]=Math.round(h[1]*255),a[s+2]=Math.round(h[2]*255),a[s+3]=Math.round(Math.min(1,Math.max(0,i))*255)}return a}function $t(e){return new URL(Object.assign({"./agx-base-srgb.lut":It,"./agx-look-medium-high-contrast.lut":Tt,"./agx-look-punchy.lut":_t,"./filmic-srgb.lut":Lt})[`./${e.replace(/\.lut$/,"")}.lut`],import.meta.url)}const Rt=57,F=-12.47393,Ze=12.5260688117,Ot=[[.4123908,.3575843,.1804808],[.212639,.7151687,.0721923],[.0193308,.1191948,.9505322]],Nt=[[1.5250528,-.3159135,-.1226583],[-.5091526,1.3333274,.1382844],[.0957153,.0508974,.7879558]];function We(e,t,n){const r=t[0],a=t[1],o=t[2];n[0]=e[0][0]*r+e[0][1]*a+e[0][2]*o,n[1]=e[1][0]*r+e[1][1]*a+e[1][2]*o,n[2]=e[2][0]*r+e[2][1]*a+e[2][2]*o}const X=new Float64Array(3),Ge=new Float64Array(3),Z=[0,0,0];function le(e){const t=Math.min(1,Math.max(0,e));return t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055}function Ke(e,t,n,r){return Xe(e,Rt,t,n,r)}function Dt(e,t){We(Ot,t,Ge),We(Nt,Ge,X);const n=Ze-F,r=Ke(e,(Math.log2(Math.max(X[0],1e-10))-F)/n,(Math.log2(Math.max(X[1],1e-10))-F)/n,(Math.log2(Math.max(X[2],1e-10))-F)/n);return Z[0]=le(Math.max(0,r[0])**2.4),Z[1]=le(Math.max(0,r[1])**2.4),Z[2]=le(Math.max(0,r[2])**2.4),Z}const Pt={"AgX - Medium High Contrast":"agx-look-medium-high-contrast.lut","AgX - Punchy":"agx-look-punchy.lut"};function Ut(e,t){const n=Ze-F;return Ke(e,(Math.log2(Math.max(t[0],1e-10))-F)/n,(Math.log2(Math.max(t[1],1e-10))-F)/n,(Math.log2(Math.max(t[2],1e-10))-F)/n)}function Vt(e,t,n,r={}){const a=r.exposure??1,o=r.composedLook===!0?Ut:Dt;return Ae(t,n,a,s=>o(e,s))}const Ye=33,me=Ye**3*3,ye=4096,ce=-12.473931188,ue=25;function de(e,t){const n=Math.min(1,Math.max(0,t))*(ye-1),r=Math.min(Math.floor(n),ye-2),a=n-r;return((1-a)*e[me+r]+a*e[me+r+1])/65535}const K=[0,0,0];function Wt(e,t){const n=Xe(e,Ye,(Math.log2(Math.max(t[0],1e-10))-ce)/ue,(Math.log2(Math.max(t[1],1e-10))-ce)/ue,(Math.log2(Math.max(t[2],1e-10))-ce)/ue);return K[0]=de(e,n[0]/.66),K[1]=de(e,n[1]/.66),K[2]=de(e,n[2]/.66),K}function Gt(e,t,n,r){if(e.length!==me+ye)throw new Error("Invalid Blender Filmic display table");return Ae(t,n,r,a=>Wt(e,a))}const W=2.4,$=.055,Je=$/(W-1),zt=1/(W/(1+$)*((Je+$)/(1+$))**(W-1)),qt=((Je+$)/(1+$))**W;function he(e){return e>0?e<qt?e*zt:(1+$)*e**(1/W)-$:0}const Y=[0,0,0];function Ht(e){return Y[0]=he(e[0]),Y[1]=he(e[1]),Y[2]=he(e[2]),Y}function Xt(e,t,n){return Ae(e,t,n,Ht)}function Qe(e,t,n,r){if(!Number.isFinite(n.width)||!Number.isFinite(n.height)||n.width<1||n.height<1)throw new Error("Scene capture requires finite positive dimensions");const a=Math.min(2048,Math.round(n.width)),o=Math.min(2048,Math.round(n.height)),s=r?1:2,i=a*s,c=o*s,h=wt(),l=h.renderer,d={target:l.getRenderTarget(),toneMapping:l.toneMapping,exposure:l.toneMappingExposure,colorSpace:l.outputColorSpace,shadows:l.shadowMap.enabled,shadowType:l.shadowMap.type,clearColor:l.getClearColor(new mt),clearAlpha:l.getClearAlpha(),background:e.background};let b,M,B=!1;try{b=new Ne(i,c,{type:De}),n.effect&&(b.depthTexture=new yt(i,c)),l.shadowMap.enabled=!0,l.shadowMap.type=bt,l.outputColorSpace=Mt,l.toneMapping=n.toneMapping??ge,l.toneMappingExposure=n.exposure??1,l.setClearColor(0,n.transparent?0:1),n.transparent&&(e.background=null),l.setRenderTarget(b),l.clear(),l.render(e,t);const w=n.effect?.render(l,b,e,t)??b;if(w.texture.type!==De||w.width!==i||w.height!==c)throw new Error("Scene capture effect must return a same-size half-float target");if(r){const y=new Uint16Array(i*c*4);return l.readRenderTargetPixels(w,0,0,i,c,y),B=!0,{pixels:y,width:a,height:o}}M=new Ne(i,c),gt(n.transparent===!0).render(l,M,w,0,!1);const g=new Uint8Array(i*c*4);l.readRenderTargetPixels(M,0,0,i,c,g);const E=document.createElement("canvas");E.width=i,E.height=c;const f=E.getContext("2d");if(!f)throw new Error("Scene capture could not create an image canvas");const m=f.createImageData(i,c),u=i*4;for(let y=0;y<c;y++)m.data.set(g.subarray((c-1-y)*u,(c-y)*u),y*u);f.putImageData(m,0,0);const p=document.createElement("canvas");p.width=a,p.height=o;const C=p.getContext("2d");if(!C)throw new Error("Scene capture could not create an output canvas");C.drawImage(E,0,0,a,o);const A=p.toDataURL("image/png");return B=!0,A}finally{e.background=d.background,l.setRenderTarget(d.target),l.toneMapping=d.toneMapping,l.toneMappingExposure=d.exposure,l.outputColorSpace=d.colorSpace,l.shadowMap.enabled=d.shadows,l.shadowMap.type=d.shadowType,l.setClearColor(d.clearColor,d.clearAlpha),M?.dispose(),b?.dispose(),h.release({discard:!B})}}function Zt(e,t,n){return Qe(e,t,n,!0)}function Kt(e,t,n){return Qe(e,t,n,!1)}const Yt=e=>typeof e=="object"&&e!==null&&typeof e.subscribeFrames=="function"&&typeof e.objectForBlenderName=="function"&&typeof e.blenderObjectName=="function"&&typeof e.blenderSelection=="function"&&typeof e.setStageMode=="function";function je(){const e=x().documents.context(at());return Yt(e)?e:null}function Jt(){return je()?.blenderSelection()??{selected:[],active:null}}const Qt={tree:null,byId:new Map,parentOf:new Map,error:null,loading:!1};let be=Qt,et=0;const Me=new Set;let P=null,re=null,Ie="",U=null;function en(e){const t=new Map,n=new Map,r=(a,o)=>{t.set(a.id,a),n.set(a.id,o);for(const s of a.children)r(s,a.id)};for(const a of e?.rows??[])r(a,null);return{byId:t,parentOf:n}}function Q(e){be={...be,...e},et+=1;for(const t of[...Me])t()}function Bn(e){return Me.add(e),()=>{Me.delete(e)}}function Cn(){return et}function An(){return be}function Te(e){U!==e&&(U=e,setTimeout(()=>{U===e&&(U=null,tt(e===""?[]:e.split("\0")))},0))}let fe=0,ve=Promise.resolve();function tt(e){const t=tn(e);return ve=t,t}async function tn(e){const t=e.join("\0"),n=++fe;re=t,Ie=t,Q({loading:!0});try{const r=await fn(e);if(n!==fe)return;je()?.setStageMode(r?.mode??null),Q({tree:r,...en(r),loading:!1,error:null})}catch(r){if(n!==fe)return;Q({loading:!1,error:nt(r)})}}function nn(){re=null,Te(Ie);for(const e of[...xe])e()}const xe=new Set;function jn(e){return _e(),xe.add(e),()=>{xe.delete(e)}}let J=!1,pe=null;function _e(){const e=je();if(P!==null&&pe===e)return;P!==null&&(P(),P=null,pe=null);const t=e;if(t!==null){P=t.subscribeFrames(nn),pe=t;return}J||(J=!0,x().documents.waitForContext(at()).then(()=>{J=!1,_e()}).catch(()=>{J=!1}))}function In(e){if(!I())return;_e();const t=[...e].sort().join("\0");re!==t&&Te(t)}async function rn(e){if(!I())return;U=null;let t=tt([...e].sort());for(;;){if(await t,ve===t)return;t=ve}}async function Tn(e,t,n){try{return await it(e,t,n),re=null,Te(Ie),!0}catch(r){return Q({error:nt(r)}),!1}}function nt(e){return e instanceof Error?e.message:String(e)}const on={transform:{cx:0,cy:0,zoom:1},looked:null,refusal:null,size:{w:0,h:0},framedAt:0,drawn:[]};let ke=on,Le=0;const ne=new Set;let rt=0;function we(){return ke}function _n(){return Le}function Ln(e){return ne.add(e),()=>{ne.delete(e)}}function V(e){ke={...ke,...e},Le+=1;for(const t of[...ne])t()}function an(){rt+=1,Le+=1;for(const e of[...ne])e()}function Fn(){return rt}function N(e){V({refusal:e})}const ze=new Map;function sn(e){let t=ze.get(e);return t||(t=fetch($t(e)).then(async n=>{if(!n.ok)throw new Error(`Blender display table ${e}: ${n.status} ${n.statusText}`);return new Uint16Array(await n.arrayBuffer())}),ze.set(e,t)),t}function ln(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return new Uint16Array(n.buffer,n.byteOffset,n.byteLength>>1)}async function ot(e,t){const n=t.look??"None",r=t.toneMapping==="filmic",a=t.toneMapping==="none";if(!a&&t.toneMapping!=="agx"&&!r)throw new Error("Blender's Khronos PBR Neutral view transform has no scene-linear implementation in the browser, so it cannot resolve a composited or scene-referred frame (implemented: Standard, AgX, Filmic)");const o=a?null:r?"filmic-srgb.lut":n==="None"?"agx-base-srgb.lut":Pt[n];if(o===void 0)throw new Error(`Blender display transform has no table for look ${n}`);const s=o?await sn(o):null,i=t.linearInput,c=i?{pixels:ln(i.base64),width:i.width,height:i.height}:e;if(!c)throw new Error("Blender display transform requires a linear capture");const{pixels:h,width:l,height:d}=c,b=a?Xt(h,l*d,t.exposure):r?Gt(s,h,l*d,t.exposure):Vt(s,h,l*d,{exposure:t.exposure,composedLook:n!=="None"}),M=document.createElement("canvas");M.width=l,M.height=d;const B=M.getContext("2d");if(!B)throw new Error("Blender display transform could not create its image canvas");const w=B.createImageData(l,d),g=l*4;for(let m=0;m<d;m++){const u=(d-1-m)*g;w.data.set(b.subarray(u,u+g),m*g)}B.putImageData(w,0,0);const E=M.toDataURL("image/png"),f={base64:E.slice(E.indexOf(",")+1),mimeType:"image/png"};if(t.linear===!0){const m=new Uint8Array(h.buffer,h.byteOffset,h.byteLength);let u="";for(let p=0;p<m.length;p+=32768)u+=String.fromCharCode(...m.subarray(p,p+32768));f.linearBase64=btoa(u),f.linearWidth=l,f.linearHeight=d}return f}async function cn(e,t,n,r,a=()=>{}){const o={none:ge,agx:Ue,neutral:Bt,filmic:ge};await n.prepare(t),a();const s={effect:n.effect,width:r.width,height:r.height,transparent:r.transparent===!0,toneMapping:o[r.toneMapping]??Ue,exposure:r.exposure},i=r.toneMapping==="agx"||r.toneMapping==="filmic"||r.linear===!0?await ot(Zt(e,t,s),r):null;if(a(),i)return i;const c=Kt(e,t,s);if(!c)throw new Error("Blender render could not capture its image");return{base64:c.slice(c.indexOf(",")+1),mimeType:"image/png"}}const un="document:blender:runtime";let j=null,qe=0;function $n(e){const t=++qe;return j=e,D(),()=>{qe===t&&(j=null,D())}}function Ee(){const e=v?.document,t=x().documents.activeId(),n=t?.startsWith("document:model:")?t.slice(15):j?.blend;return!n||!e||n===e?null:`Blender is editing ${e}; ${n} is not open. Return to ${e} before editing.`}function L(){return j?.documentId??un}function at(){return L()}async function Rn(e,t){const n=x();if(!n.session.open())throw new Error("Opening a model requires an open project session.");const r=n.projectLocalState.projectRootPath();if(r===null)throw new Error("Opening a model requires a project path.");if(j!==e||n.documents.activeId()!==e.documentId)return!1;const a=k(),o=a.start(r,e.blend);return t(),await o,j!==e?!1:(await a.present(),j===e)}function I(){return v?.project!=null&&Ee()===null}let st=0;const Se=new Set;function On(){return st}function Nn(e){return Se.add(e),()=>{Se.delete(e)}}function D(){st+=1;for(const e of[...Se])e()}async function Dn(e,t){return I()?k().rna(e,t):null}async function Pn(e,t){return I()?k().rnaContext(e,t):null}async function dn(e,t,n,r,a=!0){if(!I())return null;const o=await k().rnaSet(e,t,n,r,a);return D(),o}async function hn(e,t=!0,n="Blender Python"){const r=await k().execute(e,t,n);D();const a=/^Error executing code:/.exec(r);return{text:r,executed:a===null,result:a===null?r.replace(/^Code executed successfully: ?/,""):"",error:a===null?null:r.replace(/^Error executing code: ?/,"")}}function Un(){k().historyGesture("history-begin").catch(e=>x().console.error(`Could not begin Blender undo gesture: ${String(e)}`,"blender-history"))}async function Vn(){await k().historyGesture("history-end")}async function fn(e){return I()?k().outliner(e):null}async function Wn(e){return I()?k().nodeTree(e):null}async function Gn(e){return I()?k().uvLayout(e):null}async function zn(e){return I()?k().rig(e):null}async function qn(e){return I()?k().actionClip(e):null}async function it(e,t,n){if(!I())return null;const r=await k().outlinerSet(e,t,n);return D(),r}const pn={view:"blender-node-view",title:"Node Editor",verbs:[["state",void 0],["look",void 0],["view-all","Node Editor: Frame All"],["zoom",void 0],["pan",void 0],["move",void 0],["link",void 0],["set-value",void 0],["use-nodes",void 0],["collapse-panel",void 0]].map(([e,t])=>({id:e,...t?{title:t}:{},run:n=>lt({...n,action:e})}))};function lt(e){const t=typeof e.action=="string"?e.action:"state";switch(t){case"state":break;case"look":V({looked:typeof e.node=="string"?e.node:null,refusal:null});break;case"view-all":an(),V({refusal:null});break;case"zoom":{const n=typeof e.zoom=="number"?e.zoom:1;V({transform:{...we().transform,zoom:n},refusal:null});break}case"pan":{const n=we().transform;V({transform:{...n,cx:typeof e.cx=="number"?e.cx:n.cx,cy:typeof e.cy=="number"?e.cy:n.cy},refusal:null});break}case"move":N(`Moving "${String(e.node??"a node")}" writes Node.location — editing parity is not the program.`);break;case"link":N("Dragging between sockets would make a link — editing parity is not the program.");break;case"set-value":N(`Changing "${String(e.socket??"a socket")}" writes the socket's default_value — editing parity is not the program.`);break;case"use-nodes":N("Use Nodes writes Material.use_nodes — editing parity is not the program.");break;case"collapse-panel":N(`Collapsing "${String(e.panel??"a panel")}" writes the panel's is_collapsed — editing parity is not the program.`);break;default:N(`blender-node-view: no action "${t}" — state, look, view-all, zoom, pan, and the refusals move, link, set-value, use-nodes, collapse-panel.`)}return we()}let v=null;const ee=new Set;function ct(){ee.size&&x().history.invalidate([...ee]),ee.clear()}let Be=null,He=!1;function te(e){try{const t=x().session.beginWork(`Blender: ${e}`);return()=>{try{t()}catch{}}}catch{return()=>{}}}function Ce(){const e=te("invalidating history and releasing runtime");try{ct(),Be?.abort(),Be=null,v?.terminate(),v=null,ut=null}finally{e()}}function wn(){He||(He=!0,x().session.onBeforeClose(async()=>{await v?.stop(),Ce()}),x().session.onEnded(Ce))}let ut=null;const gn=e=>typeof e=="object"&&e!==null&&typeof e.applyFrame=="function"&&typeof e.snapshot=="function"&&typeof e.captureSnapshot=="function"&&typeof e.recordPresentation=="function"&&typeof e.recordPhotograph=="function";async function mn(){const{documents:e}=x(),t=Date.now()+15e3;let n=L();for(;;){n=L();const r=await e.waitForContext(n,Math.max(0,Math.min(250,t-Date.now())));if(gn(r))return r;if(Date.now()>=t)break}throw new Error(`The Blender Model document is not open, or the open one is not a Model this engine can present to (it must answer applyFrame, captureSnapshot, recordPresentation and recordPhotograph): nothing published a presentable view as ${n} within 15 s (bound model: ${j?.documentId??"none"}). Open the Model document first (\`volter blender-mcp\` opens it before its first call).`)}function k(){const e=Ee();if(e)throw new Error(e);if(v!==null)return v;wn();const t=new AbortController;Be=t;let n=!1;v=new jt({work:te,history:a=>{const o=v;if(!o)throw new Error("Blender history arrived before its runtime");for(const s of a){if("reset"in s){ct();continue}if(!s.resource)throw new Error("A Blender edit has no document resource");ee.add(s.resource);const i=async c=>{if(v!==o)throw new Error("This Blender history belongs to a closed worker");const h=await o.historyStep(s.id,c);return D(),await rn(Jt().selected),h};x().history.record({id:s.id,label:s.label,resources:[s.resource],document:L(),undo:()=>i("undo"),redo:()=>i("redo")})}},present:async(a,o,s)=>{const i=Ee();if(i)throw new Error(i);if(j===null){if(s?.render)throw new Error("Rendering a Blender frame needs the Model document open; nothing is presenting.");return{}}const c=L(),h=te("waiting for Model presenter");let l;try{l=await mn()}finally{h()}if(t.signal.throwIfAborted(),L()!==c)throw new Error("Blender document changed before its frame could be presented");const d=te("applying frame to Model"),b=(()=>{try{return l.applyFrame(a)}finally{d()}})(),M=typeof b=="object"&&b!==null&&"held"in b,B=M?b.held:null,w=A=>({...A===void 0?{}:{capture:A},...M?{held:B}:{}});if(l.recordPresentation(o),!s||(ut=s,!s.render))return w(void 0);const g=l.snapshot(),E=()=>{if(t.signal.throwIfAborted(),L()!==c||l.snapshot()!==g)throw new Error("Blender capture document or source revision changed before completion")};if(s.render.linearInput){const A=await ot(null,s.render);return E(),w(A)}const{render:f,position:m,target:u,up:p}=s;if(!m||!u||!p)throw new Error("A Blender render capture must carry the scene camera position, target and up");if(n)throw new Error("A Blender render capture is already in progress");const C=l.captureSnapshot();n=!0,t.signal.addEventListener("abort",C.dispose,{once:!0});try{E();const A=new vt;A.add(C.root),A.updateMatrixWorld(!0);const y=C.root.matrixWorld,oe=new xt().copy(y).invert(),dt=new Pe().setFromMatrix4(y),ht=new Pe().setFromMatrix4(oe),ae=new ie(m[0],m[1],m[2]).applyMatrix4(y),Fe=new ie(u[0],u[1],u[2]).applyMatrix4(y),$e=new ie(p[0],p[1],p[2]).applyMatrix3(dt),se=Math.min(2048,Math.round(f.width))/Math.min(2048,Math.round(f.height)),Re=At(C.root).getBoundingSphere(new kt),G=Ct(ae.distanceTo(Re.center),Re.radius);let R;if(f.orthographic){const z=f.fov/2;R=new Et(-z*se,z*se,z,-z,G.near,G.far)}else R=new St(f.fov,se,G.near,G.far);R.up.copy($e),R.position.copy(ae),R.lookAt(Fe),R.updateMatrixWorld(!0);const Oe={position:ae.clone().applyMatrix4(oe).toArray(),target:Fe.clone().applyMatrix4(oe).toArray(),up:$e.clone().applyMatrix3(ht).toArray()};l.recordPhotograph({sent:{position:m,target:u,up:p},photographed:Oe,render:{width:f.width,height:f.height,fov:f.fov,orthographic:f.orthographic}});const ft=await cn(A,R,C,f,E);return w({...ft,camera:Oe})}finally{n=!1,t.signal.removeEventListener("abort",C.dispose),C.dispose()}},log:(a,o)=>console[a](`[blender] ${o}`)});const r=v;return x().session.reportWorkerCallMeter("Blender",()=>r.metrics()),v}const yn="models/model.blend",S=(e,t)=>{const n=e[t];if(typeof n!="string")throw new Error(`${String(e.type)} requires a string "${t}"`);return n};async function bn(e){const t=x().projectLocalState.projectRootPath();if(t===null)return{};let n;try{n=await e.execute(`import bpy
5
- print(bpy.data.filepath)
6
- `,!1)}catch{return{}}if(/^Error executing code:/m.test(n))return{};const r=n.replace(/^Code executed successfully:/,"").split(`
7
- `).map(o=>o.trim()).filter(o=>o.startsWith("/")).pop()??"";if(r==="")return{};const a=t.endsWith("/")?t:`${t}/`;return r.startsWith(a)?{document:r.slice(a.length)}:{}}async function Hn(e){const t=x();if(e.type==="blender-status")return{ok:!0,data:{started:v?.project!=null,document:t.documents.context(L())!==void 0}};if(!t.session.open())return{ok:!1,error:`${e.type} needs an open project session; this editor page has none.`};try{const n=e.type==="blender-start"?S(e,"project"):null;let r=typeof e.document=="string"?e.document:void 0;if((e.type==="blender-stop"||e.type==="blender-start"&&e.fresh===!0)&&(await v?.stop(),Ce(),e.type==="blender-stop"))return{ok:!0,data:{stopped:!0}};if(e.type==="blender-start"&&!t.documents.context(L())){const o=await t.project.documentTable(),s=o.entries.filter(l=>l.kind==="model"),i=r!==void 0?s.find(l=>l.source?.path===r):s.find(l=>l.id===(j?.entryId??o.default))??(s.length===1?s[0]:void 0);if(!i)return{ok:!1,error:r!==void 0?`No declared Model document names ${r}.`:`Choose a Model document before starting Blender. Available: ${s.map(l=>l.id).join(", ")||"(none)"}.`};const c=i.id;if(r=i.source?.path,!await t.workspace.open({kind:"document",id:c}))return{ok:!1,error:`blender-start could not open the Blender Model document ${c}: nothing in this editor opens that document (the Model document ships with @volter/editor-blender).`}}const a=k();switch(e.type){case"blender-start":{const o=r!==void 0?r:j?.blend??yn;return{ok:!0,data:{...await a.start(n,o)}}}case"blender-execute":return{ok:!0,data:{result:(await hn(S(e,"code"))).text}};case"blender-scene-info":return{ok:!0,data:{result:await a.sceneInfo()}};case"blender-object-info":return{ok:!0,data:{result:await a.objectInfo(S(e,"name"))}};case"blender-rna":{const o=typeof e.names=="number"?e.names:void 0;return{ok:!0,data:{result:await a.rna(S(e,"path"),o)}}}case"blender-rna-context":{const o=typeof e.object=="string"?e.object:void 0,s=typeof e.collection=="string"?e.collection:void 0;return{ok:!0,data:{result:await a.rnaContext(o,s)}}}case"blender-rna-set":{const o=typeof e.index=="number"?e.index:void 0;return{ok:!0,data:{result:await dn(S(e,"path"),S(e,"property"),e.value,o)}}}case"blender-outliner":{const o=Array.isArray(e.selected)?e.selected.filter(s=>typeof s=="string"):void 0;return{ok:!0,data:{result:await a.outliner(o)}}}case"blender-node-tree":return{ok:!0,data:{result:await a.nodeTree({...typeof e.path=="string"?{path:e.path}:{},...typeof e.material=="string"?{material:e.material}:{}})}};case"blender-uv-layout":return{ok:!0,data:{result:await a.uvLayout({...typeof e.object=="string"?{object:e.object}:{},...typeof e.uvLayer=="string"?{uvLayer:e.uvLayer}:{}})}};case"blender-rig":return{ok:!0,data:{result:await a.rig({...typeof e.object=="string"?{object:e.object}:{}})}};case"blender-action-clip":return{ok:!0,data:{result:await a.actionClip({...typeof e.object=="string"?{object:e.object}:{},...typeof e.bake=="boolean"?{bake:e.bake}:{}})}};case"blender-node-view":{const o=typeof e.action=="string"?e.action:"state";return{ok:!0,data:{result:pn.verbs.some(i=>i.id===o)?pt("blender-node-view",o,e):lt(e)}}}case"blender-outliner-set":return{ok:!0,data:{result:await it(S(e,"path"),S(e,"column"),e.value!==!1)}};case"blender-screenshot-view":{const o=typeof e.maxSize=="number"?e.maxSize:1e3,s={kind:"document",id:j?.entryId??"blender:runtime"};return{ok:!0,data:{...await a.screenshotView(o),document:s}}}case"blender-read-file":{const o=await a.readFile(S(e,"path")),s=S(e,"transferId"),i=await fetch(`/__editor/blender-file?id=${encodeURIComponent(s)}`,{method:"POST",headers:{"content-type":"application/octet-stream"},body:new Blob([o])});return i.ok?{ok:!0,data:{bytes:o.length}}:{ok:!1,error:`Transfer ${s} was refused: ${i.status}`}}case"blender-write-file":{const o=atob(S(e,"base64")),s=Uint8Array.from(o,i=>i.charCodeAt(0));return await a.writeFile(S(e,"path"),s),{ok:!0,data:{written:s.length}}}case"blender-list-files":{const o=await a.listFiles(S(e,"path")),s=a.presented;return{ok:!0,data:{entries:o,...s?{session:s.session,revision:s.revision}:{},...await bn(a)}}}}return{ok:!1,error:`Unknown Blender command ${e.type}`}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}export{Un as A,Tn as B,In as C,hn as D,je as E,$n as F,Rn as G,pn as N,Ln as a,On as b,V as c,we as d,Wn as e,Fn as f,qn as g,Hn as h,zn as i,Gn as j,An as k,at as l,I as m,_n as n,D as o,Pn as p,Dn as q,N as r,Nn as s,dn as t,jn as u,Bn as v,rn as w,Jt as x,Cn as y,Vn as z};
@@ -1,13 +0,0 @@
1
- import{a as d}from"./jsx-runtime-DPjLkJKQ.js";import{j3 as Le,bt as xe,r as D,bv as Me,fN as W,bB as R,bC as U,hR as Ie,bA as Te,j4 as Pe,bK as Be,bn as $e,bq as De,j5 as Ve,j6 as be,j7 as Ge,j8 as We,j9 as He,ja as pe,bp as ze,bs as Ue}from"./index-C_gLrIvk.js";import{c as Ke,a as Y}from"./blender-runtime-skin-B1bWYvLx.js";import{r as h}from"./index-nmcBqr7Y.js";import{u as qe,v as J,k as X,w as Q,x as Ye,y as oe,t as fe,z as Je,A as Xe,B as me,C as Qe,D as te,E as Ze,F as et,G as tt}from"./blender-runtime-host-D_JU34fx.js";import{r as rt}from"./index-CtzuWnCS.js";import{a as nt}from"./three-contract-Dkt6PmWY.js";import{b as H,o as re}from"./viewport-door-CN3_JGfc.js";import{s as ot,a as at}from"./object3d-document-session-registry-Bt76KtzL.js";import{d9 as lt}from"./three.core-3arARmh6.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./LineSegments2-DN9pUfWA.js";import"./three.module-BLhyNg0e.js";import"./preview-renderer-BrYNFV1p.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./renderer-ownership-BovSEcLv.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./clip-planes-CnAI6DZn.js";import"./content-bounds-C6Nb8vJK.js";import"./hierarchy-marks-DMWVKCJa.js";import"./workspace-arrangement-BTINexHg.js";function Ce(e){const a=Number.isFinite(e)&&e>0?e:50;return{degrees:2*Math.atan(72/(2*a))*180/Math.PI,axis:"larger"}}Le("model",{camera:{fov:Ce(50),opening:[.8187,.4458,.3617]},interaction:{bootTool:"select",boxSelect:"touch"},all:{lighting:{source:"studio",studioPreset:xe.id,auto:null,tone:{mapper:"none",exposure:1}},xray:{enabled:!1,alpha:.5}},modes:{wireframe:{xray:{enabled:!0,alpha:0}},preview:{lighting:{source:"preview",auto:null,preview:{sceneLights:!1,sun:{enabled:!1},environment:{enabled:!0,image:"blender:forest",energy:1,rotation:0}},tone:{mapper:"agx",exposure:1}},backdrop:{source:"fill"}},rendered:{lighting:{source:"scene",auto:null,tone:{mapper:"agx",exposure:1}},backdrop:{source:"scene"}}},overlays:{selection:{origins:!0}},world:{upAxis:"z"}});function st(e){return`blender-${e.toLowerCase().replace(/_/g,"-")}`}function B(e){return e?.type==="TSE_SOME_ID"&&e.struct==="Object"&&e.object!==void 0}function he(e){if(e.struct)return e.struct}function ge(e,a){return{id:e.id,label:e.name,role:"entity",kind:st(e.icon),...he(e)?{typeLabel:he(e)}:{},parentId:a,childIds:e.children.map(o=>o.id),defaultExpanded:e.expanded}}const it={transform:!0,inspectorFields:!1,persist:!0},ee=new Set;let Ee=0;const ae=new Set;function _e(){queueMicrotask(()=>{Ee++;for(const e of ae)e()})}function ct(e){return ae.add(e),()=>{ae.delete(e)}}function je(){return Ee}function dt(e){for(const a of ee)if(a.documentId===e||a.documentId===`object3d-document:${e}`)return a;return ee.values().next().value??null}const ut=()=>({position:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1]});function ye(e,a){e.updateWorldMatrix(!0,!1);const o=a.matrixWorld.clone().invert().multiply(e.matrixWorld).elements;return[[o[0],o[1],o[2],o[3]],[o[4],o[5],o[6],o[7]],[o[8],o[9],o[10],o[11]],[o[12],o[13],o[14],o[15]]]}function K(e,a){return`${e} needs a file, and this editor has no door to ask for one: the host's file door (\`EditorHost.files\`, \`@volter/editor-sdk/host\`) reads and writes project-relative paths and has no file-picker member, so there is nothing to open the workbench's own dialog through. Blender's row opens a file browser; run without one, the engine answers "${a}".`}const bt=[{kind:"mesh.plane",label:"Plane",group:"Mesh",call:"mesh.primitive_plane_add"},{kind:"mesh.cube",label:"Cube",group:"Mesh",call:"mesh.primitive_cube_add"},{kind:"mesh.circle",label:"Circle",group:"Mesh",call:"mesh.primitive_circle_add"},{kind:"mesh.uv-sphere",label:"UV Sphere",group:"Mesh",call:"mesh.primitive_uv_sphere_add"},{kind:"mesh.ico-sphere",label:"Ico Sphere",group:"Mesh",call:"mesh.primitive_ico_sphere_add"},{kind:"mesh.cylinder",label:"Cylinder",group:"Mesh",call:"mesh.primitive_cylinder_add"},{kind:"mesh.cone",label:"Cone",group:"Mesh",call:"mesh.primitive_cone_add"},{kind:"mesh.torus",label:"Torus",group:"Mesh",call:"mesh.primitive_torus_add"},{kind:"mesh.grid",label:"Grid",group:"Mesh",call:"mesh.primitive_grid_add",separatorBefore:!0},{kind:"mesh.monkey",label:"Monkey",group:"Mesh",call:"mesh.primitive_monkey_add"},{kind:"curve.bezier",label:"Bézier",group:"Curve",call:"curve.primitive_bezier_curve_add"},{kind:"curve.bezier-circle",label:"Circle",group:"Curve",call:"curve.primitive_bezier_circle_add"},{kind:"curve.nurbs-curve",label:"Nurbs Curve",group:"Curve",call:"curve.primitive_nurbs_curve_add",separatorBefore:!0},{kind:"curve.nurbs-circle",label:"Nurbs Circle",group:"Curve",call:"curve.primitive_nurbs_circle_add"},{kind:"curve.path",label:"Path",group:"Curve",call:"curve.primitive_nurbs_path_add"},{kind:"curve.empty-hair",label:"Empty Hair",group:"Curve",call:"object.curves_empty_hair_add",separatorBefore:!0},{kind:"curve.fur",label:"Fur",group:"Curve",call:"object.quick_fur"},{kind:"surface.nurbs-curve",label:"Nurbs Curve",group:"Surface",call:"surface.primitive_nurbs_surface_curve_add"},{kind:"surface.nurbs-circle",label:"Nurbs Circle",group:"Surface",call:"surface.primitive_nurbs_surface_circle_add"},{kind:"surface.nurbs-surface",label:"Nurbs Surface",group:"Surface",call:"surface.primitive_nurbs_surface_surface_add"},{kind:"surface.nurbs-cylinder",label:"Nurbs Cylinder",group:"Surface",call:"surface.primitive_nurbs_surface_cylinder_add"},{kind:"surface.nurbs-sphere",label:"Nurbs Sphere",group:"Surface",call:"surface.primitive_nurbs_surface_sphere_add"},{kind:"surface.nurbs-torus",label:"Nurbs Torus",group:"Surface",call:"surface.primitive_nurbs_surface_torus_add"},{kind:"metaball.ball",label:"Ball",group:"Metaball",call:"object.metaball_add, type='BALL'"},{kind:"metaball.capsule",label:"Capsule",group:"Metaball",call:"object.metaball_add, type='CAPSULE'"},{kind:"metaball.plane",label:"Plane",group:"Metaball",call:"object.metaball_add, type='PLANE'"},{kind:"metaball.ellipsoid",label:"Ellipsoid",group:"Metaball",call:"object.metaball_add, type='ELLIPSOID'"},{kind:"metaball.cube",label:"Cube",group:"Metaball",call:"object.metaball_add, type='CUBE'"},{kind:"text",label:"Text",group:null,call:"object.text_add"},{kind:"point-cloud",label:"Point Cloud",group:null,call:"object.pointcloud_random_add"},{kind:"volume.import",label:"Import OpenVDB...",group:"Volume",call:"object.volume_import",refusal:`${K("Importing an OpenVDB volume","CANCELLED, with nothing created")} This build also has no OpenVDB at all (\`bpy.app.build_options.openvdb\` is False), so a file would not be read even with a picker.`},{kind:"volume.empty",label:"Empty",group:"Volume",call:"object.volume_add"},{kind:"grease-pencil.blank",label:"Blank",group:"Grease Pencil",call:"object.grease_pencil_add, type='EMPTY'"},{kind:"grease-pencil.stroke",label:"Stroke",group:"Grease Pencil",call:"object.grease_pencil_add, type='STROKE'"},{kind:"grease-pencil.monkey",label:"Monkey",group:"Grease Pencil",call:"object.grease_pencil_add, type='MONKEY'"},{kind:"grease-pencil.lineart-scene",label:"Scene Line Art",group:"Grease Pencil",call:"object.grease_pencil_add, type='LINEART_SCENE'",separatorBefore:!0},{kind:"grease-pencil.lineart-collection",label:"Collection Line Art",group:"Grease Pencil",call:"object.grease_pencil_add, type='LINEART_COLLECTION'"},{kind:"grease-pencil.lineart-object",label:"Object Line Art",group:"Grease Pencil",call:"object.grease_pencil_add, type='LINEART_OBJECT'"},{kind:"armature",label:"Armature",group:null,call:"object.armature_add"},{kind:"lattice.lattice",label:"Lattice",group:"Lattice",call:"object.add, type='LATTICE'"},{kind:"lattice.deform-selected",label:"Lattice Deform Selected",group:"Lattice",call:"object.lattice_add_to_selected"},{kind:"empty.plain-axes",label:"Plain Axes",group:"Empty",call:"object.empty_add, type='PLAIN_AXES'"},{kind:"empty.arrows",label:"Arrows",group:"Empty",call:"object.empty_add, type='ARROWS'"},{kind:"empty.single-arrow",label:"Single Arrow",group:"Empty",call:"object.empty_add, type='SINGLE_ARROW'"},{kind:"empty.circle",label:"Circle",group:"Empty",call:"object.empty_add, type='CIRCLE'"},{kind:"empty.cube",label:"Cube",group:"Empty",call:"object.empty_add, type='CUBE'"},{kind:"empty.sphere",label:"Sphere",group:"Empty",call:"object.empty_add, type='SPHERE'"},{kind:"empty.cone",label:"Cone",group:"Empty",call:"object.empty_add, type='CONE'"},{kind:"image.reference",label:"Reference...",group:"Image",call:"object.empty_image_add, background=False",refusal:K("A reference image","poll() failed, context is incorrect / Please select at least one image")},{kind:"image.background",label:"Background...",group:"Image",call:"object.empty_image_add, background=True",refusal:K("A background image","poll() failed, context is incorrect / Please select at least one image")},{kind:"image.mesh-plane",label:"Mesh Plane...",group:"Image",call:"image.import_as_mesh_planes",refusal:K("An image as a mesh plane","CANCELLED, with nothing created")},{kind:"image.empty-image",label:"Empty Image",group:"Image",call:"object.empty_add, type='IMAGE'"},{kind:"light.point",label:"Point",group:"Light",call:"object.light_add, type='POINT'"},{kind:"light.sun",label:"Sun",group:"Light",call:"object.light_add, type='SUN'"},{kind:"light.spot",label:"Spot",group:"Light",call:"object.light_add, type='SPOT'"},{kind:"light.area",label:"Area",group:"Light",call:"object.light_add, type='AREA'"},{kind:"light-probe.sphere",label:"Sphere",group:"Light Probe",call:"object.lightprobe_add, type='SPHERE'"},{kind:"light-probe.plane",label:"Plane",group:"Light Probe",call:"object.lightprobe_add, type='PLANE'"},{kind:"light-probe.volume",label:"Volume",group:"Light Probe",call:"object.lightprobe_add, type='VOLUME'"},{kind:"camera",label:"Camera",group:null,call:"object.camera_add"},{kind:"speaker",label:"Speaker",group:null,call:"object.speaker_add"},{kind:"force-field.force",label:"Force",group:"Force Field",call:"object.effector_add, type='FORCE'"},{kind:"force-field.wind",label:"Wind",group:"Force Field",call:"object.effector_add, type='WIND'"},{kind:"force-field.vortex",label:"Vortex",group:"Force Field",call:"object.effector_add, type='VORTEX'"},{kind:"force-field.magnetic",label:"Magnetic",group:"Force Field",call:"object.effector_add, type='MAGNET'"},{kind:"force-field.harmonic",label:"Harmonic",group:"Force Field",call:"object.effector_add, type='HARMONIC'"},{kind:"force-field.charge",label:"Charge",group:"Force Field",call:"object.effector_add, type='CHARGE'"},{kind:"force-field.lennard-jones",label:"Lennard-Jones",group:"Force Field",call:"object.effector_add, type='LENNARDJ'"},{kind:"force-field.texture",label:"Texture",group:"Force Field",call:"object.effector_add, type='TEXTURE'"},{kind:"force-field.curve-guide",label:"Curve Guide",group:"Force Field",call:"object.effector_add, type='GUIDE'"},{kind:"force-field.boid",label:"Boid",group:"Force Field",call:"object.effector_add, type='BOID'"},{kind:"force-field.turbulence",label:"Turbulence",group:"Force Field",call:"object.effector_add, type='TURBULENCE'"},{kind:"force-field.drag",label:"Drag",group:"Force Field",call:"object.effector_add, type='DRAG'"},{kind:"force-field.fluid-flow",label:"Fluid Flow",group:"Force Field",call:"object.effector_add, type='FLUID'"}],pt="collection-instance:";function ft(){const e=new Map;for(const a of X().byId.values()){if(a.type!=="TSE_LAYER_COLLECTION")continue;const o=a.data;o===void 0||!o.startsWith("bpy.data.collections[")||e.has(a.name)||e.set(a.name,{kind:`${pt}${a.name}`,label:a.name,group:"Collection Instance",call:`object.collection_instance_add, collection=${V(a.name)}`})}return[...e.values()]}function Z(){return[...bt,...ft()]}function mt(e){const[a,...o]=e.call.split(", ");return`bpy.ops.${a}(${o.join(", ")})`}function V(e){return JSON.stringify(e)}const ht={"curve.primitive_bezier_circle_add":"Add Bézier Circle","curve.primitive_bezier_curve_add":"Add Bézier","curve.primitive_nurbs_circle_add":"Add Nurbs Circle","curve.primitive_nurbs_curve_add":"Add Nurbs Curve","curve.primitive_nurbs_path_add":"Add Path","image.import_as_mesh_planes":"Import Images as Planes","mesh.primitive_circle_add":"Add Circle","mesh.primitive_cone_add":"Add Cone","mesh.primitive_cube_add":"Add Cube","mesh.primitive_cylinder_add":"Add Cylinder","mesh.primitive_grid_add":"Add Grid","mesh.primitive_ico_sphere_add":"Add Ico Sphere","mesh.primitive_monkey_add":"Add Monkey","mesh.primitive_plane_add":"Add Plane","mesh.primitive_torus_add":"Add Torus","mesh.primitive_uv_sphere_add":"Add UV Sphere","object.armature_add":"Add Armature","object.camera_add":"Add Camera","object.collection_add":"Add to Collection","object.collection_instance_add":"Add Collection Instance","object.constraint_add":"Add Constraint","object.curves_empty_hair_add":"Add Empty Curves","object.curves_random_add":"Add Random Curves","object.data_instance_add":"Add Object Data Instance","object.delete":"Delete","object.duplicate":"Duplicate Objects","object.effector_add":"Add Effector","object.empty_add":"Add Empty","object.empty_image_add":"Add Empty Image/Drop Image to Empty","object.grease_pencil_add":"Add Grease Pencil","object.grease_pencil_dash_modifier_segment_add":"Add Segment","object.grease_pencil_time_modifier_segment_add":"Add Segment","object.lattice_add_to_selected":"Add Lattice Deformer","object.light_add":"Add Light","object.lightprobe_add":"Add Light Probe","object.location_clear":"Clear Location","object.material_slot_add":"Add Material Slot","object.metaball_add":"Add Metaball","object.modifier_add":"Add Modifier","object.origin_set":"Set Origin","object.particle_system_add":"Add Particle System Slot","object.pointcloud_random_add":"Add Point Cloud","object.quick_fur":"Quick Fur","object.rotation_clear":"Clear Rotation","object.scale_clear":"Clear Scale","object.shaderfx_add":"Add Effect","object.shape_key_add":"Add Shape Key","object.speaker_add":"Add Speaker","object.text_add":"Add Text","object.transform_apply":"Apply Object Transform","object.vertex_group_add":"Add Vertex Group","object.volume_add":"Add Volume","object.volume_import":"Import OpenVDB Volume","surface.primitive_nurbs_surface_circle_add":"Add Surface Circle","surface.primitive_nurbs_surface_curve_add":"Add Surface Curve","surface.primitive_nurbs_surface_cylinder_add":"Add Surface Cylinder","surface.primitive_nurbs_surface_sphere_add":"Add Surface Sphere","surface.primitive_nurbs_surface_surface_add":"Add Surface Patch","surface.primitive_nurbs_surface_torus_add":"Add Surface Torus"};function gt(e){const a=/bpy\.ops\.([a-z_]+\.[a-z0-9_]+)\(/.exec(e)?.[1];return a===void 0?void 0:ht[a]}async function z(e,a){const o=["before = {o.name for o in bpy.data.objects}",e,"made = [o.name for o in bpy.data.objects if o.name not in before]",'print("\\n".join(made))'].join(`
2
- `),i=await te(o,!0,a??gt(e));return i.error!==null?{made:[],error:i.error}:{made:i.result.split(`
3
- `).map(p=>p.trim()).filter(p=>p.length>0),error:null}}async function _t(e,a){const o=[`_sel = {${e.map(V).join(", ")}}`,"_vl = bpy.context.view_layer","for _o in _vl.objects:"," _o.select_set(_o.name in _sel)",a===null?"_vl.objects.active = None":`_vl.objects.active = bpy.data.objects.get(${V(a)})`].join(`
4
- `),i=await te(o,!1);i.error!==null&&D().console.error(`Blender refused the selection write: ${i.error}`,"blender-outliner")}async function ne(e,a){if(e.length===0)return{destination:"Nothing is selected, so there was nothing to run it on.",persisted:!1};const o=[`targets = [bpy.data.objects[n] for n in [${e.map(V).join(", ")}]]`,"with bpy.context.temp_override(selected_objects=targets, selected_editable_objects=targets, active_object=targets[0], object=targets[0]):",` ${a}`].join(`
5
- `),{error:i}=await z(o);return i!==null?{destination:i,persisted:!1}:(await Q(e),{destination:`Blender — ${a}; the session saves the .blend`,persisted:!0})}const jt={source:"document",label:"blender",detail:"These rows are Blender's own View Layer tree, read from the engine through RNA. Editing the model is a bpy call; the eye and render columns write the engine directly."},yt="This collection is excluded from the view layer (LayerCollection.exclude), so its viewport visibility is not what is hiding it. Clear the Exclude checkbox on this row first.";function Oe(e){return({defaultAdapter:a})=>{const o=new Set;let i=[],u=null;const p=new Map,j=new Map,k=()=>{for(const n of[...o])n()},b=()=>X().byId,C=n=>{const t=b().get(n),l=e();return t===void 0||l===null?null:t.type==="TSE_VIEW_COLLECTION_BASE"?l.root:t.object===void 0?null:l.objectForBlenderName(t.object)},E=n=>{const t=e();if(t===null)return null;for(const l of b().values())if(B(l)&&t.objectForBlenderName(l.object)===n)return l.id;return null},v=n=>{for(const t of b().values())if(B(t)&&t.object===n)return t.id;return null},g=n=>{if(b().has(n))return n;const t=nt(a.hierarchy,n);return t===null?null:E(t)},x=n=>{const t=g(n);return t===null?null:C(t)},O=n=>{const t=x(n);return t===null?null:a.hierarchy.idForObject3D?.(t)??null},I={roots:()=>(Qe(F()),(X().tree?.rows??[]).map(t=>ge(t,null))),node:n=>{const t=X(),l=t.byId.has(n)?n:g(n),c=l===null?void 0:t.byId.get(l);return c===void 0?null:ge(c,t.parentOf.get(c.id)??null)},object3D:n=>x(n),idForObject3D:n=>E(n)};function F(){const n=b(),t=new Set;for(const l of i){const c=n.get(l)?.object;c!==void 0&&t.add(c)}return[...t]}const L=()=>{const n=[];for(const t of i){const l=x(t),c=l===null?null:a.hierarchy.idForObject3D?.(l);c&&n.push(c)}a.selection?.set(n,{intent:"exact"}),k()},M=()=>{const n=Ye(),t=`${oe()}\0${n.active??""}\0${[...n.selected].sort().join("")}`;if(t===u)return;u=t;const l=n.selected.filter(m=>m!==n.active);n.active!==null&&l.push(n.active);const c=l.map(v).filter(m=>m!==null);c.length===i.length&&c.every((m,w)=>m===i[w])||(i=c,L())},r={get:()=>[...i],set:n=>{i=n.map(g).filter(m=>m!==null),L();const t=b(),l=[],c=[];for(const m of i){const w=t.get(m),N=w?.object;N===void 0?c.push(w?.name??m):l.includes(N)||l.push(N)}c.length>0&&D().console.warn(`${c.join(", ")} ${c.length===1?"is":"are"} not an object, so Blender's object selection does not carry ${c.length===1?"it":"them"}. Selecting a collection sets the ACTIVE COLLECTION in Blender, which is its own gesture and not in this editor yet.`,"blender-outliner"),_t(l,l.length===0?null:l[l.length-1])}},s=n=>b().get(n)?.restrict,f={properties:n=>{const t=s(n);if(t===void 0)return[];const l=b().get(n),c=[{path:"name",label:"Name",type:"string",readonly:!B(l)}];return t.hide!==void 0&&c.push({path:"visible",label:"Show in Viewport",type:"boolean"}),t.render!==void 0&&c.push({path:"renderVisible",label:"Show in Renders",type:"boolean"}),t.exclude!==void 0&&c.push({path:"exclude",label:"Exclude from View Layer",type:"boolean"}),c},get:(n,t)=>{const l=b().get(n);if(l!==void 0){if(t==="name")return l.name;if(t==="visible")return l.restrict?.hide===void 0?void 0:!l.restrict.hide;if(t==="renderVisible")return l.restrict?.render===void 0?void 0:!l.restrict.render;if(t==="exclude")return l.restrict?.exclude}},editability:(n,t)=>{const l=b().get(n);return l===void 0?{writable:!1}:t==="name"?B(l)?{writable:!0}:{writable:!1,reason:`Renaming a ${l.struct??l.type} is not in this Outliner yet — only an object row renames here. Rename it with bpy.`}:l.notInCollection?{writable:!1,reason:"This row is a child drawn under its parent although it is not in that collection, and Blender's Outliner draws it no restriction columns."}:t==="visible"&&l.restrict?.exclude===!0?{writable:!1,reason:yt}:{writable:!0}},set:async(n,t,l)=>{const c=b().get(n);if(c===void 0)return;if(t==="name"){if(!B(c))return;const w=String(l);if(w===c.name||w.length===0)return;await fe(`bpy.data.objects[${V(c.object)}]`,"name",w),await Q([w]);const N=v(w);N!==null&&r.set([N]);return}if(t==="exclude"){await me(c.path,"exclude",l===!0);return}const m=t==="visible"?"hide":t==="renderVisible"?"render":null;m!==null&&await me(c.path,m,l===!1)}},S={get:n=>{const t=O(n);return(t===null?void 0:a.transforms?.get(t))??ut()},editability:n=>{const t=g(n),l=t===null?void 0:b().get(t);return B(l)&&C(l.id)!==null?{writable:!0}:{writable:!1,reason:`Only an object has a transform; this row is a ${l?.struct??l?.type??"row"}.`}},beginEdit:n=>{const t=x(n);t!==null&&!p.has(t)&&(p.set(t,t.matrixWorld.clone()),j.set(n,t),Xe())},apply:(n,t)=>{const l=x(n);l!==null&&(l.position.fromArray(t.position),l.quaternion.fromArray(t.rotation),l.scale.fromArray(t.scale),l.updateMatrix(),l.updateMatrixWorld(!0),e()?.mirrorPose?.(l))},endEdit:async n=>{const t=j.get(n)??x(n);j.delete(n);const l=e();if(t===null)return;const c=p.get(t);p.delete(t);try{if(l===null||(t.updateWorldMatrix(!0,!1),c?.equals(t.matrixWorld)===!0))return;const m=l.blenderObjectName(t);if(m===null)return;const w=`bpy.data.objects[${JSON.stringify(m)}]`;try{return await fe(w,"matrix_world",ye(t,l.root)),{destination:`Blender — ${w}.matrix_world; the session saves the .blend`,persisted:!0}}catch(N){return{destination:N instanceof Error?N.message:String(N),persisted:!1}}}finally{c&&await Je()}}},_=n=>{const t=g(n),l=t===null?void 0:b().get(t);return B(l)?l.object:null},y=n=>({destination:n,persisted:!1}),T=async n=>{await Q(n);const t=n.map(v).filter(l=>l!==null);return t.length>0&&r.set(t),t[0]??""},G=()=>{const n=a.documentId?.replace(/^object3d-document:/,""),t=H().find(m=>m.documentId===n)?.rig().drawCamera()??null,l=e(),c=["bpy.ops.object.camera_add()","added = bpy.context.view_layer.objects.active"];return t!==null&&l!==null&&c.push("kept = added.location.copy()",`added.matrix_world = ${JSON.stringify(ye(t,l.root))}`,"added.location = kept"),c.push("if bpy.context.scene.camera is None:"," bpy.context.scene.camera = added"),c.join(`
6
- `)},A={creatableKinds:()=>Z().map(({kind:n,label:t})=>({kind:n,label:t})),create:n=>{const t=Z().find(c=>c.kind===n);if(t===void 0)return{id:"",ack:y(`${n} is not a row of Blender's Add menu that this editor adds. Its rows are: ${Z().map(c=>c.label).join(", ")}.`)};if(t.refusal!==void 0)return{id:"",ack:y(t.refusal)};const l=t.call==="object.camera_add"?G():mt(t);return{id:"",ack:(async()=>{const{made:c,error:m}=await z(l);return m!==null?y(m):c.length===0?y(`Blender ran ${l} and created nothing. The operator reported no error, so it cancelled — most often because it wanted a file browser or a context this headless engine has no window for.`):(await T(c),{destination:`Blender — ${l}; the session saves the .blend`,persisted:!0})})()}},remove:n=>A.removeMany?.([n])??void 0,removeMany:async n=>{const t=[];for(const w of n){const N=_(w);if(N===null){const ue=g(w)===null?void 0:b().get(g(w));return y(`Only an object can be deleted here; this row is a ${ue?.struct??ue?.type??"row"}. Deleting a collection, a modifier or a vertex group is that datablock’s own bpy call.`)}t.push(N)}if(t.length===0)return y("Nothing selected to delete.");const c=[`targets = ${`[bpy.data.objects[n] for n in [${t.map(V).join(", ")}]]`}`,"with bpy.context.temp_override(selected_objects=targets, active_object=targets[0]):"," result = bpy.ops.object.delete(use_global=False)",'if "FINISHED" not in result: raise RuntimeError("Blender cancelled deleting the selected objects")'].join(`
7
- `),{error:m}=await z(c,"Delete Objects");return m!==null?y(m):(r.set([]),await Q([]),{destination:"Blender — bpy.ops.object.delete(use_global=False); the session saves the .blend",persisted:!0})},duplicate:n=>{const t=_(n);if(t===null)return{id:n,ack:y("Only an object can be duplicated here. Duplicating a collection is `bpy.ops.object.collection_instance_add`, its own gesture.")};const l=[`source = bpy.data.objects[${V(t)}]`,"with bpy.context.temp_override(selected_objects=[source], active_object=source):"," result = bpy.ops.object.duplicate(linked=False)",'if "FINISHED" not in result: raise RuntimeError("Blender cancelled duplicating the selected object")'].join(`
8
- `);return{id:n,ack:(async()=>{const{made:c,error:m}=await z(l,"Duplicate Object");return m!==null?y(m):(await T(c),{destination:`Blender — bpy.ops.object.duplicate(linked=False) on ${t}; the session saves the .blend`,persisted:!0})})()}},duplicateMany:async n=>{const t=[...new Set(n.map(_))];if(t.length===0||t.some(w=>w===null))return y("Select objects to duplicate; collections and data rows cannot be duplicated here.");const l=[`sources = [bpy.data.objects[name] for name in ${JSON.stringify(t)}]`,"with bpy.context.temp_override(selected_objects=sources, active_object=sources[0]):"," result = bpy.ops.object.duplicate(linked=False)",'if "FINISHED" not in result: raise RuntimeError("Blender cancelled duplicating the selected objects")'].join(`
9
- `),{made:c,error:m}=await z(l,"Duplicate Objects");return m!==null?y(m):(await T(c),{destination:"Blender — duplicate selected objects as one native operation; the session saves the .blend",persisted:!0})},reparent:()=>y("Reparenting is Blender's `bpy.ops.object.parent_set`, which needs a parent TYPE (Object, Object Keep Transform, Armature Deform, …) that a drag does not say. Set the parent on the object’s Relations panel, or with bpy.")},P={get documentId(){return a.documentId},get documentRootObject(){return a.documentRootObject},capabilities:it,provenance:jt,hierarchy:I,selection:r,inspector:f,transforms:S,structure:A,subscribe:n=>{o.add(n);const t=J(n),l=a.subscribe?.(n)??(()=>{});return()=>{o.delete(n),t(),l()}}},$={get documentId(){return P.documentId},selectedObjectNames:()=>F(),allObjectNames:()=>{const n=[];for(const t of b().values())B(t)&&n.push(t.object);return n},selectObjects:n=>{const t=n.map(v).filter(l=>l!==null);r.set(t)},rowIdForObject:n=>v(n),structure:A,subscribe:n=>{o.add(n);const t=J(n);return()=>{o.delete(n),t()}}};ee.add($),_e();const Re=qe(M),Fe=J(M);return M(),{adapter:P,dispose:()=>{Re(),Fe(),ee.delete($),_e(),o.clear()}}}}const vt=Oe(Ze),le="volter.blender.area-split:",se=new Set,ie=new Map;function St(e){try{return globalThis.localStorage?.getItem(le+e)==="1"}catch{return!1}}function de(e){let a=ie.get(e);return a===void 0&&(a=St(e),ie.set(e,a)),a}function ve(e,a){if(de(e)!==a){ie.set(e,a);try{a?globalThis.localStorage?.setItem(le+e,"1"):globalThis.localStorage?.removeItem(le+e)}catch{}for(const o of[...se])o()}}function Ae(e){return se.add(e),()=>{se.delete(e)}}const wt=[{label:"Location",call:"location=True, rotation=False, scale=False"},{label:"Rotation",call:"location=False, rotation=True, scale=False"},{label:"Scale",call:"location=False, rotation=False, scale=True"},{label:"All Transforms",call:"location=True, rotation=True, scale=True"}],kt=[{label:"Location",call:"bpy.ops.object.location_clear(clear_delta=False)"},{label:"Rotation",call:"bpy.ops.object.rotation_clear(clear_delta=False)"},{label:"Scale",call:"bpy.ops.object.scale_clear(clear_delta=False)"}],xt=[{label:"Geometry to Origin",type:"GEOMETRY_ORIGIN"},{label:"Origin to Geometry",type:"ORIGIN_GEOMETRY"},{label:"Origin to 3D Cursor",type:"ORIGIN_CURSOR"}],Ct=[{submenu:"Mesh",at:"2699"},{submenu:"Curve",at:"2702"},{submenu:"Surface",at:"2704"},{submenu:"Metaball",at:"2705"},{kind:"text",at:"2706"},{kind:"point-cloud",at:"2707"},{submenu:"Volume",at:"2708"},{submenu:"Grease Pencil",at:"2709"},{separatorAt:"2711"},{kind:"armature",at:"2716"},{submenu:"Lattice",at:"2718"},{separatorAt:"2720"},{submenu:"Empty",at:"2722"},{submenu:"Image",at:"2723"},{separatorAt:"2725"},{submenu:"Light",at:"2727"},{submenu:"Light Probe",at:"2728"},{separatorAt:"2730"},{kind:"camera",at:"2735"},{separatorAt:"2737"},{kind:"speaker",at:"2739"},{separatorAt:"2741"},{submenu:"Force Field",at:"2743"},{separatorAt:"2745"},{submenu:"Collection Instance",at:"2759"}],Et="No Collections to Instance";function q({id:e,open:a,setOpen:o,anchorRef:i,children:u}){return d.jsxs("div",{ref:i,style:{position:"relative"},children:[d.jsx(Ie,{"data-testid":`blender-menu-${e}`,"aria-expanded":a===e,onClick:()=>o(a===e?null:e),onPointerEnter:()=>{a&&o(e)},style:{textTransform:"capitalize"},children:e}),a===e&&d.jsx(Te,{anchorRef:i,dismissBoundaryRef:i,align:"start",gap:0,clamp:!0,"aria-label":e,onDismiss:()=>o(null),children:u})]})}function Ot(e,a,o){(async()=>{const i=await o;i===void 0||typeof i.destination!="string"||i.persisted!==!0&&e?.({tone:"error",title:`${a} was refused`,detail:i.destination})})()}function Ne({documentId:e,notify:a}){h.useSyncExternalStore(J,oe,oe),h.useSyncExternalStore(ct,je,je);const[o,i]=h.useState(null),u=h.useRef(null),p=h.useRef(null),j=h.useRef(null),k=h.useRef(null),b=h.useRef(null),C=h.useSyncExternalStore(Ae,()=>e===void 0?!1:de(e),()=>!1),E=dt(e);if(E===null)return null;const v=(r,s)=>()=>{i(null),Ot(a,r,s(E))},g=E.selectedObjectNames(),x=E.allObjectNames(),O=g.length===0?"Nothing is selected.":void 0,I=Z(),F=r=>d.jsx(R,{"data-testid":`blender-add-${r.kind}`,disabled:r.refusal!==void 0,title:r.refusal,onSelect:v(`Add ${r.label}`,s=>s.structure.create(r.kind).ack),children:r.label},r.kind),L=r=>I.filter(s=>s.group===r).flatMap(s=>s.separatorBefore===!0?[d.jsx(U,{},`${s.kind}-separator`),F(s)]:[F(s)]),M=r=>{if("separatorAt"in r)return d.jsx(U,{},`separator-${r.separatorAt}`);if("kind"in r){const f=I.find(S=>S.kind===r.kind);return f===void 0?null:F(f)}const s=L(r.submenu);return s.length===0?d.jsx(R,{"data-testid":"blender-add-collection-instance",disabled:!0,children:Et},r.submenu):d.jsx(W,{label:r.submenu,"data-testid":`blender-add-${r.submenu.toLowerCase().replaceAll(" ","-")}`,children:s},r.submenu)};return d.jsxs(Me,{compact:!0,label:"Blender Object Mode menus","data-testid":"blender-object-mode-menus",ref:u,children:[d.jsx(q,{id:"view",open:o,setOpen:i,anchorRef:p,children:d.jsxs(W,{label:"Area","data-testid":"blender-view-area",children:[d.jsx(R,{"data-testid":"blender-area-vertical-split",disabled:C||e===void 0,title:C?"This area is already split.":void 0,onSelect:()=>{i(null),e!==void 0&&ve(e,!0)},children:"Vertical Split"}),d.jsx(U,{}),d.jsx(R,{"data-testid":"blender-area-close",disabled:!C,title:C?void 0:"There is no second area to close.",onSelect:()=>{i(null),e!==void 0&&ve(e,!1)},children:"Close Area"})]})}),d.jsxs(q,{id:"select",open:o,setOpen:i,anchorRef:j,children:[d.jsx(R,{"data-testid":"blender-select-all",onSelect:v("Select All",r=>r.selectObjects(x)),children:"All"}),d.jsx(R,{"data-testid":"blender-select-none",onSelect:v("Select None",r=>r.selectObjects([])),children:"None"}),d.jsx(R,{"data-testid":"blender-select-invert",onSelect:v("Select Invert",r=>r.selectObjects(x.filter(s=>!g.includes(s)))),children:"Invert"})]}),d.jsx(q,{id:"add",open:o,setOpen:i,anchorRef:k,children:Ct.map(r=>M(r))}),d.jsxs(q,{id:"object",open:o,setOpen:i,anchorRef:b,children:[d.jsx(W,{label:"Set Origin","data-testid":"blender-object-origin",children:xt.map(r=>d.jsx(R,{"data-testid":`blender-origin-${r.type}`,disabled:r.refusal!==void 0||g.length===0,title:r.refusal??O,onSelect:v(`Set Origin ▸ ${r.label}`,s=>ne(s.selectedObjectNames(),`bpy.ops.object.origin_set(type='${r.type}')`)),children:r.label},r.type))}),d.jsx(W,{label:"Clear","data-testid":"blender-object-clear",children:kt.map(r=>d.jsx(R,{"data-testid":`blender-clear-${r.label.toLowerCase()}`,disabled:g.length===0,title:O,onSelect:v(`Clear ▸ ${r.label}`,s=>ne(s.selectedObjectNames(),r.call)),children:r.label},r.label))}),d.jsx(W,{label:"Apply","data-testid":"blender-object-apply",children:wt.map(r=>d.jsx(R,{"data-testid":`blender-apply-${r.label.toLowerCase().replace(/ /g,"-")}`,disabled:g.length===0,title:O,onSelect:v(`Apply ▸ ${r.label}`,s=>ne(s.selectedObjectNames(),`bpy.ops.object.transform_apply(${r.call})`)),children:r.label},r.label))}),d.jsx(U,{}),d.jsx(R,{"data-testid":"blender-object-duplicate",disabled:g.length===0,title:O,onSelect:v("Duplicate Objects",async r=>{const s=r.selectedObjectNames().map(f=>r.rowIdForObject(f)).filter(f=>f!==null);return r.structure.duplicateMany?.(s)}),children:"Duplicate Objects"}),d.jsx(R,{"data-testid":"blender-object-delete",disabled:g.length===0,title:O,onSelect:v("Delete",r=>{const s=r.selectedObjectNames().map(f=>r.rowIdForObject(f)).filter(f=>f!==null);return r.structure.removeMany?.(s)}),children:"Delete"})]})]})}const Se=new WeakSet,ir="workspace.document",cr="Blender Model",dr=({documentId:e,notify:a})=>d.jsx(Ne,{documentId:e,notify:a}),At="model",ur="owned",br=[],ce=Ke,we=new WeakMap;function Nt(e){let a=we.get(e);return a||(a={subject:()=>{const o=Y.playhead();return e.subjectLine(o===null?null:Math.floor(o))},gridScale:o=>e.gridUnitName(o),cameraView:{camera:()=>e.cameraViewCamera(),zoom:e.cameraViewZoom,pan:e.cameraViewPan,showing:o=>e.setCameraViewShowing(o),setPose:(o,i,u,p)=>{const{location:j,rotation:k}=e.blenderPose(i,u);return te(`from mathutils import Matrix, Quaternion, Vector
10
- import bpy
11
- object = bpy.data.objects[${JSON.stringify(o)}]
12
- object.matrix_world = Matrix.LocRotScale(Vector((${j.join(", ")})), Quaternion((${k.join(", ")})), object.matrix_world.to_scale())`,p,"Lock Camera to View").then(b=>{b.error!==null&&D().console.error(`Blender refused the camera's pose: ${b.error}`,"blender-camera")},b=>D().console.error(`The camera's pose was not written to Blender: ${String(b)}`,"blender-camera"))},view:(o,i,u,p)=>e.cameraView(o,i,u,p)}},we.set(e,a),a)}function pr(e){const{active:a,document:o,documentId:i,notify:u,publishContext:p}=e,j=o?.source?.path,k=o?.id,b=JSON.stringify([i,k,j]),[C,E]=h.useState(null),v=h.useRef({notify:u,publishContext:p});return v.current={notify:u,publishContext:p},h.useEffect(()=>{if(a===!1||!i)return;let g=!1,x;const O=j===void 0?null:{documentId:i,entryId:k,blend:j},I=et(O),F=()=>{x=v.current.publishContext?.(ce)};return E(null),(async()=>{try{if(O){if(!await tt(O,F))return}else F();g||E({key:b,error:null})}catch(L){if(g)return;x?.(),x=void 0;const M=L instanceof Error?L.message:String(L);E({key:b,error:M}),v.current.notify?.({tone:"error",title:`Blender could not open ${j??"the model"}`,detail:M})}})(),()=>{g=!0,x?.(),I()}},[a,j,i,k,b]),a===!1||!i?null:C?.key!==b?d.jsx("div",{role:"status",children:"Opening model…"}):C.error?d.jsx("div",{role:"alert",children:C.error}):d.jsx(Rt,{...e})}function Rt(e){const{documentId:a}=e,o=h.useSyncExternalStore(Ae,()=>a?de(a):!1,()=>!1),[i,u]=h.useState(null);if(h.useEffect(()=>{if(!o||!a)return;const k=`${a}#area-2`;Pe(k).drawMode===void 0&&Be(k,{drawMode:"rendered"});const b=ce.follow();return u(b),()=>{u(null),b.dispose()}},[o,a]),!a)return null;const p=o?i:null,j={position:"relative",flex:"1 1 0",minWidth:0,margin:12};return d.jsxs("div",{style:p?{position:"absolute",inset:-12,display:"flex",gap:2}:{display:"contents"},children:[d.jsx("div",{style:p?j:{display:"contents"},children:d.jsx(ke,{...e,view:ce,main:!0})}),p&&d.jsxs("div",{style:j,"data-testid":"blender-second-area",children:[d.jsx(ke,{...e,documentId:`${a}#area-2`,view:p.view,main:!1}),d.jsx(Ft,{documentId:a,areaId:`${a}#area-2`,notify:e.notify})]})]})}function Ft({documentId:e,areaId:a,notify:o}){h.useSyncExternalStore(Ve,be,be);const i=h.useSyncExternalStore(Ge,()=>We(e)),u=He(a)?.HeaderControls,p=h.useRef(null);return h.useEffect(()=>{const j=p.current,k=j?.parentElement;if(!k)return;const b=()=>pe(e,{headerWidth:k.getBoundingClientRect().width+12,shelf:j});b();const C=new ResizeObserver(b);return C.observe(k),()=>{C.disconnect(),pe(e,null)}},[e]),d.jsxs(d.Fragment,{children:[d.jsx("div",{ref:p,className:"volter-dock-document-shelf",role:"toolbar","aria-orientation":"vertical","aria-label":"Document tools"}),i&&rt.createPortal(d.jsxs("div",{className:"volter-dock-document-toolbar-own","data-testid":`document-header:${a}`,style:{display:"flex",alignItems:"center"},children:[d.jsx(Ne,{documentId:e,notify:o}),u&&d.jsx(h.Suspense,{fallback:null,children:d.jsx(u,{documentId:a})})]}),i)]})}function ke({active:e,document:a,documentId:o,surfaces:i,view:u,main:p}){const j=Nt(u),k=h.useCallback(()=>({root:u.root,onChange(r){const s=u.onChange(r),f=Y.subscribe(r);return()=>{s(),f()}},dispose(){}}),[u]),b=a?.source?.path,C=h.useCallback(r=>{const s=u.onChange(r),f=Y.subscribe(r);let S=null;const _=()=>{S?.(),S=H().find(T=>T.documentId===o)?.onFrame(r)??null};_();const y=re(_);return()=>{s(),f(),y(),S?.()}},[o,u]),E=h.useSyncExternalStore(C,j.subject),v=h.useMemo(()=>p?vt:Oe(()=>u),[p,u]);h.useEffect(()=>{if(p||!o)return;let r=!1;const s=()=>{if(r)return;const _=at(o);_===null||u.cameraViewCamera()===null||(r=_.toggleCameraView())};s();const f=ot(s),S=u.subscribeFrames(s);return()=>{f(),S()}},[p,o,u]),h.useEffect(()=>{if(p||!o)return;const r=()=>{const s=ze(o);s===null||Se.has(s)||(Se.add(s),s.showHelpers&&s.toggleHelpers(),s.showGizmos&&s.toggleGizmos())};return r(),$e(r)},[p,o]),h.useEffect(()=>{if(!o)return;const r=u.overlayGroups(),s=()=>{const S=H().find(_=>_.documentId===o);if(S)for(const{kind:_,object:y}of r)S.setHelper(_,y)};s();const f=re(s);return()=>{f();const S=H().find(_=>_.documentId===o);for(const{kind:_}of r)S?.setHelper(_,null)}},[o,u]),h.useEffect(()=>{if(!o||!p)return;const{transport:r}=D();let s=null;const f=()=>{if(s)return;const _=r.for(o);_&&(s=Y.attachTo(_))};f();const S=r.subscribe(f);return()=>{S(),s?.()}},[o,p]),h.useEffect(()=>{if(!o)return;const r=()=>H().find(A=>A.documentId===o);let s,f=null;const S=new lt,_=()=>r()?.rig().drawCamera()??S,y=()=>{const A=r();A!==s&&(f?.(),f=A?A.onFrame(()=>u.refreshRendered()):null,s=A);const{lighting:P}=Ue(o);u.holdRendered(P.source==="scene"&&A?_:null),u.setWorkbench(P.source==="studio"&&P.studioPreset===xe.id)};y();const T=De(y),G=re(y);return()=>{T(),G(),f?.(),u.holdRendered(null),u.setWorkbench(!1)}},[o,u]);const g=h.useRef(null),x=r=>r.button===2&&r.shiftKey&&r.target instanceof HTMLCanvasElement,O=r=>{if(!x(r)){g.current=null;return}r.preventDefault(),r.stopPropagation(),g.current={id:r.pointerId,x:r.clientX,y:r.clientY},r.isTrusted&&r.target.setPointerCapture(r.pointerId)},I=()=>{g.current=null},F=r=>{const s=g.current;if(s===null||r.pointerId!==s.id||r.button!==2||(g.current=null,r.preventDefault(),r.stopPropagation(),Math.hypot(r.clientX-s.x,r.clientY-s.y)>3))return;const f=u.placeCursor(r.clientX,r.clientY,r.target);if(f===null)return;const[S,_,y]=f.location,[T,G,A,P]=f.rotation;te(`from mathutils import Matrix, Quaternion, Vector
13
- bpy.context.scene.cursor.matrix = Matrix.LocRotScale(Vector((${S}, ${_}, ${y})), Quaternion((${T}, ${G}, ${A}, ${P})), None)`,!1,"Set 3D Cursor").then($=>{$.error!==null&&D().console.error(`Blender refused the 3D cursor: ${$.error}`,"blender-cursor")},$=>D().console.error(`The 3D cursor was not written to Blender: ${String($)}`,"blender-cursor"))},L=r=>{x(r)&&r.preventDefault()};if(!o)return null;const M=i.Object3DAuthoring;return d.jsx("div",{style:{display:"contents"},onPointerDownCapture:O,onPointerUpCapture:F,onPointerCancelCapture:I,onLostPointerCaptureCapture:I,onContextMenuCapture:L,children:d.jsx(M,{active:e??!0,documentId:o,sourcePath:b??"blender:runtime",displayName:a?.label??"Model",...E===null?{}:{subject:E},gridScale:j.gridScale,cameraView:j.cameraView,build:k,audit:!1,authoring:v,cameraDirection:[.8187,.4458,.3617],openingFit:3,openingView:u.savedView(),presentation:(()=>{const r=u.savedView();return r?{camera:{fov:Ce(r.lens)}}:null})(),stageKind:At,dressing:{environment:!1,keyLight:!1,viewLocked:u.studioLights()}})})}export{dr as Toolbar,pr as default,At as documentKind,br as inspectorBuiltins,ur as inspectorRail,ir as point,cr as title};
@@ -1 +0,0 @@
1
- import{ah as m}from"./index-C_gLrIvk.js";import{b as p,a as e,c as n,s}from"./game-network-BoP-iKCC.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-Dvzh4rev.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B0UtXvgn.js";import"./contract-system-adapters-CJXxexZO.js";import"./game-contract-seams-BhjR536D.js";import"./seeded-random-CilWrQ9p.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-DBGzvsy3.js";import"./capability-coverage-NcL3fdGj.js";import"./edit-mode-authoring-8eqT4Ah6.js";import"./json-history-resource-BReCXsj2.js";import"./binding-resolver-DCeGebRY.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-CyH5yTHN.js";import"./canvas-entry-runtime-BLPKpqpp.js";import"./three-ingest-runtime-B09tYa9n.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-ZOiV0Jtk.js";import"./ingest-source-persistence-Cxv-xcnT.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CV9AuiRe.js";import"./mounted-authoring-DI-dfAS5.js";import"./entity-object-CTha2dPd.js";import"./user-data-BS92dOsI.js";import"./workspace-arrangement-BTINexHg.js";import"./three-contract-Dkt6PmWY.js";import"./three-BWA441zQ.js";import"./editor-layers-TtgYYi_s.js";import"./component-instance-root-4o-HMx39.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-cWKLa6xe.js";import"./source-persistence-backend-CpNTlQ6r.js";import"./three-projection-core-BAHKdNuj.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-B0M0RByC.js";import"./deferred-ingest-play-BpPZrTLz.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-C9fTSu6u.js";import"./board-guides-B_1dNBxX.js";import"./relative-import-specifier-Dg5O2O1R.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-DybkUNPY.js";import"./inference-diagnostics-CSTitz6Y.js";import"./writer-tw6EcuVO.js";import"./three-state-CR9QYeCl.js";import"./editor-shell-store-C9QYXDRr.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-CN3_JGfc.js";import"./game-surface-defaults-D8S4cRxi.js";const zt="workspace.command",a=()=>({ok:!1,error:"not in play mode — start play before using the debug seam"}),Bt={"set-instance-count":{derivedRefresh:"always",handle:o=>{if(!e())return a();const r=o.names;if(Array.isArray(r)&&r.every(i=>typeof i=="string"))return r.length<1?{ok:!1,error:'set-instance-count "names" must have at least one entry.'}:(n(r),{ok:!0});const t=o.count;return typeof t!="number"||!Number.isFinite(t)||t<1?{ok:!1,error:`set-instance-count requires a whole "count" >= 1 (or a "names" array), got ${String(t)}.`}:(s(Math.floor(t)-1),{ok:!0})}},"list-instances":{derivedRefresh:"if-content-changed",handle:()=>({ok:!0,data:{instances:m(),named:p()}})}};export{Bt as commands,zt as point};
@@ -1 +0,0 @@
1
- import{i as t}from"./game-network-BoP-iKCC.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-C_gLrIvk.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./native-debug-module-Dvzh4rev.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B0UtXvgn.js";import"./contract-system-adapters-CJXxexZO.js";import"./game-contract-seams-BhjR536D.js";import"./seeded-random-CilWrQ9p.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-DBGzvsy3.js";import"./capability-coverage-NcL3fdGj.js";import"./edit-mode-authoring-8eqT4Ah6.js";import"./json-history-resource-BReCXsj2.js";import"./binding-resolver-DCeGebRY.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-CyH5yTHN.js";import"./canvas-entry-runtime-BLPKpqpp.js";import"./three-ingest-runtime-B09tYa9n.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-ZOiV0Jtk.js";import"./ingest-source-persistence-Cxv-xcnT.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CV9AuiRe.js";import"./mounted-authoring-DI-dfAS5.js";import"./entity-object-CTha2dPd.js";import"./user-data-BS92dOsI.js";import"./workspace-arrangement-BTINexHg.js";import"./three-contract-Dkt6PmWY.js";import"./three-BWA441zQ.js";import"./editor-layers-TtgYYi_s.js";import"./component-instance-root-4o-HMx39.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-cWKLa6xe.js";import"./source-persistence-backend-CpNTlQ6r.js";import"./three-projection-core-BAHKdNuj.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-B0M0RByC.js";import"./deferred-ingest-play-BpPZrTLz.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-C9fTSu6u.js";import"./board-guides-B_1dNBxX.js";import"./relative-import-specifier-Dg5O2O1R.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-DybkUNPY.js";import"./inference-diagnostics-CSTitz6Y.js";import"./writer-tw6EcuVO.js";import"./three-state-CR9QYeCl.js";import"./editor-shell-store-C9QYXDRr.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-CN3_JGfc.js";import"./game-surface-defaults-D8S4cRxi.js";const zt="workspace.service";function At(){t()}export{zt as point,At as start};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/r3f-design-session-CNjz1_AF.js","assets/index-C_gLrIvk.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/edit-mode-authoring-8eqT4Ah6.js","assets/game-network-BoP-iKCC.js","assets/index-OZVqp6xS.js","assets/index-Da9JhEvW.js","assets/native-debug-module-Dvzh4rev.js","assets/native-entry-surface-BE8LJNdu.js","assets/debug-registry-B0UtXvgn.js","assets/contract-system-adapters-CJXxexZO.js","assets/game-contract-seams-BhjR536D.js","assets/seeded-random-CilWrQ9p.js","assets/game-audio-BeCyd0Ha.js","assets/rapier-physics-adapter-CaZqWLu0.js","assets/events-156d8d12.esm-CYeuVCYr.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/index-bQE2NA0D.js","assets/live-project-verbs-DBGzvsy3.js","assets/capability-coverage-NcL3fdGj.js","assets/json-history-resource-BReCXsj2.js","assets/binding-resolver-DCeGebRY.js","assets/adapter-surface-Y37Nzcyw.js","assets/structural-signature-Dc7skRiy.js","assets/webgl-frame-capture-DdJkM2mi.js","assets/realm-services-CyH5yTHN.js","assets/canvas-entry-runtime-BLPKpqpp.js","assets/three-ingest-runtime-B09tYa9n.js","assets/EffectComposer-BEAt0PtQ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-DTnDQXm0.js","assets/Pass-D1MRT672.js","assets/CSS3DRenderer-BsAqfavI.js","assets/relative-path-guard-GiM7Lsz8.js","assets/react-root-BHA-cdrW.js","assets/editor-presentation-activity-CqJH4G9t.js","assets/active-ingest-ZOiV0Jtk.js","assets/ingest-source-persistence-Cxv-xcnT.js","assets/pixi-story-model-DNkfnWUV.js","assets/surface-content-Dg9Kkazf.js","assets/viewport-root-presentation-CV9AuiRe.js","assets/mounted-authoring-DI-dfAS5.js","assets/entity-object-CTha2dPd.js","assets/user-data-BS92dOsI.js","assets/workspace-arrangement-BTINexHg.js","assets/three-contract-Dkt6PmWY.js","assets/three-BWA441zQ.js","assets/editor-layers-TtgYYi_s.js","assets/component-instance-root-4o-HMx39.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/three-authoring-adapter-cWKLa6xe.js","assets/source-persistence-backend-CpNTlQ6r.js","assets/three-projection-core-BAHKdNuj.js","assets/body-marks-C1LxJtQb.js","assets/user-data-CODoGZqA.js","assets/object-marks-BnvSuCTt.js","assets/structural-ids-BOo2BRoY.js","assets/object3d-authoring-subject-XccsO0xG.js","assets/r3f-physics-binding-B0M0RByC.js","assets/deferred-ingest-play-BpPZrTLz.js","assets/rrweb-Cd2ifIRP.js","assets/react-world-authoring-adapter-C9fTSu6u.js","assets/board-guides-B_1dNBxX.js","assets/relative-import-specifier-Dg5O2O1R.js","assets/story-arg-descriptors-Ek86ExX7.js","assets/inspect-DybkUNPY.js","assets/inference-diagnostics-CSTitz6Y.js","assets/writer-tw6EcuVO.js","assets/three-state-CR9QYeCl.js","assets/editor-shell-store-C9QYXDRr.js","assets/output-pass-HurwNl0G.js","assets/viewport-door-CN3_JGfc.js","assets/game-surface-defaults-D8S4cRxi.js","assets/scene-framing-DeMlXIgX.js","assets/assets-BcrMQHRv.js","assets/loader-BTUKnX5Q.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/create-runtime-BcW4ljbo.js","assets/binding-Bmxqznjk.js","assets/root-stacking-BEd9ZvxC.js","assets/setup-renderer-D4rh83E5.js","assets/index-DHhMOs_s.js","assets/defaults-DKiBJCPN.js","assets/render-settings-DBqv2yw8.js","assets/render-features-BPb6UG8u.js","assets/loop-gate-report-N52EWFGD.js","assets/system-slot-E2mEdiih.js","assets/performance-profiler-CMbwGBuk.js","assets/live-gesture-lock-DJbrjOqf.js"])))=>i.map(i=>d[i]);
2
- import{_ as s,aF as n}from"./index-C_gLrIvk.js";import{r as a}from"./design-time-mount-registry-DUpXCg1U.js";import{q as c}from"./edit-mode-authoring-8eqT4Ah6.js";import{a as u}from"./json-history-resource-BReCXsj2.js";import{o as h}from"./three-authoring-adapter-cWKLa6xe.js";import{t as i}from"./editor-shell-store-C9QYXDRr.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./component-instance-root-4o-HMx39.js";import"./user-data-BS92dOsI.js";import"./workspace-arrangement-BTINexHg.js";import"./source-persistence-backend-CpNTlQ6r.js";import"./ingest-source-persistence-Cxv-xcnT.js";import"./three-projection-core-BAHKdNuj.js";import"./editor-layers-TtgYYi_s.js";import"./three-BWA441zQ.js";import"./entity-object-CTha2dPd.js";import"./three-contract-Dkt6PmWY.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three.core-3arARmh6.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./r3f-physics-binding-B0M0RByC.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./Pass-D1MRT672.js";const U="workspace.service";function X(){const r=s(()=>import("./r3f-design-session-CNjz1_AF.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99]));r.catch(()=>{});const m=n("three",(t,o)=>h(i(t),()=>i(t).scene,o,u(o))),e=a({kind:"three",owner:"@volter/editor-game/three/three-authoring",async mountWorldRootSession(t){const o=t,{mountR3FDesignSession:p}=await r;return p(o.store,o.composite,o.renderer)}});return c(),()=>{e(),m()}}export{U as point,X as start};
@@ -1 +0,0 @@
1
- import{e as r}from"./three-integration-BXyJZy9c.js";import"./index-C_gLrIvk.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./renderer-ownership-BovSEcLv.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./preview-renderer-BrYNFV1p.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./layered-pick-BJfI6PwU.js";import"./root-stacking-BEd9ZvxC.js";import"./user-data-BS92dOsI.js";import"./workspace-arrangement-BTINexHg.js";import"./model-thumbnail-zIoZC1z2.js";import"./studio-environment-CjfDi6Xs.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./object3d-document-session-registry-Bt76KtzL.js";import"./three-state-CR9QYeCl.js";import"./editor-shell-store-C9QYXDRr.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./editor-layers-TtgYYi_s.js";import"./entity-object-CTha2dPd.js";import"./three-contract-Dkt6PmWY.js";import"./hierarchy-marks-DMWVKCJa.js";import"./component-instance-root-4o-HMx39.js";import"./viewport-door-CN3_JGfc.js";import"./content-bounds-C6Nb8vJK.js";import"./asset-preview-Clo8SaV6.js";import"./bitmap-label-Ct4k6ehY.js";const Q="workspace.service";function R(){return r()}export{Q as point,R as start};