@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
@@ -3,6 +3,8 @@ import { FlowGraphAsyncExecutionBlock } from "../../../flowGraphAsyncExecutionBl
3
3
  import { RichTypeAny, RichTypeNumber, RichTypeBoolean } from "../../../flowGraphRichTypes.pure.js";
4
4
  import { AnimationGroup } from "../../../../Animations/animationGroup.pure.js";
5
5
  import { RegisterClass } from "../../../../Misc/typeStore.js";
6
+ import { RemoveFlowGraphAnimationGroupObservers } from "../../../flowGraphAnimationHelpers.js";
7
+ export { RemoveFlowGraphAnimationGroupObservers } from "../../../flowGraphAnimationHelpers.js";
6
8
  /**
7
9
  * @experimental
8
10
  * A block that plays an animation on an animatable object.
@@ -24,6 +26,7 @@ export class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {
24
26
  this.currentAnimationGroup = this.registerDataOutput("currentAnimationGroup", RichTypeAny);
25
27
  this.animationGroup = this.registerDataInput("animationGroup", RichTypeAny, config?.animationGroup);
26
28
  this.animation = this.registerDataInput("animation", RichTypeAny);
29
+ this.animationTargets = this.registerDataInput("animationTargets", RichTypeAny);
27
30
  this.object = this.registerDataInput("object", RichTypeAny);
28
31
  }
29
32
  /**
@@ -39,8 +42,8 @@ export class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {
39
42
  return;
40
43
  }
41
44
  context._addPendingBlock(this);
42
- this.out._activateSignal(context);
43
45
  context._setExecutionVariable(this, "_initialized", true);
46
+ this.out._activateSignal(context);
44
47
  }
45
48
  /**
46
49
  * @internal
@@ -57,12 +60,30 @@ export class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {
57
60
  * @returns whether the animation was prepared and started successfully
58
61
  */
