@onerjs/core 8.56.4 → 9.0.1

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 (722) hide show
  1. package/Animations/animatable.core.js +36 -0
  2. package/Animations/animatable.core.js.map +1 -1
  3. package/Animations/animationGroup.pure.d.ts +61 -1
  4. package/Animations/animationGroup.pure.js +191 -2
  5. package/Animations/animationGroup.pure.js.map +1 -1
  6. package/Animations/index.d.ts +1 -0
  7. package/Animations/index.js +1 -0
  8. package/Animations/index.js.map +1 -1
  9. package/Animations/pure.d.ts +1 -0
  10. package/Animations/pure.js +1 -0
  11. package/Animations/pure.js.map +1 -1
  12. package/Animations/rootMotion.d.ts +560 -0
  13. package/Animations/rootMotion.js +1709 -0
  14. package/Animations/rootMotion.js.map +1 -0
  15. package/Animations/runtimeAnimation.d.ts +57 -0
  16. package/Animations/runtimeAnimation.js +127 -3
  17. package/Animations/runtimeAnimation.js.map +1 -1
  18. package/Cameras/arcRotateCamera.pure.d.ts +2 -0
  19. package/Cameras/arcRotateCamera.pure.js +2 -0
  20. package/Cameras/arcRotateCamera.pure.js.map +1 -1
  21. package/Cameras/targetCamera.pure.d.ts +2 -0
  22. package/Cameras/targetCamera.pure.js +13 -2
  23. package/Cameras/targetCamera.pure.js.map +1 -1
  24. package/Collisions/gpuPicker.js +5 -5
  25. package/Collisions/gpuPicker.js.map +1 -1
  26. package/Engines/AbstractEngine/abstractEngine.query.pure.js +4 -2
  27. package/Engines/AbstractEngine/abstractEngine.query.pure.js.map +1 -1
  28. package/Engines/AbstractEngine/abstractEngine.query.types.d.ts +11 -2
  29. package/Engines/AbstractEngine/abstractEngine.query.types.js.map +1 -1
  30. package/Engines/AbstractEngine/abstractEngine.renderPass.pure.js +1 -0
  31. package/Engines/AbstractEngine/abstractEngine.renderPass.pure.js.map +1 -1
  32. package/Engines/Extensions/engine.multiRender.pure.js +63 -0
  33. package/Engines/Extensions/engine.multiRender.pure.js.map +1 -1
  34. package/Engines/Extensions/engine.multiRender.types.d.ts +13 -0
  35. package/Engines/Extensions/engine.multiRender.types.js.map +1 -1
  36. package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js +2 -2
  37. package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js.map +1 -1
  38. package/Engines/Extensions/engine.prefilteredCubeTexture.types.d.ts +2 -1
  39. package/Engines/Extensions/engine.prefilteredCubeTexture.types.js.map +1 -1
  40. package/Engines/Extensions/index.d.ts +1 -0
  41. package/Engines/Extensions/index.js +1 -0
  42. package/Engines/Extensions/index.js.map +1 -1
  43. package/Engines/Extensions/pure.d.ts +1 -1
  44. package/Engines/Extensions/pure.js +1 -1
  45. package/Engines/Extensions/pure.js.map +1 -1
  46. package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js +88 -39
  47. package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js.map +1 -1
  48. package/Engines/Native/Extensions/nativeEngine.cubeTexture.types.d.ts +20 -2
  49. package/Engines/Native/Extensions/nativeEngine.cubeTexture.types.js.map +1 -1
  50. package/Engines/Native/nativeHardwareTexture.d.ts +8 -1
  51. package/Engines/Native/nativeHardwareTexture.js +7 -0
  52. package/Engines/Native/nativeHardwareTexture.js.map +1 -1
  53. package/Engines/Native/nativeHelpers.js +56 -1
  54. package/Engines/Native/nativeHelpers.js.map +1 -1
  55. package/Engines/Native/nativeInterfaces.d.ts +37 -8
  56. package/Engines/Native/nativeInterfaces.js.map +1 -1
  57. package/Engines/Native/nativeRenderTargetWrapper.d.ts +40 -0
  58. package/Engines/Native/nativeRenderTargetWrapper.js +265 -5
  59. package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
  60. package/Engines/Processors/shaderCodeCursor.d.ts +1 -0
  61. package/Engines/Processors/shaderCodeCursor.js +40 -3
  62. package/Engines/Processors/shaderCodeCursor.js.map +1 -1
  63. package/Engines/WebGPU/Extensions/engine.multiRender.pure.js +4 -0
  64. package/Engines/WebGPU/Extensions/engine.multiRender.pure.js.map +1 -1
  65. package/Engines/WebGPU/Extensions/engine.multiRender.types.d.ts +13 -0
  66. package/Engines/WebGPU/Extensions/engine.multiRender.types.js.map +1 -1
  67. package/Engines/WebGPU/Extensions/engine.query.pure.js +11 -3
  68. package/Engines/WebGPU/Extensions/engine.query.pure.js.map +1 -1
  69. package/Engines/WebGPU/Extensions/engine.renderTarget.pure.js +1 -0
  70. package/Engines/WebGPU/Extensions/engine.renderTarget.pure.js.map +1 -1
  71. package/Engines/WebGPU/Extensions/index.d.ts +1 -0
  72. package/Engines/WebGPU/Extensions/index.js +1 -0
  73. package/Engines/WebGPU/Extensions/index.js.map +1 -1
  74. package/Engines/WebGPU/Extensions/pure.d.ts +1 -1
  75. package/Engines/WebGPU/Extensions/pure.js +1 -1
  76. package/Engines/WebGPU/Extensions/pure.js.map +1 -1
  77. package/Engines/WebGPU/webgpuBundleList.d.ts +2 -0
  78. package/Engines/WebGPU/webgpuBundleList.js +4 -0
  79. package/Engines/WebGPU/webgpuBundleList.js.map +1 -1
  80. package/Engines/WebGPU/webgpuCacheRenderPipeline.js +5 -2
  81. package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
  82. package/Engines/WebGPU/webgpuHardwareTexture.js +3 -1
  83. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  84. package/Engines/WebGPU/webgpuOcclusionQuery.js +1 -1
  85. package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
  86. package/Engines/WebGPU/webgpuSnapshotRendering.d.ts +4 -0
  87. package/Engines/WebGPU/webgpuSnapshotRendering.js +40 -7
  88. package/Engines/WebGPU/webgpuSnapshotRendering.js.map +1 -1
  89. package/Engines/WebGPU/webgpuTextureHelper.d.ts +1 -1
  90. package/Engines/WebGPU/webgpuTextureHelper.js +2 -2
  91. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  92. package/Engines/WebGPU/webgpuTextureManager.d.ts +2 -0
  93. package/Engines/WebGPU/webgpuTextureManager.js +286 -13
  94. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  95. package/Engines/abstractEngine.pure.d.ts +17 -1
  96. package/Engines/abstractEngine.pure.js +17 -5
  97. package/Engines/abstractEngine.pure.js.map +1 -1
  98. package/Engines/constants.d.ts +4 -0
  99. package/Engines/constants.js +4 -0
  100. package/Engines/constants.js.map +1 -1
  101. package/Engines/engine.pure.d.ts +0 -1
  102. package/Engines/engine.pure.js +0 -7
  103. package/Engines/engine.pure.js.map +1 -1
  104. package/Engines/nativeEngine.pure.js +1 -1
  105. package/Engines/nativeEngine.pure.js.map +1 -1
  106. package/Engines/thinEngine.pure.d.ts +15 -0
  107. package/Engines/thinEngine.pure.js +61 -14
  108. package/Engines/thinEngine.pure.js.map +1 -1
  109. package/Engines/thinNativeEngine.pure.d.ts +218 -17
  110. package/Engines/thinNativeEngine.pure.js +1438 -165
  111. package/Engines/thinNativeEngine.pure.js.map +1 -1
  112. package/Engines/thinWebGPUEngine.d.ts +4 -0
  113. package/Engines/thinWebGPUEngine.js +16 -2
  114. package/Engines/thinWebGPUEngine.js.map +1 -1
  115. package/Engines/webgpuEngine.pure.d.ts +17 -3
  116. package/Engines/webgpuEngine.pure.js +56 -13
  117. package/Engines/webgpuEngine.pure.js.map +1 -1
  118. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.js +2 -2
  119. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.js.map +1 -1
  120. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.d.ts +10 -0
  121. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.js +24 -12
  122. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.js.map +1 -1
  123. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.d.ts +11 -2
  124. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.js +1 -1
  125. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.js.map +1 -1
  126. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.d.ts +7 -0
  127. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.js +43 -0
  128. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.js.map +1 -1
  129. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.d.ts +9 -1
  130. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.js +6 -8
  131. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.js.map +1 -1
  132. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.d.ts +2 -0
  133. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.js +5 -1
  134. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.js.map +1 -1
  135. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.d.ts +2 -0
  136. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.js +5 -1
  137. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.js.map +1 -1
  138. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.d.ts +9 -0
  139. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.js +34 -9
  140. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.js.map +1 -1
  141. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.d.ts +2 -0
  142. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.js +4 -0
  143. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.js.map +1 -1
  144. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.d.ts +18 -4
  145. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js +24 -6
  146. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js.map +1 -1
  147. package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.pure.js +19 -7
  148. package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.pure.js.map +1 -1
  149. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.js +3 -3
  150. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.js.map +1 -1
  151. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.d.ts +20 -2
  152. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js +85 -25
  153. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js.map +1 -1
  154. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.d.ts +16 -1
  155. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.js +64 -14
  156. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.js.map +1 -1
  157. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.d.ts +12 -1
  158. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js +8 -0
  159. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js.map +1 -1
  160. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.pure.js +4 -1
  161. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.pure.js.map +1 -1
  162. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.d.ts +12 -1
  163. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.js +5 -1
  164. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.js.map +1 -1
  165. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.pure.js +64 -16
  166. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.pure.js.map +1 -1
  167. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.d.ts +2 -0
  168. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.js +14 -2
  169. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.js.map +1 -1
  170. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.d.ts +5 -1
  171. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.js +23 -8
  172. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.js.map +1 -1
  173. package/FlowGraph/CustomTypes/flowGraphInteger.pure.d.ts +5 -0
  174. package/FlowGraph/CustomTypes/flowGraphInteger.pure.js +7 -0
  175. package/FlowGraph/CustomTypes/flowGraphInteger.pure.js.map +1 -1
  176. package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +10 -0
  177. package/FlowGraph/CustomTypes/flowGraphMatrix.js +14 -0
  178. package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -1
  179. package/FlowGraph/flowGraph.d.ts +6 -1
  180. package/FlowGraph/flowGraph.js +41 -9
  181. package/FlowGraph/flowGraph.js.map +1 -1
  182. package/FlowGraph/flowGraphAnimationHelpers.d.ts +24 -0
  183. package/FlowGraph/flowGraphAnimationHelpers.js +21 -0
  184. package/FlowGraph/flowGraphAnimationHelpers.js.map +1 -0
  185. package/FlowGraph/flowGraphBlock.js +3 -0
  186. package/FlowGraph/flowGraphBlock.js.map +1 -1
  187. package/FlowGraph/flowGraphConnection.d.ts +7 -0
  188. package/FlowGraph/flowGraphConnection.js +7 -0
  189. package/FlowGraph/flowGraphConnection.js.map +1 -1
  190. package/FlowGraph/flowGraphContext.d.ts +2 -1
  191. package/FlowGraph/flowGraphContext.js +5 -3
  192. package/FlowGraph/flowGraphContext.js.map +1 -1
  193. package/FlowGraph/flowGraphCoordinator.d.ts +15 -1
  194. package/FlowGraph/flowGraphCoordinator.js +47 -16
  195. package/FlowGraph/flowGraphCoordinator.js.map +1 -1
  196. package/FlowGraph/flowGraphEventBlock.d.ts +5 -0
  197. package/FlowGraph/flowGraphEventBlock.js +7 -0
  198. package/FlowGraph/flowGraphEventBlock.js.map +1 -1
  199. package/FlowGraph/flowGraphHostResolver.d.ts +2 -1
  200. package/FlowGraph/flowGraphHostResolver.js.map +1 -1
  201. package/FlowGraph/flowGraphParser.js +60 -2
  202. package/FlowGraph/flowGraphParser.js.map +1 -1
  203. package/FlowGraph/flowGraphValidator.js +0 -4
  204. package/FlowGraph/flowGraphValidator.js.map +1 -1
  205. package/FlowGraph/index.d.ts +2 -0
  206. package/FlowGraph/index.js +2 -0
  207. package/FlowGraph/index.js.map +1 -1
  208. package/FlowGraph/pure.d.ts +2 -0
  209. package/FlowGraph/pure.js +2 -0
  210. package/FlowGraph/pure.js.map +1 -1
  211. package/FlowGraph/serialization.d.ts +4 -2
  212. package/FlowGraph/serialization.js +12 -24
  213. package/FlowGraph/serialization.js.map +1 -1
  214. package/FlowGraph/typeDefinitions.d.ts +9 -1
  215. package/FlowGraph/typeDefinitions.js.map +1 -1
  216. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.d.ts +5 -0
  217. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.js +8 -0
  218. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.js.map +1 -0
  219. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.d.ts +87 -0
  220. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.js +295 -0
  221. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.js.map +1 -0
  222. package/FrameGraph/Node/Blocks/PostProcesses/pure.d.ts +1 -0
  223. package/FrameGraph/Node/Blocks/PostProcesses/pure.js +1 -0
  224. package/FrameGraph/Node/Blocks/PostProcesses/pure.js.map +1 -1
  225. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +4 -4
  226. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  227. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.d.ts +5 -1
  228. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js +13 -1
  229. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js.map +1 -1
  230. package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.d.ts +1 -0
  231. package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.js +4 -0
  232. package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.js.map +1 -0
  233. package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.d.ts +54 -0
  234. package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.js +155 -0
  235. package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.js.map +1 -0
  236. package/FrameGraph/Node/Blocks/Textures/pure.d.ts +1 -0
  237. package/FrameGraph/Node/Blocks/Textures/pure.js +1 -0
  238. package/FrameGraph/Node/Blocks/Textures/pure.js.map +1 -1
  239. package/FrameGraph/Node/Blocks/allBlocks.pure.js +4 -0
  240. package/FrameGraph/Node/Blocks/allBlocks.pure.js.map +1 -1
  241. package/FrameGraph/Node/Blocks/index.d.ts +2 -0
  242. package/FrameGraph/Node/Blocks/index.js +2 -0
  243. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  244. package/FrameGraph/Node/Blocks/inputBlock.pure.js +20 -1
  245. package/FrameGraph/Node/Blocks/inputBlock.pure.js.map +1 -1
  246. package/FrameGraph/Node/Blocks/pure.d.ts +2 -0
  247. package/FrameGraph/Node/Blocks/pure.js +2 -0
  248. package/FrameGraph/Node/Blocks/pure.js.map +1 -1
  249. package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +4 -2
  250. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +4 -2
  251. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
  252. package/FrameGraph/Node/nodeRenderGraph.js +1 -1
  253. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  254. package/FrameGraph/Tasks/Layers/selectionOutlineTask.js +1 -0
  255. package/FrameGraph/Tasks/Layers/selectionOutlineTask.js.map +1 -1
  256. package/FrameGraph/Tasks/Misc/cullObjectsTask.js +5 -1
  257. package/FrameGraph/Tasks/Misc/cullObjectsTask.js.map +1 -1
  258. package/FrameGraph/Tasks/Misc/lightingVolumeTask.js +1 -0
  259. package/FrameGraph/Tasks/Misc/lightingVolumeTask.js.map +1 -1
  260. package/FrameGraph/Tasks/Misc/minMaxReducerTask.d.ts +62 -0
  261. package/FrameGraph/Tasks/Misc/minMaxReducerTask.js +159 -0
  262. package/FrameGraph/Tasks/Misc/minMaxReducerTask.js.map +1 -0
  263. package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.d.ts +69 -0
  264. package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.js +223 -0
  265. package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.js.map +1 -0
  266. package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +25 -3
  267. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +72 -34
  268. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  269. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +3 -1
  270. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  271. package/FrameGraph/frameGraph.d.ts +4 -0
  272. package/FrameGraph/frameGraph.js +14 -0
  273. package/FrameGraph/frameGraph.js.map +1 -1
  274. package/FrameGraph/frameGraphObjectList.d.ts +6 -1
  275. package/FrameGraph/frameGraphObjectList.js.map +1 -1
  276. package/FrameGraph/frameGraphRenderContext.d.ts +3 -1
  277. package/FrameGraph/frameGraphRenderContext.js +5 -5
  278. package/FrameGraph/frameGraphRenderContext.js.map +1 -1
  279. package/FrameGraph/index.d.ts +2 -0
  280. package/FrameGraph/index.js +2 -0
  281. package/FrameGraph/index.js.map +1 -1
  282. package/FrameGraph/pure.d.ts +2 -0
  283. package/FrameGraph/pure.js +2 -0
  284. package/FrameGraph/pure.js.map +1 -1
  285. package/Inputs/scene.inputManager.d.ts +4 -0
  286. package/Inputs/scene.inputManager.js +50 -8
  287. package/Inputs/scene.inputManager.js.map +1 -1
  288. package/Lights/Clustered/clusteredLightingSceneComponent.pure.d.ts +5 -0
  289. package/Lights/Clustered/clusteredLightingSceneComponent.pure.js +22 -1
  290. package/Lights/Clustered/clusteredLightingSceneComponent.pure.js.map +1 -1
  291. package/Lights/Shadows/cascadedShadowGenerator.pure.js +7 -3
  292. package/Lights/Shadows/cascadedShadowGenerator.pure.js.map +1 -1
  293. package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.d.ts +7 -0
  294. package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.js +8 -0
  295. package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.js.map +1 -0
  296. package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.d.ts +54 -0
  297. package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.js +81 -0
  298. package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.js.map +1 -0
  299. package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.d.ts +7 -0
  300. package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.js +8 -0
  301. package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.js.map +1 -0
  302. package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.d.ts +60 -0
  303. package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.js +90 -0
  304. package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.js.map +1 -0
  305. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.d.ts +31 -0
  306. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js +103 -5
  307. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js.map +1 -1
  308. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js +6 -6
  309. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js.map +1 -1
  310. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.d.ts +26 -1
  311. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +153 -49
  312. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
  313. package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.d.ts +1 -0
  314. package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.js +4 -0
  315. package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.js.map +1 -0
  316. package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.d.ts +83 -0
  317. package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.js +191 -0
  318. package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.js.map +1 -0
  319. package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.d.ts +1 -0
  320. package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.js +4 -0
  321. package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.js.map +1 -0
  322. package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.d.ts +62 -0
  323. package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.js +125 -0
  324. package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.js.map +1 -0
  325. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js +5 -5
  326. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js.map +1 -1
  327. package/Materials/GaussianSplatting/pure.d.ts +4 -0
  328. package/Materials/GaussianSplatting/pure.js +4 -0
  329. package/Materials/GaussianSplatting/pure.js.map +1 -1
  330. package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.d.ts +1 -0
  331. package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js +12 -0
  332. package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js.map +1 -1
  333. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js +11 -1
  334. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js.map +1 -1
  335. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js +17 -2
  336. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js.map +1 -1
  337. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js +2 -2
  338. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js.map +1 -1
  339. package/Materials/Node/nodeMaterial.pure.d.ts +4 -0
  340. package/Materials/Node/nodeMaterial.pure.js +4 -0
  341. package/Materials/Node/nodeMaterial.pure.js.map +1 -1
  342. package/Materials/Node/nodeMaterialBuildState.d.ts +1 -1
  343. package/Materials/Node/nodeMaterialBuildState.js +25 -3
  344. package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
  345. package/Materials/PBR/openpbrMaterial.pure.d.ts +2 -0
  346. package/Materials/PBR/pbrBaseMaterial.pure.d.ts +2 -0
  347. package/Materials/Textures/Procedurals/proceduralTexture.pure.d.ts +14 -14
  348. package/Materials/Textures/Procedurals/proceduralTexture.pure.js +37 -13
  349. package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
  350. package/Materials/Textures/baseTexture.pure.js +3 -0
  351. package/Materials/Textures/baseTexture.pure.js.map +1 -1
  352. package/Materials/Textures/cubeTexture.pure.js +1 -1
  353. package/Materials/Textures/cubeTexture.pure.js.map +1 -1
  354. package/Materials/Textures/internalTexture.d.ts +8 -1
  355. package/Materials/Textures/internalTexture.js +9 -2
  356. package/Materials/Textures/internalTexture.js.map +1 -1
  357. package/Materials/Textures/mirrorTexture.pure.js +3 -1
  358. package/Materials/Textures/mirrorTexture.pure.js.map +1 -1
  359. package/Materials/Textures/rawTexture2DArray.functions.d.ts +3 -3
  360. package/Materials/Textures/rawTexture2DArray.functions.js.map +1 -1
  361. package/Materials/Textures/rawTexture3D.d.ts +1 -1
  362. package/Materials/Textures/rawTexture3D.js +1 -1
  363. package/Materials/Textures/rawTexture3D.js.map +1 -1
  364. package/Materials/Textures/texture.pure.js +1 -1
  365. package/Materials/Textures/texture.pure.js.map +1 -1
  366. package/Materials/Textures/textureHelper.functions.d.ts +14 -0
  367. package/Materials/Textures/textureHelper.functions.js +24 -0
  368. package/Materials/Textures/textureHelper.functions.js.map +1 -1
  369. package/Materials/ditheredTileFadeMaterialPlugin.d.ts +210 -0
  370. package/Materials/ditheredTileFadeMaterialPlugin.js +509 -0
  371. package/Materials/ditheredTileFadeMaterialPlugin.js.map +1 -0
  372. package/Materials/effectRenderer.pure.d.ts +4 -0
  373. package/Materials/effectRenderer.pure.js +3 -2
  374. package/Materials/effectRenderer.pure.js.map +1 -1
  375. package/Materials/index.d.ts +5 -0
  376. package/Materials/index.js +5 -0
  377. package/Materials/index.js.map +1 -1
  378. package/Materials/material.pure.js +25 -12
  379. package/Materials/material.pure.js.map +1 -1
  380. package/Materials/materialHelper.geometryrendering.d.ts +46 -1
  381. package/Materials/materialHelper.geometryrendering.js +105 -8
  382. package/Materials/materialHelper.geometryrendering.js.map +1 -1
  383. package/Materials/prepass.defines.d.ts +2 -0
  384. package/Materials/prepass.defines.js +2 -0
  385. package/Materials/prepass.defines.js.map +1 -1
  386. package/Materials/pure.d.ts +5 -0
  387. package/Materials/pure.js +5 -0
  388. package/Materials/pure.js.map +1 -1
  389. package/Materials/standardMaterial.pure.d.ts +10 -0
  390. package/Materials/standardMaterial.pure.js +30 -5
  391. package/Materials/standardMaterial.pure.js.map +1 -1
  392. package/Meshes/Builders/polygonBuilder.pure.d.ts +4 -0
  393. package/Meshes/Builders/polygonBuilder.pure.js +3 -0
  394. package/Meshes/Builders/polygonBuilder.pure.js.map +1 -1
  395. package/Meshes/GaussianSplatting/gaussianPointSplattingController.d.ts +8 -0
  396. package/Meshes/GaussianSplatting/gaussianPointSplattingController.js +11 -0
  397. package/Meshes/GaussianSplatting/gaussianPointSplattingController.js.map +1 -0
  398. package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.d.ts +231 -0
  399. package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.js +1212 -0
  400. package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.js.map +1 -0
  401. package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.d.ts +14 -0
  402. package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.js +15 -0
  403. package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.js.map +1 -0
  404. package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.d.ts +285 -0
  405. package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.js +812 -0
  406. package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.js.map +1 -0
  407. package/Meshes/GaussianSplatting/gaussianSplatting.functions.d.ts +19 -0
  408. package/Meshes/GaussianSplatting/gaussianSplatting.functions.js +23 -0
  409. package/Meshes/GaussianSplatting/gaussianSplatting.functions.js.map +1 -0
  410. package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +1 -0
  411. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +2 -0
  412. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  413. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +163 -14
  414. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +239 -24
  415. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
  416. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +34 -4
  417. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +125 -25
  418. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  419. package/Meshes/GaussianSplatting/pure.d.ts +2 -0
  420. package/Meshes/GaussianSplatting/pure.js +2 -0
  421. package/Meshes/GaussianSplatting/pure.js.map +1 -1
  422. package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js +25 -11
  423. package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js.map +1 -1
  424. package/Meshes/abstractMesh.pure.d.ts +30 -0
  425. package/Meshes/abstractMesh.pure.js +54 -0
  426. package/Meshes/abstractMesh.pure.js.map +1 -1
  427. package/Meshes/index.d.ts +2 -0
  428. package/Meshes/index.js +2 -0
  429. package/Meshes/index.js.map +1 -1
  430. package/Meshes/instancedMesh.pure.d.ts +5 -0
  431. package/Meshes/instancedMesh.pure.js +12 -0
  432. package/Meshes/instancedMesh.pure.js.map +1 -1
  433. package/Meshes/mesh.pure.js +23 -8
  434. package/Meshes/mesh.pure.js.map +1 -1
  435. package/Meshes/meshBlendingTag.d.ts +47 -0
  436. package/Meshes/meshBlendingTag.js +64 -0
  437. package/Meshes/meshBlendingTag.js.map +1 -0
  438. package/Meshes/polygonMesh.js +2 -2
  439. package/Meshes/polygonMesh.js.map +1 -1
  440. package/Meshes/pure.d.ts +2 -0
  441. package/Meshes/pure.js +2 -0
  442. package/Meshes/pure.js.map +1 -1
  443. package/Meshes/subMesh.pure.d.ts +11 -2
  444. package/Meshes/subMesh.pure.js +20 -5
  445. package/Meshes/subMesh.pure.js.map +1 -1
  446. package/Meshes/thinInstanceMesh.pure.js +1 -0
  447. package/Meshes/thinInstanceMesh.pure.js.map +1 -1
  448. package/Misc/andOrNotEvaluator.js +4 -0
  449. package/Misc/andOrNotEvaluator.js.map +1 -1
  450. package/Misc/fileTools.pure.js +21 -0
  451. package/Misc/fileTools.pure.js.map +1 -1
  452. package/Misc/minMaxReducer.pure.d.ts +6 -0
  453. package/Misc/minMaxReducer.pure.js +10 -0
  454. package/Misc/minMaxReducer.pure.js.map +1 -1
  455. package/Misc/snapshotRenderingHelper.js +2 -2
  456. package/Misc/snapshotRenderingHelper.js.map +1 -1
  457. package/Misc/thinMinMaxReducer.d.ts +19 -2
  458. package/Misc/thinMinMaxReducer.js +74 -21
  459. package/Misc/thinMinMaxReducer.js.map +1 -1
  460. package/Misc/tools.pure.js +1 -1
  461. package/Misc/tools.pure.js.map +1 -1
  462. package/Particles/Node/Blocks/Update/updateNoiseBlock.pure.js +19 -7
  463. package/Particles/Node/Blocks/Update/updateNoiseBlock.pure.js.map +1 -1
  464. package/Particles/Node/Blocks/particleSourceTextureBlock.pure.js +3 -2
  465. package/Particles/Node/Blocks/particleSourceTextureBlock.pure.js.map +1 -1
  466. package/Particles/gpuParticleSystem.pure.d.ts +4 -0
  467. package/Particles/gpuParticleSystem.pure.js +101 -32
  468. package/Particles/gpuParticleSystem.pure.js.map +1 -1
  469. package/Particles/particle.js +3 -2
  470. package/Particles/particle.js.map +1 -1
  471. package/Particles/solidParticleSystem.js +7 -1
  472. package/Particles/solidParticleSystem.js.map +1 -1
  473. package/Particles/thinParticleSystem.function.d.ts +6 -0
  474. package/Particles/thinParticleSystem.function.js +144 -88
  475. package/Particles/thinParticleSystem.function.js.map +1 -1
  476. package/Particles/thinParticleSystem.pure.d.ts +8 -0
  477. package/Particles/thinParticleSystem.pure.js +154 -28
  478. package/Particles/thinParticleSystem.pure.js.map +1 -1
  479. package/Particles/webgl2ParticleSystem.pure.d.ts +1 -0
  480. package/Particles/webgl2ParticleSystem.pure.js +12 -4
  481. package/Particles/webgl2ParticleSystem.pure.js.map +1 -1
  482. package/Physics/v2/ragdoll.d.ts +2 -4
  483. package/Physics/v2/ragdoll.js +11 -4
  484. package/Physics/v2/ragdoll.js.map +1 -1
  485. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.pure.js +7 -0
  486. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.pure.js.map +1 -1
  487. package/PostProcesses/index.d.ts +2 -0
  488. package/PostProcesses/index.js +2 -0
  489. package/PostProcesses/index.js.map +1 -1
  490. package/PostProcesses/meshBlendingBlueNoise.d.ts +15 -0
  491. package/PostProcesses/meshBlendingBlueNoise.js +77 -0
  492. package/PostProcesses/meshBlendingBlueNoise.js.map +1 -0
  493. package/PostProcesses/meshBlendingPostProcess.d.ts +131 -0
  494. package/PostProcesses/meshBlendingPostProcess.js +315 -0
  495. package/PostProcesses/meshBlendingPostProcess.js.map +1 -0
  496. package/PostProcesses/pure.d.ts +2 -0
  497. package/PostProcesses/pure.js +2 -0
  498. package/PostProcesses/pure.js.map +1 -1
  499. package/PostProcesses/thinMeshBlendingPostProcess.d.ts +339 -0
  500. package/PostProcesses/thinMeshBlendingPostProcess.js +771 -0
  501. package/PostProcesses/thinMeshBlendingPostProcess.js.map +1 -0
  502. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js +6 -6
  503. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js.map +1 -1
  504. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.d.ts +12 -0
  505. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +50 -25
  506. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
  507. package/Rendering/boundingBoxRenderer.pure.js +2 -1
  508. package/Rendering/boundingBoxRenderer.pure.js.map +1 -1
  509. package/Rendering/depthRenderer.pure.d.ts +9 -0
  510. package/Rendering/depthRenderer.pure.js +15 -4
  511. package/Rendering/depthRenderer.pure.js.map +1 -1
  512. package/Rendering/edgesRenderer.pure.d.ts +4 -2
  513. package/Rendering/edgesRenderer.pure.js +11 -2
  514. package/Rendering/edgesRenderer.pure.js.map +1 -1
  515. package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +14 -0
  516. package/Rendering/fluidRenderer/fluidRenderingObject.js +26 -0
  517. package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
  518. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +13 -3
  519. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +22 -9
  520. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
  521. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +3 -0
  522. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
  523. package/Rendering/geometryBufferRenderer.pure.d.ts +38 -4
  524. package/Rendering/geometryBufferRenderer.pure.js +130 -18
  525. package/Rendering/geometryBufferRenderer.pure.js.map +1 -1
  526. package/Rendering/objectRenderer.d.ts +7 -1
  527. package/Rendering/objectRenderer.js +45 -7
  528. package/Rendering/objectRenderer.js.map +1 -1
  529. package/Rendering/outlineRenderer.pure.js +6 -2
  530. package/Rendering/outlineRenderer.pure.js.map +1 -1
  531. package/Rendering/prePassRenderer.pure.js +3 -3
  532. package/Rendering/prePassRenderer.pure.js.map +1 -1
  533. package/Rendering/renderingManager.d.ts +1 -1
  534. package/Rendering/renderingManager.js +5 -4
  535. package/Rendering/renderingManager.js.map +1 -1
  536. package/Shaders/ShadersInclude/defaultFragmentAlpha.d.ts +5 -0
  537. package/Shaders/ShadersInclude/defaultFragmentAlpha.js +34 -0
  538. package/Shaders/ShadersInclude/defaultFragmentAlpha.js.map +1 -0
  539. package/Shaders/ShadersInclude/gaussianSplatting.js +3 -1
  540. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  541. package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js +5 -1
  542. package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js.map +1 -1
  543. package/Shaders/ShadersInclude/geometryRenderingFragment.d.ts +5 -0
  544. package/Shaders/ShadersInclude/geometryRenderingFragment.js +74 -0
  545. package/Shaders/ShadersInclude/geometryRenderingFragment.js.map +1 -0
  546. package/Shaders/ShadersInclude/lightsFragmentFunctions.js +27 -3
  547. package/Shaders/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
  548. package/Shaders/ShadersInclude/mrtFragmentDeclaration.js +89 -0
  549. package/Shaders/ShadersInclude/mrtFragmentDeclaration.js.map +1 -1
  550. package/Shaders/ShadersInclude/oitDeclaration.js +1 -1
  551. package/Shaders/ShadersInclude/oitDeclaration.js.map +1 -1
  552. package/Shaders/ShadersInclude/openpbrBlockPrePass.js +24 -17
  553. package/Shaders/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
  554. package/Shaders/ShadersInclude/pbrBlockPrePass.js +27 -20
  555. package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -1
  556. package/Shaders/ShadersInclude/pbrDebug.js +6 -2
  557. package/Shaders/ShadersInclude/pbrDebug.js.map +1 -1
  558. package/Shaders/ShadersInclude/prePassDeclaration.js +95 -2
  559. package/Shaders/ShadersInclude/prePassDeclaration.js.map +1 -1
  560. package/Shaders/default.fragment.js +31 -40
  561. package/Shaders/default.fragment.js.map +1 -1
  562. package/Shaders/depthOfField.fragment.js +13 -9
  563. package/Shaders/depthOfField.fragment.js.map +1 -1
  564. package/Shaders/fluidRenderingParticleDepth.vertex.js +16 -1
  565. package/Shaders/fluidRenderingParticleDepth.vertex.js.map +1 -1
  566. package/Shaders/fluidRenderingParticleThickness.vertex.js +16 -1
  567. package/Shaders/fluidRenderingParticleThickness.vertex.js.map +1 -1
  568. package/Shaders/gaussianSplatting.fragment.js +63 -3
  569. package/Shaders/gaussianSplatting.fragment.js.map +1 -1
  570. package/Shaders/gaussianSplatting.vertex.js +80 -0
  571. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  572. package/Shaders/geometry.fragment.js +17 -11
  573. package/Shaders/geometry.fragment.js.map +1 -1
  574. package/Shaders/gpuRenderParticles.fragment.js +43 -1
  575. package/Shaders/gpuRenderParticles.fragment.js.map +1 -1
  576. package/Shaders/gpuRenderParticles.vertex.js +96 -16
  577. package/Shaders/gpuRenderParticles.vertex.js.map +1 -1
  578. package/Shaders/meshBlending.fragment.d.ts +5 -0
  579. package/Shaders/meshBlending.fragment.js +519 -0
  580. package/Shaders/meshBlending.fragment.js.map +1 -0
  581. package/Shaders/minmaxRedux.fragment.js +6 -1
  582. package/Shaders/minmaxRedux.fragment.js.map +1 -1
  583. package/Shaders/particles.fragment.js +43 -1
  584. package/Shaders/particles.fragment.js.map +1 -1
  585. package/Shaders/particles.vertex.js +84 -3
  586. package/Shaders/particles.vertex.js.map +1 -1
  587. package/Shaders/sprites.fragment.js +52 -2
  588. package/Shaders/sprites.fragment.js.map +1 -1
  589. package/Shaders/sprites.vertex.js +62 -1
  590. package/Shaders/sprites.vertex.js.map +1 -1
  591. package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.d.ts +5 -0
  592. package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.js +33 -0
  593. package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.js.map +1 -0
  594. package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.d.ts +5 -0
  595. package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.js +65 -0
  596. package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.js.map +1 -0
  597. package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.d.ts +5 -0
  598. package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.js +17 -0
  599. package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.js.map +1 -0
  600. package/ShadersWGSL/ShadersInclude/gaussianSplatting.d.ts +1 -0
  601. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +6 -78
  602. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
  603. package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js +2 -2
  604. package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js.map +1 -1
  605. package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.d.ts +5 -0
  606. package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.js +79 -0
  607. package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.js.map +1 -0
  608. package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.d.ts +6 -0
  609. package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.js +76 -0
  610. package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.js.map +1 -0
  611. package/ShadersWGSL/ShadersInclude/lightFragment.js +1 -1
  612. package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
  613. package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js +27 -3
  614. package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
  615. package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.d.ts +5 -0
  616. package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.js +18 -0
  617. package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.js.map +1 -0
  618. package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.d.ts +1 -0
  619. package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js +11 -25
  620. package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
  621. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.d.ts +1 -0
  622. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +11 -25
  623. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -1
  624. package/ShadersWGSL/ShadersInclude/pbrDebug.js +5 -1
  625. package/ShadersWGSL/ShadersInclude/pbrDebug.js.map +1 -1
  626. package/ShadersWGSL/ShadersInclude/prePassDeclaration.js +6 -1
  627. package/ShadersWGSL/ShadersInclude/prePassDeclaration.js.map +1 -1
  628. package/ShadersWGSL/default.fragment.js +17 -48
  629. package/ShadersWGSL/default.fragment.js.map +1 -1
  630. package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js +15 -2
  631. package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js.map +1 -1
  632. package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js +15 -2
  633. package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js.map +1 -1
  634. package/ShadersWGSL/gaussianPointSplattingBlit.fragment.d.ts +5 -0
  635. package/ShadersWGSL/gaussianPointSplattingBlit.fragment.js +22 -0
  636. package/ShadersWGSL/gaussianPointSplattingBlit.fragment.js.map +1 -0
  637. package/ShadersWGSL/gaussianPointSplattingBlit.vertex.d.ts +5 -0
  638. package/ShadersWGSL/gaussianPointSplattingBlit.vertex.js +19 -0
  639. package/ShadersWGSL/gaussianPointSplattingBlit.vertex.js.map +1 -0
  640. package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.d.ts +5 -0
  641. package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.js +21 -0
  642. package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.js.map +1 -0
  643. package/ShadersWGSL/gaussianSplatting.fragment.js +63 -2
  644. package/ShadersWGSL/gaussianSplatting.fragment.js.map +1 -1
  645. package/ShadersWGSL/gaussianSplatting.vertex.js +82 -1
  646. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  647. package/ShadersWGSL/gaussianSplattingDepth.vertex.js +2 -1
  648. package/ShadersWGSL/gaussianSplattingDepth.vertex.js.map +1 -1
  649. package/ShadersWGSL/gaussianSplattingVoxel.vertex.js +2 -1
  650. package/ShadersWGSL/gaussianSplattingVoxel.vertex.js.map +1 -1
  651. package/ShadersWGSL/geometry.fragment.js +37 -2
  652. package/ShadersWGSL/geometry.fragment.js.map +1 -1
  653. package/ShadersWGSL/gpsHiZBuild.compute.d.ts +5 -0
  654. package/ShadersWGSL/gpsHiZBuild.compute.js +16 -0
  655. package/ShadersWGSL/gpsHiZBuild.compute.js.map +1 -0
  656. package/ShadersWGSL/gpsPartition.compute.d.ts +5 -0
  657. package/ShadersWGSL/gpsPartition.compute.js +27 -0
  658. package/ShadersWGSL/gpsPartition.compute.js.map +1 -0
  659. package/ShadersWGSL/gpsPreprocess.compute.d.ts +5 -0
  660. package/ShadersWGSL/gpsPreprocess.compute.js +86 -0
  661. package/ShadersWGSL/gpsPreprocess.compute.js.map +1 -0
  662. package/ShadersWGSL/gpsResolve.compute.d.ts +5 -0
  663. package/ShadersWGSL/gpsResolve.compute.js +41 -0
  664. package/ShadersWGSL/gpsResolve.compute.js.map +1 -0
  665. package/ShadersWGSL/gpsScanAdd.compute.d.ts +5 -0
  666. package/ShadersWGSL/gpsScanAdd.compute.js +22 -0
  667. package/ShadersWGSL/gpsScanAdd.compute.js.map +1 -0
  668. package/ShadersWGSL/gpsScanBlocks.compute.d.ts +5 -0
  669. package/ShadersWGSL/gpsScanBlocks.compute.js +23 -0
  670. package/ShadersWGSL/gpsScanBlocks.compute.js.map +1 -0
  671. package/ShadersWGSL/gpsScanSums.compute.d.ts +5 -0
  672. package/ShadersWGSL/gpsScanSums.compute.js +30 -0
  673. package/ShadersWGSL/gpsScanSums.compute.js.map +1 -0
  674. package/ShadersWGSL/gpsSplat.compute.d.ts +5 -0
  675. package/ShadersWGSL/gpsSplat.compute.js +37 -0
  676. package/ShadersWGSL/gpsSplat.compute.js.map +1 -0
  677. package/ShadersWGSL/gpuRenderParticles.fragment.js +47 -2
  678. package/ShadersWGSL/gpuRenderParticles.fragment.js.map +1 -1
  679. package/ShadersWGSL/gpuRenderParticles.vertex.js +110 -7
  680. package/ShadersWGSL/gpuRenderParticles.vertex.js.map +1 -1
  681. package/ShadersWGSL/meshBlending.fragment.d.ts +5 -0
  682. package/ShadersWGSL/meshBlending.fragment.js +576 -0
  683. package/ShadersWGSL/meshBlending.fragment.js.map +1 -0
  684. package/ShadersWGSL/minmaxRedux.fragment.js +20 -3
  685. package/ShadersWGSL/minmaxRedux.fragment.js.map +1 -1
  686. package/ShadersWGSL/openpbr.fragment.js +2 -1
  687. package/ShadersWGSL/openpbr.fragment.js.map +1 -1
  688. package/ShadersWGSL/particles.fragment.js +45 -1
  689. package/ShadersWGSL/particles.fragment.js.map +1 -1
  690. package/ShadersWGSL/particles.vertex.js +86 -4
  691. package/ShadersWGSL/particles.vertex.js.map +1 -1
  692. package/ShadersWGSL/pbr.fragment.js +2 -1
  693. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  694. package/ShadersWGSL/sprites.fragment.js +56 -2
  695. package/ShadersWGSL/sprites.fragment.js.map +1 -1
  696. package/ShadersWGSL/sprites.vertex.js +62 -1
  697. package/ShadersWGSL/sprites.vertex.js.map +1 -1
  698. package/Sprites/spriteManager.d.ts +13 -0
  699. package/Sprites/spriteManager.js +15 -0
  700. package/Sprites/spriteManager.js.map +1 -1
  701. package/Sprites/spriteRenderer.d.ts +24 -1
  702. package/Sprites/spriteRenderer.js +368 -50
  703. package/Sprites/spriteRenderer.js.map +1 -1
  704. package/Sprites/thinSprite.d.ts +4 -0
  705. package/Sprites/thinSprite.js +4 -0
  706. package/Sprites/thinSprite.js.map +1 -1
  707. package/States/alphaCullingState.d.ts +3 -1
  708. package/States/alphaCullingState.js +18 -3
  709. package/States/alphaCullingState.js.map +1 -1
  710. package/XR/features/WebXRSpaceWarp.pure.js +2 -1
  711. package/XR/features/WebXRSpaceWarp.pure.js.map +1 -1
  712. package/XR/webXRDefaultExperience.d.ts +5 -1
  713. package/XR/webXRDefaultExperience.js.map +1 -1
  714. package/XR/webXREnterExitUI.d.ts +2 -1
  715. package/XR/webXREnterExitUI.js.map +1 -1
  716. package/assetContainer.d.ts +1 -0
  717. package/assetContainer.js +5 -1
  718. package/assetContainer.js.map +1 -1
  719. package/package.json +1 -1
  720. package/scene.pure.d.ts +36 -2
  721. package/scene.pure.js +63 -4
  722. package/scene.pure.js.map +1 -1
