@babylonjs/core 7.51.1 → 7.51.3

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 (343) hide show
  1. package/Animations/animation.js +2 -1
  2. package/Animations/animation.js.map +1 -1
  3. package/Buffers/bufferUtils.d.ts +7 -5
  4. package/Buffers/bufferUtils.js +13 -9
  5. package/Buffers/bufferUtils.js.map +1 -1
  6. package/Engines/ICanvas.d.ts +96 -1
  7. package/Engines/ICanvas.js.map +1 -1
  8. package/Engines/Native/nativeInterfaces.d.ts +7 -1
  9. package/Engines/Native/nativeInterfaces.js.map +1 -1
  10. package/Engines/WebGPU/webgpuTextureManager.js +3 -3
  11. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  12. package/Engines/abstractEngine.d.ts +7 -1
  13. package/Engines/abstractEngine.js +10 -2
  14. package/Engines/abstractEngine.js.map +1 -1
  15. package/Engines/constants.d.ts +32 -0
  16. package/Engines/constants.js +33 -0
  17. package/Engines/constants.js.map +1 -1
  18. package/Engines/nativeEngine.d.ts +7 -1
  19. package/Engines/nativeEngine.js +12 -0
  20. package/Engines/nativeEngine.js.map +1 -1
  21. package/Engines/webgpuEngine.js +6 -3
  22. package/Engines/webgpuEngine.js.map +1 -1
  23. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.d.ts +148 -465
  24. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +394 -691
  25. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -1
  26. package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.d.ts +142 -0
  27. package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.js +342 -0
  28. package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.js.map +1 -0
  29. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.d.ts +111 -0
  30. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js +141 -0
  31. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js.map +1 -0
  32. package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.d.ts +77 -0
  33. package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.js +139 -0
  34. package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.js.map +1 -0
  35. package/FlowGraph/Blocks/Data/Math/index.d.ts +3 -0
  36. package/FlowGraph/Blocks/Data/Math/index.js +3 -0
  37. package/FlowGraph/Blocks/Data/Math/index.js.map +1 -1
  38. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.d.ts +85 -0
  39. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js +133 -0
  40. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js.map +1 -0
  41. package/FlowGraph/Blocks/Data/Transformers/flowGraphTypeToTypeBlocks.d.ts +49 -0
  42. package/FlowGraph/Blocks/Data/Transformers/flowGraphTypeToTypeBlocks.js +71 -0
  43. package/FlowGraph/Blocks/Data/Transformers/flowGraphTypeToTypeBlocks.js.map +1 -0
  44. package/FlowGraph/Blocks/Data/Transformers/index.d.ts +2 -0
  45. package/FlowGraph/Blocks/Data/Transformers/index.js +3 -0
  46. package/FlowGraph/Blocks/Data/Transformers/index.js.map +1 -0
  47. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.d.ts +39 -0
  48. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.js +46 -0
  49. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.js.map +1 -0
  50. package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.d.ts +35 -0
  51. package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.js +34 -0
  52. package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.js.map +1 -0
  53. package/FlowGraph/Blocks/Data/Utils/flowGraphContextBlock.d.ts +20 -0
  54. package/FlowGraph/Blocks/Data/Utils/flowGraphContextBlock.js +25 -0
  55. package/FlowGraph/Blocks/Data/Utils/flowGraphContextBlock.js.map +1 -0
  56. package/FlowGraph/Blocks/Data/Utils/flowGraphFunctionReferenceBlock.d.ts +34 -0
  57. package/FlowGraph/Blocks/Data/Utils/flowGraphFunctionReferenceBlock.js +35 -0
  58. package/FlowGraph/Blocks/Data/Utils/flowGraphFunctionReferenceBlock.js.map +1 -0
  59. package/FlowGraph/Blocks/Data/Utils/flowGraphIndexOfBlock.d.ts +39 -0
  60. package/FlowGraph/Blocks/Data/Utils/flowGraphIndexOfBlock.js +42 -0
  61. package/FlowGraph/Blocks/Data/Utils/flowGraphIndexOfBlock.js.map +1 -0
  62. package/FlowGraph/Blocks/Data/Utils/index.d.ts +5 -0
  63. package/FlowGraph/Blocks/Data/Utils/index.js +6 -0
  64. package/FlowGraph/Blocks/Data/Utils/index.js.map +1 -0
  65. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.d.ts +0 -1
  66. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js +3 -2
  67. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
  68. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.d.ts +1 -1
  69. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +4 -4
  70. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
  71. package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.d.ts +6 -3
  72. package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js +12 -6
  73. package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js.map +1 -1
  74. package/FlowGraph/Blocks/Data/flowGraphConstantBlock.d.ts +0 -2
  75. package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js +2 -3
  76. package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
  77. package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.d.ts +5 -4
  78. package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js +5 -4
  79. package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js.map +1 -1
  80. package/FlowGraph/Blocks/Data/flowGraphGetAssetBlock.d.ts +62 -0
  81. package/FlowGraph/Blocks/Data/flowGraphGetAssetBlock.js +41 -0
  82. package/FlowGraph/Blocks/Data/flowGraphGetAssetBlock.js.map +1 -0
  83. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.d.ts +38 -33
  84. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js +42 -25
  85. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -1
  86. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.d.ts +11 -16
  87. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +9 -17
  88. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
  89. package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.d.ts +1 -1
  90. package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js +1 -1
  91. package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js.map +1 -1
  92. package/FlowGraph/Blocks/Data/{flowGraphCoordinateTransformBlock.d.ts → flowGraphTransformCoordinatesSystemBlock.d.ts} +1 -2
  93. package/FlowGraph/Blocks/Data/{flowGraphCoordinateTransformBlock.js → flowGraphTransformCoordinatesSystemBlock.js} +4 -5
  94. package/FlowGraph/Blocks/Data/flowGraphTransformCoordinatesSystemBlock.js.map +1 -0
  95. package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.d.ts +1 -1
  96. package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js +1 -1
  97. package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js.map +1 -1
  98. package/FlowGraph/Blocks/Data/index.d.ts +7 -3
  99. package/FlowGraph/Blocks/Data/index.js +9 -4
  100. package/FlowGraph/Blocks/Data/index.js.map +1 -1
  101. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.d.ts +45 -24
  102. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +45 -51
  103. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
  104. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.d.ts +61 -0
  105. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.js +39 -0
  106. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.js.map +1 -0
  107. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.d.ts +61 -0
  108. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.js +40 -0
  109. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.js.map +1 -0
  110. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +12 -14
  111. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +19 -26
  112. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
  113. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.d.ts +6 -12
  114. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js +13 -24
  115. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js.map +1 -1
  116. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.d.ts +31 -7
  117. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js +22 -20
  118. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js.map +1 -1
  119. package/FlowGraph/Blocks/{Execution → Event}/flowGraphSendCustomEventBlock.d.ts +12 -7
  120. package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.js +39 -0
  121. package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.js.map +1 -0
  122. package/FlowGraph/Blocks/Event/index.d.ts +3 -0
  123. package/FlowGraph/Blocks/Event/index.js +3 -0
  124. package/FlowGraph/Blocks/Event/index.js.map +1 -1
  125. package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.d.ts +44 -0
  126. package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.js +46 -0
  127. package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.js.map +1 -0
  128. package/FlowGraph/Blocks/Execution/Animation/flowGraphEasingBlock.d.ts +60 -0
  129. package/FlowGraph/Blocks/Execution/Animation/flowGraphEasingBlock.js +93 -0
  130. package/FlowGraph/Blocks/Execution/Animation/flowGraphEasingBlock.js.map +1 -0
  131. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.d.ts +82 -0
  132. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.js +105 -0
  133. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.js.map +1 -0
  134. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.d.ts +2 -2
  135. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +2 -2
  136. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
  137. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +40 -42
  138. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +116 -50
  139. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
  140. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.d.ts +12 -4
  141. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +86 -8
  142. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
  143. package/FlowGraph/Blocks/Execution/Animation/index.d.ts +3 -0
  144. package/FlowGraph/Blocks/Execution/Animation/index.js +3 -0
  145. package/FlowGraph/Blocks/Execution/Animation/index.js.map +1 -1
  146. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.d.ts +1 -2
  147. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js +3 -4
  148. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js.map +1 -1
  149. package/FlowGraph/Blocks/Execution/{Audio/flowGraphStopAudioBlock.d.ts → ControlFlow/flowGraphCancelDelayBlock.d.ts} +6 -8
  150. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js +31 -0
  151. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js.map +1 -0
  152. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.d.ts +2 -2
  153. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +5 -5
  154. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
  155. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.d.ts +0 -1
  156. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +2 -3
  157. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
  158. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +5 -10
  159. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +11 -15
  160. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
  161. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.d.ts +11 -3
  162. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js +5 -6
  163. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js.map +1 -1
  164. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.d.ts +27 -7
  165. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +28 -30
  166. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
  167. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.d.ts +13 -16
  168. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js +50 -52
  169. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js.map +1 -1
  170. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.d.ts +8 -9
  171. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js +26 -13
  172. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js.map +1 -1
  173. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.d.ts +32 -0
  174. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js +84 -0
  175. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js.map +1 -0
  176. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.d.ts +20 -6
  177. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js +55 -16
  178. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js.map +1 -1
  179. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.d.ts +3 -4
  180. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +36 -13
  181. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
  182. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +13 -5
  183. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +22 -17
  184. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
  185. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +12 -16
  186. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +21 -21
  187. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
  188. package/FlowGraph/Blocks/Execution/ControlFlow/index.d.ts +2 -1
  189. package/FlowGraph/Blocks/Execution/ControlFlow/index.js +2 -1
  190. package/FlowGraph/Blocks/Execution/ControlFlow/index.js.map +1 -1
  191. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.d.ts +4 -5
  192. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js +13 -8
  193. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -1
  194. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +33 -36
  195. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +42 -26
  196. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
  197. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +10 -25
  198. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +38 -24
  199. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
  200. package/FlowGraph/Blocks/Execution/index.d.ts +0 -3
  201. package/FlowGraph/Blocks/Execution/index.js +0 -3
  202. package/FlowGraph/Blocks/Execution/index.js.map +1 -1
  203. package/FlowGraph/Blocks/flowGraphBlockFactory.d.ts +16 -0
  204. package/FlowGraph/Blocks/flowGraphBlockFactory.js +292 -0
  205. package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -0
  206. package/FlowGraph/Blocks/flowGraphBlockNames.d.ts +145 -0
  207. package/FlowGraph/Blocks/flowGraphBlockNames.js +147 -0
  208. package/FlowGraph/Blocks/flowGraphBlockNames.js.map +1 -0
  209. package/FlowGraph/Blocks/index.d.ts +2 -0
  210. package/FlowGraph/Blocks/index.js +2 -0
  211. package/FlowGraph/Blocks/index.js.map +1 -1
  212. package/FlowGraph/{flowGraphInteger.d.ts → CustomTypes/flowGraphInteger.d.ts} +2 -3
  213. package/FlowGraph/{flowGraphInteger.js → CustomTypes/flowGraphInteger.js} +4 -5
  214. package/FlowGraph/CustomTypes/flowGraphInteger.js.map +1 -0
  215. package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +196 -0
  216. package/FlowGraph/CustomTypes/flowGraphMatrix.js +272 -0
  217. package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -0
  218. package/FlowGraph/CustomTypes/index.d.ts +2 -0
  219. package/FlowGraph/CustomTypes/index.js +3 -0
  220. package/FlowGraph/CustomTypes/index.js.map +1 -0
  221. package/FlowGraph/flowGraph.d.ts +29 -34
  222. package/FlowGraph/flowGraph.js +120 -104
  223. package/FlowGraph/flowGraph.js.map +1 -1
  224. package/FlowGraph/flowGraphAssetsContext.d.ts +29 -0
  225. package/FlowGraph/flowGraphAssetsContext.js +52 -0
  226. package/FlowGraph/flowGraphAssetsContext.js.map +1 -0
  227. package/FlowGraph/flowGraphAsyncExecutionBlock.d.ts +15 -8
  228. package/FlowGraph/flowGraphAsyncExecutionBlock.js +25 -5
  229. package/FlowGraph/flowGraphAsyncExecutionBlock.js.map +1 -1
  230. package/FlowGraph/flowGraphBlock.d.ts +22 -15
  231. package/FlowGraph/flowGraphBlock.js +31 -52
  232. package/FlowGraph/flowGraphBlock.js.map +1 -1
  233. package/FlowGraph/flowGraphConnection.d.ts +13 -12
  234. package/FlowGraph/flowGraphConnection.js +31 -16
  235. package/FlowGraph/flowGraphConnection.js.map +1 -1
  236. package/FlowGraph/flowGraphContext.d.ts +89 -13
  237. package/FlowGraph/flowGraphContext.js +210 -23
  238. package/FlowGraph/flowGraphContext.js.map +1 -1
  239. package/FlowGraph/flowGraphCoordinator.d.ts +4 -10
  240. package/FlowGraph/flowGraphCoordinator.js +4 -16
  241. package/FlowGraph/flowGraphCoordinator.js.map +1 -1
  242. package/FlowGraph/flowGraphDataConnection.d.ts +52 -14
  243. package/FlowGraph/flowGraphDataConnection.js +73 -26
  244. package/FlowGraph/flowGraphDataConnection.js.map +1 -1
  245. package/FlowGraph/flowGraphEventBlock.d.ts +17 -1
  246. package/FlowGraph/flowGraphEventBlock.js +13 -2
  247. package/FlowGraph/flowGraphEventBlock.js.map +1 -1
  248. package/FlowGraph/flowGraphEventType.d.ts +16 -0
  249. package/FlowGraph/flowGraphEventType.js +18 -0
  250. package/FlowGraph/flowGraphEventType.js.map +1 -0
  251. package/FlowGraph/flowGraphExecutionBlock.d.ts +11 -1
  252. package/FlowGraph/flowGraphExecutionBlock.js +21 -2
  253. package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
  254. package/FlowGraph/flowGraphExecutionBlockWithOutSignal.d.ts +2 -2
  255. package/FlowGraph/flowGraphExecutionBlockWithOutSignal.js +0 -1
  256. package/FlowGraph/flowGraphExecutionBlockWithOutSignal.js.map +1 -1
  257. package/FlowGraph/flowGraphLogger.d.ts +60 -0
  258. package/FlowGraph/flowGraphLogger.js +53 -0
  259. package/FlowGraph/flowGraphLogger.js.map +1 -0
  260. package/FlowGraph/flowGraphParser.d.ts +85 -0
  261. package/FlowGraph/flowGraphParser.js +271 -0
  262. package/FlowGraph/flowGraphParser.js.map +1 -0
  263. package/FlowGraph/flowGraphPathConverter.d.ts +1 -1
  264. package/FlowGraph/flowGraphPathConverter.js +3 -2
  265. package/FlowGraph/flowGraphPathConverter.js.map +1 -1
  266. package/FlowGraph/flowGraphPathConverterComponent.d.ts +8 -1
  267. package/FlowGraph/flowGraphPathConverterComponent.js +18 -2
  268. package/FlowGraph/flowGraphPathConverterComponent.js.map +1 -1
  269. package/FlowGraph/flowGraphRichTypes.d.ts +51 -9
  270. package/FlowGraph/flowGraphRichTypes.js +160 -50
  271. package/FlowGraph/flowGraphRichTypes.js.map +1 -1
  272. package/FlowGraph/flowGraphSceneEventCoordinator.d.ts +45 -0
  273. package/FlowGraph/flowGraphSceneEventCoordinator.js +77 -0
  274. package/FlowGraph/flowGraphSceneEventCoordinator.js.map +1 -0
  275. package/FlowGraph/flowGraphSignalConnection.d.ts +8 -5
  276. package/FlowGraph/flowGraphSignalConnection.js +26 -9
  277. package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
  278. package/FlowGraph/index.d.ts +6 -1
  279. package/FlowGraph/index.js +7 -1
  280. package/FlowGraph/index.js.map +1 -1
  281. package/FlowGraph/serialization.d.ts +5 -2
  282. package/FlowGraph/serialization.js +94 -22
  283. package/FlowGraph/serialization.js.map +1 -1
  284. package/FlowGraph/typeDefinitions.d.ts +74 -12
  285. package/FlowGraph/typeDefinitions.js.map +1 -1
  286. package/FlowGraph/utils.d.ts +47 -0
  287. package/FlowGraph/utils.js +55 -0
  288. package/FlowGraph/utils.js.map +1 -1
  289. package/Layers/effectLayer.d.ts +5 -0
  290. package/Layers/effectLayer.js +7 -0
  291. package/Layers/effectLayer.js.map +1 -1
  292. package/Loading/sceneLoader.d.ts +25 -11
  293. package/Loading/sceneLoader.js +28 -11
  294. package/Loading/sceneLoader.js.map +1 -1
  295. package/Materials/material.js +1 -0
  296. package/Materials/material.js.map +1 -1
  297. package/Maths/math.path.js +3 -0
  298. package/Maths/math.path.js.map +1 -1
  299. package/Meshes/csg2.d.ts +2 -2
  300. package/Meshes/csg2.js +2 -2
  301. package/Meshes/csg2.js.map +1 -1
  302. package/Meshes/geometry.d.ts +2 -1
  303. package/Meshes/geometry.js +8 -2
  304. package/Meshes/geometry.js.map +1 -1
  305. package/Meshes/instancedMesh.d.ts +5 -0
  306. package/Meshes/instancedMesh.js +6 -0
  307. package/Meshes/instancedMesh.js.map +1 -1
  308. package/Meshes/mesh.d.ts +2 -1
  309. package/Meshes/mesh.js +3 -2
  310. package/Meshes/mesh.js.map +1 -1
  311. package/Misc/environmentTextureTools.js +2 -2
  312. package/Misc/environmentTextureTools.js.map +1 -1
  313. package/ObjectModel/objectModelInterfaces.d.ts +2 -2
  314. package/ObjectModel/objectModelInterfaces.js.map +1 -1
  315. package/Rendering/IBLShadows/iblShadowsPluginMaterial.js +26 -18
  316. package/Rendering/IBLShadows/iblShadowsPluginMaterial.js.map +1 -1
  317. package/package.json +1 -1
  318. package/scene.js +8 -0
  319. package/scene.js.map +1 -1
  320. package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.d.ts +0 -24
  321. package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js +0 -39
  322. package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js.map +0 -1
  323. package/FlowGraph/Blocks/Data/Logic/index.d.ts +0 -1
  324. package/FlowGraph/Blocks/Data/Logic/index.js +0 -2
  325. package/FlowGraph/Blocks/Data/Logic/index.js.map +0 -1
  326. package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js.map +0 -1
  327. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.d.ts +0 -19
  328. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js +0 -26
  329. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +0 -1
  330. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js +0 -25
  331. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +0 -1
  332. package/FlowGraph/Blocks/Execution/Audio/index.d.ts +0 -2
  333. package/FlowGraph/Blocks/Execution/Audio/index.js +0 -3
  334. package/FlowGraph/Blocks/Execution/Audio/index.js.map +0 -1
  335. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.d.ts +0 -31
  336. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js +0 -69
  337. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +0 -1
  338. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +0 -38
  339. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +0 -1
  340. package/FlowGraph/flowGraphContextLogger.d.ts +0 -9
  341. package/FlowGraph/flowGraphContextLogger.js +0 -14
  342. package/FlowGraph/flowGraphContextLogger.js.map +0 -1
  343. package/FlowGraph/flowGraphInteger.js.map +0 -1