59
62
  _tryPreparePendingTasks(context) {
60
- const ag = this.animationGroup.getValue(context);
61
- const animation = this.animation.getValue(context);
63
+ let ag;
64
+ let animation;
65
+ let animationTargets;
66
+ try {
67
+ ag = this.animationGroup.getValue(context);
68
+ animation = this.animation.getValue(context);
69
+ animationTargets = ag ? undefined : this.animationTargets.getValue(context);
70
+ }
71
+ catch (error) {
72
+ this._reportError(context, error);
73
+ return false;
74
+ }
62
75
  if (!ag && !animation) {
63
76
  this._reportError(context, "No animation or animation group provided");
64
77
  return false;
65
78
  }
79
+ else if (!ag && Array.isArray(animation) && animation.length === 0) {
80
+ this._reportError(context, "Animation array is empty");
81
+ return false;
82
+ }
83
+ else if (ag && ag.targetedAnimations.length === 0) {
84
+ this._reportError(context, "Animation group has no targeted animations");
85
+ return false;
86
+ }
66
87
  else {
67
88
  // if an animation group was already created, dispose it and create a new one
68
89
  const currentAnimationGroup = this.currentAnimationGroup.getValue(context);
@@ -75,17 +96,30 @@ export class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {
75
96
  let interpolationTarget;
76
97
  // check which animation to use. If no animationGroup was defined and an animation was provided, use the animation
77
98
  if (animation && !animationGroupToUse) {
78
- const target = this.object.getValue(context);
79
- if (!target) {
99
+ const target = animationTargets === undefined ? this.object.getValue(context) : undefined;
100
+ const animationsArray = Array.isArray(animation) ? animation : [animation];
101
+ if (animationTargets !== undefined && (!Array.isArray(animationTargets) || animationTargets.length !== animationsArray.length)) {
102
+ this._reportError(context, "Animation targets must match the animation array.");
103
+ return false;
104
+ }
105
+ if (!animationTargets && !target) {
80
106
  this._reportError(context, "No target object provided");
81
107
  return false;
82
108
  }
83
- const animationsArray = Array.isArray(animation) ? animation : [animation];
109
+ if (animationTargets) {
110
+ for (const animationTarget of animationTargets) {
111
+ if (!animationTarget) {
112
+ this._reportError(context, "No target object provided");
113
+ return false;
114
+ }
115
+ }
116
+ }
84
117
  const name = animationsArray[0].name;
85
- animationGroupToUse = new AnimationGroup("flowGraphAnimationGroup-" + name + "-" + target.name, context.configuration.scene);
118
+ animationGroupToUse = new AnimationGroup("flowGraphAnimationGroup-" + name + "-" + (target?.name ?? "targets"), context.configuration.scene);
86
119
  const interpolationAnimations = context._getGlobalContextVariable("interpolationAnimations", []);
87
- for (const anim of animationsArray) {
88
- animationGroupToUse.addTargetedAnimation(anim, target);
120
+ for (let index = 0; index < animationsArray.length; index++) {
121
+ const anim = animationsArray[index];
122
+ animationGroupToUse.addTargetedAnimation(anim, animationTargets ? animationTargets[index] : target);
89
123
  if (interpolationAnimations.indexOf(anim.uniqueId) !== -1) {
90
124
  isInterpolation = true;
91
125
  }
@@ -99,8 +133,8 @@ export class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {
99
133
  // Read the raw end time before it is defaulted to the animation group's natural end, so that an
100
134
  // explicitly provided NaN end time can still be detected by the animation/start validation below.
101
135
  const rawTo = this.to.getValue(context);
102
- // not accepting 0
103
- const to = rawTo || animationGroupToUse.to;
136
+ const hasTo = this.to.isConnected() || context._hasConnectionValue(this.to);
137
+ const to = hasTo ? rawTo : animationGroupToUse.to;
104
138
  // Input validation. Only applies to animation-group playback
105
139
  // (animation/start); interpolation uses the `animation` input and has its own validation below.
106
140
  // The operation activates its `err` flow when the speed is NaN, infinite, or <= 0, or
@@ -159,22 +193,33 @@ export class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {
159
193
  // Stop any interpolation already running on the same target/property, but only after validation has
160
194
  // passed. An invalid interpolation (bad duration or NaN control points) must report [err] without
161
195
  // disturbing an interpolation that is already running on the same target.
162
- if (isInterpolation && interpolationAnimationsArray && interpolationTarget !== undefined) {
163
- this._checkInterpolationDuplications(context, interpolationAnimationsArray, interpolationTarget);
196
+ if (isInterpolation && interpolationAnimationsArray) {
197
+ this._checkInterpolationDuplications(context, interpolationAnimationsArray, interpolationTarget, animationTargets);
164
198
  }
165
199
  const loop = !isFinite(to) || this.loop.getValue(context);
166
200
  this.currentAnimationGroup.setValue(animationGroupToUse, context);
167
201
  const currentlyRunningAnimationGroups = context._getGlobalContextVariable("currentlyRunningAnimationGroups", []);
168
202
  // check if it already running
169
203
  if (currentlyRunningAnimationGroups.indexOf(animationGroupToUse.uniqueId) !== -1) {
170
- animationGroupToUse.stop();
204
+ this._stopAnimationGroup(context, animationGroupToUse);
171
205
  }
172
206
  try {
173
- animationGroupToUse.start(loop, speed, from, to);
174
- animationGroupToUse.onAnimationGroupEndObservable.add(() => this._onAnimationGroupEnd(context));
175
- animationGroupToUse.onAnimationEndObservable.add(() => this._eventsSignalOutputs["animationEnd"]._activateSignal(context));
176
- animationGroupToUse.onAnimationLoopObservable.add(() => this._eventsSignalOutputs["animationLoop"]._activateSignal(context));
177
- animationGroupToUse.onAnimationGroupLoopObservable.add(() => this._eventsSignalOutputs["animationGroupLoop"]._activateSignal(context));
207
+ if (this.config?.useVirtualTimeline) {
208
+ animationGroupToUse.startWithVirtualTimeline(loop, speed, from, to);
209
+ }
210
+ else {
211
+ animationGroupToUse.start(loop, speed, from, to);
212
+ }
213
+ const observers = {
214
+ block: this,
215
+ groupEnd: animationGroupToUse.onAnimationGroupEndObservable.add(() => this._onAnimationGroupEnd(context, animationGroupToUse)),
216
+ animationEnd: animationGroupToUse.onAnimationEndObservable.add(() => this._eventsSignalOutputs["animationEnd"]._activateSignal(context)),
217
+ animationLoop: animationGroupToUse.onAnimationLoopObservable.add(() => this._eventsSignalOutputs["animationLoop"]._activateSignal(context)),
218
+ groupLoop: animationGroupToUse.onAnimationGroupLoopObservable.add(() => this._eventsSignalOutputs["animationGroupLoop"]._activateSignal(context)),
219
+ };
220
+ const observerSets = context._getGlobalContextVariable("animationGroupObserverSets", new Map());
221
+ observerSets.set(animationGroupToUse.uniqueId, observers);
222
+ context._setGlobalContextVariable("animationGroupObserverSets", observerSets);
178
223
  currentlyRunningAnimationGroups.push(animationGroupToUse.uniqueId);
179
224
  context._setGlobalContextVariable("currentlyRunningAnimationGroups", currentlyRunningAnimationGroups);
180
225
  }
@@ -203,8 +248,9 @@ export class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {
203
248
  _execute(context) {
204
249
  this._startPendingTasks(context);
205
250
  }
206
- _onAnimationGroupEnd(context) {
207
- this._removeFromCurrentlyRunning(context, this.currentAnimationGroup.getValue(context));
251
+ _onAnimationGroupEnd(context, animationGroup) {
252
+ RemoveFlowGraphAnimationGroupObservers(context, animationGroup);
253
+ this._removeFromCurrentlyRunning(context, animationGroup);
208
254
  this._resetAfterCanceled(context);
209
255
  this.done._activateSignal(context);
210
256
  }
@@ -214,22 +260,31 @@ export class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {
214
260
  * If they do, we want to stop the already-running animation group.
215
261
  * @internal
216
262
  */
217
- _checkInterpolationDuplications(context, animation, target) {
263
+ _checkInterpolationDuplications(context, animation, target, targets) {
218
264
  const currentlyRunningAnimationGroups = context._getGlobalContextVariable("currentlyRunningAnimationGroups", []);
219
- for (const uniqueId of currentlyRunningAnimationGroups) {
265
+ for (let groupIndex = currentlyRunningAnimationGroups.length - 1; groupIndex >= 0; groupIndex--) {
266
+ const uniqueId = currentlyRunningAnimationGroups[groupIndex];
220
267
  const ag = context.assetsContext.animationGroups.find((ag) => ag.uniqueId === uniqueId);
221
268
  if (ag) {
269
+ let stopped = false;
222
270
  for (const anim of ag.targetedAnimations) {
223
- for (const animToCheck of animation) {
224
- if (anim.animation.targetProperty === animToCheck.targetProperty && anim.target === target) {
271
+ for (let index = 0; index < animation.length; index++) {
272
+ if (anim.animation.targetProperty === animation[index].targetProperty && anim.target === (targets ? targets[index] : target)) {
225
273
  this._stopAnimationGroup(context, ag);
274
+ stopped = true;
275
+ break;
226
276
  }
227
277
  }
278
+ if (stopped) {
279
+ break;
280
+ }
228
281
  }
229
282
  }
230
283
  }
231
284
  }
232
285
  _stopAnimationGroup(context, animationGroup) {
286
+ const owner = RemoveFlowGraphAnimationGroupObservers(context, animationGroup);
287
+ owner?._cleanupAfterExternalStop(context, animationGroup);
233
288
  // stop, while skipping the on AnimationEndObservable to avoid the "done" signal
234
289
  animationGroup.stop(true);
235
290
  // Only dispose animation groups that were internally created by this block
@@ -241,6 +296,11 @@ export class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {
241
296
  }
242
297
  this._removeFromCurrentlyRunning(context, animationGroup);
243
298
  }
299
+ /** @internal */
300
+ _cleanupAfterExternalStop(context, animationGroup) {
301
+ this._removeFromCurrentlyRunning(context, animationGroup);
302
+ this._resetAfterCanceled(context);
303
+ }
244
304
  _removeFromCurrentlyRunning(context, animationGroup) {
245
305
  const currentlyRunningAnimationGroups = context._getGlobalContextVariable("currentlyRunningAnimationGroups", []);
246
306
  const idx = currentlyRunningAnimationGroups.indexOf(animationGroup.uniqueId);
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphPlay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\r\nimport { type FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport { type FlowGraphDataConnection } from \"../../../flowGraphDataConnection.pure\";\r\nimport { FlowGraphAsyncExecutionBlock } from \"../../../flowGraphAsyncExecutionBlock\";\r\nimport { RichTypeAny, RichTypeNumber, RichTypeBoolean } from \"../../../flowGraphRichTypes.pure\";\r\nimport { type IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { AnimationGroup } from \"core/Animations/animationGroup.pure\";\r\nimport { type Animation } from \"core/Animations/animation.pure\";\r\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n\r\n/**\r\n * @experimental\r\n * A block that plays an animation on an animatable object.\r\n */\r\nexport class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {\r\n /**\r\n * Input connection: The speed of the animation.\r\n */\r\n public readonly speed: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: Should the animation loop?\r\n * Not in glTF specs, but useful for the engine.\r\n */\r\n public readonly loop: FlowGraphDataConnection<boolean>;\r\n /**\r\n * Input connection: The starting frame of the animation.\r\n */\r\n public readonly from: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The ending frame of the animation.\r\n */\r\n public readonly to: FlowGraphDataConnection<number>;\r\n\r\n /**\r\n * Output connection: The current frame of the animation.\r\n */\r\n public readonly currentFrame: FlowGraphDataConnection<number>;\r\n\r\n /**\r\n * Output connection: The current time of the animation.\r\n */\r\n public readonly currentTime: FlowGraphDataConnection<number>;\r\n\r\n /**\r\n * Output connection: The animatable that is currently running.\r\n */\r\n public readonly currentAnimationGroup: FlowGraphDataConnection<AnimationGroup>;\r\n\r\n /**\r\n * Input: Will be initialized if no animation group was provided in the configuration.\r\n */\r\n public readonly animationGroup: FlowGraphDataConnection<AnimationGroup>;\r\n\r\n /**\r\n * Input: If provided this animation will be used. Priority will be given to the animation group input.\r\n */\r\n public readonly animation: FlowGraphDataConnection<Animation | Animation[]>;\r\n\r\n /**\r\n * Input connection: The target object that will be animated. If animation group is provided this input will be ignored.\r\n */\r\n public readonly object: FlowGraphDataConnection<any>;\r\n\r\n public constructor(\r\n /**\r\n * the configuration of the block\r\n */\r\n public override config?: IFlowGraphBlockConfiguration\r\n ) {\r\n super(config, [\"animationLoop\", \"animationEnd\", \"animationGroupLoop\"]);\r\n\r\n this.speed = this.registerDataInput(\"speed\", RichTypeNumber);\r\n this.loop = this.registerDataInput(\"loop\", RichTypeBoolean);\r\n this.from = this.registerDataInput(\"from\", RichTypeNumber, 0);\r\n this.to = this.registerDataInput(\"to\", RichTypeNumber);\r\n\r\n this.currentFrame = this.registerDataOutput(\"currentFrame\", RichTypeNumber);\r\n this.currentTime = this.registerDataOutput(\"currentTime\", RichTypeNumber);\r\n\r\n this.currentAnimationGroup = this.registerDataOutput(\"currentAnimationGroup\", RichTypeAny);\r\n this.animationGroup = this.registerDataInput(\"animationGroup\", RichTypeAny, config?.animationGroup);\r\n this.animation = this.registerDataInput(\"animation\", RichTypeAny);\r\n this.object = this.registerDataInput(\"object\", RichTypeAny);\r\n }\r\n\r\n /**\r\n * @internal\r\n * @param context\r\n */\r\n public override _startPendingTasks(context: FlowGraphContext): void {\r\n if (context._getExecutionVariable(this, \"_initialized\", false)) {\r\n this._cancelPendingTasks(context);\r\n this._resetAfterCanceled(context);\r\n }\r\n\r\n if (!this._tryPreparePendingTasks(context)) {\r\n return;\r\n }\r\n context._addPendingBlock(this);\r\n this.out._activateSignal(context);\r\n context._setExecutionVariable(this, \"_initialized\", true);\r\n }\r\n\r\n /**\r\n * @internal\r\n * @param context the graph context\r\n */\r\n public override _preparePendingTasks(context: FlowGraphContext): void {\r\n this._tryPreparePendingTasks(context);\r\n }\r\n\r\n /**\r\n * Prepares and starts the animation, reporting whether it could be started. Invalid inputs\r\n * activate `err` and return false, so the caller neither activates `out` nor registers the\r\n * block as pending.\r\n * @param context the graph context\r\n * @returns whether the animation was prepared and started successfully\r\n */\r\n private _tryPreparePendingTasks(context: FlowGraphContext): boolean {\r\n const ag = this.animationGroup.getValue(context);\r\n const animation = this.animation.getValue(context);\r\n if (!ag && !animation) {\r\n this._reportError(context, \"No animation or animation group provided\");\r\n return false;\r\n } else {\r\n // if an animation group was already created, dispose it and create a new one\r\n const currentAnimationGroup = this.currentAnimationGroup.getValue(context);\r\n if (currentAnimationGroup && currentAnimationGroup !== ag) {\r\n currentAnimationGroup.dispose();\r\n }\r\n let animationGroupToUse = ag;\r\n let isInterpolation = false;\r\n let interpolationAnimationsArray: Animation[] | undefined;\r\n let interpolationTarget: any;\r\n // check which animation to use. If no animationGroup was defined and an animation was provided, use the animation\r\n if (animation && !animationGroupToUse) {\r\n const target = this.object.getValue(context);\r\n if (!target) {\r\n this._reportError(context, \"No target object provided\");\r\n return false;\r\n }\r\n const animationsArray = Array.isArray(animation) ? animation : [animation];\r\n const name = animationsArray[0].name;\r\n animationGroupToUse = new AnimationGroup(\"flowGraphAnimationGroup-\" + name + \"-\" + target.name, context.configuration.scene);\r\n const interpolationAnimations = context._getGlobalContextVariable(\"interpolationAnimations\", []) as number[];\r\n for (const anim of animationsArray) {\r\n animationGroupToUse.addTargetedAnimation(anim, target);\r\n if (interpolationAnimations.indexOf(anim.uniqueId) !== -1) {\r\n isInterpolation = true;\r\n }\r\n }\r\n interpolationAnimationsArray = animationsArray;\r\n interpolationTarget = target;\r\n }\r\n // not accepting 0\r\n const speed = this.speed.getValue(context) || 1;\r\n const from = this.from.getValue(context) ?? 0;\r\n // Read the raw end time before it is defaulted to the animation group's natural end, so that an\r\n // explicitly provided NaN end time can still be detected by the animation/start validation below.\r\n const rawTo = this.to.getValue(context);\r\n // not accepting 0\r\n const to = rawTo || animationGroupToUse.to;\r\n\r\n // Input validation. Only applies to animation-group playback\r\n // (animation/start); interpolation uses the `animation` input and has its own validation below.\r\n // The operation activates its `err` flow when the speed is NaN, infinite, or <= 0, or\r\n // when the end time is NaN. A NaN or infinite start time is caught by the finite check on `from`.\r\n if (!animation) {\r\n if (isNaN(rawTo)) {\r\n this._reportError(context, \"Invalid animation end time\");\r\n return false;\r\n }\r\n // Only validate a speed that was explicitly provided; an unconnected speed keeps the engine\r\n // default of 1 (matching the historical Babylon behavior for animation/start without a speed).\r\n if (this.speed.isConnected() || context._hasConnectionValue(this.speed)) {\r\n const providedSpeed = this.speed.getValue(context);\r\n if (!isFinite(providedSpeed) || providedSpeed <= 0) {\r\n this._reportError(context, \"Invalid animation speed\");\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n // The start value (interpolation start frame / animation start time) must always be finite. For\r\n // animation/start this also satisfies the spec requirement that a NaN or infinite start time\r\n // activates the err flow.\r\n if (!isFinite(from)) {\r\n this._reportError(context, \"Invalid animation duration\");\r\n return false;\r\n }\r\n // For interpolation the end value is the animation duration and must be a finite, non-negative number.\r\n // Animation-group playback (animation/start) instead allows an infinite end time — it means \"play to\r\n // the natural end / loop\" (see the `loop` computation below) — and its NaN end time was already\r\n // rejected above, so the end value is only range-checked here for the interpolation case.\r\n if (animation && (!isFinite(to) || to < 0)) {\r\n this._reportError(context, \"Invalid animation duration\");\r\n return false;\r\n }\r\n\r\n // CSS cubic-bezier control points must be finite, and the X components must be in [0, 1].\r\n if (animation) {\r\n const animationsArray = Array.isArray(animation) ? animation : [animation];\r\n for (const anim of animationsArray) {\r\n const easing = anim.getEasingFunction?.();\r\n if (easing && \"x1\" in easing) {\r\n const bezier = easing as unknown as { x1: number; y1: number; x2: number; y2: number };\r\n if (\r\n !Number.isFinite(bezier.x1) ||\r\n !Number.isFinite(bezier.y1) ||\r\n !Number.isFinite(bezier.x2) ||\r\n !Number.isFinite(bezier.y2) ||\r\n bezier.x1 < 0 ||\r\n bezier.x1 > 1 ||\r\n bezier.x2 < 0 ||\r\n bezier.x2 > 1\r\n ) {\r\n this._reportError(context, \"Invalid bezier curve control points\");\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Stop any interpolation already running on the same target/property, but only after validation has\r\n // passed. An invalid interpolation (bad duration or NaN control points) must report [err] without\r\n // disturbing an interpolation that is already running on the same target.\r\n if (isInterpolation && interpolationAnimationsArray && interpolationTarget !== undefined) {\r\n this._checkInterpolationDuplications(context, interpolationAnimationsArray, interpolationTarget);\r\n }\r\n\r\n const loop = !isFinite(to) || this.loop.getValue(context);\r\n this.currentAnimationGroup.setValue(animationGroupToUse, context);\r\n\r\n const currentlyRunningAnimationGroups = context._getGlobalContextVariable(\"currentlyRunningAnimationGroups\", []) as number[];\r\n // check if it already running\r\n if (currentlyRunningAnimationGroups.indexOf(animationGroupToUse.uniqueId) !== -1) {\r\n animationGroupToUse.stop();\r\n }\r\n try {\r\n animationGroupToUse.start(loop, speed, from, to);\r\n animationGroupToUse.onAnimationGroupEndObservable.add(() => this._onAnimationGroupEnd(context));\r\n animationGroupToUse.onAnimationEndObservable.add(() => this._eventsSignalOutputs[\"animationEnd\"]._activateSignal(context));\r\n animationGroupToUse.onAnimationLoopObservable.add(() => this._eventsSignalOutputs[\"animationLoop\"]._activateSignal(context));\r\n animationGroupToUse.onAnimationGroupLoopObservable.add(() => this._eventsSignalOutputs[\"animationGroupLoop\"]._activateSignal(context));\r\n currentlyRunningAnimationGroups.push(animationGroupToUse.uniqueId);\r\n context._setGlobalContextVariable(\"currentlyRunningAnimationGroups\", currentlyRunningAnimationGroups);\r\n } catch (e) {\r\n this._reportError(context, e);\r\n return false;\r\n }\r\n return true;\r\n }\r\n }\r\n\r\n protected override _reportError(context: FlowGraphContext, error: string | Error): void {\r\n super._reportError(context, error);\r\n this.currentFrame.setValue(-1, context);\r\n this.currentTime.setValue(-1, context);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _executeOnTick(_context: FlowGraphContext): void {\r\n const ag = this.currentAnimationGroup.getValue(_context);\r\n if (ag) {\r\n this.currentFrame.setValue(ag.getCurrentFrame(), _context);\r\n this.currentTime.setValue(ag.animatables[0]?.elapsedTime ?? 0, _context);\r\n }\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n this._startPendingTasks(context);\r\n }\r\n\r\n private _onAnimationGroupEnd(context: FlowGraphContext) {\r\n this._removeFromCurrentlyRunning(context, this.currentAnimationGroup.getValue(context));\r\n this._resetAfterCanceled(context);\r\n this.done._activateSignal(context);\r\n }\r\n\r\n /**\r\n * The idea behind this function is to check every running animation group and check if the targeted animations it uses are interpolation animations.\r\n * If they are, we want to see that they don't collide with the current interpolation animations that are starting to play.\r\n * If they do, we want to stop the already-running animation group.\r\n * @internal\r\n */\r\n private _checkInterpolationDuplications(context: FlowGraphContext, animation: Animation[], target: any) {\r\n const currentlyRunningAnimationGroups = context._getGlobalContextVariable(\"currentlyRunningAnimationGroups\", []) as number[];\r\n for (const uniqueId of currentlyRunningAnimationGroups) {\r\n const ag = context.assetsContext.animationGroups.find((ag) => ag.uniqueId === uniqueId);\r\n if (ag) {\r\n for (const anim of ag.targetedAnimations) {\r\n for (const animToCheck of animation) {\r\n if (anim.animation.targetProperty === animToCheck.targetProperty && anim.target === target) {\r\n this._stopAnimationGroup(context, ag);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n private _stopAnimationGroup(context: FlowGraphContext, animationGroup: AnimationGroup) {\r\n // stop, while skipping the on AnimationEndObservable to avoid the \"done\" signal\r\n animationGroup.stop(true);\r\n // Only dispose animation groups that were internally created by this block\r\n // (i.e. built from individual animations). Scene-provided animation groups\r\n // must not be disposed as that removes them from the scene catalog and\r\n // breaks the editor dropdown / re-use on replay.\r\n if (animationGroup.name.startsWith(\"flowGraphAnimationGroup-\")) {\r\n animationGroup.dispose();\r\n }\r\n this._removeFromCurrentlyRunning(context, animationGroup);\r\n }\r\n\r\n private _removeFromCurrentlyRunning(context: FlowGraphContext, animationGroup: AnimationGroup) {\r\n const currentlyRunningAnimationGroups = context._getGlobalContextVariable(\"currentlyRunningAnimationGroups\", []) as number[];\r\n const idx = currentlyRunningAnimationGroups.indexOf(animationGroup.uniqueId);\r\n if (idx !== -1) {\r\n currentlyRunningAnimationGroups.splice(idx, 1);\r\n context._setGlobalContextVariable(\"currentlyRunningAnimationGroups\", currentlyRunningAnimationGroups);\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n * Stop any currently running animations.\r\n */\r\n public override _cancelPendingTasks(context: FlowGraphContext): void {\r\n const ag = this.currentAnimationGroup.getValue(context);\r\n if (ag) {\r\n this._stopAnimationGroup(context, ag);\r\n }\r\n }\r\n\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName(): string {\r\n return FlowGraphBlockNames.PlayAnimation;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for flowGraphPlayAnimationBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterFlowGraphPlayAnimationBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(FlowGraphBlockNames.PlayAnimation, FlowGraphPlayAnimationBlock);\r\n}\r\n"]}
1
+ {"version":3,"file":"flowGraphPlayAnimationBlock.pure.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAI7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEhG,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAIrE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,sCAAsC,EAAuC,MAAM,oCAAoC,CAAC;AACjI,OAAO,EAAE,sCAAsC,EAAE,MAAM,oCAAoC,CAAC;AAY5F;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ,4BAA4B;IAuDzE;IACI;;OAEG;IACa,MAAkD;QAElE,KAAK,CAAC,MAAM,EAAE,CAAC,eAAe,EAA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AC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,wEAAoC,2BAA2B,CAAC,CAAC;AAClF,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { type FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport { type FlowGraphDataConnection } from \"../../../flowGraphDataConnection.pure\";\r\nimport { FlowGraphAsyncExecutionBlock } from \"../../../flowGraphAsyncExecutionBlock\";\r\nimport { RichTypeAny, RichTypeNumber, RichTypeBoolean } from \"../../../flowGraphRichTypes.pure\";\r\nimport { type IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { AnimationGroup } from \"core/Animations/animationGroup.pure\";\r\nimport { type Animation } from \"core/Animations/animation.pure\";\r\nimport { type IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { RemoveFlowGraphAnimationGroupObservers, type IFlowGraphAnimationObserverSet } from \"../../../flowGraphAnimationHelpers\";\r\nexport { RemoveFlowGraphAnimationGroupObservers } from \"../../../flowGraphAnimationHelpers\";\r\n\r\n/**\r\n * Configuration for playing an animation.\r\n */\r\nexport interface IFlowGraphPlayAnimationBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * Whether animation-group playback uses the unbounded KHR_interactivity timeline.\r\n */\r\n useVirtualTimeline?: boolean;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * A block that plays an animation on an animatable object.\r\n */\r\nexport class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {\r\n /**\r\n * Input connection: The speed of the animation.\r\n */\r\n public readonly speed: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: Should the animation loop?\r\n * Not in glTF specs, but useful for the engine.\r\n */\r\n public readonly loop: FlowGraphDataConnection<boolean>;\r\n /**\r\n * Input connection: The starting frame of the animation.\r\n */\r\n public readonly from: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The ending frame of the animation.\r\n */\r\n public readonly to: FlowGraphDataConnection<number>;\r\n\r\n /**\r\n * Output connection: The current frame of the animation.\r\n */\r\n public readonly currentFrame: FlowGraphDataConnection<number>;\r\n\r\n /**\r\n * Output connection: The current time of the animation.\r\n */\r\n public readonly currentTime: FlowGraphDataConnection<number>;\r\n\r\n /**\r\n * Output connection: The animatable that is currently running.\r\n */\r\n public readonly currentAnimationGroup: FlowGraphDataConnection<AnimationGroup>;\r\n\r\n /**\r\n * Input: Will be initialized if no animation group was provided in the configuration.\r\n */\r\n public readonly animationGroup: FlowGraphDataConnection<AnimationGroup>;\r\n\r\n /**\r\n * Input: If provided this animation will be used. Priority will be given to the animation group input.\r\n */\r\n public readonly animation: FlowGraphDataConnection<Animation | Animation[]>;\r\n\r\n /**\r\n * Input connection: Optional targets matching the animation array in order.\r\n * When supplied, these replace the single object target. Ignored when animationGroup is supplied.\r\n */\r\n public readonly animationTargets: FlowGraphDataConnection<IAnimatable[] | undefined>;\r\n\r\n /**\r\n * Input connection: The target object that will be animated. If animation group is provided this input will be ignored.\r\n */\r\n public readonly object: FlowGraphDataConnection<any>;\r\n\r\n public constructor(\r\n /**\r\n * the configuration of the block\r\n */\r\n public override config?: IFlowGraphPlayAnimationBlockConfiguration\r\n ) {\r\n super(config, [\"animationLoop\", \"animationEnd\", \"animationGroupLoop\"]);\r\n\r\n this.speed = this.registerDataInput(\"speed\", RichTypeNumber);\r\n this.loop = this.registerDataInput(\"loop\", RichTypeBoolean);\r\n this.from = this.registerDataInput(\"from\", RichTypeNumber, 0);\r\n this.to = this.registerDataInput(\"to\", RichTypeNumber);\r\n\r\n this.currentFrame = this.registerDataOutput(\"currentFrame\", RichTypeNumber);\r\n this.currentTime = this.registerDataOutput(\"currentTime\", RichTypeNumber);\r\n\r\n this.currentAnimationGroup = this.registerDataOutput(\"currentAnimationGroup\", RichTypeAny);\r\n this.animationGroup = this.registerDataInput(\"animationGroup\", RichTypeAny, config?.animationGroup);\r\n this.animation = this.registerDataInput(\"animation\", RichTypeAny);\r\n this.animationTargets = this.registerDataInput(\"animationTargets\", RichTypeAny);\r\n this.object = this.registerDataInput(\"object\", RichTypeAny);\r\n }\r\n\r\n /**\r\n * @internal\r\n * @param context\r\n */\r\n public override _startPendingTasks(context: FlowGraphContext): void {\r\n if (context._getExecutionVariable(this, \"_initialized\", false)) {\r\n this._cancelPendingTasks(context);\r\n this._resetAfterCanceled(context);\r\n }\r\n\r\n if (!this._tryPreparePendingTasks(context)) {\r\n return;\r\n }\r\n context._addPendingBlock(this);\r\n context._setExecutionVariable(this, \"_initialized\", true);\r\n this.out._activateSignal(context);\r\n }\r\n\r\n /**\r\n * @internal\r\n * @param context the graph context\r\n */\r\n public override _preparePendingTasks(context: FlowGraphContext): void {\r\n this._tryPreparePendingTasks(context);\r\n }\r\n\r\n /**\r\n * Prepares and starts the animation, reporting whether it could be started. Invalid inputs\r\n * activate `err` and return false, so the caller neither activates `out` nor registers the\r\n * block as pending.\r\n * @param context the graph context\r\n * @returns whether the animation was prepared and started successfully\r\n */\r\n private _tryPreparePendingTasks(context: FlowGraphContext): boolean {\r\n let ag: AnimationGroup;\r\n let animation: Animation | Animation[];\r\n let animationTargets: IAnimatable[] | undefined;\r\n try {\r\n ag = this.animationGroup.getValue(context);\r\n animation = this.animation.getValue(context);\r\n animationTargets = ag ? undefined : this.animationTargets.getValue(context);\r\n } catch (error) {\r\n this._reportError(context, error);\r\n return false;\r\n }\r\n if (!ag && !animation) {\r\n this._reportError(context, \"No animation or animation group provided\");\r\n return false;\r\n } else if (!ag && Array.isArray(animation) && animation.length === 0) {\r\n this._reportError(context, \"Animation array is empty\");\r\n return false;\r\n } else if (ag && ag.targetedAnimations.length === 0) {\r\n this._reportError(context, \"Animation group has no targeted animations\");\r\n return false;\r\n } else {\r\n // if an animation group was already created, dispose it and create a new one\r\n const currentAnimationGroup = this.currentAnimationGroup.getValue(context);\r\n if (currentAnimationGroup && currentAnimationGroup !== ag) {\r\n currentAnimationGroup.dispose();\r\n }\r\n let animationGroupToUse = ag;\r\n let isInterpolation = false;\r\n let interpolationAnimationsArray: Animation[] | undefined;\r\n let interpolationTarget: any;\r\n // check which animation to use. If no animationGroup was defined and an animation was provided, use the animation\r\n if (animation && !animationGroupToUse) {\r\n const target = animationTargets === undefined ? this.object.getValue(context) : undefined;\r\n const animationsArray = Array.isArray(animation) ? animation : [animation];\r\n if (animationTargets !== undefined && (!Array.isArray(animationTargets) || animationTargets.length !== animationsArray.length)) {\r\n this._reportError(context, \"Animation targets must match the animation array.\");\r\n return false;\r\n }\r\n if (!animationTargets && !target) {\r\n this._reportError(context, \"No target object provided\");\r\n return false;\r\n }\r\n if (animationTargets) {\r\n for (const animationTarget of animationTargets) {\r\n if (!animationTarget) {\r\n this._reportError(context, \"No target object provided\");\r\n return false;\r\n }\r\n }\r\n }\r\n const name = animationsArray[0].name;\r\n animationGroupToUse = new AnimationGroup(\"flowGraphAnimationGroup-\" + name + \"-\" + (target?.name ?? \"targets\"), context.configuration.scene);\r\n const interpolationAnimations = context._getGlobalContextVariable(\"interpolationAnimations\", []) as number[];\r\n for (let index = 0; index < animationsArray.length; index++) {\r\n const anim = animationsArray[index];\r\n animationGroupToUse.addTargetedAnimation(anim, animationTargets ? animationTargets[index] : target);\r\n if (interpolationAnimations.indexOf(anim.uniqueId) !== -1) {\r\n isInterpolation = true;\r\n }\r\n }\r\n interpolationAnimationsArray = animationsArray;\r\n interpolationTarget = target;\r\n }\r\n // not accepting 0\r\n const speed = this.speed.getValue(context) || 1;\r\n const from = this.from.getValue(context) ?? 0;\r\n // Read the raw end time before it is defaulted to the animation group's natural end, so that an\r\n // explicitly provided NaN end time can still be detected by the animation/start validation below.\r\n const rawTo = this.to.getValue(context);\r\n const hasTo = this.to.isConnected() || context._hasConnectionValue(this.to);\r\n const to = hasTo ? rawTo : animationGroupToUse.to;\r\n\r\n // Input validation. Only applies to animation-group playback\r\n // (animation/start); interpolation uses the `animation` input and has its own validation below.\r\n // The operation activates its `err` flow when the speed is NaN, infinite, or <= 0, or\r\n // when the end time is NaN. A NaN or infinite start time is caught by the finite check on `from`.\r\n if (!animation) {\r\n if (isNaN(rawTo)) {\r\n this._reportError(context, \"Invalid animation end time\");\r\n return false;\r\n }\r\n // Only validate a speed that was explicitly provided; an unconnected speed keeps the engine\r\n // default of 1 (matching the historical Babylon behavior for animation/start without a speed).\r\n if (this.speed.isConnected() || context._hasConnectionValue(this.speed)) {\r\n const providedSpeed = this.speed.getValue(context);\r\n if (!isFinite(providedSpeed) || providedSpeed <= 0) {\r\n this._reportError(context, \"Invalid animation speed\");\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n // The start value (interpolation start frame / animation start time) must always be finite. For\r\n // animation/start this also satisfies the spec requirement that a NaN or infinite start time\r\n // activates the err flow.\r\n if (!isFinite(from)) {\r\n this._reportError(context, \"Invalid animation duration\");\r\n return false;\r\n }\r\n // For interpolation the end value is the animation duration and must be a finite, non-negative number.\r\n // Animation-group playback (animation/start) instead allows an infinite end time — it means \"play to\r\n // the natural end / loop\" (see the `loop` computation below) — and its NaN end time was already\r\n // rejected above, so the end value is only range-checked here for the interpolation case.\r\n if (animation && (!isFinite(to) || to < 0)) {\r\n this._reportError(context, \"Invalid animation duration\");\r\n return false;\r\n }\r\n\r\n // CSS cubic-bezier control points must be finite, and the X components must be in [0, 1].\r\n if (animation) {\r\n const animationsArray = Array.isArray(animation) ? animation : [animation];\r\n for (const anim of animationsArray) {\r\n const easing = anim.getEasingFunction?.();\r\n if (easing && \"x1\" in easing) {\r\n const bezier = easing as unknown as { x1: number; y1: number; x2: number; y2: number };\r\n if (\r\n !Number.isFinite(bezier.x1) ||\r\n !Number.isFinite(bezier.y1) ||\r\n !Number.isFinite(bezier.x2) ||\r\n !Number.isFinite(bezier.y2) ||\r\n bezier.x1 < 0 ||\r\n bezier.x1 > 1 ||\r\n bezier.x2 < 0 ||\r\n bezier.x2 > 1\r\n ) {\r\n this._reportError(context, \"Invalid bezier curve control points\");\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Stop any interpolation already running on the same target/property, but only after validation has\r\n // passed. An invalid interpolation (bad duration or NaN control points) must report [err] without\r\n // disturbing an interpolation that is already running on the same target.\r\n if (isInterpolation && interpolationAnimationsArray) {\r\n this._checkInterpolationDuplications(context, interpolationAnimationsArray, interpolationTarget, animationTargets);\r\n }\r\n\r\n const loop = !isFinite(to) || this.loop.getValue(context);\r\n this.currentAnimationGroup.setValue(animationGroupToUse, context);\r\n\r\n const currentlyRunningAnimationGroups = context._getGlobalContextVariable(\"currentlyRunningAnimationGroups\", []) as number[];\r\n // check if it already running\r\n if (currentlyRunningAnimationGroups.indexOf(animationGroupToUse.uniqueId) !== -1) {\r\n this._stopAnimationGroup(context, animationGroupToUse);\r\n }\r\n try {\r\n if (this.config?.useVirtualTimeline) {\r\n animationGroupToUse.startWithVirtualTimeline(loop, speed, from, to);\r\n } else {\r\n animationGroupToUse.start(loop, speed, from, to);\r\n }\r\n const observers: IFlowGraphAnimationObserverSet = {\r\n block: this,\r\n groupEnd: animationGroupToUse.onAnimationGroupEndObservable.add(() => this._onAnimationGroupEnd(context, animationGroupToUse)),\r\n animationEnd: animationGroupToUse.onAnimationEndObservable.add(() => this._eventsSignalOutputs[\"animationEnd\"]._activateSignal(context)),\r\n animationLoop: animationGroupToUse.onAnimationLoopObservable.add(() => this._eventsSignalOutputs[\"animationLoop\"]._activateSignal(context)),\r\n groupLoop: animationGroupToUse.onAnimationGroupLoopObservable.add(() => this._eventsSignalOutputs[\"animationGroupLoop\"]._activateSignal(context)),\r\n };\r\n const observerSets = context._getGlobalContextVariable(\"animationGroupObserverSets\", new Map<number, IFlowGraphAnimationObserverSet>());\r\n observerSets.set(animationGroupToUse.uniqueId, observers);\r\n context._setGlobalContextVariable(\"animationGroupObserverSets\", observerSets);\r\n currentlyRunningAnimationGroups.push(animationGroupToUse.uniqueId);\r\n context._setGlobalContextVariable(\"currentlyRunningAnimationGroups\", currentlyRunningAnimationGroups);\r\n } catch (e) {\r\n this._reportError(context, e);\r\n return false;\r\n }\r\n return true;\r\n }\r\n }\r\n\r\n protected override _reportError(context: FlowGraphContext, error: string | Error): void {\r\n super._reportError(context, error);\r\n this.currentFrame.setValue(-1, context);\r\n this.currentTime.setValue(-1, context);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _executeOnTick(_context: FlowGraphContext): void {\r\n const ag = this.currentAnimationGroup.getValue(_context);\r\n if (ag) {\r\n this.currentFrame.setValue(ag.getCurrentFrame(), _context);\r\n this.currentTime.setValue(ag.animatables[0]?.elapsedTime ?? 0, _context);\r\n }\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n this._startPendingTasks(context);\r\n }\r\n\r\n private _onAnimationGroupEnd(context: FlowGraphContext, animationGroup: AnimationGroup) {\r\n RemoveFlowGraphAnimationGroupObservers(context, animationGroup);\r\n this._removeFromCurrentlyRunning(context, animationGroup);\r\n this._resetAfterCanceled(context);\r\n this.done._activateSignal(context);\r\n }\r\n\r\n /**\r\n * The idea behind this function is to check every running animation group and check if the targeted animations it uses are interpolation animations.\r\n * If they are, we want to see that they don't collide with the current interpolation animations that are starting to play.\r\n * If they do, we want to stop the already-running animation group.\r\n * @internal\r\n */\r\n private _checkInterpolationDuplications(context: FlowGraphContext, animation: Animation[], target: any, targets?: IAnimatable[]) {\r\n const currentlyRunningAnimationGroups = context._getGlobalContextVariable(\"currentlyRunningAnimationGroups\", []) as number[];\r\n for (let groupIndex = currentlyRunningAnimationGroups.length - 1; groupIndex >= 0; groupIndex--) {\r\n const uniqueId = currentlyRunningAnimationGroups[groupIndex];\r\n const ag = context.assetsContext.animationGroups.find((ag) => ag.uniqueId === uniqueId);\r\n if (ag) {\r\n let stopped = false;\r\n for (const anim of ag.targetedAnimations) {\r\n for (let index = 0; index < animation.length; index++) {\r\n if (anim.animation.targetProperty === animation[index].targetProperty && anim.target === (targets ? targets[index] : target)) {\r\n this._stopAnimationGroup(context, ag);\r\n stopped = true;\r\n break;\r\n }\r\n }\r\n if (stopped) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n private _stopAnimationGroup(context: FlowGraphContext, animationGroup: AnimationGroup) {\r\n const owner = RemoveFlowGraphAnimationGroupObservers(context, animationGroup);\r\n owner?._cleanupAfterExternalStop(context, animationGroup);\r\n // stop, while skipping the on AnimationEndObservable to avoid the \"done\" signal\r\n animationGroup.stop(true);\r\n // Only dispose animation groups that were internally created by this block\r\n // (i.e. built from individual animations). Scene-provided animation groups\r\n // must not be disposed as that removes them from the scene catalog and\r\n // breaks the editor dropdown / re-use on replay.\r\n if (animationGroup.name.startsWith(\"flowGraphAnimationGroup-\")) {\r\n animationGroup.dispose();\r\n }\r\n this._removeFromCurrentlyRunning(context, animationGroup);\r\n }\r\n\r\n /** @internal */\r\n public _cleanupAfterExternalStop(context: FlowGraphContext, animationGroup: AnimationGroup): void {\r\n this._removeFromCurrentlyRunning(context, animationGroup);\r\n this._resetAfterCanceled(context);\r\n }\r\n\r\n private _removeFromCurrentlyRunning(context: FlowGraphContext, animationGroup: AnimationGroup) {\r\n const currentlyRunningAnimationGroups = context._getGlobalContextVariable(\"currentlyRunningAnimationGroups\", []) as number[];\r\n const idx = currentlyRunningAnimationGroups.indexOf(animationGroup.uniqueId);\r\n if (idx !== -1) {\r\n currentlyRunningAnimationGroups.splice(idx, 1);\r\n context._setGlobalContextVariable(\"currentlyRunningAnimationGroups\", currentlyRunningAnimationGroups);\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n * Stop any currently running animations.\r\n */\r\n public override _cancelPendingTasks(context: FlowGraphContext): void {\r\n const ag = this.currentAnimationGroup.getValue(context);\r\n if (ag) {\r\n this._stopAnimationGroup(context, ag);\r\n }\r\n }\r\n\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName(): string {\r\n return FlowGraphBlockNames.PlayAnimation;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for flowGraphPlayAnimationBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterFlowGraphPlayAnimationBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(FlowGraphBlockNames.PlayAnimation, FlowGraphPlayAnimationBlock);\r\n}\r\n"]}
@@ -4,6 +4,21 @@ import { type FlowGraphDataConnection } from "../../../flowGraphDataConnection.p
4
4
  import { type IFlowGraphBlockConfiguration } from "../../../flowGraphBlock.js";
5
5
  import { type AnimationGroup } from "../../../../Animations/animationGroup.pure.js";
6
6
  import { FlowGraphAsyncExecutionBlock } from "../../../flowGraphAsyncExecutionBlock.js";
7
+ /**
8
+ * Configuration for stopping an animation.
9
+ */
10
+ export interface IFlowGraphStopAnimationBlockConfiguration extends IFlowGraphBlockConfiguration {
11
+ /**
12
+ * Whether stopAtFrame uses the unbounded KHR_interactivity timeline.
13
+ * When false, the block retains its legacy positive-frame scheduling behavior.
14
+ */
15
+ useVirtualStopAt?: boolean;
16
+ /**
17
+ * Whether stopping suppresses the animation-group end notification.
18
+ * Defaults to true to preserve the historical StopAnimation behavior.
19
+ */
20
+ skipOnAnimationEnd?: boolean;
21
+ }
7
22
  /**
8
23
  * @experimental
9
24
  * Block that stops a running animation
@@ -17,7 +32,7 @@ export declare class FlowGraphStopAnimationBlock extends FlowGraphAsyncExecution
17
32
  * Input connection - if defined (positive integer) the animation will stop at this frame.
18
33
  */
19
34
  readonly stopAtFrame: FlowGraphDataConnection<number>;
20
- constructor(config?: IFlowGraphBlockConfiguration);
35
+ constructor(config?: IFlowGraphStopAnimationBlockConfiguration);
21
36
  _preparePendingTasks(context: FlowGraphContext): void;
22
37
  _cancelPendingTasks(context: FlowGraphContext): void;
23
38
  _execute(context: FlowGraphContext): void;
@@ -3,6 +3,7 @@ import { RichTypeAny, RichTypeNumber } from "../../../flowGraphRichTypes.pure.js
3
3
  import { Logger } from "../../../../Misc/logger.js";
4
4
  import { FlowGraphAsyncExecutionBlock } from "../../../flowGraphAsyncExecutionBlock.js";
5
5
  import { RegisterClass } from "../../../../Misc/typeStore.js";
6
+ import { RemoveFlowGraphAnimationGroupObservers } from "./flowGraphPlayAnimationBlock.pure.js";
6
7
  /**
7
8
  * @experimental
8
9
  * Block that stops a running animation
@@ -18,8 +19,22 @@ export class FlowGraphStopAnimationBlock extends FlowGraphAsyncExecutionBlock {
18
19
  const stopAtFrame = this.stopAtFrame.getValue(context) ?? -1;
19
20
  // get the context variable
20
21
  const pendingStopAnimations = context._getGlobalContextVariable("pendingStopAnimations", []);
21
- // add the animation to the list
22
- pendingStopAnimations.push({ uniqueId: animationToStopValue.uniqueId, stopAtFrame });
22
+ if (this.config?.useVirtualStopAt) {
23
+ const existing = pendingStopAnimations.find((entry) => entry.uniqueId === animationToStopValue.uniqueId && entry.useVirtualStopAt);
24
+ if (existing) {
25
+ if (existing.block !== this) {
26
+ context._removePendingBlock(existing.block);
27
+ }
28
+ existing.stopAtFrame = stopAtFrame;
29
+ existing.block = this;
30
+ }
31
+ else {
32
+ pendingStopAnimations.push({ uniqueId: animationToStopValue.uniqueId, stopAtFrame, block: this, useVirtualStopAt: true });
33
+ }
34
+ }
35
+ else {
36
+ pendingStopAnimations.push({ uniqueId: animationToStopValue.uniqueId, stopAtFrame, block: this, useVirtualStopAt: false });
37
+ }
23
38
  // set the global context variable
24
39
  context._setGlobalContextVariable("pendingStopAnimations", pendingStopAnimations);
25
40
  }
@@ -28,7 +43,7 @@ export class FlowGraphStopAnimationBlock extends FlowGraphAsyncExecutionBlock {
28
43
  const animationToStopValue = this.animationGroup.getValue(context);
29
44
  const pendingStopAnimations = context._getGlobalContextVariable("pendingStopAnimations", []);
30
45
  for (let i = 0; i < pendingStopAnimations.length; i++) {
31
- if (pendingStopAnimations[i].uniqueId === animationToStopValue.uniqueId) {
46
+ if (pendingStopAnimations[i].uniqueId === animationToStopValue.uniqueId && pendingStopAnimations[i].block === this) {
32
47
  pendingStopAnimations.splice(i, 1);
33
48
  // set the global context variable
34
49
  context._setGlobalContextVariable("pendingStopAnimations", pendingStopAnimations);
@@ -47,14 +62,26 @@ export class FlowGraphStopAnimationBlock extends FlowGraphAsyncExecutionBlock {
47
62
  if (isNaN(stopTime)) {
48
63
  return this._reportError(context, "Invalid stop time.");
49
64
  }
50
- if (stopTime > 0) {
51
- this._startPendingTasks(context);
65
+ const useVirtualStopAt = !!this.config?.useVirtualStopAt;
66
+ const hasScheduledStop = useVirtualStopAt ? this.stopAtFrame.isConnected() || context._hasConnectionValue(this.stopAtFrame) : stopTime > 0;
67
+ let activateDone = false;
68
+ if (hasScheduledStop) {
69
+ if (useVirtualStopAt && animationToStopValue.isValidVirtualStopFrame(stopTime) && animationToStopValue.isVirtualFrameReached(stopTime)) {
70
+ this._stopAnimation(animationToStopValue, context, stopTime);
71
+ activateDone = true;
72
+ }
73
+ else {
74
+ this._startPendingTasks(context);
75
+ }
52
76
  }
53
77
  else {
54
78
  this._stopAnimation(animationToStopValue, context);
55
79
  }
56
80
  // note that out will not be triggered in case of an error
57
81
  this.out._activateSignal(context);
82
+ if (activateDone) {
83
+ this.done._activateSignal(context);
84
+ }
58
85
  }
59
86
  _executeOnTick(context) {
60
87
  const animationToStopValue = this.animationGroup.getValue(context);
@@ -62,11 +89,15 @@ export class FlowGraphStopAnimationBlock extends FlowGraphAsyncExecutionBlock {
62
89
  const pendingStopAnimations = context._getGlobalContextVariable("pendingStopAnimations", []);
63
90
  for (let i = 0; i < pendingStopAnimations.length; i++) {
64
91
  // compare the uniqueId to the animation to stop
65
- if (pendingStopAnimations[i].uniqueId === animationToStopValue.uniqueId) {
66
- // check if the current frame is AFTER the stopAtFrame
67
- if (animationToStopValue.getCurrentFrame() >= pendingStopAnimations[i].stopAtFrame) {
92
+ if (pendingStopAnimations[i].uniqueId === animationToStopValue.uniqueId && pendingStopAnimations[i].block === this) {
93
+ const useVirtualStopAt = pendingStopAnimations[i].useVirtualStopAt;
94
+ const shouldStop = useVirtualStopAt
95
+ ? animationToStopValue.isValidVirtualStopFrame(pendingStopAnimations[i].stopAtFrame) &&
96
+ animationToStopValue.isVirtualFrameReached(pendingStopAnimations[i].stopAtFrame)
97
+ : animationToStopValue.getCurrentFrame() >= pendingStopAnimations[i].stopAtFrame;
98
+ if (shouldStop) {
68
99
  // stop the animation
69
- this._stopAnimation(animationToStopValue, context);
100
+ this._stopAnimation(animationToStopValue, context, useVirtualStopAt ? pendingStopAnimations[i].stopAtFrame : undefined);
70
101
  // remove the animation from the list
71
102
  pendingStopAnimations.splice(i, 1);
72
103
  // set the global context variable
@@ -75,6 +106,12 @@ export class FlowGraphStopAnimationBlock extends FlowGraphAsyncExecutionBlock {
75
106
  context._removePendingBlock(this);
76
107
  break;
77
108
  }
109
+ else if (!animationToStopValue.isPlaying) {
110
+ pendingStopAnimations.splice(i, 1);
111
+ context._setGlobalContextVariable("pendingStopAnimations", pendingStopAnimations);
112
+ context._removePendingBlock(this);
113
+ break;
114
+ }
78
115
  }
79
116
  }
80
117
  }
@@ -84,18 +121,31 @@ export class FlowGraphStopAnimationBlock extends FlowGraphAsyncExecutionBlock {
84
121
  getClassName() {
85
122
  return "FlowGraphStopAnimationBlock" /* FlowGraphBlockNames.StopAnimation */;
86
123
  }
87
- _stopAnimation(animationGroup, context) {
124
+ _stopAnimation(animationGroup, context, virtualStopFrame) {
88
125
  const currentlyRunning = context._getGlobalContextVariable("currentlyRunningAnimationGroups", []);
89
126
  const index = currentlyRunning.indexOf(animationGroup.uniqueId);
90
127
  if (index !== -1) {
128
+ const suppressAnimationEnd = this.config?.skipOnAnimationEnd !== false;
129
+ const owner = suppressAnimationEnd ? RemoveFlowGraphAnimationGroupObservers(context, animationGroup) : undefined;
130
+ owner?._cleanupAfterExternalStop(context, animationGroup);
131
+ if (virtualStopFrame !== undefined) {
132
+ animationGroup.setVirtualCurrentFrame(virtualStopFrame);
133
+ }
91
134
  // Skip the animation-end observable so that stopping does not activate the originating
92
135
  // starting block's `done` flow. When an animation is
93
136
  // stopped (animation/stop or animation/stopAt) the previously associated `done` flows MUST NOT be
94
137
  // activated; only animation/stopAt's own `done` flow (fired from _executeOnTick) should run.
95
- animationGroup.stop(true);
96
- currentlyRunning.splice(index, 1);
97
- // update the global context variable
98
- context._setGlobalContextVariable("currentlyRunningAnimationGroups", currentlyRunning);
138
+ if (suppressAnimationEnd) {
139
+ animationGroup.stop(true);
140
+ }
141
+ else {
142
+ animationGroup.stop();
143
+ }
144
+ const remainingIndex = currentlyRunning.indexOf(animationGroup.uniqueId);
145
+ if (remainingIndex !== -1) {
146
+ currentlyRunning.splice(remainingIndex, 1);
147
+ context._setGlobalContextVariable("currentlyRunningAnimationGroups", currentlyRunning);
148
+ }
99
149
  }
100
150
  else {
101
151
  // Logger.Warn("Trying to stop an animation that is not running.");
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphStopAnimationBlock.pure.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAI7D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAI/E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ,4BAA4B;IAWzE,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC;QAC5E,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,iBAAiB,CAAC,aAAa,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC;IACjF,CAAC;IAEe,oBAAoB,CAAC,OAAyB;QAC1D,MAAM,oBAAoB,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*/\r\n\r\nimport { type FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport { type FlowGraphDataConnection } from \"../../../flowGraphDataConnection.pure\";\r\nimport { RichTypeAny, RichTypeNumber } from \"../../../flowGraphRichTypes.pure\";\r\nimport { type IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { type AnimationGroup } from \"core/Animations/animationGroup.pure\";\r\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\r\nimport { Logger } from \"core/Misc/logger\";\r\nimport { FlowGraphAsyncExecutionBlock } from \"core/FlowGraph/flowGraphAsyncExecutionBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Block that stops a running animation\r\n */\r\nexport class FlowGraphStopAnimationBlock extends FlowGraphAsyncExecutionBlock {\r\n /**\r\n * Input connection: The animation to stop.\r\n */\r\n public readonly animationGroup: FlowGraphDataConnection<AnimationGroup>;\r\n\r\n /**\r\n * Input connection - if defined (positive integer) the animation will stop at this frame.\r\n */\r\n public readonly stopAtFrame: FlowGraphDataConnection<number>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.animationGroup = this.registerDataInput(\"animationGroup\", RichTypeAny);\r\n this.stopAtFrame = this.registerDataInput(\"stopAtFrame\", RichTypeNumber, -1);\r\n }\r\n\r\n public override _preparePendingTasks(context: FlowGraphContext): void {\r\n const animationToStopValue = this.animationGroup.getValue(context);\r\n const stopAtFrame = this.stopAtFrame.getValue(context) ?? -1;\r\n // get the context variable\r\n const pendingStopAnimations = context._getGlobalContextVariable(\r\n \"pendingStopAnimations\",\r\n [] as {\r\n uniqueId: number;\r\n stopAtFrame: number;\r\n }[]\r\n );\r\n // add the animation to the list\r\n pendingStopAnimations.push({ uniqueId: animationToStopValue.uniqueId, stopAtFrame });\r\n // set the global context variable\r\n context._setGlobalContextVariable(\"pendingStopAnimations\", pendingStopAnimations);\r\n }\r\n public override _cancelPendingTasks(context: FlowGraphContext): void {\r\n // remove the animation from the list\r\n const animationToStopValue = this.animationGroup.getValue(context);\r\n const pendingStopAnimations = context._getGlobalContextVariable(\r\n \"pendingStopAnimations\",\r\n [] as {\r\n uniqueId: number;\r\n stopAtFrame: number;\r\n }[]\r\n );\r\n for (let i = 0; i < pendingStopAnimations.length; i++) {\r\n if (pendingStopAnimations[i].uniqueId === animationToStopValue.uniqueId) {\r\n pendingStopAnimations.splice(i, 1);\r\n // set the global context variable\r\n context._setGlobalContextVariable(\"pendingStopAnimations\", pendingStopAnimations);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const animationToStopValue = this.animationGroup.getValue(context);\r\n const stopTime = this.stopAtFrame.getValue(context) ?? -1;\r\n // check the values\r\n if (!animationToStopValue) {\r\n Logger.Warn(\"No animation group provided to stop.\");\r\n return this._reportError(context, \"No animation group provided to stop.\");\r\n }\r\n if (isNaN(stopTime)) {\r\n return this._reportError(context, \"Invalid stop time.\");\r\n }\r\n if (stopTime > 0) {\r\n this._startPendingTasks(context);\r\n } else {\r\n this._stopAnimation(animationToStopValue, context);\r\n }\r\n // note that out will not be triggered in case of an error\r\n this.out._activateSignal(context);\r\n }\r\n\r\n public override _executeOnTick(context: FlowGraphContext): void {\r\n const animationToStopValue = this.animationGroup.getValue(context);\r\n // check each frame if any animation should be stopped\r\n const pendingStopAnimations = context._getGlobalContextVariable(\"pendingStopAnimations\", [] as { uniqueId: number; stopAtFrame: number }[]);\r\n for (let i = 0; i < pendingStopAnimations.length; i++) {\r\n // compare the uniqueId to the animation to stop\r\n if (pendingStopAnimations[i].uniqueId === animationToStopValue.uniqueId) {\r\n // check if the current frame is AFTER the stopAtFrame\r\n if (animationToStopValue.getCurrentFrame() >= pendingStopAnimations[i].stopAtFrame) {\r\n // stop the animation\r\n this._stopAnimation(animationToStopValue, context);\r\n // remove the animation from the list\r\n pendingStopAnimations.splice(i, 1);\r\n // set the global context variable\r\n context._setGlobalContextVariable(\"pendingStopAnimations\", pendingStopAnimations);\r\n this.done._activateSignal(context);\r\n context._removePendingBlock(this);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName(): string {\r\n return FlowGraphBlockNames.StopAnimation;\r\n }\r\n\r\n private _stopAnimation(animationGroup: AnimationGroup, context: FlowGraphContext): void {\r\n const currentlyRunning = context._getGlobalContextVariable(\"currentlyRunningAnimationGroups\", []) as number[];\r\n const index = currentlyRunning.indexOf(animationGroup.uniqueId);\r\n if (index !== -1) {\r\n // Skip the animation-end observable so that stopping does not activate the originating\r\n // starting block's `done` flow. When an animation is\r\n // stopped (animation/stop or animation/stopAt) the previously associated `done` flows MUST NOT be\r\n // activated; only animation/stopAt's own `done` flow (fired from _executeOnTick) should run.\r\n animationGroup.stop(true);\r\n currentlyRunning.splice(index, 1);\r\n // update the global context variable\r\n context._setGlobalContextVariable(\"currentlyRunningAnimationGroups\", currentlyRunning);\r\n } else {\r\n // Logger.Warn(\"Trying to stop an animation that is not running.\");\r\n // no-op for now. Probably no need to log anything here.\r\n }\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for flowGraphStopAnimationBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterFlowGraphStopAnimationBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(FlowGraphBlockNames.StopAnimation, FlowGraphStopAnimationBlock);\r\n}\r\n"]}
1
+ {"version":3,"file":"flowGraphStopAnimationBlock.pure.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAI7D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAI/E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,4BAA4B,EA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AC,CAAC;YAC5D,CAAC;YACD,uFAAuF;YACvF,qDAAqD;YACrD,kGAAkG;YAClG,6FAA6F;YAC7F,IAAI,oBAAoB,EAAE,CAAC;gBACvB,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC9B,CAAC;iBAAM,CAAC;gBACJ,cAAc,CAAC,IAAI,EAAE,CAAC;YAC1B,CAAC;YACD,MAAM,cAAc,GAAG,gBAAgB,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;YACzE,IAAI,cAAc,KAAK,CAAC,CAAC,EAAE,CAAC;gBACxB,gBAAgB,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;gBAC3C,OAAO,CAAC,yBAAyB,CAAC,iCAAiC,EAAE,gBAAgB,CAAC,CAAC;YAC3F,CAAC;QACL,CAAC;aAAM,CAAC;YACJ,mEAAmE;YACnE,wDAAwD;QAC5D,CAAC;IACL,CAAC;CACJ;AAED,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,mCAAmC;IAC/C,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,wEAAoC,2BAA2B,CAAC,CAAC;AAClF,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { type FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport { type FlowGraphDataConnection } from \"../../../flowGraphDataConnection.pure\";\r\nimport { RichTypeAny, RichTypeNumber } from \"../../../flowGraphRichTypes.pure\";\r\nimport { type IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { type AnimationGroup } from \"core/Animations/animationGroup.pure\";\r\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\r\nimport { Logger } from \"core/Misc/logger\";\r\nimport { FlowGraphAsyncExecutionBlock } from \"core/FlowGraph/flowGraphAsyncExecutionBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { RemoveFlowGraphAnimationGroupObservers } from \"./flowGraphPlayAnimationBlock.pure\";\r\n\r\n/**\r\n * Configuration for stopping an animation.\r\n */\r\nexport interface IFlowGraphStopAnimationBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * Whether stopAtFrame uses the unbounded KHR_interactivity timeline.\r\n * When false, the block retains its legacy positive-frame scheduling behavior.\r\n */\r\n useVirtualStopAt?: boolean;\r\n\r\n /**\r\n * Whether stopping suppresses the animation-group end notification.\r\n * Defaults to true to preserve the historical StopAnimation behavior.\r\n */\r\n skipOnAnimationEnd?: boolean;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * Block that stops a running animation\r\n */\r\nexport class FlowGraphStopAnimationBlock extends FlowGraphAsyncExecutionBlock {\r\n /**\r\n * Input connection: The animation to stop.\r\n */\r\n public readonly animationGroup: FlowGraphDataConnection<AnimationGroup>;\r\n\r\n /**\r\n * Input connection - if defined (positive integer) the animation will stop at this frame.\r\n */\r\n public readonly stopAtFrame: FlowGraphDataConnection<number>;\r\n\r\n constructor(config?: IFlowGraphStopAnimationBlockConfiguration) {\r\n super(config);\r\n this.animationGroup = this.registerDataInput(\"animationGroup\", RichTypeAny);\r\n this.stopAtFrame = this.registerDataInput(\"stopAtFrame\", RichTypeNumber, -1);\r\n }\r\n\r\n public override _preparePendingTasks(context: FlowGraphContext): void {\r\n const animationToStopValue = this.animationGroup.getValue(context);\r\n const stopAtFrame = this.stopAtFrame.getValue(context) ?? -1;\r\n // get the context variable\r\n const pendingStopAnimations = context._getGlobalContextVariable(\r\n \"pendingStopAnimations\",\r\n [] as {\r\n uniqueId: number;\r\n stopAtFrame: number;\r\n block: FlowGraphStopAnimationBlock;\r\n useVirtualStopAt: boolean;\r\n }[]\r\n );\r\n if (this.config?.useVirtualStopAt) {\r\n const existing = pendingStopAnimations.find((entry) => entry.uniqueId === animationToStopValue.uniqueId && entry.useVirtualStopAt);\r\n if (existing) {\r\n if (existing.block !== this) {\r\n context._removePendingBlock(existing.block);\r\n }\r\n existing.stopAtFrame = stopAtFrame;\r\n existing.block = this;\r\n } else {\r\n pendingStopAnimations.push({ uniqueId: animationToStopValue.uniqueId, stopAtFrame, block: this, useVirtualStopAt: true });\r\n }\r\n } else {\r\n pendingStopAnimations.push({ uniqueId: animationToStopValue.uniqueId, stopAtFrame, block: this, useVirtualStopAt: false });\r\n }\r\n // set the global context variable\r\n context._setGlobalContextVariable(\"pendingStopAnimations\", pendingStopAnimations);\r\n }\r\n public override _cancelPendingTasks(context: FlowGraphContext): void {\r\n // remove the animation from the list\r\n const animationToStopValue = this.animationGroup.getValue(context);\r\n const pendingStopAnimations = context._getGlobalContextVariable(\r\n \"pendingStopAnimations\",\r\n [] as {\r\n uniqueId: number;\r\n stopAtFrame: number;\r\n block: FlowGraphStopAnimationBlock;\r\n useVirtualStopAt: boolean;\r\n }[]\r\n );\r\n for (let i = 0; i < pendingStopAnimations.length; i++) {\r\n if (pendingStopAnimations[i].uniqueId === animationToStopValue.uniqueId && pendingStopAnimations[i].block === this) {\r\n pendingStopAnimations.splice(i, 1);\r\n // set the global context variable\r\n context._setGlobalContextVariable(\"pendingStopAnimations\", pendingStopAnimations);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const animationToStopValue = this.animationGroup.getValue(context);\r\n const stopTime = this.stopAtFrame.getValue(context) ?? -1;\r\n // check the values\r\n if (!animationToStopValue) {\r\n Logger.Warn(\"No animation group provided to stop.\");\r\n return this._reportError(context, \"No animation group provided to stop.\");\r\n }\r\n if (isNaN(stopTime)) {\r\n return this._reportError(context, \"Invalid stop time.\");\r\n }\r\n const useVirtualStopAt = !!this.config?.useVirtualStopAt;\r\n const hasScheduledStop = useVirtualStopAt ? this.stopAtFrame.isConnected() || context._hasConnectionValue(this.stopAtFrame) : stopTime > 0;\r\n let activateDone = false;\r\n if (hasScheduledStop) {\r\n if (useVirtualStopAt && animationToStopValue.isValidVirtualStopFrame(stopTime) && animationToStopValue.isVirtualFrameReached(stopTime)) {\r\n this._stopAnimation(animationToStopValue, context, stopTime);\r\n activateDone = true;\r\n } else {\r\n this._startPendingTasks(context);\r\n }\r\n } else {\r\n this._stopAnimation(animationToStopValue, context);\r\n }\r\n // note that out will not be triggered in case of an error\r\n this.out._activateSignal(context);\r\n if (activateDone) {\r\n this.done._activateSignal(context);\r\n }\r\n }\r\n\r\n public override _executeOnTick(context: FlowGraphContext): void {\r\n const animationToStopValue = this.animationGroup.getValue(context);\r\n // check each frame if any animation should be stopped\r\n const pendingStopAnimations = context._getGlobalContextVariable(\r\n \"pendingStopAnimations\",\r\n [] as { uniqueId: number; stopAtFrame: number; block: FlowGraphStopAnimationBlock; useVirtualStopAt: boolean }[]\r\n );\r\n for (let i = 0; i < pendingStopAnimations.length; i++) {\r\n // compare the uniqueId to the animation to stop\r\n if (pendingStopAnimations[i].uniqueId === animationToStopValue.uniqueId && pendingStopAnimations[i].block === this) {\r\n const useVirtualStopAt = pendingStopAnimations[i].useVirtualStopAt;\r\n const shouldStop = useVirtualStopAt\r\n ? animationToStopValue.isValidVirtualStopFrame(pendingStopAnimations[i].stopAtFrame) &&\r\n animationToStopValue.isVirtualFrameReached(pendingStopAnimations[i].stopAtFrame)\r\n : animationToStopValue.getCurrentFrame() >= pendingStopAnimations[i].stopAtFrame;\r\n if (shouldStop) {\r\n // stop the animation\r\n this._stopAnimation(animationToStopValue, context, useVirtualStopAt ? pendingStopAnimations[i].stopAtFrame : undefined);\r\n // remove the animation from the list\r\n pendingStopAnimations.splice(i, 1);\r\n // set the global context variable\r\n context._setGlobalContextVariable(\"pendingStopAnimations\", pendingStopAnimations);\r\n this.done._activateSignal(context);\r\n context._removePendingBlock(this);\r\n break;\r\n } else if (!animationToStopValue.isPlaying) {\r\n pendingStopAnimations.splice(i, 1);\r\n context._setGlobalContextVariable(\"pendingStopAnimations\", pendingStopAnimations);\r\n context._removePendingBlock(this);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName(): string {\r\n return FlowGraphBlockNames.StopAnimation;\r\n }\r\n\r\n private _stopAnimation(animationGroup: AnimationGroup, context: FlowGraphContext, virtualStopFrame?: number): void {\r\n const currentlyRunning = context._getGlobalContextVariable(\"currentlyRunningAnimationGroups\", []) as number[];\r\n const index = currentlyRunning.indexOf(animationGroup.uniqueId);\r\n if (index !== -1) {\r\n const suppressAnimationEnd = this.config?.skipOnAnimationEnd !== false;\r\n const owner = suppressAnimationEnd ? RemoveFlowGraphAnimationGroupObservers(context, animationGroup) : undefined;\r\n owner?._cleanupAfterExternalStop(context, animationGroup);\r\n if (virtualStopFrame !== undefined) {\r\n animationGroup.setVirtualCurrentFrame(virtualStopFrame);\r\n }\r\n // Skip the animation-end observable so that stopping does not activate the originating\r\n // starting block's `done` flow. When an animation is\r\n // stopped (animation/stop or animation/stopAt) the previously associated `done` flows MUST NOT be\r\n // activated; only animation/stopAt's own `done` flow (fired from _executeOnTick) should run.\r\n if (suppressAnimationEnd) {\r\n animationGroup.stop(true);\r\n } else {\r\n animationGroup.stop();\r\n }\r\n const remainingIndex = currentlyRunning.indexOf(animationGroup.uniqueId);\r\n if (remainingIndex !== -1) {\r\n currentlyRunning.splice(remainingIndex, 1);\r\n context._setGlobalContextVariable(\"currentlyRunningAnimationGroups\", currentlyRunning);\r\n }\r\n } else {\r\n // Logger.Warn(\"Trying to stop an animation that is not running.\");\r\n // no-op for now. Probably no need to log anything here.\r\n }\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for flowGraphStopAnimationBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterFlowGraphStopAnimationBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(FlowGraphBlockNames.StopAnimation, FlowGraphStopAnimationBlock);\r\n}\r\n"]}