@@ -2,10 +2,51 @@ import { blockFactory } from "./Blocks/flowGraphBlockFactory.js";
2
2
  import { FlowGraphCoordinator } from "./flowGraphCoordinator.js";
3
3
  import { FlowGraphEventBlock } from "./flowGraphEventBlock.js";
4
4
  import { FlowGraphExecutionBlock } from "./flowGraphExecutionBlock.js";
5
- import { defaultValueParseFunction, needsPathConverter } from "./serialization.js";
5
+ import { _GetDefaultEventDataParseCount, defaultValueParseFunction, needsPathConverter } from "./serialization.js";
6
6
  import { getRichTypeByFlowGraphType, RichType } from "./flowGraphRichTypes.pure.js";
7
7
 
8
8
  import { WebRequest } from "../Misc/webRequest.js";
9
+ function ParseCustomEventData(serializedEventData, valueParseFunction, assetsContainer, scene) {
10
+ const eventData = Object.create(null);
11
+ if (Array.isArray(serializedEventData)) {
12
+ for (const serializedEntry of serializedEventData) {
13
+ if (!serializedEntry?.eventData) {
14
+ continue;
15
+ }
16
+ const entry = { type: getRichTypeByFlowGraphType(serializedEntry.type) };
17
+ if (serializedEntry.value !== undefined) {
18
+ entry.value = serializedEntry.value?.getClassName?.() ? serializedEntry.value : valueParseFunction("value", serializedEntry, assetsContainer, scene);
19
+ }
20
+ Object.defineProperty(eventData, serializedEntry.id, {
21
+ configurable: true,
22
+ enumerable: true,
23
+ value: entry,
24
+ writable: true,
25
+ });
26
+ }
27
+ return eventData;
28
+ }
29
+ if (serializedEventData === null || typeof serializedEventData !== "object") {
30
+ return eventData;
31
+ }
32
+ for (const eventKey of Object.keys(serializedEventData)) {
33
+ const serializedEntry = serializedEventData[eventKey];
34
+ if (serializedEntry === null || typeof serializedEntry !== "object") {
35
+ continue;
36
+ }
37
+ const entry = { type: serializedEntry.type };
38
+ if (serializedEntry.value !== undefined) {
39
+ entry.value = serializedEntry.value?.getClassName?.() ? serializedEntry.value : valueParseFunction("value", serializedEntry, assetsContainer, scene);
40
+ }
41
+ Object.defineProperty(eventData, eventKey, {
42
+ configurable: true,
43
+ enumerable: true,
44
+ value: entry,
45
+ writable: true,
46
+ });
47
+ }
48
+ return eventData;
49
+ }
9
50
  async function GetSerializedFlowGraphFromSnippetAsync(snippetId) {
10
51
  const response = await WebRequest.FetchAsync(`https://snippet.babylonjs.com` + "/" + snippetId.replace(/#/g, "/"));
11
52
  if (!response.ok) {
@@ -149,6 +190,7 @@ export function ParseFlowGraph(serializationObject, options, resolvedClasses) {
149
190
  if (serializationObject.uniqueId) {
150
191
  graph.uniqueId = serializationObject.uniqueId;
151
192
  }
193
+ graph.metadata = serializationObject.metadata;
152
194
  const blocks = [];
153
195
  const valueParseFunction = options.valueParseFunction ?? defaultValueParseFunction;
154
196
  // Parse all blocks
@@ -323,9 +365,25 @@ export async function ParseBlockAsync(serializationObject, parseOptions) {
323
365
  export function ParseFlowGraphBlockWithClassType(serializationObject, parseOptions, classType) {
324
366
  const parsedConfig = {};
325
367
  const valueParseFunction = parseOptions.valueParseFunction ?? defaultValueParseFunction;
368
+ const customValueParseFunction = parseOptions.valueParseFunction === defaultValueParseFunction ? undefined : parseOptions.valueParseFunction;
326
369
  if (serializationObject.config) {
327
370
  for (const key in serializationObject.config) {
328
- parsedConfig[key] = valueParseFunction(key, serializationObject.config, parseOptions.assetsContainer || parseOptions.scene, parseOptions.scene);
371
+ const assetsContainer = parseOptions.assetsContainer || parseOptions.scene;
372
+ const isCustomEventData = key === "eventData" &&
373
+ (serializationObject.className === "FlowGraphSendCustomEventBlock" /* FlowGraphBlockNames.SendCustomEvent */ || serializationObject.className === "FlowGraphReceiveCustomEventBlock" /* FlowGraphBlockNames.ReceiveCustomEvent */);
374
+ if (isCustomEventData) {
375
+ const eventData = serializationObject.config[key];
376
+ const defaultParseCount = _GetDefaultEventDataParseCount(eventData);
377
+ const customParsedEventData = customValueParseFunction?.(key, serializationObject.config, assetsContainer, parseOptions.scene);
378
+ const delegatedToDefault = _GetDefaultEventDataParseCount(eventData) > defaultParseCount;
379
+ parsedConfig[key] =
380
+ customValueParseFunction && (!delegatedToDefault || customParsedEventData !== eventData)
381
+ ? customParsedEventData
382
+ : ParseCustomEventData(eventData, valueParseFunction, assetsContainer, parseOptions.scene);
383
+ }
384
+ else {
385
+ parsedConfig[key] = valueParseFunction(key, serializationObject.config, assetsContainer, parseOptions.scene);
386
+ }
329
387
  }
330
388
  }
331
389
  if (needsPathConverter(serializationObject.className)) {
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphParser.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphParser.ts"],"names":[],"mappings":"AAC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E,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACrK,UAAU,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC;IAC5C,OAAO,UAAU,CAAC;AACtB,CAAC;AAED;;;;GAIG;AACH,SAAS,aAAa,CAAC,mBAAwB;IAC3C,OAAO,IAAI,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC;AACxF,CAAC","sourcesContent":["import { type IAssetContainer } from \"core/IAssetContainer\";\nimport { blockFactory } from \"./Blocks/flowGraphBlockFactory\";\nimport { type FlowGraphBlockNames } from \"./Blocks/flowGraphBlockNames\";\nimport { type FlowGraph, type IFlowGraphParseOptions } from \"./flowGraph\";\nimport { type FlowGraphBlock, type IFlowGraphBlockParseOptions } from \"./flowGraphBlock\";\nimport { type FlowGraphContext, type IFlowGraphContextParseOptions } from \"./flowGraphContext\";\nimport { type IFlowGraphCoordinatorParseOptions, FlowGraphCoordinator } from \"./flowGraphCoordinator\";\nimport { type FlowGraphDataConnection } from \"./flowGraphDataConnection\";\nimport { FlowGraphEventBlock } from \"./flowGraphEventBlock\";\nimport { FlowGraphExecutionBlock } from \"./flowGraphExecutionBlock\";\nimport { type FlowGraphSignalConnection } from \"./flowGraphSignalConnection\";\nimport { defaultValueParseFunction, needsPathConverter } from \"./serialization\";\nimport { type ISerializedFlowGraph, type ISerializedFlowGraphBlock, type ISerializedFlowGraphContext } from \"./typeDefinitions\";\nimport { type Node } from \"core/node\";\nimport { getRichTypeByFlowGraphType, RichType } from \"./flowGraphRichTypes.pure\";\nimport { type FlowGraphConnection } from \"./flowGraphConnection\";\nimport { Constants } from \"core/Engines/constants\";\nimport { WebRequest } from \"core/Misc/webRequest\";\n\nasync function GetSerializedFlowGraphFromSnippetAsync(snippetId: string): Promise<any> {\n const response = await WebRequest.FetchAsync(Constants.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\n if (!response.ok) {\n throw new Error(\"Unable to load the snippet \" + snippetId);\n }\n\n const text = new TextDecoder().decode(await response.arrayBuffer());\n const snippet = JSON.parse(text);\n const snippetPayload = JSON.parse(snippet.jsonPayload);\n const flowGraphPayload = snippetPayload.flowGraph;\n if (!flowGraphPayload) {\n throw new Error(\"Snippet \" + snippetId + \" does not contain a flow graph\");\n }\n\n return typeof flowGraphPayload === \"string\" ? JSON.parse(flowGraphPayload) : flowGraphPayload;\n}\n\nfunction ApplyCoordinatorSerializationSettings(serializedObject: any, coordinator: FlowGraphCoordinator): void {\n if (serializedObject.dispatchEventsSynchronously !== undefined) {\n coordinator.dispatchEventsSynchronously = serializedObject.dispatchEventsSynchronously;\n }\n\n if (serializedObject._defaultValues) {\n for (const key in serializedObject._defaultValues) {\n getRichTypeByFlowGraphType(key).defaultValue = serializedObject._defaultValues[key];\n }\n }\n}\n\n/**\n * Given a list of blocks, find an output data connection that has a specific unique id\n * @param blocks a list of flow graph blocks\n * @param uniqueId the unique id of a connection\n * @returns the connection that has this unique id. throws an error if none was found\n */\nexport function GetDataOutConnectionByUniqueId(blocks: FlowGraphBlock[], uniqueId: string): FlowGraphDataConnection<any> {\n for (const block of blocks) {\n for (const dataOut of block.dataOutputs) {\n if (dataOut.uniqueId === uniqueId) {\n return dataOut;\n }\n }\n }\n throw new Error(\"Could not find data out connection with unique id \" + uniqueId);\n}\n\n/**\n * Given a list of blocks, find an input signal connection that has a specific unique id\n * @param blocks a list of flow graph blocks\n * @param uniqueId the unique id of a connection\n * @returns the connection that has this unique id. throws an error if none was found\n */\nexport function GetSignalInConnectionByUniqueId(blocks: FlowGraphBlock[], uniqueId: string): FlowGraphSignalConnection {\n for (const block of blocks) {\n if (block instanceof FlowGraphExecutionBlock) {\n for (const signalIn of block.signalInputs) {\n if (signalIn.uniqueId === uniqueId) {\n return signalIn;\n }\n }\n }\n }\n throw new Error(\"Could not find signal in connection with unique id \" + uniqueId);\n}\n\n/**\n * Parses a serialized coordinator.\n * @param serializedObject the object to parse\n * @param options the options to use when parsing\n * @returns the parsed coordinator\n */\nexport async function ParseCoordinatorAsync(serializedObject: any, options: IFlowGraphCoordinatorParseOptions) {\n const valueParseFunction = options.valueParseFunction ?? defaultValueParseFunction;\n const coordinator = new FlowGraphCoordinator({ scene: options.scene });\n\n ApplyCoordinatorSerializationSettings(serializedObject, coordinator);\n\n await options.scene.whenReadyAsync();\n // async-parse the flow graphs. This can be done in parallel\n await Promise.all(\n serializedObject._flowGraphs?.map(\n async (serializedGraph: any) => await ParseFlowGraphAsync(serializedGraph, { coordinator, valueParseFunction, pathConverter: options.pathConverter })\n )\n );\n return coordinator;\n}\n\n/**\n * Parses a flow graph coordinator from a snippet saved by the Flow Graph Editor.\n * @param snippetId the snippet id to load. Versioned ids such as \"ABC123#4\" are supported.\n * @param options options for parsing the coordinator.\n * @returns the parsed flow graph coordinator.\n */\nexport async function ParseFlowGraphCoordinatorFromSnippetAsync(snippetId: string, options: IFlowGraphCoordinatorParseOptions): Promise<FlowGraphCoordinator> {\n const serializedObject = await GetSerializedFlowGraphFromSnippetAsync(snippetId);\n if (serializedObject._flowGraphs) {\n return await ParseCoordinatorAsync(serializedObject, options);\n }\n\n const valueParseFunction = options.valueParseFunction ?? defaultValueParseFunction;\n const coordinator = new FlowGraphCoordinator({ scene: options.scene });\n await options.scene.whenReadyAsync();\n await ParseFlowGraphAsync(serializedObject, { coordinator, valueParseFunction, pathConverter: options.pathConverter });\n return coordinator;\n}\n\n/**\n * Parses a flow graph from a snippet saved by the Flow Graph Editor.\n * If the snippet contains multiple graphs, all graphs are parsed into the provided coordinator and the active graph is returned.\n * @param snippetId the snippet id to load. Versioned ids such as \"ABC123#4\" are supported.\n * @param options options for parsing the graph.\n * @returns the parsed flow graph.\n */\nexport async function ParseFlowGraphFromSnippetAsync(snippetId: string, options: IFlowGraphParseOptions): Promise<FlowGraph> {\n const serializedObject = await GetSerializedFlowGraphFromSnippetAsync(snippetId);\n const valueParseFunction = options.valueParseFunction ?? defaultValueParseFunction;\n\n if (!serializedObject._flowGraphs) {\n return await ParseFlowGraphAsync(serializedObject, options);\n }\n\n ApplyCoordinatorSerializationSettings(serializedObject, options.coordinator);\n const parsedGraphs: FlowGraph[] = [];\n for (const serializedGraph of serializedObject._flowGraphs) {\n // eslint-disable-next-line no-await-in-loop -- graph order matters for the active graph index.\n parsedGraphs.push(await ParseFlowGraphAsync(serializedGraph, { coordinator: options.coordinator, valueParseFunction, pathConverter: options.pathConverter }));\n }\n\n const activeGraphIndex = serializedObject.activeGraphIndex ?? 0;\n return parsedGraphs[activeGraphIndex] ?? parsedGraphs[0];\n}\n\n/**\n * Parses a graph from a given serialization object\n * @param serializationObject the object where the values are written\n * @param options options for parsing the graph\n * @returns the parsed graph\n */\nexport async function ParseFlowGraphAsync(serializationObject: ISerializedFlowGraph, options: IFlowGraphParseOptions): Promise<FlowGraph> {\n // get all classes types needed for the blocks using the block factory\n const resolvedClasses = await Promise.all(\n serializationObject.allBlocks.map(async (serializedBlock) => {\n const classFactory = blockFactory(serializedBlock.className as FlowGraphBlockNames);\n return await classFactory();\n })\n );\n // async will be used when we start using the block async factory\n return ParseFlowGraph(serializationObject, options, resolvedClasses);\n}\n\n/**\n * Parses a graph from a given serialization object\n * @param serializationObject the object where the values are written\n * @param options options for parsing the graph\n * @param resolvedClasses the resolved classes for the blocks\n * @returns the parsed graph\n */\nexport function ParseFlowGraph(serializationObject: ISerializedFlowGraph, options: IFlowGraphParseOptions, resolvedClasses: (typeof FlowGraphBlock)[]) {\n const graph = options.coordinator.createGraph();\n // Restore graph identity from serialized data\n if (serializationObject.name) {\n graph.name = serializationObject.name;\n }\n if (serializationObject.uniqueId) {\n graph.uniqueId = serializationObject.uniqueId;\n }\n const blocks: FlowGraphBlock[] = [];\n const valueParseFunction = options.valueParseFunction ?? defaultValueParseFunction;\n // Parse all blocks\n // for (const serializedBlock of serializationObject.allBlocks) {\n for (let i = 0; i < serializationObject.allBlocks.length; i++) {\n const serializedBlock = serializationObject.allBlocks[i];\n const block = ParseFlowGraphBlockWithClassType(\n serializedBlock,\n { scene: options.coordinator.config.scene, pathConverter: options.pathConverter, assetsContainer: options.coordinator.config.scene, valueParseFunction },\n resolvedClasses[i]\n );\n blocks.push(block);\n graph.addBlock(block);\n if (block instanceof FlowGraphEventBlock) {\n graph.addEventBlock(block);\n }\n }\n // After parsing all blocks, connect them.\n // Build lookup maps for O(1) connection resolution instead of O(B*P) linear scans.\n const dataInMap = new Map<string, FlowGraphDataConnection<any>>();\n const dataOutMap = new Map<string, FlowGraphDataConnection<any>>();\n const signalInMap = new Map<string, FlowGraphSignalConnection>();\n const signalOutMap = new Map<string, FlowGraphSignalConnection>();\n for (const block of blocks) {\n for (const dataIn of block.dataInputs) {\n dataInMap.set(dataIn.uniqueId, dataIn);\n }\n for (const dataOut of block.dataOutputs) {\n dataOutMap.set(dataOut.uniqueId, dataOut);\n }\n if (block instanceof FlowGraphExecutionBlock) {\n for (const signalIn of block.signalInputs) {\n signalInMap.set(signalIn.uniqueId, signalIn);\n }\n for (const signalOut of block.signalOutputs) {\n signalOutMap.set(signalOut.uniqueId, signalOut);\n }\n }\n }\n const connectIfNeeded = <ConnectionT extends FlowGraphConnection<any, any>>(connection: ConnectionT, connectedConnection: ConnectionT) => {\n if (connection._connectedPoint.indexOf(connectedConnection) !== -1) {\n return;\n }\n connection.connectTo(connectedConnection);\n };\n for (const block of blocks) {\n for (const dataIn of block.dataInputs) {\n for (const serializedConnection of dataIn.connectedPointIds) {\n const connection = dataOutMap.get(serializedConnection);\n if (!connection) {\n throw new Error(\"Could not find data out connection with unique id \" + serializedConnection);\n }\n connectIfNeeded(dataIn, connection);\n }\n }\n for (const dataOut of block.dataOutputs) {\n for (const serializedConnection of dataOut.connectedPointIds) {\n const connection = dataInMap.get(serializedConnection);\n if (!connection) {\n throw new Error(\"Could not find data in connection with unique id \" + serializedConnection);\n }\n connectIfNeeded(dataOut, connection);\n }\n }\n if (block instanceof FlowGraphExecutionBlock) {\n for (const signalOut of block.signalOutputs) {\n for (const serializedConnection of signalOut.connectedPointIds) {\n const connection = signalInMap.get(serializedConnection);\n if (!connection) {\n throw new Error(\"Could not find signal in connection with unique id \" + serializedConnection);\n }\n connectIfNeeded(signalOut, connection);\n }\n }\n for (const signalIn of block.signalInputs) {\n for (const serializedConnection of signalIn.connectedPointIds) {\n const connection = signalOutMap.get(serializedConnection);\n if (!connection) {\n throw new Error(\"Could not find signal out connection with unique id \" + serializedConnection);\n }\n connectIfNeeded(connection, signalIn);\n }\n }\n }\n }\n for (const serializedContext of serializationObject.executionContexts ?? []) {\n ParseFlowGraphContext(serializedContext, { graph, valueParseFunction }, serializationObject.rightHanded);\n }\n return graph;\n}\n\n/**\n * Parses a context\n * @param serializationObject the object containing the context serialization values\n * @param options the options for parsing the context\n * @param rightHanded whether the serialized data is right handed\n * @returns\n */\nexport function ParseFlowGraphContext(serializationObject: ISerializedFlowGraphContext, options: IFlowGraphContextParseOptions, rightHanded?: boolean): FlowGraphContext {\n const result = options.graph.createContext();\n if (serializationObject.enableLogging) {\n result.enableLogging = true;\n }\n result.treatDataAsRightHanded = rightHanded || false;\n const valueParseFunction = options.valueParseFunction ?? defaultValueParseFunction;\n result.uniqueId = serializationObject.uniqueId;\n result.name = serializationObject.name ?? \"\";\n const scene = result.getScene();\n // check if assets context is available\n if (serializationObject._assetsContext) {\n const ac = serializationObject._assetsContext;\n const assetsContext: IAssetContainer = {\n meshes: ac.meshes?.map((m: string) => scene.getMeshById(m)),\n lights: ac.lights?.map((l: string) => scene.getLightByName(l)),\n cameras: ac.cameras?.map((c: string) => scene.getCameraByName(c)),\n materials: ac.materials?.map((m: string) => scene.getMaterialById(m)),\n textures: ac.textures?.map((t: string) => scene.getTextureByName(t)),\n animations: ac.animations?.map((a: string) => scene.animations.find((anim) => anim.name === a)),\n skeletons: ac.skeletons?.map((s: string) => scene.getSkeletonByName(s)),\n particleSystems: ac.particleSystems?.map((ps: string) => scene.getParticleSystemById(ps)),\n animationGroups: ac.animationGroups?.map((ag: string) => scene.getAnimationGroupByName(ag)),\n transformNodes: ac.transformNodes?.map((tn: string) => scene.getTransformNodeById(tn)),\n rootNodes: [],\n multiMaterials: [],\n morphTargetManagers: [],\n geometries: [],\n actionManagers: [],\n environmentTexture: null,\n postProcesses: [],\n sounds: null,\n effectLayers: [],\n layers: [],\n reflectionProbes: [],\n lensFlareSystems: [],\n proceduralTextures: [],\n getNodes: function (): Array<Node> {\n throw new Error(\"Function not implemented.\");\n },\n };\n result.assetsContext = assetsContext;\n }\n for (const key in serializationObject._userVariables) {\n const value = valueParseFunction(key, serializationObject._userVariables, result.assetsContext, scene);\n result.userVariables[key] = value;\n }\n // Restore variable type annotations\n if (serializationObject._variableTypes) {\n for (const key in serializationObject._variableTypes) {\n result.setVariableType(key, serializationObject._variableTypes[key]);\n }\n }\n for (const key in serializationObject._connectionValues) {\n const value = valueParseFunction(key, serializationObject._connectionValues, result.assetsContext, scene);\n result._setConnectionValueByKey(key, value);\n }\n\n return result;\n}\n\n/**\n * Parses a block from a serialization object\n * This function is async due to the factory method that is used to create the block's class. If you load the class externally use ParseBlockWithClassType\n * @param serializationObject the object to parse from\n * @param parseOptions options for parsing the block\n * @returns the parsed block\n */\nexport async function ParseBlockAsync(serializationObject: ISerializedFlowGraphBlock, parseOptions: IFlowGraphBlockParseOptions): Promise<FlowGraphBlock> {\n const classFactory = blockFactory(serializationObject.className as FlowGraphBlockNames);\n const classType = await classFactory();\n return ParseFlowGraphBlockWithClassType(serializationObject, parseOptions, classType);\n}\n\n/**\n * Parses a block from a serialization object\n * @param serializationObject the object to parse from\n * @param parseOptions options for parsing the block\n * @param classType the class type of the block. This is used when the class is not loaded asynchronously\n * @returns the parsed block\n */\nexport function ParseFlowGraphBlockWithClassType(\n serializationObject: ISerializedFlowGraphBlock,\n parseOptions: IFlowGraphBlockParseOptions,\n classType: typeof FlowGraphBlock\n): FlowGraphBlock {\n const parsedConfig: any = {};\n const valueParseFunction = parseOptions.valueParseFunction ?? defaultValueParseFunction;\n if (serializationObject.config) {\n for (const key in serializationObject.config) {\n parsedConfig[key] = valueParseFunction(key, serializationObject.config, parseOptions.assetsContainer || parseOptions.scene, parseOptions.scene);\n }\n }\n if (needsPathConverter(serializationObject.className)) {\n if (!parseOptions.pathConverter) {\n throw new Error(\"Block \" + serializationObject.className + \" requires a path converter to be provided in parse options.\");\n }\n parsedConfig.pathConverter = parseOptions.pathConverter;\n }\n const obj = new classType(parsedConfig);\n obj.uniqueId = serializationObject.uniqueId;\n for (let i = 0; i < serializationObject.dataInputs.length; i++) {\n const dataInput = obj.getDataInput(serializationObject.dataInputs[i].name);\n if (dataInput) {\n dataInput.deserialize(serializationObject.dataInputs[i]);\n // Restore _defaultValue if it was serialized. Without this, the\n // user-set inline value (e.g. \"2\" on an Add input, or \"position\"\n // on a GetProperty's propertyName) is lost during round-trips.\n if (serializationObject.dataInputs[i].defaultValue !== undefined) {\n (dataInput as any)._defaultValue = valueParseFunction(\n \"defaultValue\",\n serializationObject.dataInputs[i],\n parseOptions.assetsContainer || parseOptions.scene,\n parseOptions.scene\n );\n }\n } else {\n throw new Error(\"Could not find data input with name \" + serializationObject.dataInputs[i].name + \" in block \" + serializationObject.className);\n }\n }\n for (let i = 0; i < serializationObject.dataOutputs.length; i++) {\n const dataOutput = obj.getDataOutput(serializationObject.dataOutputs[i].name);\n if (dataOutput) {\n dataOutput.deserialize(serializationObject.dataOutputs[i]);\n } else {\n throw new Error(\"Could not find data output with name \" + serializationObject.dataOutputs[i].name + \" in block \" + serializationObject.className);\n }\n }\n obj.metadata = serializationObject.metadata;\n obj.deserialize && obj.deserialize(serializationObject);\n return obj;\n}\n\n/**\n * Parses a connection from an object\n * @param serializationObject the object to parse from.\n * @param ownerBlock the block that owns the connection.\n * @param classType the class type of the connection.\n * @returns the parsed connection.\n */\nexport function ParseGraphConnectionWithClassType<BlockT extends FlowGraphBlock>(serializationObject: any = {}, ownerBlock: BlockT, classType: typeof FlowGraphConnection) {\n const connection = new classType(serializationObject.name, serializationObject._connectionType, ownerBlock);\n connection.deserialize(serializationObject);\n return connection;\n}\n\n/**\n * Parses a data connection from a serialized object.\n * @param serializationObject the object to parse from\n * @param ownerBlock the block that owns the connection\n * @param classType the class type of the data connection\n * @returns the parsed connection\n */\nexport function ParseGraphDataConnection(serializationObject: any, ownerBlock: FlowGraphBlock, classType: typeof FlowGraphDataConnection): FlowGraphDataConnection<any> {\n const richType = ParseRichType(serializationObject.richType);\n const defaultValue = serializationObject.defaultValue;\n const connection = new classType(serializationObject.name, serializationObject._connectionType, ownerBlock, richType, defaultValue, !!serializationObject._optional);\n connection.deserialize(serializationObject);\n return connection;\n}\n\n/**\n * Parses a rich type from a serialization object.\n * @param serializationObject a serialization object\n * @returns the parsed rich type\n */\nfunction ParseRichType(serializationObject: any): RichType<any> {\n return new RichType(serializationObject.typeName, serializationObject.defaultValue);\n}\n"]}
1
+ {"version":3,"file":"flowGraphParser.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphParser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAK9D,OAAO,EAA0C,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEtG,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,8BAA8B,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAIhH,OAAO,EAAE,0BAA0B,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEjF,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,SAAS,oBAAoB,CACzB,mBAA4B,EAC5B,kBAAkF,EAClF,eAAgC,EAChC,KAAY;IAEZ,MAAM,SAAS,GAAuD,MAAM,CAAC,M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,mBAAwB;IAC3C,OAAO,IAAI,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC;AACxF,CAAC","sourcesContent":["import { type IAssetContainer } from \"core/IAssetContainer\";\nimport { blockFactory } from \"./Blocks/flowGraphBlockFactory\";\nimport { FlowGraphBlockNames } from \"./Blocks/flowGraphBlockNames\";\nimport { type FlowGraph, type IFlowGraphParseOptions } from \"./flowGraph\";\nimport { type FlowGraphBlock, type IFlowGraphBlockParseOptions } from \"./flowGraphBlock\";\nimport { type FlowGraphContext, type IFlowGraphContextParseOptions } from \"./flowGraphContext\";\nimport { type IFlowGraphCoordinatorParseOptions, FlowGraphCoordinator } from \"./flowGraphCoordinator\";\nimport { type FlowGraphDataConnection } from \"./flowGraphDataConnection\";\nimport { FlowGraphEventBlock } from \"./flowGraphEventBlock\";\nimport { FlowGraphExecutionBlock } from \"./flowGraphExecutionBlock\";\nimport { type FlowGraphSignalConnection } from \"./flowGraphSignalConnection\";\nimport { _GetDefaultEventDataParseCount, defaultValueParseFunction, needsPathConverter } from \"./serialization\";\nimport { type ISerializedFlowGraph, type ISerializedFlowGraphBlock, type ISerializedFlowGraphContext } from \"./typeDefinitions\";\nimport { type Node } from \"core/node\";\nimport { type Scene } from \"core/scene\";\nimport { getRichTypeByFlowGraphType, RichType } from \"./flowGraphRichTypes.pure\";\nimport { type FlowGraphConnection } from \"./flowGraphConnection\";\nimport { Constants } from \"core/Engines/constants\";\nimport { WebRequest } from \"core/Misc/webRequest\";\n\nfunction ParseCustomEventData(\n serializedEventData: unknown,\n valueParseFunction: NonNullable<IFlowGraphBlockParseOptions[\"valueParseFunction\"]>,\n assetsContainer: IAssetContainer,\n scene: Scene\n): Record<string, { type: unknown; value?: unknown }> {\n const eventData: Record<string, { type: unknown; value?: unknown }> = Object.create(null);\n if (Array.isArray(serializedEventData)) {\n for (const serializedEntry of serializedEventData) {\n if (!serializedEntry?.eventData) {\n continue;\n }\n const entry: { type: unknown; value?: unknown } = { type: getRichTypeByFlowGraphType(serializedEntry.type) };\n if (serializedEntry.value !== undefined) {\n entry.value = serializedEntry.value?.getClassName?.() ? serializedEntry.value : valueParseFunction(\"value\", serializedEntry, assetsContainer, scene);\n }\n Object.defineProperty(eventData, serializedEntry.id, {\n configurable: true,\n enumerable: true,\n value: entry,\n writable: true,\n });\n }\n return eventData;\n }\n if (serializedEventData === null || typeof serializedEventData !== \"object\") {\n return eventData;\n }\n for (const eventKey of Object.keys(serializedEventData)) {\n const serializedEntry = (serializedEventData as Record<string, unknown>)[eventKey] as { type?: unknown; value?: unknown };\n if (serializedEntry === null || typeof serializedEntry !== \"object\") {\n continue;\n }\n const entry: { type: unknown; value?: unknown } = { type: serializedEntry.type };\n if (serializedEntry.value !== undefined) {\n entry.value = (serializedEntry.value as any)?.getClassName?.() ? serializedEntry.value : valueParseFunction(\"value\", serializedEntry, assetsContainer, scene);\n }\n Object.defineProperty(eventData, eventKey, {\n configurable: true,\n enumerable: true,\n value: entry,\n writable: true,\n });\n }\n return eventData;\n}\n\nasync function GetSerializedFlowGraphFromSnippetAsync(snippetId: string): Promise<any> {\n const response = await WebRequest.FetchAsync(Constants.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\n if (!response.ok) {\n throw new Error(\"Unable to load the snippet \" + snippetId);\n }\n\n const text = new TextDecoder().decode(await response.arrayBuffer());\n const snippet = JSON.parse(text);\n const snippetPayload = JSON.parse(snippet.jsonPayload);\n const flowGraphPayload = snippetPayload.flowGraph;\n if (!flowGraphPayload) {\n throw new Error(\"Snippet \" + snippetId + \" does not contain a flow graph\");\n }\n\n return typeof flowGraphPayload === \"string\" ? JSON.parse(flowGraphPayload) : flowGraphPayload;\n}\n\nfunction ApplyCoordinatorSerializationSettings(serializedObject: any, coordinator: FlowGraphCoordinator): void {\n if (serializedObject.dispatchEventsSynchronously !== undefined) {\n coordinator.dispatchEventsSynchronously = serializedObject.dispatchEventsSynchronously;\n }\n\n if (serializedObject._defaultValues) {\n for (const key in serializedObject._defaultValues) {\n getRichTypeByFlowGraphType(key).defaultValue = serializedObject._defaultValues[key];\n }\n }\n}\n\n/**\n * Given a list of blocks, find an output data connection that has a specific unique id\n * @param blocks a list of flow graph blocks\n * @param uniqueId the unique id of a connection\n * @returns the connection that has this unique id. throws an error if none was found\n */\nexport function GetDataOutConnectionByUniqueId(blocks: FlowGraphBlock[], uniqueId: string): FlowGraphDataConnection<any> {\n for (const block of blocks) {\n for (const dataOut of block.dataOutputs) {\n if (dataOut.uniqueId === uniqueId) {\n return dataOut;\n }\n }\n }\n throw new Error(\"Could not find data out connection with unique id \" + uniqueId);\n}\n\n/**\n * Given a list of blocks, find an input signal connection that has a specific unique id\n * @param blocks a list of flow graph blocks\n * @param uniqueId the unique id of a connection\n * @returns the connection that has this unique id. throws an error if none was found\n */\nexport function GetSignalInConnectionByUniqueId(blocks: FlowGraphBlock[], uniqueId: string): FlowGraphSignalConnection {\n for (const block of blocks) {\n if (block instanceof FlowGraphExecutionBlock) {\n for (const signalIn of block.signalInputs) {\n if (signalIn.uniqueId === uniqueId) {\n return signalIn;\n }\n }\n }\n }\n throw new Error(\"Could not find signal in connection with unique id \" + uniqueId);\n}\n\n/**\n * Parses a serialized coordinator.\n * @param serializedObject the object to parse\n * @param options the options to use when parsing\n * @returns the parsed coordinator\n */\nexport async function ParseCoordinatorAsync(serializedObject: any, options: IFlowGraphCoordinatorParseOptions) {\n const valueParseFunction = options.valueParseFunction ?? defaultValueParseFunction;\n const coordinator = new FlowGraphCoordinator({ scene: options.scene });\n\n ApplyCoordinatorSerializationSettings(serializedObject, coordinator);\n\n await options.scene.whenReadyAsync();\n // async-parse the flow graphs. This can be done in parallel\n await Promise.all(\n serializedObject._flowGraphs?.map(\n async (serializedGraph: any) => await ParseFlowGraphAsync(serializedGraph, { coordinator, valueParseFunction, pathConverter: options.pathConverter })\n )\n );\n return coordinator;\n}\n\n/**\n * Parses a flow graph coordinator from a snippet saved by the Flow Graph Editor.\n * @param snippetId the snippet id to load. Versioned ids such as \"ABC123#4\" are supported.\n * @param options options for parsing the coordinator.\n * @returns the parsed flow graph coordinator.\n */\nexport async function ParseFlowGraphCoordinatorFromSnippetAsync(snippetId: string, options: IFlowGraphCoordinatorParseOptions): Promise<FlowGraphCoordinator> {\n const serializedObject = await GetSerializedFlowGraphFromSnippetAsync(snippetId);\n if (serializedObject._flowGraphs) {\n return await ParseCoordinatorAsync(serializedObject, options);\n }\n\n const valueParseFunction = options.valueParseFunction ?? defaultValueParseFunction;\n const coordinator = new FlowGraphCoordinator({ scene: options.scene });\n await options.scene.whenReadyAsync();\n await ParseFlowGraphAsync(serializedObject, { coordinator, valueParseFunction, pathConverter: options.pathConverter });\n return coordinator;\n}\n\n/**\n * Parses a flow graph from a snippet saved by the Flow Graph Editor.\n * If the snippet contains multiple graphs, all graphs are parsed into the provided coordinator and the active graph is returned.\n * @param snippetId the snippet id to load. Versioned ids such as \"ABC123#4\" are supported.\n * @param options options for parsing the graph.\n * @returns the parsed flow graph.\n */\nexport async function ParseFlowGraphFromSnippetAsync(snippetId: string, options: IFlowGraphParseOptions): Promise<FlowGraph> {\n const serializedObject = await GetSerializedFlowGraphFromSnippetAsync(snippetId);\n const valueParseFunction = options.valueParseFunction ?? defaultValueParseFunction;\n\n if (!serializedObject._flowGraphs) {\n return await ParseFlowGraphAsync(serializedObject, options);\n }\n\n ApplyCoordinatorSerializationSettings(serializedObject, options.coordinator);\n const parsedGraphs: FlowGraph[] = [];\n for (const serializedGraph of serializedObject._flowGraphs) {\n // eslint-disable-next-line no-await-in-loop -- graph order matters for the active graph index.\n parsedGraphs.push(await ParseFlowGraphAsync(serializedGraph, { coordinator: options.coordinator, valueParseFunction, pathConverter: options.pathConverter }));\n }\n\n const activeGraphIndex = serializedObject.activeGraphIndex ?? 0;\n return parsedGraphs[activeGraphIndex] ?? parsedGraphs[0];\n}\n\n/**\n * Parses a graph from a given serialization object\n * @param serializationObject the object where the values are written\n * @param options options for parsing the graph\n * @returns the parsed graph\n */\nexport async function ParseFlowGraphAsync(serializationObject: ISerializedFlowGraph, options: IFlowGraphParseOptions): Promise<FlowGraph> {\n // get all classes types needed for the blocks using the block factory\n const resolvedClasses = await Promise.all(\n serializationObject.allBlocks.map(async (serializedBlock) => {\n const classFactory = blockFactory(serializedBlock.className as FlowGraphBlockNames);\n return await classFactory();\n })\n );\n // async will be used when we start using the block async factory\n return ParseFlowGraph(serializationObject, options, resolvedClasses);\n}\n\n/**\n * Parses a graph from a given serialization object\n * @param serializationObject the object where the values are written\n * @param options options for parsing the graph\n * @param resolvedClasses the resolved classes for the blocks\n * @returns the parsed graph\n */\nexport function ParseFlowGraph(serializationObject: ISerializedFlowGraph, options: IFlowGraphParseOptions, resolvedClasses: (typeof FlowGraphBlock)[]) {\n const graph = options.coordinator.createGraph();\n // Restore graph identity from serialized data\n if (serializationObject.name) {\n graph.name = serializationObject.name;\n }\n if (serializationObject.uniqueId) {\n graph.uniqueId = serializationObject.uniqueId;\n }\n graph.metadata = serializationObject.metadata;\n const blocks: FlowGraphBlock[] = [];\n const valueParseFunction = options.valueParseFunction ?? defaultValueParseFunction;\n // Parse all blocks\n // for (const serializedBlock of serializationObject.allBlocks) {\n for (let i = 0; i < serializationObject.allBlocks.length; i++) {\n const serializedBlock = serializationObject.allBlocks[i];\n const block = ParseFlowGraphBlockWithClassType(\n serializedBlock,\n { scene: options.coordinator.config.scene, pathConverter: options.pathConverter, assetsContainer: options.coordinator.config.scene, valueParseFunction },\n resolvedClasses[i]\n );\n blocks.push(block);\n graph.addBlock(block);\n if (block instanceof FlowGraphEventBlock) {\n graph.addEventBlock(block);\n }\n }\n // After parsing all blocks, connect them.\n // Build lookup maps for O(1) connection resolution instead of O(B*P) linear scans.\n const dataInMap = new Map<string, FlowGraphDataConnection<any>>();\n const dataOutMap = new Map<string, FlowGraphDataConnection<any>>();\n const signalInMap = new Map<string, FlowGraphSignalConnection>();\n const signalOutMap = new Map<string, FlowGraphSignalConnection>();\n for (const block of blocks) {\n for (const dataIn of block.dataInputs) {\n dataInMap.set(dataIn.uniqueId, dataIn);\n }\n for (const dataOut of block.dataOutputs) {\n dataOutMap.set(dataOut.uniqueId, dataOut);\n }\n if (block instanceof FlowGraphExecutionBlock) {\n for (const signalIn of block.signalInputs) {\n signalInMap.set(signalIn.uniqueId, signalIn);\n }\n for (const signalOut of block.signalOutputs) {\n signalOutMap.set(signalOut.uniqueId, signalOut);\n }\n }\n }\n const connectIfNeeded = <ConnectionT extends FlowGraphConnection<any, any>>(connection: ConnectionT, connectedConnection: ConnectionT) => {\n if (connection._connectedPoint.indexOf(connectedConnection) !== -1) {\n return;\n }\n connection.connectTo(connectedConnection);\n };\n for (const block of blocks) {\n for (const dataIn of block.dataInputs) {\n for (const serializedConnection of dataIn.connectedPointIds) {\n const connection = dataOutMap.get(serializedConnection);\n if (!connection) {\n throw new Error(\"Could not find data out connection with unique id \" + serializedConnection);\n }\n connectIfNeeded(dataIn, connection);\n }\n }\n for (const dataOut of block.dataOutputs) {\n for (const serializedConnection of dataOut.connectedPointIds) {\n const connection = dataInMap.get(serializedConnection);\n if (!connection) {\n throw new Error(\"Could not find data in connection with unique id \" + serializedConnection);\n }\n connectIfNeeded(dataOut, connection);\n }\n }\n if (block instanceof FlowGraphExecutionBlock) {\n for (const signalOut of block.signalOutputs) {\n for (const serializedConnection of signalOut.connectedPointIds) {\n const connection = signalInMap.get(serializedConnection);\n if (!connection) {\n throw new Error(\"Could not find signal in connection with unique id \" + serializedConnection);\n }\n connectIfNeeded(signalOut, connection);\n }\n }\n for (const signalIn of block.signalInputs) {\n for (const serializedConnection of signalIn.connectedPointIds) {\n const connection = signalOutMap.get(serializedConnection);\n if (!connection) {\n throw new Error(\"Could not find signal out connection with unique id \" + serializedConnection);\n }\n connectIfNeeded(connection, signalIn);\n }\n }\n }\n }\n for (const serializedContext of serializationObject.executionContexts ?? []) {\n ParseFlowGraphContext(serializedContext, { graph, valueParseFunction }, serializationObject.rightHanded);\n }\n return graph;\n}\n\n/**\n * Parses a context\n * @param serializationObject the object containing the context serialization values\n * @param options the options for parsing the context\n * @param rightHanded whether the serialized data is right handed\n * @returns\n */\nexport function ParseFlowGraphContext(serializationObject: ISerializedFlowGraphContext, options: IFlowGraphContextParseOptions, rightHanded?: boolean): FlowGraphContext {\n const result = options.graph.createContext();\n if (serializationObject.enableLogging) {\n result.enableLogging = true;\n }\n result.treatDataAsRightHanded = rightHanded || false;\n const valueParseFunction = options.valueParseFunction ?? defaultValueParseFunction;\n result.uniqueId = serializationObject.uniqueId;\n result.name = serializationObject.name ?? \"\";\n const scene = result.getScene();\n // check if assets context is available\n if (serializationObject._assetsContext) {\n const ac = serializationObject._assetsContext;\n const assetsContext: IAssetContainer = {\n meshes: ac.meshes?.map((m: string) => scene.getMeshById(m)),\n lights: ac.lights?.map((l: string) => scene.getLightByName(l)),\n cameras: ac.cameras?.map((c: string) => scene.getCameraByName(c)),\n materials: ac.materials?.map((m: string) => scene.getMaterialById(m)),\n textures: ac.textures?.map((t: string) => scene.getTextureByName(t)),\n animations: ac.animations?.map((a: string) => scene.animations.find((anim) => anim.name === a)),\n skeletons: ac.skeletons?.map((s: string) => scene.getSkeletonByName(s)),\n particleSystems: ac.particleSystems?.map((ps: string) => scene.getParticleSystemById(ps)),\n animationGroups: ac.animationGroups?.map((ag: string) => scene.getAnimationGroupByName(ag)),\n transformNodes: ac.transformNodes?.map((tn: string) => scene.getTransformNodeById(tn)),\n rootNodes: [],\n multiMaterials: [],\n morphTargetManagers: [],\n geometries: [],\n actionManagers: [],\n environmentTexture: null,\n postProcesses: [],\n sounds: null,\n effectLayers: [],\n layers: [],\n reflectionProbes: [],\n lensFlareSystems: [],\n proceduralTextures: [],\n getNodes: function (): Array<Node> {\n throw new Error(\"Function not implemented.\");\n },\n };\n result.assetsContext = assetsContext;\n }\n for (const key in serializationObject._userVariables) {\n const value = valueParseFunction(key, serializationObject._userVariables, result.assetsContext, scene);\n result.userVariables[key] = value;\n }\n // Restore variable type annotations\n if (serializationObject._variableTypes) {\n for (const key in serializationObject._variableTypes) {\n result.setVariableType(key, serializationObject._variableTypes[key]);\n }\n }\n for (const key in serializationObject._connectionValues) {\n const value = valueParseFunction(key, serializationObject._connectionValues, result.assetsContext, scene);\n result._setConnectionValueByKey(key, value);\n }\n\n return result;\n}\n\n/**\n * Parses a block from a serialization object\n * This function is async due to the factory method that is used to create the block's class. If you load the class externally use ParseBlockWithClassType\n * @param serializationObject the object to parse from\n * @param parseOptions options for parsing the block\n * @returns the parsed block\n */\nexport async function ParseBlockAsync(serializationObject: ISerializedFlowGraphBlock, parseOptions: IFlowGraphBlockParseOptions): Promise<FlowGraphBlock> {\n const classFactory = blockFactory(serializationObject.className as FlowGraphBlockNames);\n const classType = await classFactory();\n return ParseFlowGraphBlockWithClassType(serializationObject, parseOptions, classType);\n}\n\n/**\n * Parses a block from a serialization object\n * @param serializationObject the object to parse from\n * @param parseOptions options for parsing the block\n * @param classType the class type of the block. This is used when the class is not loaded asynchronously\n * @returns the parsed block\n */\nexport function ParseFlowGraphBlockWithClassType(\n serializationObject: ISerializedFlowGraphBlock,\n parseOptions: IFlowGraphBlockParseOptions,\n classType: typeof FlowGraphBlock\n): FlowGraphBlock {\n const parsedConfig: any = {};\n const valueParseFunction = parseOptions.valueParseFunction ?? defaultValueParseFunction;\n const customValueParseFunction = parseOptions.valueParseFunction === defaultValueParseFunction ? undefined : parseOptions.valueParseFunction;\n if (serializationObject.config) {\n for (const key in serializationObject.config) {\n const assetsContainer = parseOptions.assetsContainer || parseOptions.scene;\n const isCustomEventData =\n key === \"eventData\" &&\n (serializationObject.className === FlowGraphBlockNames.SendCustomEvent || serializationObject.className === FlowGraphBlockNames.ReceiveCustomEvent);\n if (isCustomEventData) {\n const eventData = serializationObject.config[key];\n const defaultParseCount = _GetDefaultEventDataParseCount(eventData);\n const customParsedEventData = customValueParseFunction?.(key, serializationObject.config, assetsContainer, parseOptions.scene);\n const delegatedToDefault = _GetDefaultEventDataParseCount(eventData) > defaultParseCount;\n parsedConfig[key] =\n customValueParseFunction && (!delegatedToDefault || customParsedEventData !== eventData)\n ? customParsedEventData\n : ParseCustomEventData(eventData, valueParseFunction, assetsContainer, parseOptions.scene);\n } else {\n parsedConfig[key] = valueParseFunction(key, serializationObject.config, assetsContainer, parseOptions.scene);\n }\n }\n }\n if (needsPathConverter(serializationObject.className)) {\n if (!parseOptions.pathConverter) {\n throw new Error(\"Block \" + serializationObject.className + \" requires a path converter to be provided in parse options.\");\n }\n parsedConfig.pathConverter = parseOptions.pathConverter;\n }\n const obj = new classType(parsedConfig);\n obj.uniqueId = serializationObject.uniqueId;\n for (let i = 0; i < serializationObject.dataInputs.length; i++) {\n const dataInput = obj.getDataInput(serializationObject.dataInputs[i].name);\n if (dataInput) {\n dataInput.deserialize(serializationObject.dataInputs[i]);\n // Restore _defaultValue if it was serialized. Without this, the\n // user-set inline value (e.g. \"2\" on an Add input, or \"position\"\n // on a GetProperty's propertyName) is lost during round-trips.\n if (serializationObject.dataInputs[i].defaultValue !== undefined) {\n (dataInput as any)._defaultValue = valueParseFunction(\n \"defaultValue\",\n serializationObject.dataInputs[i],\n parseOptions.assetsContainer || parseOptions.scene,\n parseOptions.scene\n );\n }\n } else {\n throw new Error(\"Could not find data input with name \" + serializationObject.dataInputs[i].name + \" in block \" + serializationObject.className);\n }\n }\n for (let i = 0; i < serializationObject.dataOutputs.length; i++) {\n const dataOutput = obj.getDataOutput(serializationObject.dataOutputs[i].name);\n if (dataOutput) {\n dataOutput.deserialize(serializationObject.dataOutputs[i]);\n } else {\n throw new Error(\"Could not find data output with name \" + serializationObject.dataOutputs[i].name + \" in block \" + serializationObject.className);\n }\n }\n obj.metadata = serializationObject.metadata;\n obj.deserialize && obj.deserialize(serializationObject);\n return obj;\n}\n\n/**\n * Parses a connection from an object\n * @param serializationObject the object to parse from.\n * @param ownerBlock the block that owns the connection.\n * @param classType the class type of the connection.\n * @returns the parsed connection.\n */\nexport function ParseGraphConnectionWithClassType<BlockT extends FlowGraphBlock>(serializationObject: any = {}, ownerBlock: BlockT, classType: typeof FlowGraphConnection) {\n const connection = new classType(serializationObject.name, serializationObject._connectionType, ownerBlock);\n connection.deserialize(serializationObject);\n return connection;\n}\n\n/**\n * Parses a data connection from a serialized object.\n * @param serializationObject the object to parse from\n * @param ownerBlock the block that owns the connection\n * @param classType the class type of the data connection\n * @returns the parsed connection\n */\nexport function ParseGraphDataConnection(serializationObject: any, ownerBlock: FlowGraphBlock, classType: typeof FlowGraphDataConnection): FlowGraphDataConnection<any> {\n const richType = ParseRichType(serializationObject.richType);\n const defaultValue = serializationObject.defaultValue;\n const connection = new classType(serializationObject.name, serializationObject._connectionType, ownerBlock, richType, defaultValue, !!serializationObject._optional);\n connection.deserialize(serializationObject);\n return connection;\n}\n\n/**\n * Parses a rich type from a serialization object.\n * @param serializationObject a serialization object\n * @returns the parsed rich type\n */\nfunction ParseRichType(serializationObject: any): RichType<any> {\n return new RichType(serializationObject.typeName, serializationObject.defaultValue);\n}\n"]}
@@ -269,10 +269,6 @@ function _DetectDataCycles(allBlocks, addIssue) {
269
269
  for (const block of allBlocks) {
270
270
  color.set(block.uniqueId, white);
271
271
  }
272
- const blockMap = new Map();
273
- for (const block of allBlocks) {
274
- blockMap.set(block.uniqueId, block);
275
- }
276
272
  const reportedCycleBlocks = new Set();
277
273
  function dfs(block) {
278
274
  color.set(block.uniqueId, gray);
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphValidator.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphValidator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D;;GAEG;AACH,MAAM,CAAN,IAAkB,2BAKjB;AALD,WAAkB,2BAA2B;IACzC,wDAAwD;IACxD,+EAAK,CAAA;IACL,qDAAqD;IACrD,mFAAO,CAAA;AACX,CAAC,EALiB,2BAA2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QAC5B,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,KAAK,EAAE,CAAC;YACtC,GAAG,CAAC,KAAK,CAAC,CAAC;QACf,CAAC;IACL,CAAC;AACL,CAAC","sourcesContent":["import { type FlowGraph } from \"./flowGraph\";\nimport { type FlowGraphBlock } from \"./flowGraphBlock\";\nimport { FlowGraphExecutionBlock } from \"./flowGraphExecutionBlock\";\nimport { type FlowGraphDataConnection } from \"./flowGraphDataConnection\";\nimport { FlowGraphTypes } from \"./flowGraphRichTypes.pure\";\nimport { FlowGraphEventBlock } from \"./flowGraphEventBlock\";\nimport { type FlowGraphEventType } from \"./flowGraphEventType\";\n\n/**\n * Severity level for a validation issue.\n */\nexport const enum FlowGraphValidationSeverity {\n /** A critical issue that will cause runtime failure. */\n Error,\n /** A potential issue that may indicate a mistake. */\n Warning,\n}\n\n/**\n * A single validation issue found in the flow graph.\n */\nexport interface IFlowGraphValidationIssue {\n /** The severity level. */\n severity: FlowGraphValidationSeverity;\n /** Human-readable description of the issue. */\n message: string;\n /** The block where the issue was found (if applicable). */\n block?: FlowGraphBlock;\n /** The connection name involved (if applicable). */\n connectionName?: string;\n}\n\n/**\n * The result of validating a flow graph.\n */\nexport interface IFlowGraphValidationResult {\n /** Whether the graph passed validation with no errors. */\n isValid: boolean;\n /** All issues found, ordered by severity (errors first). */\n issues: IFlowGraphValidationIssue[];\n /** Convenience: number of error-level issues. */\n errorCount: number;\n /** Convenience: number of warning-level issues. */\n warningCount: number;\n /** Map from block uniqueId to the issues affecting that block. */\n issuesByBlock: Map<string, IFlowGraphValidationIssue[]>;\n}\n\n// Types that are mutually coercible and should not produce type-mismatch warnings\nconst NumericLikeTypes = new Set<string>([FlowGraphTypes.Number, FlowGraphTypes.Integer, FlowGraphTypes.Boolean]);\nconst VectorLikeTypes = new Set<string>([FlowGraphTypes.Vector4, FlowGraphTypes.Quaternion]);\nconst ColorLikeTypes = new Set<string>([FlowGraphTypes.Color3, FlowGraphTypes.Color4]);\n\n/**\n * @internal\n */\nfunction _AreTypesCompatible(sourceType: string, targetType: string): boolean {\n if (sourceType === targetType) {\n return true;\n }\n // \"any\" is compatible with everything\n if (sourceType === FlowGraphTypes.Any || targetType === FlowGraphTypes.Any) {\n return true;\n }\n // Numeric coercion group\n if (NumericLikeTypes.has(sourceType) && NumericLikeTypes.has(targetType)) {\n return true;\n }\n // Vector4 / Quaternion are interchangeable\n if (VectorLikeTypes.has(sourceType) && VectorLikeTypes.has(targetType)) {\n return true;\n }\n // Color3 → Color4 widening is safe\n if (ColorLikeTypes.has(sourceType) && ColorLikeTypes.has(targetType)) {\n return true;\n }\n return false;\n}\n\n/**\n * Validates a flow graph and returns all issues found.\n *\n * The following checks are performed:\n * 1. **No event blocks** — the graph has no entry points.\n * 2. **Unconnected required data inputs** — a non-optional data input with no connection.\n * 3. **Unconnected signal inputs** — an execution block whose `in` signal has no connection and\n * that is not an event block (entry point).\n * 4. **Data type mismatches** — a data connection whose source richType is incompatible with the\n * target richType.\n * 5. **Unreachable blocks** — blocks not reachable from any event block via signal/data traversal.\n * 6. **Data dependency cycles** — circular data-only connections that would cause infinite recursion.\n *\n * @param flowGraph - The flow graph to validate.\n * @returns The validation result.\n */\nexport function ValidateFlowGraph(flowGraph: FlowGraph): IFlowGraphValidationResult {\n const issues: IFlowGraphValidationIssue[] = [];\n const issuesByBlock = new Map<string, IFlowGraphValidationIssue[]>();\n\n const addIssue = (issue: IFlowGraphValidationIssue) => {\n issues.push(issue);\n if (issue.block) {\n let arr = issuesByBlock.get(issue.block.uniqueId);\n if (!arr) {\n arr = [];\n issuesByBlock.set(issue.block.uniqueId, arr);\n }\n arr.push(issue);\n }\n };\n\n // Collect ALL blocks via visitAllBlocks\n const allBlocks: FlowGraphBlock[] = [];\n flowGraph.visitAllBlocks((block) => {\n allBlocks.push(block);\n });\n\n // ── Check 1: No event blocks ───────────────────────────────────────\n const eventBlocks = _GetEventBlocks(flowGraph);\n if (eventBlocks.length === 0) {\n addIssue({\n severity: FlowGraphValidationSeverity.Error,\n message: \"Graph has no event blocks — nothing will trigger execution.\",\n });\n }\n\n // ── Check 2: Unconnected required data inputs ──────────────────────\n for (const block of allBlocks) {\n for (const input of block.dataInputs) {\n if (!input.optional && !input.isDisabled && !input.isConnected()) {\n addIssue({\n severity: FlowGraphValidationSeverity.Warning,\n message: `\"${input.name}\" is not connected and will use its default value.`,\n block,\n connectionName: input.name,\n });\n }\n }\n }\n\n // ── Check 3: Unconnected signal inputs on non-event execution blocks\n for (const block of allBlocks) {\n if (block instanceof FlowGraphExecutionBlock) {\n // Skip event blocks — they are entry points and don't need an incoming signal.\n if (_IsEventBlock(block)) {\n continue;\n }\n const inSignal = block.signalInputs.find((s) => s.name === \"in\");\n if (inSignal && !inSignal.isConnected()) {\n addIssue({\n severity: FlowGraphValidationSeverity.Error,\n message: `Execution block has no incoming signal — it will never execute.`,\n block,\n connectionName: \"in\",\n });\n }\n }\n }\n\n // ── Check 4: Data type mismatches ──────────────────────────────────\n for (const block of allBlocks) {\n for (const input of block.dataInputs) {\n if (!input.isConnected()) {\n continue;\n }\n const source = input._connectedPoint[0] as FlowGraphDataConnection<any>;\n const srcType = source.richType?.typeName;\n const tgtType = input.richType?.typeName;\n if (srcType && tgtType && !_AreTypesCompatible(srcType, tgtType)) {\n // If either side has a typeTransformer, it's intentionally converted\n if (source.richType.typeTransformer !== undefined || input.richType.typeTransformer !== undefined) {\n continue;\n }\n addIssue({\n severity: FlowGraphValidationSeverity.Warning,\n message: `Type mismatch: \"${source._ownerBlock.name}.${source.name}\" (${srcType}) → \"${block.name}.${input.name}\" (${tgtType}).`,\n block,\n connectionName: input.name,\n });\n }\n }\n }\n\n // ── Check 5: Unreachable blocks ────────────────────────────────────\n const reachableIds = new Set<string>();\n flowGraph.visitAllBlocks((block) => {\n reachableIds.add(block.uniqueId);\n });\n // We need to also check standalone data blocks not visited by visitAllBlocks.\n // visitAllBlocks starts from event blocks; any block not found is unreachable.\n // Since we can only iterate blocks we know about, the allBlocks list IS\n // from visitAllBlocks, so everything in it IS reachable.\n // There's no separate registry of \"all added blocks\" in the FlowGraph.\n // So: unreachable blocks are blocks that exist but aren't visited.\n // Currently visitAllBlocks IS our source, so this check is a no-op for\n // blocks added via the graph. However, the editor creates nodes and adds\n // execution blocks, so we should compare against the editor's full list.\n // For the core validator, we expose a variant that accepts an external block list.\n\n // ── Check 6: Data dependency cycles ────────────────────────────────\n _DetectDataCycles(allBlocks, addIssue);\n\n // Sort: errors first, then warnings\n issues.sort((a, b) => a.severity - b.severity);\n\n return {\n isValid: issues.every((i) => i.severity !== FlowGraphValidationSeverity.Error),\n issues,\n errorCount: issues.filter((i) => i.severity === FlowGraphValidationSeverity.Error).length,\n warningCount: issues.filter((i) => i.severity === FlowGraphValidationSeverity.Warning).length,\n issuesByBlock,\n };\n}\n\n/**\n * Extended validation that also checks for unreachable blocks.\n * Requires a full list of all blocks in the graph (including those not reachable\n * from event blocks via the normal traversal).\n *\n * @param flowGraph - The flow graph to validate.\n * @param allKnownBlocks - Complete list of all blocks (e.g., from the editor's node set).\n * @returns The validation result.\n */\nexport function ValidateFlowGraphWithBlockList(flowGraph: FlowGraph, allKnownBlocks: FlowGraphBlock[]): IFlowGraphValidationResult {\n const result = ValidateFlowGraph(flowGraph);\n\n // Check for unreachable blocks\n const reachableIds = new Set<string>();\n flowGraph.visitAllBlocks((block) => {\n reachableIds.add(block.uniqueId);\n });\n\n for (const block of allKnownBlocks) {\n if (!reachableIds.has(block.uniqueId)) {\n const issue: IFlowGraphValidationIssue = {\n severity: FlowGraphValidationSeverity.Warning,\n message: `Block is unreachable from any event block.`,\n block,\n };\n result.issues.push(issue);\n result.warningCount++;\n let arr = result.issuesByBlock.get(block.uniqueId);\n if (!arr) {\n arr = [];\n result.issuesByBlock.set(block.uniqueId, arr);\n }\n arr.push(issue);\n\n // Also run Check 2 and Check 3 on unreachable blocks so the editor\n // can display all issues, not just reachability ones.\n for (const input of block.dataInputs) {\n if (!input.optional && !input.isDisabled && !input.isConnected()) {\n const dataIssue: IFlowGraphValidationIssue = {\n severity: FlowGraphValidationSeverity.Warning,\n message: `\"${input.name}\" is not connected and will use its default value.`,\n block,\n connectionName: input.name,\n };\n result.issues.push(dataIssue);\n result.warningCount++;\n arr.push(dataIssue);\n }\n }\n\n if (block instanceof FlowGraphExecutionBlock && !_IsEventBlock(block)) {\n const inSignal = block.signalInputs.find((s) => s.name === \"in\");\n if (inSignal && !inSignal.isConnected()) {\n const signalIssue: IFlowGraphValidationIssue = {\n severity: FlowGraphValidationSeverity.Error,\n message: `Execution block has no incoming signal — it will never execute.`,\n block,\n connectionName: \"in\",\n };\n result.issues.push(signalIssue);\n result.errorCount++;\n arr.push(signalIssue);\n }\n }\n }\n }\n\n result.isValid = result.issues.every((i) => i.severity !== FlowGraphValidationSeverity.Error);\n result.issues.sort((a, b) => a.severity - b.severity);\n return result;\n}\n\n/**\n * Get all event blocks from a flow graph.\n * @param flowGraph - the flow graph\n * @returns the event blocks\n */\nfunction _GetEventBlocks(flowGraph: FlowGraph): FlowGraphEventBlock[] {\n const eventBlocks: FlowGraphEventBlock[] = [];\n for (const type in flowGraph._eventBlocks) {\n for (const block of flowGraph._eventBlocks[type as FlowGraphEventType]) {\n eventBlocks.push(block);\n }\n }\n return eventBlocks;\n}\n\n/**\n * Detect whether a block is an event block (entry point).\n * @param block - the block to check\n * @returns true if it is an event block\n */\nfunction _IsEventBlock(block: FlowGraphBlock): boolean {\n return block instanceof FlowGraphEventBlock;\n}\n\n/**\n * Detects cycles among data-only blocks.\n * A data cycle means that block A's output feeds into block B's input, and\n * block B's output feeds back into block A (directly or indirectly).\n * This would cause infinite recursion during getValue().\n * @param allBlocks - all blocks to check\n * @param addIssue - callback to report issues\n */\nfunction _DetectDataCycles(allBlocks: FlowGraphBlock[], addIssue: (issue: IFlowGraphValidationIssue) => void): void {\n // Build adjacency: for each block, which blocks do its data inputs depend on?\n // (Data inputs pull values from connected output blocks.)\n const white = 0; // unvisited\n const gray = 1; // in current DFS path\n const black = 2; // fully explored\n const color = new Map<string, number>();\n\n for (const block of allBlocks) {\n color.set(block.uniqueId, white);\n }\n\n const blockMap = new Map<string, FlowGraphBlock>();\n for (const block of allBlocks) {\n blockMap.set(block.uniqueId, block);\n }\n\n const reportedCycleBlocks = new Set<string>();\n\n function dfs(block: FlowGraphBlock): boolean {\n color.set(block.uniqueId, gray);\n for (const input of block.dataInputs) {\n if (!input.isConnected()) {\n continue;\n }\n for (const connected of input._connectedPoint) {\n const dep = (connected as FlowGraphDataConnection<any>)._ownerBlock;\n // Only consider data-only blocks (not execution blocks which are driven by signals)\n if (dep instanceof FlowGraphExecutionBlock) {\n continue;\n }\n const depColor = color.get(dep.uniqueId);\n if (depColor === gray) {\n // Cycle found\n if (!reportedCycleBlocks.has(block.uniqueId)) {\n reportedCycleBlocks.add(block.uniqueId);\n addIssue({\n severity: FlowGraphValidationSeverity.Error,\n message: `Data dependency cycle detected — getValue() will recurse infinitely.`,\n block,\n });\n }\n if (!reportedCycleBlocks.has(dep.uniqueId)) {\n reportedCycleBlocks.add(dep.uniqueId);\n addIssue({\n severity: FlowGraphValidationSeverity.Error,\n message: `Data dependency cycle detected — getValue() will recurse infinitely.`,\n block: dep,\n });\n }\n return true;\n }\n if (depColor === white) {\n dfs(dep);\n }\n }\n }\n color.set(block.uniqueId, black);\n return false;\n }\n\n for (const block of allBlocks) {\n if (color.get(block.uniqueId) === white) {\n dfs(block);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"flowGraphValidator.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphValidator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D;;GAEG;AACH,MAAM,CAAN,IAAkB,2BAKjB;AALD,WAAkB,2BAA2B;IACzC,wDAAwD;IACxD,+EAAK,CAAA;IACL,qDA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CAAC;AACL,CAAC","sourcesContent":["import { type FlowGraph } from \"./flowGraph\";\nimport { type FlowGraphBlock } from \"./flowGraphBlock\";\nimport { FlowGraphExecutionBlock } from \"./flowGraphExecutionBlock\";\nimport { type FlowGraphDataConnection } from \"./flowGraphDataConnection\";\nimport { FlowGraphTypes } from \"./flowGraphRichTypes.pure\";\nimport { FlowGraphEventBlock } from \"./flowGraphEventBlock\";\nimport { type FlowGraphEventType } from \"./flowGraphEventType\";\n\n/**\n * Severity level for a validation issue.\n */\nexport const enum FlowGraphValidationSeverity {\n /** A critical issue that will cause runtime failure. */\n Error,\n /** A potential issue that may indicate a mistake. */\n Warning,\n}\n\n/**\n * A single validation issue found in the flow graph.\n */\nexport interface IFlowGraphValidationIssue {\n /** The severity level. */\n severity: FlowGraphValidationSeverity;\n /** Human-readable description of the issue. */\n message: string;\n /** The block where the issue was found (if applicable). */\n block?: FlowGraphBlock;\n /** The connection name involved (if applicable). */\n connectionName?: string;\n}\n\n/**\n * The result of validating a flow graph.\n */\nexport interface IFlowGraphValidationResult {\n /** Whether the graph passed validation with no errors. */\n isValid: boolean;\n /** All issues found, ordered by severity (errors first). */\n issues: IFlowGraphValidationIssue[];\n /** Convenience: number of error-level issues. */\n errorCount: number;\n /** Convenience: number of warning-level issues. */\n warningCount: number;\n /** Map from block uniqueId to the issues affecting that block. */\n issuesByBlock: Map<string, IFlowGraphValidationIssue[]>;\n}\n\n// Types that are mutually coercible and should not produce type-mismatch warnings\nconst NumericLikeTypes = new Set<string>([FlowGraphTypes.Number, FlowGraphTypes.Integer, FlowGraphTypes.Boolean]);\nconst VectorLikeTypes = new Set<string>([FlowGraphTypes.Vector4, FlowGraphTypes.Quaternion]);\nconst ColorLikeTypes = new Set<string>([FlowGraphTypes.Color3, FlowGraphTypes.Color4]);\n\n/**\n * @internal\n */\nfunction _AreTypesCompatible(sourceType: string, targetType: string): boolean {\n if (sourceType === targetType) {\n return true;\n }\n // \"any\" is compatible with everything\n if (sourceType === FlowGraphTypes.Any || targetType === FlowGraphTypes.Any) {\n return true;\n }\n // Numeric coercion group\n if (NumericLikeTypes.has(sourceType) && NumericLikeTypes.has(targetType)) {\n return true;\n }\n // Vector4 / Quaternion are interchangeable\n if (VectorLikeTypes.has(sourceType) && VectorLikeTypes.has(targetType)) {\n return true;\n }\n // Color3 → Color4 widening is safe\n if (ColorLikeTypes.has(sourceType) && ColorLikeTypes.has(targetType)) {\n return true;\n }\n return false;\n}\n\n/**\n * Validates a flow graph and returns all issues found.\n *\n * The following checks are performed:\n * 1. **No event blocks** — the graph has no entry points.\n * 2. **Unconnected required data inputs** — a non-optional data input with no connection.\n * 3. **Unconnected signal inputs** — an execution block whose `in` signal has no connection and\n * that is not an event block (entry point).\n * 4. **Data type mismatches** — a data connection whose source richType is incompatible with the\n * target richType.\n * 5. **Unreachable blocks** — blocks not reachable from any event block via signal/data traversal.\n * 6. **Data dependency cycles** — circular data-only connections that would cause infinite recursion.\n *\n * @param flowGraph - The flow graph to validate.\n * @returns The validation result.\n */\nexport function ValidateFlowGraph(flowGraph: FlowGraph): IFlowGraphValidationResult {\n const issues: IFlowGraphValidationIssue[] = [];\n const issuesByBlock = new Map<string, IFlowGraphValidationIssue[]>();\n\n const addIssue = (issue: IFlowGraphValidationIssue) => {\n issues.push(issue);\n if (issue.block) {\n let arr = issuesByBlock.get(issue.block.uniqueId);\n if (!arr) {\n arr = [];\n issuesByBlock.set(issue.block.uniqueId, arr);\n }\n arr.push(issue);\n }\n };\n\n // Collect ALL blocks via visitAllBlocks\n const allBlocks: FlowGraphBlock[] = [];\n flowGraph.visitAllBlocks((block) => {\n allBlocks.push(block);\n });\n\n // ── Check 1: No event blocks ───────────────────────────────────────\n const eventBlocks = _GetEventBlocks(flowGraph);\n if (eventBlocks.length === 0) {\n addIssue({\n severity: FlowGraphValidationSeverity.Error,\n message: \"Graph has no event blocks — nothing will trigger execution.\",\n });\n }\n\n // ── Check 2: Unconnected required data inputs ──────────────────────\n for (const block of allBlocks) {\n for (const input of block.dataInputs) {\n if (!input.optional && !input.isDisabled && !input.isConnected()) {\n addIssue({\n severity: FlowGraphValidationSeverity.Warning,\n message: `\"${input.name}\" is not connected and will use its default value.`,\n block,\n connectionName: input.name,\n });\n }\n }\n }\n\n // ── Check 3: Unconnected signal inputs on non-event execution blocks\n for (const block of allBlocks) {\n if (block instanceof FlowGraphExecutionBlock) {\n // Skip event blocks — they are entry points and don't need an incoming signal.\n if (_IsEventBlock(block)) {\n continue;\n }\n const inSignal = block.signalInputs.find((s) => s.name === \"in\");\n if (inSignal && !inSignal.isConnected()) {\n addIssue({\n severity: FlowGraphValidationSeverity.Error,\n message: `Execution block has no incoming signal — it will never execute.`,\n block,\n connectionName: \"in\",\n });\n }\n }\n }\n\n // ── Check 4: Data type mismatches ──────────────────────────────────\n for (const block of allBlocks) {\n for (const input of block.dataInputs) {\n if (!input.isConnected()) {\n continue;\n }\n const source = input._connectedPoint[0] as FlowGraphDataConnection<any>;\n const srcType = source.richType?.typeName;\n const tgtType = input.richType?.typeName;\n if (srcType && tgtType && !_AreTypesCompatible(srcType, tgtType)) {\n // If either side has a typeTransformer, it's intentionally converted\n if (source.richType.typeTransformer !== undefined || input.richType.typeTransformer !== undefined) {\n continue;\n }\n addIssue({\n severity: FlowGraphValidationSeverity.Warning,\n message: `Type mismatch: \"${source._ownerBlock.name}.${source.name}\" (${srcType}) → \"${block.name}.${input.name}\" (${tgtType}).`,\n block,\n connectionName: input.name,\n });\n }\n }\n }\n\n // ── Check 5: Unreachable blocks ────────────────────────────────────\n const reachableIds = new Set<string>();\n flowGraph.visitAllBlocks((block) => {\n reachableIds.add(block.uniqueId);\n });\n // We need to also check standalone data blocks not visited by visitAllBlocks.\n // visitAllBlocks starts from event blocks; any block not found is unreachable.\n // Since we can only iterate blocks we know about, the allBlocks list IS\n // from visitAllBlocks, so everything in it IS reachable.\n // There's no separate registry of \"all added blocks\" in the FlowGraph.\n // So: unreachable blocks are blocks that exist but aren't visited.\n // Currently visitAllBlocks IS our source, so this check is a no-op for\n // blocks added via the graph. However, the editor creates nodes and adds\n // execution blocks, so we should compare against the editor's full list.\n // For the core validator, we expose a variant that accepts an external block list.\n\n // ── Check 6: Data dependency cycles ────────────────────────────────\n _DetectDataCycles(allBlocks, addIssue);\n\n // Sort: errors first, then warnings\n issues.sort((a, b) => a.severity - b.severity);\n\n return {\n isValid: issues.every((i) => i.severity !== FlowGraphValidationSeverity.Error),\n issues,\n errorCount: issues.filter((i) => i.severity === FlowGraphValidationSeverity.Error).length,\n warningCount: issues.filter((i) => i.severity === FlowGraphValidationSeverity.Warning).length,\n issuesByBlock,\n };\n}\n\n/**\n * Extended validation that also checks for unreachable blocks.\n * Requires a full list of all blocks in the graph (including those not reachable\n * from event blocks via the normal traversal).\n *\n * @param flowGraph - The flow graph to validate.\n * @param allKnownBlocks - Complete list of all blocks (e.g., from the editor's node set).\n * @returns The validation result.\n */\nexport function ValidateFlowGraphWithBlockList(flowGraph: FlowGraph, allKnownBlocks: FlowGraphBlock[]): IFlowGraphValidationResult {\n const result = ValidateFlowGraph(flowGraph);\n\n // Check for unreachable blocks\n const reachableIds = new Set<string>();\n flowGraph.visitAllBlocks((block) => {\n reachableIds.add(block.uniqueId);\n });\n\n for (const block of allKnownBlocks) {\n if (!reachableIds.has(block.uniqueId)) {\n const issue: IFlowGraphValidationIssue = {\n severity: FlowGraphValidationSeverity.Warning,\n message: `Block is unreachable from any event block.`,\n block,\n };\n result.issues.push(issue);\n result.warningCount++;\n let arr = result.issuesByBlock.get(block.uniqueId);\n if (!arr) {\n arr = [];\n result.issuesByBlock.set(block.uniqueId, arr);\n }\n arr.push(issue);\n\n // Also run Check 2 and Check 3 on unreachable blocks so the editor\n // can display all issues, not just reachability ones.\n for (const input of block.dataInputs) {\n if (!input.optional && !input.isDisabled && !input.isConnected()) {\n const dataIssue: IFlowGraphValidationIssue = {\n severity: FlowGraphValidationSeverity.Warning,\n message: `\"${input.name}\" is not connected and will use its default value.`,\n block,\n connectionName: input.name,\n };\n result.issues.push(dataIssue);\n result.warningCount++;\n arr.push(dataIssue);\n }\n }\n\n if (block instanceof FlowGraphExecutionBlock && !_IsEventBlock(block)) {\n const inSignal = block.signalInputs.find((s) => s.name === \"in\");\n if (inSignal && !inSignal.isConnected()) {\n const signalIssue: IFlowGraphValidationIssue = {\n severity: FlowGraphValidationSeverity.Error,\n message: `Execution block has no incoming signal — it will never execute.`,\n block,\n connectionName: \"in\",\n };\n result.issues.push(signalIssue);\n result.errorCount++;\n arr.push(signalIssue);\n }\n }\n }\n }\n\n result.isValid = result.issues.every((i) => i.severity !== FlowGraphValidationSeverity.Error);\n result.issues.sort((a, b) => a.severity - b.severity);\n return result;\n}\n\n/**\n * Get all event blocks from a flow graph.\n * @param flowGraph - the flow graph\n * @returns the event blocks\n */\nfunction _GetEventBlocks(flowGraph: FlowGraph): FlowGraphEventBlock[] {\n const eventBlocks: FlowGraphEventBlock[] = [];\n for (const type in flowGraph._eventBlocks) {\n for (const block of flowGraph._eventBlocks[type as FlowGraphEventType]) {\n eventBlocks.push(block);\n }\n }\n return eventBlocks;\n}\n\n/**\n * Detect whether a block is an event block (entry point).\n * @param block - the block to check\n * @returns true if it is an event block\n */\nfunction _IsEventBlock(block: FlowGraphBlock): boolean {\n return block instanceof FlowGraphEventBlock;\n}\n\n/**\n * Detects cycles among data-only blocks.\n * A data cycle means that block A's output feeds into block B's input, and\n * block B's output feeds back into block A (directly or indirectly).\n * This would cause infinite recursion during getValue().\n * @param allBlocks - all blocks to check\n * @param addIssue - callback to report issues\n */\nfunction _DetectDataCycles(allBlocks: FlowGraphBlock[], addIssue: (issue: IFlowGraphValidationIssue) => void): void {\n // Build adjacency: for each block, which blocks do its data inputs depend on?\n // (Data inputs pull values from connected output blocks.)\n const white = 0; // unvisited\n const gray = 1; // in current DFS path\n const black = 2; // fully explored\n const color = new Map<string, number>();\n\n for (const block of allBlocks) {\n color.set(block.uniqueId, white);\n }\n\n const reportedCycleBlocks = new Set<string>();\n\n function dfs(block: FlowGraphBlock): boolean {\n color.set(block.uniqueId, gray);\n for (const input of block.dataInputs) {\n if (!input.isConnected()) {\n continue;\n }\n for (const connected of input._connectedPoint) {\n const dep = (connected as FlowGraphDataConnection<any>)._ownerBlock;\n // Only consider data-only blocks (not execution blocks which are driven by signals)\n if (dep instanceof FlowGraphExecutionBlock) {\n continue;\n }\n const depColor = color.get(dep.uniqueId);\n if (depColor === gray) {\n // Cycle found\n if (!reportedCycleBlocks.has(block.uniqueId)) {\n reportedCycleBlocks.add(block.uniqueId);\n addIssue({\n severity: FlowGraphValidationSeverity.Error,\n message: `Data dependency cycle detected — getValue() will recurse infinitely.`,\n block,\n });\n }\n if (!reportedCycleBlocks.has(dep.uniqueId)) {\n reportedCycleBlocks.add(dep.uniqueId);\n addIssue({\n severity: FlowGraphValidationSeverity.Error,\n message: `Data dependency cycle detected — getValue() will recurse infinitely.`,\n block: dep,\n });\n }\n return true;\n }\n if (depColor === white) {\n dfs(dep);\n }\n }\n }\n color.set(block.uniqueId, black);\n return false;\n }\n\n for (const block of allBlocks) {\n if (color.get(block.uniqueId) === white) {\n dfs(block);\n }\n }\n}\n"]}
@@ -15,7 +15,9 @@ export * from "./flowGraphPathConverter.js";
15
15
  export * from "./flowGraphPathConverterComponent.js";
16
16
  export * from "./flowGraphHostResolver.js";
17
17
  export * from "./flowGraphDelayRegistry.js";
18
+ export * from "./flowGraphAnimationHelpers.js";
18
19
  export * from "./flowGraphLogger.js";
19
20
  export * from "./flowGraphValidator.js";
21
+ export { defaultValueParseFunction } from "./serialization.js";
20
22
  export * from "./Blocks/index.js";
21
23
  export * from "./CustomTypes/index.js";
@@ -15,8 +15,10 @@ export * from "./flowGraphPathConverter.js";
15
15
  export * from "./flowGraphPathConverterComponent.js";
16
16
  export * from "./flowGraphHostResolver.js";
17
17
  export * from "./flowGraphDelayRegistry.js";
18
+ export * from "./flowGraphAnimationHelpers.js";
18
19
  export * from "./flowGraphLogger.js";
19
20
  export * from "./flowGraphValidator.js";
21
+ export { defaultValueParseFunction } from "./serialization.js";
20
22
  // eslint-disable-next-line @typescript-eslint/no-restricted-imports
21
23
  export * from "./Blocks/index.js";
22
24
  // eslint-disable-next-line @typescript-eslint/no-restricted-imports
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,oEAAoE;AACpE,cAAc,gBAAgB,CAAC;AAC/B,oEAAoE;AACpE,cAAc,qBAAqB,CAAC","sourcesContent":["export * from \"./flowGraph\";\r\nexport * from \"./flowGraphBlock\";\r\nexport * from \"./flowGraphSignalConnection\";\r\nexport * from \"./flowGraphExecutionBlock\";\r\nexport * from \"./flowGraphEventBlock\";\r\nexport * from \"./flowGraphRichTypes\";\r\nexport * from \"./flowGraphContext\";\r\nexport * from \"./flowGraphCoordinator\";\r\nexport * from \"./typeDefinitions\";\r\nexport * from \"./flowGraphConnection\";\r\nexport * from \"./flowGraphDataConnection\";\r\nexport * from \"./flowGraphAssetsContext\";\r\nexport * from \"./flowGraphParser\";\r\nexport * from \"./flowGraphPathConverter\";\r\nexport * from \"./flowGraphPathConverterComponent\";\r\nexport * from \"./flowGraphHostResolver\";\r\nexport * from \"./flowGraphDelayRegistry\";\r\nexport * from \"./flowGraphLogger\";\r\nexport * from \"./flowGraphValidator\";\r\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\r\nexport * from \"./Blocks/index\";\r\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\r\nexport * from \"./CustomTypes/index\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,oEAAoE;AACpE,cAAc,gBAAgB,CAAC;AAC/B,oEAAoE;AACpE,cAAc,qBAAqB,CAAC","sourcesContent":["export * from \"./flowGraph\";\r\nexport * from \"./flowGraphBlock\";\r\nexport * from \"./flowGraphSignalConnection\";\r\nexport * from \"./flowGraphExecutionBlock\";\r\nexport * from \"./flowGraphEventBlock\";\r\nexport * from \"./flowGraphRichTypes\";\r\nexport * from \"./flowGraphContext\";\r\nexport * from \"./flowGraphCoordinator\";\r\nexport * from \"./typeDefinitions\";\r\nexport * from \"./flowGraphConnection\";\r\nexport * from \"./flowGraphDataConnection\";\r\nexport * from \"./flowGraphAssetsContext\";\r\nexport * from \"./flowGraphParser\";\r\nexport * from \"./flowGraphPathConverter\";\r\nexport * from \"./flowGraphPathConverterComponent\";\r\nexport * from \"./flowGraphHostResolver\";\r\nexport * from \"./flowGraphDelayRegistry\";\r\nexport * from \"./flowGraphAnimationHelpers\";\r\nexport * from \"./flowGraphLogger\";\r\nexport * from \"./flowGraphValidator\";\r\nexport { defaultValueParseFunction } from \"./serialization\";\r\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\r\nexport * from \"./Blocks/index\";\r\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\r\nexport * from \"./CustomTypes/index\";\r\n"]}
@@ -16,7 +16,9 @@ export * from "./flowGraphPathConverter.js";
16
16
  export * from "./flowGraphPathConverterComponent.js";
17
17
  export * from "./flowGraphHostResolver.js";
18
18
  export * from "./flowGraphDelayRegistry.js";
19
+ export * from "./flowGraphAnimationHelpers.js";
19
20
  export * from "./flowGraphLogger.js";
20
21
  export * from "./flowGraphValidator.js";
22
+ export { defaultValueParseFunction } from "./serialization.js";
21
23
  export * from "./Blocks/pure.js";
22
24
  export * from "./CustomTypes/pure.js";
package/FlowGraph/pure.js CHANGED
@@ -17,8 +17,10 @@ export * from "./flowGraphPathConverter.js";
17
17
  export * from "./flowGraphPathConverterComponent.js";
18
18
  export * from "./flowGraphHostResolver.js";
19
19
  export * from "./flowGraphDelayRegistry.js";
20
+ export * from "./flowGraphAnimationHelpers.js";
20
21
  export * from "./flowGraphLogger.js";
21
22
  export * from "./flowGraphValidator.js";
23
+ export { defaultValueParseFunction } from "./serialization.js";
22
24
  export * from "./Blocks/pure.js";
23
25
  export * from "./CustomTypes/pure.js";
24
26
  //# sourceMappingURL=pure.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pure.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,oEAAoE;AACpE,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC","sourcesContent":["/** Pure barrel — re-exports only side-effect-free modules */\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\nexport * from \"./flowGraph\";\nexport * from \"./flowGraphBlock\";\nexport * from \"./flowGraphSignalConnection.pure\";\nexport * from \"./flowGraphExecutionBlock\";\nexport * from \"./flowGraphEventBlock\";\nexport * from \"./flowGraphRichTypes.pure\";\nexport * from \"./flowGraphContext\";\nexport * from \"./flowGraphCoordinator\";\nexport * from \"./typeDefinitions\";\nexport * from \"./flowGraphConnection\";\nexport * from \"./flowGraphDataConnection.pure\";\nexport * from \"./flowGraphAssetsContext\";\nexport * from \"./flowGraphParser\";\nexport * from \"./flowGraphPathConverter\";\nexport * from \"./flowGraphPathConverterComponent\";\nexport * from \"./flowGraphHostResolver\";\nexport * from \"./flowGraphDelayRegistry\";\nexport * from \"./flowGraphLogger\";\nexport * from \"./flowGraphValidator\";\nexport * from \"./Blocks/pure\";\nexport * from \"./CustomTypes/pure\";\n"]}
1
+ {"version":3,"file":"pure.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,oEAAoE;AACpE,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC","sourcesContent":["/** Pure barrel — re-exports only side-effect-free modules */\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\nexport * from \"./flowGraph\";\nexport * from \"./flowGraphBlock\";\nexport * from \"./flowGraphSignalConnection.pure\";\nexport * from \"./flowGraphExecutionBlock\";\nexport * from \"./flowGraphEventBlock\";\nexport * from \"./flowGraphRichTypes.pure\";\nexport * from \"./flowGraphContext\";\nexport * from \"./flowGraphCoordinator\";\nexport * from \"./typeDefinitions\";\nexport * from \"./flowGraphConnection\";\nexport * from \"./flowGraphDataConnection.pure\";\nexport * from \"./flowGraphAssetsContext\";\nexport * from \"./flowGraphParser\";\nexport * from \"./flowGraphPathConverter\";\nexport * from \"./flowGraphPathConverterComponent\";\nexport * from \"./flowGraphHostResolver\";\nexport * from \"./flowGraphDelayRegistry\";\nexport * from \"./flowGraphAnimationHelpers\";\nexport * from \"./flowGraphLogger\";\nexport * from \"./flowGraphValidator\";\nexport { defaultValueParseFunction } from \"./serialization\";\nexport * from \"./Blocks/pure\";\nexport * from \"./CustomTypes/pure\";\n"]}
@@ -2,6 +2,8 @@ import { type IAssetContainer } from "../IAssetContainer.js";
2
2
  import { type Scene } from "../scene.js";
3
3
  import { FlowGraphBlockNames } from "./Blocks/flowGraphBlockNames.js";
4
4
  import { type Node } from "../node.js";
5
+ /** @internal */
6
+ export declare function _GetDefaultEventDataParseCount(value: unknown): number;
5
7
  /**
6
8
  * Resolves a serialized node reference (`{ id, name, className, uniqueId }`) to an actual scene node.
7
9
  * Matching prefers `id` (falling back to `name`), then narrows by class name, then by `uniqueId`.
@@ -24,8 +26,8 @@ export declare function defaultValueSerializationFunction(key: string, value: an
24
26
  * @param key the key to the value that will be parsed
25
27
  * @param serializationObject the object that will be parsed
26
28
  * @param assetsContainer the assets container that will be used to find the objects
27
- * @param scene
28
- * @returns
29
+ * @param scene the scene used to resolve node and animation group references
30
+ * @returns the parsed value, with serialized Babylon types and scene references restored
29
31
  */
30
32
  export declare function defaultValueParseFunction(key: string, serializationObject: any, assetsContainer: IAssetContainer, scene: Scene): any;
31
33
  /**
@@ -2,8 +2,12 @@ import { Logger } from "../Misc/logger.js";
2
2
  import { Color3, Color4 } from "../Maths/math.color.pure.js";
3
3
  import { Matrix, Quaternion, Vector2, Vector3, Vector4 } from "../Maths/math.vector.pure.js";
4
4
  import { FlowGraphInteger } from "./CustomTypes/flowGraphInteger.pure.js";
5
- import { getRichTypeByFlowGraphType } from "./flowGraphRichTypes.pure.js";
6
5
  import { FlowGraphMatrix2D, FlowGraphMatrix3D } from "./CustomTypes/flowGraphMatrix.js";
6
+ const _DefaultEventDataParseCounts = new WeakMap();
7
+ /** @internal */
8
+ export function _GetDefaultEventDataParseCount(value) {
9
+ return value !== null && typeof value === "object" ? (_DefaultEventDataParseCounts.get(value) ?? 0) : 0;
10
+ }
7
11
  function IsVectorClassName(className) {
8
12
  return (className === "Vector2" /* FlowGraphTypes.Vector2 */ ||
9
13
  className === "Vector3" /* FlowGraphTypes.Vector3 */ ||
@@ -134,8 +138,8 @@ export function defaultValueSerializationFunction(key, value, serializationObjec
134
138
  * @param key the key to the value that will be parsed
135
139
  * @param serializationObject the object that will be parsed
136
140
  * @param assetsContainer the assets container that will be used to find the objects
137
- * @param scene
138
- * @returns
141
+ * @param scene the scene used to resolve node and animation group references
142
+ * @returns the parsed value, with serialized Babylon types and scene references restored
139
143
  */
140
144
  // eslint-disable-next-line @typescript-eslint/naming-convention
141
145
  export function defaultValueParseFunction(key, serializationObject, assetsContainer, scene) {
@@ -170,32 +174,16 @@ export function defaultValueParseFunction(key, serializationObject, assetsContai
170
174
  else if (className === "number" /* FlowGraphTypes.Number */ || className === "string" /* FlowGraphTypes.String */ || className === "boolean" /* FlowGraphTypes.Boolean */) {
171
175
  finalValue = intermediateValue.value[0];
172
176
  }
177
+ else if (key === "eventData" && intermediateValue !== null && typeof intermediateValue === "object") {
178
+ _DefaultEventDataParseCounts.set(intermediateValue, _GetDefaultEventDataParseCount(intermediateValue) + 1);
179
+ finalValue = intermediateValue;
180
+ }
173
181
  else if (intermediateValue && intermediateValue.value !== undefined) {
174
182
  finalValue = intermediateValue.value;
175
183
  }
176
184
  else {
177
185
  if (Array.isArray(intermediateValue)) {
178
- // Check if this is an event configuration array (objects with id/eventData)
179
- // versus a plain array of primitives (e.g. variable name lists)
180
- if (intermediateValue.length > 0 && typeof intermediateValue[0] === "object" && intermediateValue[0] !== null && "eventData" in intermediateValue[0]) {
181
- // configuration data of an event
182
- finalValue = intermediateValue.reduce((acc, val) => {
183
- if (!val.eventData) {
184
- return acc;
185
- }
186
- acc[val.id] = {
187
- type: getRichTypeByFlowGraphType(val.type),
188
- };
189
- if (typeof val.value !== "undefined") {
190
- acc[val.id].value = defaultValueParseFunction("value", val, assetsContainer, scene);
191
- }
192
- return acc;
193
- }, {});
194
- }
195
- else {
196
- // Plain array of primitives — return as-is
197
- finalValue = intermediateValue;
198
- }
186
+ finalValue = intermediateValue;
199
187
  }
200
188
  else {
201
189
  finalValue = intermediateValue;