@@ -3,20 +3,29 @@ import { RichTypeAny } from "../../flowGraphRichTypes.js";
3
3
  import { RegisterClass } from "../../../Misc/typeStore.js";
4
4
  import { Logger } from "../../../Misc/logger.js";
5
5
  /**
6
- * @experimental
7
6
  * Block that logs a message to the console.
8
7
  */
9
8
  export class FlowGraphConsoleLogBlock extends FlowGraphExecutionBlockWithOutSignal {
10
9
  constructor(config) {
11
10
  super(config);
12
11
  this.message = this.registerDataInput("message", RichTypeAny);
12
+ this.logType = this.registerDataInput("logType", RichTypeAny, "log");
13
13
  }
14
14
  /**
15
15
  * @internal
16
16
  */
17
17
  _execute(context) {
18
+ const typeValue = this.logType.getValue(context);
18
19
  const messageValue = this.message.getValue(context);
19
- Logger.Log(messageValue);
20
+ if (typeValue === "warn") {
21
+ Logger.Warn(messageValue);
22
+ }
23
+ else if (typeValue === "error") {
24
+ Logger.Error(messageValue);
25
+ }
26
+ else {
27
+ Logger.Log(messageValue);
28
+ }
20
29
  // activate the output flow block
21
30
  this.out._activateSignal(context);
22
31
  }
@@ -24,12 +33,8 @@ export class FlowGraphConsoleLogBlock extends FlowGraphExecutionBlockWithOutSign
24
33
  * @returns class name of the block.
25
34
  */
26
35
  getClassName() {
27
- return FlowGraphConsoleLogBlock.ClassName;
36
+ return "FlowGraphConsoleLogBlock" /* FlowGraphBlockNames.ConsoleLog */;
28
37
  }
29
38
  }
30
- /**
31
- * the class name of the block.
32
- */
33
- FlowGraphConsoleLogBlock.ClassName = "FGConsoleLogBlock";
34
- RegisterClass(FlowGraphConsoleLogBlock.ClassName, FlowGraphConsoleLogBlock);
39
+ RegisterClass("FlowGraphConsoleLogBlock" /* FlowGraphBlockNames.ConsoleLog */, FlowGraphConsoleLogBlock);
35
40
  //# sourceMappingURL=flowGraphConsoleLogBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphConsoleLogBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,gCAAyB;AAE1C;;;GAGG;AACH,MAAM,OAAO,wBAAyB,SAAQ,oCAAoC;IAM9E,YAAmB,MAAqC;QACpD,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACI,QAAQ,CAAC,OAAyB;QACrC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACpD,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACzB,iCAAiC;QACjC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,OAAO,wBAAwB,CAAC,SAAS,CAAC;IAC9C,CAAC;;AAED;;GAEG;AACW,kCAAS,GAAG,mBAAmB,CAAC;AAElD,aAAa,CAAC,wBAAwB,CAAC,SAAS,EAAE,wBAAwB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../flowGraphExecutionBlockWithOutSignal\";\r\nimport { RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { Logger } from \"core/Misc/logger\";\r\n\r\n/**\r\n * @experimental\r\n * Block that logs a message to the console.\r\n */\r\nexport class FlowGraphConsoleLogBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The message to log.\r\n */\r\n public readonly message: FlowGraphDataConnection<any>;\r\n\r\n public constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.message = this.registerDataInput(\"message\", RichTypeAny);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _execute(context: FlowGraphContext): void {\r\n const messageValue = this.message.getValue(context);\r\n Logger.Log(messageValue);\r\n // activate the output flow block\r\n this.out._activateSignal(context);\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 FlowGraphConsoleLogBlock.ClassName;\r\n }\r\n\r\n /**\r\n * the class name of the block.\r\n */\r\n public static ClassName = \"FGConsoleLogBlock\";\r\n}\r\nRegisterClass(FlowGraphConsoleLogBlock.ClassName, FlowGraphConsoleLogBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphConsoleLogBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,gCAAyB;AAG1C;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,oCAAoC;IAW9E,YAAmB,MAAqC;QACpD,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QAC9D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IACzE,CAAC;IAED;;OAEG;IACI,QAAQ,CAAC,OAAyB;QACrC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACpD,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC;YACvB,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC9B,CAAC;aAAM,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;YAC/B,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC/B,CAAC;aAAM,CAAC;YACJ,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC7B,CAAC;QACD,iCAAiC;QACjC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,uEAAsC;IAC1C,CAAC;CACJ;AAED,aAAa,kEAAiC,wBAAwB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../flowGraphExecutionBlockWithOutSignal\";\r\nimport { RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { Logger } from \"core/Misc/logger\";\r\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\r\n\r\n/**\r\n * Block that logs a message to the console.\r\n */\r\nexport class FlowGraphConsoleLogBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The message to log.\r\n */\r\n public readonly message: FlowGraphDataConnection<any>;\r\n\r\n /**\r\n * Input connection: The log type.\r\n */\r\n public readonly logType: FlowGraphDataConnection<\"log\" | \"warn\" | \"error\">;\r\n\r\n public constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.message = this.registerDataInput(\"message\", RichTypeAny);\r\n this.logType = this.registerDataInput(\"logType\", RichTypeAny, \"log\");\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _execute(context: FlowGraphContext): void {\r\n const typeValue = this.logType.getValue(context);\r\n const messageValue = this.message.getValue(context);\r\n if (typeValue === \"warn\") {\r\n Logger.Warn(messageValue);\r\n } else if (typeValue === \"error\") {\r\n Logger.Error(messageValue);\r\n } else {\r\n Logger.Log(messageValue);\r\n }\r\n // activate the output flow block\r\n this.out._activateSignal(context);\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.ConsoleLog;\r\n }\r\n}\r\n\r\nRegisterClass(FlowGraphBlockNames.ConsoleLog, FlowGraphConsoleLogBlock);\r\n"]}
@@ -1,59 +1,56 @@
1
- import type { FlowGraphContext } from "../../flowGraphContext";
2
- import type { FlowGraphDataConnection } from "../../flowGraphDataConnection";
3
- import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphExecutionBlockWithOutSignal";
4
- import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock";
5
- import { FlowGraphPathConverterComponent } from "../../flowGraphPathConverterComponent";
6
- import type { IPathToObjectConverter } from "../../../ObjectModel/objectModelInterfaces";
7
- import type { IObjectAccessor } from "../../typeDefinitions";
8
- /**
9
- * @experimental
10
- * Configuration for the set property block.
11
- */
12
- export interface IFlowGraphSetPropertyBlockConfiguration extends IFlowGraphBlockConfiguration {
1
+ import type { AssetType, FlowGraphAssetType } from "../../flowGraphAssetsContext.js";
2
+ import type { FlowGraphContext } from "../../flowGraphContext.js";
3
+ import type { FlowGraphDataConnection } from "../../flowGraphDataConnection.js";
4
+ import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphExecutionBlockWithOutSignal.js";
5
+ import type { FlowGraphSignalConnection } from "../../flowGraphSignalConnection.js";
6
+ export interface IFlowGraphSetPropertyBlockConfiguration<O extends FlowGraphAssetType> {
13
7
  /**
14
- * The path of the entity whose property will be set. Needs a corresponding
15
- * entity on the context variables.
8
+ * The name of the property that will be set
16
9
  */
17
- path: string;
10
+ propertyName?: string;
18
11
  /**
19
- * The path converter to use to convert the path to an object accessor.
12
+ * The target asset from which the property will be retrieved
20
13
  */
21
- pathConverter: IPathToObjectConverter<IObjectAccessor>;
14
+ target?: AssetType<O>;
22
15
  }
23
16
  /**
24
- * @experimental
25
- * Block that sets a property on a target object.
17
+ * This block will set a property on a given target asset.
18
+ * The property name can include dots ("."), which will be interpreted as a path to the property.
19
+ * The target asset is an input and can be changed at any time.
20
+ * The value of the property is an input and can be changed at any time.
21
+ *
22
+ * For example, with an input of a mesh asset, the property name "position.x" will set the x component of the position of the mesh.
23
+ *
24
+ * Note that it is recommended to input the object on which you are working on (i.e. a material) than providing a mesh and then getting the material from it.
26
25
  */
27
- export declare class FlowGraphSetPropertyBlock<ValueT> extends FlowGraphExecutionBlockWithOutSignal {
26
+ export declare class FlowGraphSetPropertyBlock<P extends any, O extends FlowGraphAssetType> extends FlowGraphExecutionBlockWithOutSignal {
28
27
  /**
29
28
  * the configuration of the block
30
29
  */
31
- config: IFlowGraphSetPropertyBlockConfiguration;
30
+ config: IFlowGraphSetPropertyBlockConfiguration<O>;
32
31
  /**
33
32
  * Input connection: The value to set on the property.
34
33
  */
35
- readonly a: FlowGraphDataConnection<ValueT>;
34
+ readonly value: FlowGraphDataConnection<P>;
36
35
  /**
37
- * The component with the templated inputs for the provided path.
36
+ * Input connection: The target asset from which the property will be retrieved
38
37
  */
39
- readonly templateComponent: FlowGraphPathConverterComponent;
40
- constructor(
38
+ readonly object: FlowGraphDataConnection<AssetType<O>>;
41
39
  /**
42
- * the configuration of the block
40
+ * Input connection: The name of the property that will be set
43
41
  */
44
- config: IFlowGraphSetPropertyBlockConfiguration);
45
- _execute(context: FlowGraphContext): void;
42
+ readonly propertyName: FlowGraphDataConnection<string>;
46
43
  /**
47
- * Serializes the block to a JSON object.
48
- * @param serializationObject the object to serialize to.
44
+ * Input connection: A function that can be used to set the value of the property.
45
+ * If set it will be used instead of the default set function.
49
46
  */
50
- serialize(serializationObject?: any): void;
47
+ readonly customSetFunction: FlowGraphDataConnection<(target: AssetType<O>, propertyName: string, value: P, context: FlowGraphContext) => void>;
48
+ constructor(
51
49
  /**
52
- * @returns class name of the block.
50
+ * the configuration of the block
53
51
  */
52
+ config: IFlowGraphSetPropertyBlockConfiguration<O>);
53
+ _execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void;
54
+ private _setPropertyValue;
54
55
  getClassName(): string;
55
- /**
56
- * Class name of the block.
57
- */
58
- static ClassName: string;
59
56
  }
@@ -1,10 +1,15 @@
1
- import { RichTypeAny } from "../../flowGraphRichTypes.js";
2
1
  import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphExecutionBlockWithOutSignal.js";
2
+ import { RichTypeAny } from "../../flowGraphRichTypes.js";
3
3
  import { RegisterClass } from "../../../Misc/typeStore.js";
4
- import { FlowGraphPathConverterComponent } from "../../flowGraphPathConverterComponent.js";
5
4
  /**
6
- * @experimental
7
- * Block that sets a property on a target object.
5
+ * This block will set a property on a given target asset.
6
+ * The property name can include dots ("."), which will be interpreted as a path to the property.
7
+ * The target asset is an input and can be changed at any time.
8
+ * The value of the property is an input and can be changed at any time.
9
+ *
10
+ * For example, with an input of a mesh asset, the property name "position.x" will set the x component of the position of the mesh.
11
+ *
12
+ * Note that it is recommended to input the object on which you are working on (i.e. a material) than providing a mesh and then getting the material from it.
8
13
  */
9
14
  export class FlowGraphSetPropertyBlock extends FlowGraphExecutionBlockWithOutSignal {
10
15
  constructor(
@@ -14,33 +19,44 @@ export class FlowGraphSetPropertyBlock extends FlowGraphExecutionBlockWithOutSig
14
19
  config) {
15
20
  super(config);
16
21
  this.config = config;
17
- this.a = this.registerDataInput("a", RichTypeAny);
18
- this.templateComponent = new FlowGraphPathConverterComponent(config.path, this);
22
+ this.object = this.registerDataInput("object", RichTypeAny, config.target);
23
+ this.value = this.registerDataInput("value", RichTypeAny);
24
+ this.propertyName = this.registerDataInput("propertyName", RichTypeAny, config.propertyName);
25
+ this.customSetFunction = this.registerDataInput("customSetFunction", RichTypeAny);
19
26
  }
20
- _execute(context) {
21
- const value = this.a.getValue(context);
22
- const accessor = this.templateComponent.getAccessor(this.config.pathConverter, context);
23
- accessor.info.set(value, accessor.object);
27
+ _execute(context, _callingSignal) {
28
+ try {
29
+ const target = this.object.getValue(context);
30
+ const value = this.value.getValue(context);
31
+ const setFunction = this.customSetFunction.getValue(context);
32
+ if (setFunction) {
33
+ setFunction(target, this.propertyName.getValue(context), value, context);
34
+ }
35
+ else {
36
+ this._setPropertyValue(target, this.propertyName.getValue(context), value);
37
+ }
38
+ }
39
+ catch (e) {
40
+ this.error.payload = e;
41
+ this.error._activateSignal(context);
42
+ }
24
43
  this.out._activateSignal(context);
25
44
  }
26
- /**
27
- * Serializes the block to a JSON object.
28
- * @param serializationObject the object to serialize to.
29
- */
30
- serialize(serializationObject = {}) {
31
- super.serialize(serializationObject);
32
- serializationObject.config.path = this.config.path;
45
+ _setPropertyValue(target, propertyName, value) {
46
+ const path = propertyName.split(".");
47
+ let obj = target;
48
+ for (let i = 0; i < path.length - 1; i++) {
49
+ const prop = path[i];
50
+ if (obj[prop] === undefined) {
51
+ obj[prop] = {};
52
+ }
53
+ obj = obj[prop];
54
+ }
55
+ obj[path[path.length - 1]] = value;
33
56
  }
34
- /**
35
- * @returns class name of the block.
36
- */
37
57
  getClassName() {
38
- return FlowGraphSetPropertyBlock.ClassName;
58
+ return "FlowGraphSetPropertyBlock" /* FlowGraphBlockNames.SetProperty */;
39
59
  }
40
60
  }
41
- /**
42
- * Class name of the block.
43
- */
44
- FlowGraphSetPropertyBlock.ClassName = "FGSetPropertyBlock";
45
- RegisterClass("FGSetPropertyBlock", FlowGraphSetPropertyBlock);
61
+ RegisterClass("FlowGraphSetPropertyBlock" /* FlowGraphBlockNames.SetProperty */, FlowGraphSetPropertyBlock);
46
62
  //# sourceMappingURL=flowGraphSetPropertyBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphSetPropertyBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AAoBxF;;;GAGG;AACH,MAAM,OAAO,yBAAkC,SAAQ,oCAAoC;IAUvF;IACI;;OAEG;IACa,MAA+C;QAE/D,KAAK,CAAC,MAAM,CAAC,CAAC;QAFE,WAAM,GAAN,MAAM,CAAyC;QAI/D,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QAClD,IAAI,CAAC,iBAAiB,GAAG,IAAI,+BAA+B,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACpF,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACxF,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAE1C,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED;;;OAGG;IACa,SAAS,CAAC,sBAA2B,EAAE;QACnD,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,mBAAmB,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IACvD,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,OAAO,yBAAyB,CAAC,SAAS,CAAC;IAC/C,CAAC;;AAED;;GAEG;AACW,mCAAS,GAAG,oBAAoB,CAAC;AAEnD,aAAa,CAAC,oBAAoB,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import { RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../flowGraphExecutionBlockWithOutSignal\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { FlowGraphPathConverterComponent } from \"../../flowGraphPathConverterComponent\";\r\nimport type { IPathToObjectConverter } from \"../../../ObjectModel/objectModelInterfaces\";\r\nimport type { IObjectAccessor } from \"../../typeDefinitions\";\r\n\r\n/**\r\n * @experimental\r\n * Configuration for the set property block.\r\n */\r\nexport interface IFlowGraphSetPropertyBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The path of the entity whose property will be set. Needs a corresponding\r\n * entity on the context variables.\r\n */\r\n path: string;\r\n /**\r\n * The path converter to use to convert the path to an object accessor.\r\n */\r\n pathConverter: IPathToObjectConverter<IObjectAccessor>;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * Block that sets a property on a target object.\r\n */\r\nexport class FlowGraphSetPropertyBlock<ValueT> extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The value to set on the property.\r\n */\r\n public readonly a: FlowGraphDataConnection<ValueT>;\r\n /**\r\n * The component with the templated inputs for the provided path.\r\n */\r\n public readonly templateComponent: FlowGraphPathConverterComponent;\r\n\r\n public constructor(\r\n /**\r\n * the configuration of the block\r\n */\r\n public override config: IFlowGraphSetPropertyBlockConfiguration\r\n ) {\r\n super(config);\r\n\r\n this.a = this.registerDataInput(\"a\", RichTypeAny);\r\n this.templateComponent = new FlowGraphPathConverterComponent(config.path, this);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const value = this.a.getValue(context);\r\n const accessor = this.templateComponent.getAccessor(this.config.pathConverter, context);\r\n accessor.info.set(value, accessor.object);\r\n\r\n this.out._activateSignal(context);\r\n }\r\n\r\n /**\r\n * Serializes the block to a JSON object.\r\n * @param serializationObject the object to serialize to.\r\n */\r\n public override serialize(serializationObject: any = {}) {\r\n super.serialize(serializationObject);\r\n serializationObject.config.path = this.config.path;\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 FlowGraphSetPropertyBlock.ClassName;\r\n }\r\n\r\n /**\r\n * Class name of the block.\r\n */\r\n public static ClassName = \"FGSetPropertyBlock\";\r\n}\r\nRegisterClass(\"FGSetPropertyBlock\", FlowGraphSetPropertyBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphSetPropertyBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oCAAoC,EAAE,sDAA4D;AAC3G,OAAO,EAAE,WAAW,EAAE,oCAA0C;AAEhE,OAAO,EAAE,aAAa,EAAE,mCAA4B;AAepD;;;;;;;;;GASG;AACH,MAAM,OAAO,yBAAuE,SAAQ,oCAAoC;IAsB5H;IACI;;OAEG;IACa,MAAkD;QAElE,KAAK,CAAC,MAAM,CAAC,CAAC;QAFE,WAAM,GAAN,MAAM,CAA4C;QAGlE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QAC3E,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAC1D,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,WAAW,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;QAC7F,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;IACtF,CAAC;IACe,QAAQ,CAAC,OAAyB,EAAE,cAAyC;QACzF,IAAI,CAAC;YACD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAE3C,MAAM,WAAW,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC7D,IAAI,WAAW,EAAE,CAAC;gBACd,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;YAC7E,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC;YAC/E,CAAC;QACL,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC;YACvB,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAEO,iBAAiB,CAAC,MAAoB,EAAE,YAAoB,EAAE,KAAQ;QAC1E,MAAM,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,GAAG,GAAG,MAAa,CAAC;QACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YACvC,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YACrB,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;gBAC1B,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YACnB,CAAC;YACD,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;IACvC,CAAC;IAEe,YAAY;QACxB,yEAAuC;IAC3C,CAAC;CACJ;AAED,aAAa,oEAAkC,yBAAyB,CAAC,CAAC","sourcesContent":["import type { AssetType, FlowGraphAssetType } from \"core/FlowGraph/flowGraphAssetsContext\";\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\nimport { FlowGraphExecutionBlockWithOutSignal } from \"core/FlowGraph/flowGraphExecutionBlockWithOutSignal\";\nimport { RichTypeAny } from \"core/FlowGraph/flowGraphRichTypes\";\nimport type { FlowGraphSignalConnection } from \"core/FlowGraph/flowGraphSignalConnection\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\n\nexport interface IFlowGraphSetPropertyBlockConfiguration<O extends FlowGraphAssetType> {\n /**\n * The name of the property that will be set\n */\n propertyName?: string;\n\n /**\n * The target asset from which the property will be retrieved\n */\n target?: AssetType<O>;\n}\n\n/**\n * This block will set a property on a given target asset.\n * The property name can include dots (\".\"), which will be interpreted as a path to the property.\n * The target asset is an input and can be changed at any time.\n * The value of the property is an input and can be changed at any time.\n *\n * For example, with an input of a mesh asset, the property name \"position.x\" will set the x component of the position of the mesh.\n *\n * Note that it is recommended to input the object on which you are working on (i.e. a material) than providing a mesh and then getting the material from it.\n */\nexport class FlowGraphSetPropertyBlock<P extends any, O extends FlowGraphAssetType> extends FlowGraphExecutionBlockWithOutSignal {\n /**\n * Input connection: The value to set on the property.\n */\n public readonly value: FlowGraphDataConnection<P>;\n\n /**\n * Input connection: The target asset from which the property will be retrieved\n */\n public readonly object: FlowGraphDataConnection<AssetType<O>>;\n\n /**\n * Input connection: The name of the property that will be set\n */\n public readonly propertyName: FlowGraphDataConnection<string>;\n\n /**\n * Input connection: A function that can be used to set the value of the property.\n * If set it will be used instead of the default set function.\n */\n public readonly customSetFunction: FlowGraphDataConnection<(target: AssetType<O>, propertyName: string, value: P, context: FlowGraphContext) => void>;\n\n constructor(\n /**\n * the configuration of the block\n */\n public override config: IFlowGraphSetPropertyBlockConfiguration<O>\n ) {\n super(config);\n this.object = this.registerDataInput(\"object\", RichTypeAny, config.target);\n this.value = this.registerDataInput(\"value\", RichTypeAny);\n this.propertyName = this.registerDataInput(\"propertyName\", RichTypeAny, config.propertyName);\n this.customSetFunction = this.registerDataInput(\"customSetFunction\", RichTypeAny);\n }\n public override _execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void {\n try {\n const target = this.object.getValue(context);\n const value = this.value.getValue(context);\n\n const setFunction = this.customSetFunction.getValue(context);\n if (setFunction) {\n setFunction(target, this.propertyName.getValue(context), value, context);\n } else {\n this._setPropertyValue(target, this.propertyName.getValue(context), value);\n }\n } catch (e) {\n this.error.payload = e;\n this.error._activateSignal(context);\n }\n this.out._activateSignal(context);\n }\n\n private _setPropertyValue(target: AssetType<O>, propertyName: string, value: P): void {\n const path = propertyName.split(\".\");\n let obj = target as any;\n for (let i = 0; i < path.length - 1; i++) {\n const prop = path[i];\n if (obj[prop] === undefined) {\n obj[prop] = {};\n }\n obj = obj[prop];\n }\n obj[path[path.length - 1]] = value;\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.SetProperty;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.SetProperty, FlowGraphSetPropertyBlock);\n"]}
@@ -1,42 +1,27 @@
1
+ import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock";
1
2
  import type { FlowGraphContext } from "../../flowGraphContext";
2
3
  import type { FlowGraphDataConnection } from "../../flowGraphDataConnection";
3
4
  import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphExecutionBlockWithOutSignal";
4
- import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock";
5
+ import type { FlowGraphSignalConnection } from "../../flowGraphSignalConnection";
5
6
  /**
6
- * @experimental
7
- * The variable block configuration.
7
+ * The configuration of the FlowGraphGetVariableBlock.
8
8
  */
9
9
  export interface IFlowGraphSetVariableBlockConfiguration extends IFlowGraphBlockConfiguration {
10
10
  /**
11
11
  * The name of the variable to set.
12
12
  */
13
- variableName: string;
13
+ variable: string;
14
14
  }
15
15
  /**
16
- * Block to set a variable.
17
- * @experimental
16
+ * This block will set a variable on the context.
18
17
  */
19
18
  export declare class FlowGraphSetVariableBlock<T> extends FlowGraphExecutionBlockWithOutSignal {
20
19
  /**
21
- * the configuration of the block
22
- */
23
- config: IFlowGraphSetVariableBlockConfiguration;
24
- /**
25
- * Input connection: The value to set on the variable.
26
- */
27
- readonly input: FlowGraphDataConnection<T>;
28
- constructor(
29
- /**
30
- * the configuration of the block
31
- */
32
- config: IFlowGraphSetVariableBlockConfiguration);
33
- _execute(context: FlowGraphContext): void;
34
- /**
35
- * @returns class name of the block.
20
+ * Input connection: The value to set.
36
21
  */
22
+ readonly value: FlowGraphDataConnection<T>;
23
+ constructor(config: IFlowGraphSetVariableBlockConfiguration);
24
+ _execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void;
37
25
  getClassName(): string;
38
- /**
39
- * the class name of the block.
40
- */
41
- static ClassName: string;
26
+ serialize(serializationObject?: any): void;
42
27
  }
@@ -1,36 +1,50 @@
1
- import { RichTypeAny } from "../../flowGraphRichTypes.js";
2
- import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphExecutionBlockWithOutSignal.js";
3
1
  import { RegisterClass } from "../../../Misc/typeStore.js";
2
+ import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphExecutionBlockWithOutSignal.js";
3
+ import { RichTypeAny } from "../../flowGraphRichTypes.js";
4
4
  /**
5
- * Block to set a variable.
6
- * @experimental
5
+ * This block will set a variable on the context.
7
6
  */
8
7
  export class FlowGraphSetVariableBlock extends FlowGraphExecutionBlockWithOutSignal {
9
- constructor(
10
- /**
11
- * the configuration of the block
12
- */
13
- config) {
8
+ constructor(config) {
14
9
  super(config);
15
- this.config = config;
16
- this.input = this.registerDataInput(config.variableName, RichTypeAny);
10
+ this.value = this.registerDataInput("value", RichTypeAny);
17
11
  }
18
- _execute(context) {
19
- const variableNameValue = this.config.variableName;
20
- const inputValue = this.input.getValue(context);
21
- context.setVariable(variableNameValue, inputValue);
12
+ _execute(context, _callingSignal) {
13
+ // check if there is an animation(group) running on this variable. If there is, stop the animation - a value was force-set.
14
+ const currentlyRunningAnimationGroups = context._getGlobalContextVariable("currentlyRunningAnimationGroups", []);
15
+ for (const animationUniqueId of currentlyRunningAnimationGroups) {
16
+ const animation = context.assetsContext.animationGroups[animationUniqueId];
17
+ // check if there is a target animation that has the target set to be the context
18
+ for (const targetAnimation of animation.targetedAnimations) {
19
+ if (targetAnimation.target === context) {
20
+ // check if the target property is the variable we are setting
21
+ if (targetAnimation.target === context) {
22
+ // check the variable name
23
+ if (targetAnimation.animation.targetProperty === this.config?.variable) {
24
+ // stop the animation
25
+ animation.stop();
26
+ // remove the animation from the currently running animations
27
+ const index = currentlyRunningAnimationGroups.indexOf(animationUniqueId);
28
+ if (index > -1) {
29
+ currentlyRunningAnimationGroups.splice(index, 1);
30
+ }
31
+ context._setGlobalContextVariable("currentlyRunningAnimationGroups", currentlyRunningAnimationGroups);
32
+ break;
33
+ }
34
+ }
35
+ }
36
+ }
37
+ }
38
+ context.setVariable(this.config?.variable, this.value.getValue(context));
22
39
  this.out._activateSignal(context);
23
40
  }
24
- /**
25
- * @returns class name of the block.
26
- */
27
41
  getClassName() {
28
- return FlowGraphSetVariableBlock.ClassName;
42
+ return "FlowGraphSetVariableBlock" /* FlowGraphBlockNames.SetVariable */;
43
+ }
44
+ serialize(serializationObject) {
45
+ super.serialize(serializationObject);
46
+ serializationObject.config.variable = this.config?.variable;
29
47
  }
30
48
  }
31
- /**
32
- * the class name of the block.
33
- */
34
- FlowGraphSetVariableBlock.ClassName = "FGSetVariableBlock";
35
- RegisterClass(FlowGraphSetVariableBlock.ClassName, FlowGraphSetVariableBlock);
49
+ RegisterClass("FlowGraphSetVariableBlock" /* FlowGraphBlockNames.SetVariable */, FlowGraphSetVariableBlock);
36
50
  //# sourceMappingURL=flowGraphSetVariableBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphSetVariableBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,aAAa,EAAE,mCAA4B;AAcpD;;;GAGG;AACH,MAAM,OAAO,yBAA6B,SAAQ,oCAAoC;IAMlF;IACI;;OAEG;IACa,MAA+C;QAE/D,KAAK,CAAC,MAAM,CAAC,CAAC;QAFE,WAAM,GAAN,MAAM,CAAyC;QAI/D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IAC1E,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;QACnD,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAChD,OAAO,CAAC,WAAW,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;QACnD,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,OAAO,yBAAyB,CAAC,SAAS,CAAC;IAC/C,CAAC;;AAED;;GAEG;AACW,mCAAS,GAAG,oBAAoB,CAAC;AAEnD,aAAa,CAAC,yBAAyB,CAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import { RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../flowGraphExecutionBlockWithOutSignal\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\n\r\n/**\r\n * @experimental\r\n * The variable block configuration.\r\n */\r\nexport interface IFlowGraphSetVariableBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The name of the variable to set.\r\n */\r\n variableName: string;\r\n}\r\n\r\n/**\r\n * Block to set a variable.\r\n * @experimental\r\n */\r\nexport class FlowGraphSetVariableBlock<T> extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The value to set on the variable.\r\n */\r\n public readonly input: FlowGraphDataConnection<T>;\r\n\r\n constructor(\r\n /**\r\n * the configuration of the block\r\n */\r\n public override config: IFlowGraphSetVariableBlockConfiguration\r\n ) {\r\n super(config);\r\n\r\n this.input = this.registerDataInput(config.variableName, RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const variableNameValue = this.config.variableName;\r\n const inputValue = this.input.getValue(context);\r\n context.setVariable(variableNameValue, inputValue);\r\n this.out._activateSignal(context);\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 FlowGraphSetVariableBlock.ClassName;\r\n }\r\n\r\n /**\r\n * the class name of the block.\r\n */\r\n public static ClassName = \"FGSetVariableBlock\";\r\n}\r\nRegisterClass(FlowGraphSetVariableBlock.ClassName, FlowGraphSetVariableBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphSetVariableBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,mCAA4B;AAIpD,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAGlG,OAAO,EAAE,WAAW,EAAE,oCAA0C;AAYhE;;GAEG;AACH,MAAM,OAAO,yBAA6B,SAAQ,oCAAoC;IAMlF,YAAY,MAA+C;QACvD,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC9D,CAAC;IAEe,QAAQ,CAAC,OAAyB,EAAE,cAAyC;QACzF,2HAA2H;QAC3H,MAAM,+BAA+B,GAAG,OAAO,CAAC,yBAAyB,CAAC,iCAAiC,EAAE,EAAE,CAAa,CAAC;QAC7H,KAAK,MAAM,iBAAiB,IAAI,+BAA+B,EAAE,CAAC;YAC9D,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;YAC3E,iFAAiF;YACjF,KAAK,MAAM,eAAe,IAAI,SAAS,CAAC,kBAAkB,EAAE,CAAC;gBACzD,IAAI,eAAe,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;oBACrC,8DAA8D;oBAC9D,IAAI,eAAe,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;wBACrC,0BAA0B;wBAC1B,IAAI,eAAe,CAAC,SAAS,CAAC,cAAc,KAAK,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC;4BACrE,qBAAqB;4BACrB,SAAS,CAAC,IAAI,EAAE,CAAC;4BACjB,6DAA6D;4BAC7D,MAAM,KAAK,GAAG,+BAA+B,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;4BACzE,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC;gCACb,+BAA+B,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;4BACrD,CAAC;4BACD,OAAO,CAAC,yBAAyB,CAAC,iCAAiC,EAAE,+BAA+B,CAAC,CAAC;4BACtG,MAAM;wBACV,CAAC;oBACL,CAAC;gBACL,CAAC;YACL,CAAC;QACL,CAAC;QACD,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QACzE,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAEe,YAAY;QACxB,yEAAuC;IAC3C,CAAC;IAEe,SAAS,CAAC,mBAAyB;QAC/C,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,mBAAmB,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC;IAChE,CAAC;CACJ;AAED,aAAa,oEAAkC,yBAAyB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"core/Misc/typeStore\";\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../flowGraphExecutionBlockWithOutSignal\";\nimport type { FlowGraphSignalConnection } from \"../../flowGraphSignalConnection\";\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\nimport { RichTypeAny } from \"core/FlowGraph/flowGraphRichTypes\";\n\n/**\n * The configuration of the FlowGraphGetVariableBlock.\n */\nexport interface IFlowGraphSetVariableBlockConfiguration extends IFlowGraphBlockConfiguration {\n /**\n * The name of the variable to set.\n */\n variable: string;\n}\n\n/**\n * This block will set a variable on the context.\n */\nexport class FlowGraphSetVariableBlock<T> extends FlowGraphExecutionBlockWithOutSignal {\n /**\n * Input connection: The value to set.\n */\n public readonly value: FlowGraphDataConnection<T>;\n\n constructor(config: IFlowGraphSetVariableBlockConfiguration) {\n super(config);\n\n this.value = this.registerDataInput(\"value\", RichTypeAny);\n }\n\n public override _execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void {\n // check if there is an animation(group) running on this variable. If there is, stop the animation - a value was force-set.\n const currentlyRunningAnimationGroups = context._getGlobalContextVariable(\"currentlyRunningAnimationGroups\", []) as number[];\n for (const animationUniqueId of currentlyRunningAnimationGroups) {\n const animation = context.assetsContext.animationGroups[animationUniqueId];\n // check if there is a target animation that has the target set to be the context\n for (const targetAnimation of animation.targetedAnimations) {\n if (targetAnimation.target === context) {\n // check if the target property is the variable we are setting\n if (targetAnimation.target === context) {\n // check the variable name\n if (targetAnimation.animation.targetProperty === this.config?.variable) {\n // stop the animation\n animation.stop();\n // remove the animation from the currently running animations\n const index = currentlyRunningAnimationGroups.indexOf(animationUniqueId);\n if (index > -1) {\n currentlyRunningAnimationGroups.splice(index, 1);\n }\n context._setGlobalContextVariable(\"currentlyRunningAnimationGroups\", currentlyRunningAnimationGroups);\n break;\n }\n }\n }\n }\n }\n context.setVariable(this.config?.variable, this.value.getValue(context));\n this.out._activateSignal(context);\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.SetVariable;\n }\n\n public override serialize(serializationObject?: any): void {\n super.serialize(serializationObject);\n serializationObject.config.variable = this.config?.variable;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.SetVariable, FlowGraphSetVariableBlock);\n"]}
@@ -1,6 +1,3 @@
1
1
  export * from "./flowGraphConsoleLogBlock";
2
- export * from "./flowGraphSetVariableBlock";
3
- export * from "./flowGraphSetPropertyBlock";
4
- export * from "./flowGraphSendCustomEventBlock";
5
2
  export * from "./ControlFlow/index";
6
3
  export * from "./Animation/index";
@@ -1,7 +1,4 @@
1
1
  export * from "./flowGraphConsoleLogBlock.js";
2
- export * from "./flowGraphSetVariableBlock.js";
3
- export * from "./flowGraphSetPropertyBlock.js";
4
- export * from "./flowGraphSendCustomEventBlock.js";
5
2
  // eslint-disable-next-line import/no-internal-modules
6
3
  export * from "./ControlFlow/index.js";
7
4
  // eslint-disable-next-line import/no-internal-modules
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,sDAAsD;AACtD,cAAc,qBAAqB,CAAC;AACpC,sDAAsD;AACtD,cAAc,mBAAmB,CAAC","sourcesContent":["export * from \"./flowGraphConsoleLogBlock\";\r\nexport * from \"./flowGraphSetVariableBlock\";\r\nexport * from \"./flowGraphSetPropertyBlock\";\r\nexport * from \"./flowGraphSendCustomEventBlock\";\r\n// eslint-disable-next-line import/no-internal-modules\r\nexport * from \"./ControlFlow/index\";\r\n// eslint-disable-next-line import/no-internal-modules\r\nexport * from \"./Animation/index\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,sDAAsD;AACtD,cAAc,qBAAqB,CAAC;AACpC,sDAAsD;AACtD,cAAc,mBAAmB,CAAC","sourcesContent":["export * from \"./flowGraphConsoleLogBlock\";\r\n// eslint-disable-next-line import/no-internal-modules\r\nexport * from \"./ControlFlow/index\";\r\n// eslint-disable-next-line import/no-internal-modules\r\nexport * from \"./Animation/index\";\r\n"]}
@@ -0,0 +1,16 @@
1
+ import type { FlowGraphBlock } from "../flowGraphBlock";
2
+ import { FlowGraphBlockNames } from "./flowGraphBlockNames";
3
+ /**
4
+ * If you want to add a new block to the block factory, you should use this function.
5
+ * Please be sure to choose a unique name and define the responsible module.
6
+ * @param module the name of the module that is responsible for the block
7
+ * @param blockName the name of the block. This should be unique.
8
+ * @param factory an async factory function to generate the block
9
+ */
10
+ export declare function addToBlockFactory(module: string, blockName: string, factory: () => Promise<typeof FlowGraphBlock>): void;
11
+ /**
12
+ * a function to get a factory function for a block.
13
+ * @param blockName the block name to initialize. If the block comes from an external module, the name should be in the format "module/blockName"
14
+ * @returns an async factory function that will return the block class when called.
15
+ */
16
+ export declare function blockFactory(blockName: FlowGraphBlockNames | string): () => Promise<typeof FlowGraphBlock>;