@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
@@ -0,0 +1,39 @@
1
+ import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock.js";
2
+ import { FlowGraphBlock } from "../../../flowGraphBlock.js";
3
+ import type { FlowGraphContext } from "../../../flowGraphContext.js";
4
+ import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection.js";
5
+ import { FlowGraphInteger } from "../../../CustomTypes/flowGraphInteger.js";
6
+ /**
7
+ * This block takes an object as input and an array and returns the index of the object in the array.
8
+ */
9
+ export declare class FlowGraphIndexOfBlock<T = any> extends FlowGraphBlock {
10
+ config: IFlowGraphBlockConfiguration;
11
+ /**
12
+ * Input connection: The object to find in the array.
13
+ */
14
+ readonly object: FlowGraphDataConnection<T>;
15
+ /**
16
+ * Input connection: The array to search in.
17
+ */
18
+ readonly array: FlowGraphDataConnection<T[]>;
19
+ /**
20
+ * Output connection: The index of the object in the array.
21
+ * -1 if not found!
22
+ */
23
+ readonly index: FlowGraphDataConnection<FlowGraphInteger>;
24
+ /**
25
+ * Construct a FlowGraphIndexOfBlock.
26
+ * @param config construction parameters
27
+ */
28
+ constructor(config: IFlowGraphBlockConfiguration);
29
+ /**
30
+ * @internal
31
+ */
32
+ _updateOutputs(context: FlowGraphContext): void;
33
+ /**
34
+ * Serializes this block
35
+ * @param serializationObject the object to serialize to
36
+ */
37
+ serialize(serializationObject?: any): void;
38
+ getClassName(): string;
39
+ }
@@ -0,0 +1,42 @@
1
+ import { FlowGraphBlock } from "../../../flowGraphBlock.js";
2
+ import { RichTypeAny, RichTypeFlowGraphInteger } from "../../../flowGraphRichTypes.js";
3
+ import { RegisterClass } from "../../../../Misc/typeStore.js";
4
+ import { FlowGraphInteger } from "../../../CustomTypes/flowGraphInteger.js";
5
+ /**
6
+ * This block takes an object as input and an array and returns the index of the object in the array.
7
+ */
8
+ export class FlowGraphIndexOfBlock extends FlowGraphBlock {
9
+ /**
10
+ * Construct a FlowGraphIndexOfBlock.
11
+ * @param config construction parameters
12
+ */
13
+ constructor(config) {
14
+ super(config);
15
+ this.config = config;
16
+ this.object = this.registerDataInput("object", RichTypeAny);
17
+ this.array = this.registerDataInput("array", RichTypeAny);
18
+ this.index = this.registerDataOutput("index", RichTypeFlowGraphInteger, new FlowGraphInteger(-1));
19
+ }
20
+ /**
21
+ * @internal
22
+ */
23
+ _updateOutputs(context) {
24
+ const object = this.object.getValue(context);
25
+ const array = this.array.getValue(context);
26
+ if (array) {
27
+ this.index.setValue(new FlowGraphInteger(array.indexOf(object)), context);
28
+ }
29
+ }
30
+ /**
31
+ * Serializes this block
32
+ * @param serializationObject the object to serialize to
33
+ */
34
+ serialize(serializationObject) {
35
+ super.serialize(serializationObject);
36
+ }
37
+ getClassName() {
38
+ return "FlowGraphIndexOfBlock" /* FlowGraphBlockNames.IndexOf */;
39
+ }
40
+ }
41
+ RegisterClass("FlowGraphIndexOfBlock" /* FlowGraphBlockNames.IndexOf */, FlowGraphIndexOfBlock);
42
+ //# sourceMappingURL=flowGraphIndexOfBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowGraphIndexOfBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Data/Utils/flowGraphIndexOfBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,mCAAsC;AAG/D,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,uCAA0C;AAE1F,OAAO,EAAE,aAAa,EAAE,sCAA4B;AACpD,OAAO,EAAE,gBAAgB,EAAE,iDAAoD;AAE/E;;GAEG;AACH,MAAM,OAAO,qBAA+B,SAAQ,cAAc;IAiB9D;;;OAGG;IACH,YAA4B,MAAoC;QAC5D,KAAK,CAAC,MAAM,CAAC,CAAC;QADU,WAAM,GAAN,MAAM,CAA8B;QAG5D,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QAC5D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAC1D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,wBAAwB,EAAE,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtG,CAAC;IAED;;OAEG;IACa,cAAc,CAAC,OAAyB;QACpD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC3C,IAAI,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QAC9E,CAAC;IACL,CAAC;IAED;;;OAGG;IACa,SAAS,CAAC,mBAAyB;QAC/C,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;IACzC,CAAC;IAEe,YAAY;QACxB,iEAAmC;IACvC,CAAC;CACJ;AAED,aAAa,4DAA8B,qBAAqB,CAAC,CAAC","sourcesContent":["import type { IFlowGraphBlockConfiguration } from \"core/FlowGraph/flowGraphBlock\";\nimport { FlowGraphBlock } from \"core/FlowGraph/flowGraphBlock\";\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\nimport { RichTypeAny, RichTypeFlowGraphInteger } from \"core/FlowGraph/flowGraphRichTypes\";\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport { FlowGraphInteger } from \"core/FlowGraph/CustomTypes/flowGraphInteger\";\n\n/**\n * This block takes an object as input and an array and returns the index of the object in the array.\n */\nexport class FlowGraphIndexOfBlock<T = any> extends FlowGraphBlock {\n /**\n * Input connection: The object to find in the array.\n */\n public readonly object: FlowGraphDataConnection<T>;\n\n /**\n * Input connection: The array to search in.\n */\n public readonly array: FlowGraphDataConnection<T[]>;\n\n /**\n * Output connection: The index of the object in the array.\n * -1 if not found!\n */\n public readonly index: FlowGraphDataConnection<FlowGraphInteger>;\n\n /**\n * Construct a FlowGraphIndexOfBlock.\n * @param config construction parameters\n */\n constructor(public override config: IFlowGraphBlockConfiguration) {\n super(config);\n\n this.object = this.registerDataInput(\"object\", RichTypeAny);\n this.array = this.registerDataInput(\"array\", RichTypeAny);\n this.index = this.registerDataOutput(\"index\", RichTypeFlowGraphInteger, new FlowGraphInteger(-1));\n }\n\n /**\n * @internal\n */\n public override _updateOutputs(context: FlowGraphContext): void {\n const object = this.object.getValue(context);\n const array = this.array.getValue(context);\n if (array) {\n this.index.setValue(new FlowGraphInteger(array.indexOf(object)), context);\n }\n }\n\n /**\n * Serializes this block\n * @param serializationObject the object to serialize to\n */\n public override serialize(serializationObject?: any): void {\n super.serialize(serializationObject);\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.IndexOf;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.IndexOf, FlowGraphIndexOfBlock);\n"]}
@@ -0,0 +1,5 @@
1
+ export * from "./flowGraphContextBlock";
2
+ export * from "./flowGraphArrayIndexBlock";
3
+ export * from "./flowGraphCodeExecutionBlock";
4
+ export * from "./flowGraphIndexOfBlock";
5
+ export * from "./flowGraphFunctionReferenceBlock";
@@ -0,0 +1,6 @@
1
+ export * from "./flowGraphContextBlock.js";
2
+ export * from "./flowGraphArrayIndexBlock.js";
3
+ export * from "./flowGraphCodeExecutionBlock.js";
4
+ export * from "./flowGraphIndexOfBlock.js";
5
+ export * from "./flowGraphFunctionReferenceBlock.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Data/Utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mCAAmC,CAAC","sourcesContent":["export * from \"./flowGraphContextBlock\";\nexport * from \"./flowGraphArrayIndexBlock\";\nexport * from \"./flowGraphCodeExecutionBlock\";\nexport * from \"./flowGraphIndexOfBlock\";\nexport * from \"./flowGraphFunctionReferenceBlock\";\n"]}
@@ -4,7 +4,6 @@ import type { FlowGraphContext } from "../../flowGraphContext";
4
4
  import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock";
5
5
  import { FlowGraphCachedOperationBlock } from "./flowGraphCachedOperationBlock";
6
6
  /**
7
- * @experimental
8
7
  * The base block for all binary operation blocks. Receives an input of type
9
8
  * LeftT, one of type RightT, and outputs a value of type ResultT.
10
9
  */
@@ -1,6 +1,5 @@
1
1
  import { FlowGraphCachedOperationBlock } from "./flowGraphCachedOperationBlock.js";
2
2
  /**
3
- * @experimental
4
3
  * The base block for all binary operation blocks. Receives an input of type
5
4
  * LeftT, one of type RightT, and outputs a value of type ResultT.
6
5
  */
@@ -18,7 +17,9 @@ export class FlowGraphBinaryOperationBlock extends FlowGraphCachedOperationBlock
18
17
  * @returns the result of the operation
19
18
  */
20
19
  _doOperation(context) {
21
- return this._operation(this.a.getValue(context), this.b.getValue(context));
20
+ const a = this.a.getValue(context);
21
+ const b = this.b.getValue(context);
22
+ return this._operation(a, b);
22
23
  }
23
24
  /**
24
25
  * Gets the class name of this block
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphBinaryOperationBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF;;;;GAIG;AACH,MAAM,OAAO,6BAAsD,SAAQ,6BAAsC;IAU7G,YACI,YAA6B,EAC7B,aAA+B,EAC/B,cAAiC,EACzB,UAAmD,EACnD,UAAkB,EAC1B,MAAqC;QAErC,KAAK,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QAJtB,eAAU,GAAV,UAAU,CAAyC;QACnD,eAAU,GAAV,UAAU,CAAQ;QAI1B,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;QACnD,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IACxD,CAAC;IAED;;;;OAIG;IACa,YAAY,CAAC,OAAyB;QAClD,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/E,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;CACJ","sourcesContent":["import type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport type { RichType } from \"../../flowGraphRichTypes\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { FlowGraphCachedOperationBlock } from \"./flowGraphCachedOperationBlock\";\r\n/**\r\n * @experimental\r\n * The base block for all binary operation blocks. Receives an input of type\r\n * LeftT, one of type RightT, and outputs a value of type ResultT.\r\n */\r\nexport class FlowGraphBinaryOperationBlock<LeftT, RightT, ResultT> extends FlowGraphCachedOperationBlock<ResultT> {\r\n /**\r\n * First input of this block\r\n */\r\n a: FlowGraphDataConnection<LeftT>;\r\n /**\r\n * Second input of this block\r\n */\r\n b: FlowGraphDataConnection<RightT>;\r\n\r\n constructor(\r\n leftRichType: RichType<LeftT>,\r\n rightRichType: RichType<RightT>,\r\n resultRichType: RichType<ResultT>,\r\n private _operation: (left: LeftT, right: RightT) => ResultT,\r\n private _className: string,\r\n config?: IFlowGraphBlockConfiguration\r\n ) {\r\n super(resultRichType, config);\r\n this.a = this.registerDataInput(\"a\", leftRichType);\r\n this.b = this.registerDataInput(\"b\", rightRichType);\r\n }\r\n\r\n /**\r\n * the operation performed by this block\r\n * @param context the graph context\r\n * @returns the result of the operation\r\n */\r\n public override _doOperation(context: FlowGraphContext): ResultT {\r\n return this._operation(this.a.getValue(context), this.b.getValue(context));\r\n }\r\n\r\n /**\r\n * Gets the class name of this block\r\n * @returns the class name\r\n */\r\n public override getClassName(): string {\r\n return this._className;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"flowGraphBinaryOperationBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF;;;GAGG;AACH,MAAM,OAAO,6BAAsD,SAAQ,6BAAsC;IAU7G,YACI,YAA6B,EAC7B,aAA+B,EAC/B,cAAiC,EACzB,UAAmD,EACnD,UAAkB,EAC1B,MAAqC;QAErC,KAAK,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QAJtB,eAAU,GAAV,UAAU,CAAyC;QACnD,eAAU,GAAV,UAAU,CAAQ;QAI1B,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;QACnD,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IACxD,CAAC;IAED;;;;OAIG;IACa,YAAY,CAAC,OAAyB;QAClD,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACnC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACjC,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;CACJ","sourcesContent":["import type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport type { RichType } from \"../../flowGraphRichTypes\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { FlowGraphCachedOperationBlock } from \"./flowGraphCachedOperationBlock\";\r\n/**\r\n * The base block for all binary operation blocks. Receives an input of type\r\n * LeftT, one of type RightT, and outputs a value of type ResultT.\r\n */\r\nexport class FlowGraphBinaryOperationBlock<LeftT, RightT, ResultT> extends FlowGraphCachedOperationBlock<ResultT> {\r\n /**\r\n * First input of this block\r\n */\r\n a: FlowGraphDataConnection<LeftT>;\r\n /**\r\n * Second input of this block\r\n */\r\n b: FlowGraphDataConnection<RightT>;\r\n\r\n constructor(\r\n leftRichType: RichType<LeftT>,\r\n rightRichType: RichType<RightT>,\r\n resultRichType: RichType<ResultT>,\r\n private _operation: (left: LeftT, right: RightT) => ResultT,\r\n private _className: string,\r\n config?: IFlowGraphBlockConfiguration\r\n ) {\r\n super(resultRichType, config);\r\n this.a = this.registerDataInput(\"a\", leftRichType);\r\n this.b = this.registerDataInput(\"b\", rightRichType);\r\n }\r\n\r\n /**\r\n * the operation performed by this block\r\n * @param context the graph context\r\n * @returns the result of the operation\r\n */\r\n public override _doOperation(context: FlowGraphContext): ResultT {\r\n const a = this.a.getValue(context);\r\n const b = this.b.getValue(context);\r\n return this._operation(a, b);\r\n }\r\n\r\n /**\r\n * Gets the class name of this block\r\n * @returns the class name\r\n */\r\n public override getClassName(): string {\r\n return this._className;\r\n }\r\n}\r\n"]}
@@ -4,7 +4,7 @@ import type { FlowGraphContext } from "../../flowGraphContext";
4
4
  import type { FlowGraphDataConnection } from "../../flowGraphDataConnection";
5
5
  import type { RichType } from "../../flowGraphRichTypes";
6
6
  /**
7
- * @experimental
7
+ * A block that will cache the result of an operation and deliver it as an output.
8
8
  */
9
9
  export declare abstract class FlowGraphCachedOperationBlock<OutputT> extends FlowGraphBlock {
10
10
  /**
@@ -2,7 +2,7 @@ import { FlowGraphBlock } from "../../flowGraphBlock.js";
2
2
  const cacheName = "cachedOperationValue";
3
3
  const cacheExecIdName = "cachedExecutionId";
4
4
  /**
5
- * @experimental
5
+ * A block that will cache the result of an operation and deliver it as an output.
6
6
  */
7
7
  export class FlowGraphCachedOperationBlock extends FlowGraphBlock {
8
8
  constructor(outputRichType, config) {
@@ -10,9 +10,9 @@ export class FlowGraphCachedOperationBlock extends FlowGraphBlock {
10
10
  this.value = this.registerDataOutput("value", outputRichType);
11
11
  }
12
12
  _updateOutputs(context) {
13
- const cachedExecutionId = context._getExecutionVariable(this, cacheExecIdName);
14
- const cachedValue = context._getExecutionVariable(this, cacheName);
15
- if (cachedValue !== undefined && cachedExecutionId === context.executionId) {
13
+ const cachedExecutionId = context._getExecutionVariable(this, cacheExecIdName, -1);
14
+ const cachedValue = context._getExecutionVariable(this, cacheName, null);
15
+ if (cachedValue !== undefined && cachedValue !== null && cachedExecutionId === context.executionId) {
16
16
  this.value.setValue(cachedValue, context);
17
17
  }
18
18
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphCachedOperationBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD,MAAM,SAAS,GAAG,sBAAsB,CAAC;AACzC,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAE5C;;GAEG;AACH,MAAM,OAAgB,6BAAuC,SAAQ,cAAc;IAM/E,YAAY,cAAiC,EAAE,MAAqC;QAChF,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAClE,CAAC;IASe,cAAc,CAAC,OAAyB;QACpD,MAAM,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QAC/E,MAAM,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QACnE,IAAI,WAAW,KAAK,SAAS,IAAI,iBAAiB,KAAK,OAAO,CAAC,WAAW,EAAE,CAAC;YACzE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC9C,CAAC;aAAM,CAAC;YACJ,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YACnD,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;YAChE,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;YAC1E,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;IACL,CAAC;CACJ","sourcesContent":["import type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { FlowGraphBlock } from \"../../flowGraphBlock\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport type { RichType } from \"../../flowGraphRichTypes\";\r\n\r\nconst cacheName = \"cachedOperationValue\";\r\nconst cacheExecIdName = \"cachedExecutionId\";\r\n\r\n/**\r\n * @experimental\r\n */\r\nexport abstract class FlowGraphCachedOperationBlock<OutputT> extends FlowGraphBlock {\r\n /**\r\n * The output of the operation\r\n */\r\n public readonly value: FlowGraphDataConnection<OutputT>;\r\n\r\n constructor(outputRichType: RichType<OutputT>, config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.value = this.registerDataOutput(\"value\", outputRichType);\r\n }\r\n\r\n /**\r\n * @internal\r\n * Operation to realize\r\n * @param context the graph context\r\n */\r\n public abstract _doOperation(context: FlowGraphContext): OutputT;\r\n\r\n public override _updateOutputs(context: FlowGraphContext) {\r\n const cachedExecutionId = context._getExecutionVariable(this, cacheExecIdName);\r\n const cachedValue = context._getExecutionVariable(this, cacheName);\r\n if (cachedValue !== undefined && cachedExecutionId === context.executionId) {\r\n this.value.setValue(cachedValue, context);\r\n } else {\r\n const calculatedValue = this._doOperation(context);\r\n context._setExecutionVariable(this, cacheName, calculatedValue);\r\n context._setExecutionVariable(this, cacheExecIdName, context.executionId);\r\n this.value.setValue(calculatedValue, context);\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"flowGraphCachedOperationBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD,MAAM,SAAS,GAAG,sBAAsB,CAAC;AACzC,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAE5C;;GAEG;AACH,MAAM,OAAgB,6BAAuC,SAAQ,cAAc;IAM/E,YAAY,cAAiC,EAAE,MAAqC;QAChF,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAClE,CAAC;IASe,cAAc,CAAC,OAAyB;QACpD,MAAM,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC;QACnF,MAAM,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAoB,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;QAC5F,IAAI,WAAW,KAAK,SAAS,IAAI,WAAW,KAAK,IAAI,IAAI,iBAAiB,KAAK,OAAO,CAAC,WAAW,EAAE,CAAC;YACjG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC9C,CAAC;aAAM,CAAC;YACJ,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YACnD,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;YAChE,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;YAC1E,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;IACL,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"../../../types\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { FlowGraphBlock } from \"../../flowGraphBlock\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport type { RichType } from \"../../flowGraphRichTypes\";\r\n\r\nconst cacheName = \"cachedOperationValue\";\r\nconst cacheExecIdName = \"cachedExecutionId\";\r\n\r\n/**\r\n * A block that will cache the result of an operation and deliver it as an output.\r\n */\r\nexport abstract class FlowGraphCachedOperationBlock<OutputT> extends FlowGraphBlock {\r\n /**\r\n * The output of the operation\r\n */\r\n public readonly value: FlowGraphDataConnection<OutputT>;\r\n\r\n constructor(outputRichType: RichType<OutputT>, config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.value = this.registerDataOutput(\"value\", outputRichType);\r\n }\r\n\r\n /**\r\n * @internal\r\n * Operation to realize\r\n * @param context the graph context\r\n */\r\n public abstract _doOperation(context: FlowGraphContext): OutputT;\r\n\r\n public override _updateOutputs(context: FlowGraphContext) {\r\n const cachedExecutionId = context._getExecutionVariable(this, cacheExecIdName, -1);\r\n const cachedValue = context._getExecutionVariable<Nullable<OutputT>>(this, cacheName, null);\r\n if (cachedValue !== undefined && cachedValue !== null && cachedExecutionId === context.executionId) {\r\n this.value.setValue(cachedValue, context);\r\n } else {\r\n const calculatedValue = this._doOperation(context);\r\n context._setExecutionVariable(this, cacheName, calculatedValue);\r\n context._setExecutionVariable(this, cacheExecIdName, context.executionId);\r\n this.value.setValue(calculatedValue, context);\r\n }\r\n }\r\n}\r\n"]}
@@ -3,7 +3,6 @@ import { FlowGraphBlock } from "../../flowGraphBlock";
3
3
  import type { FlowGraphDataConnection } from "../../flowGraphDataConnection";
4
4
  import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock";
5
5
  /**
6
- * @experimental
7
6
  * Block that returns a value based on a condition.
8
7
  */
9
8
  export declare class FlowGraphConditionalDataBlock<T> extends FlowGraphBlock {
@@ -14,15 +13,19 @@ export declare class FlowGraphConditionalDataBlock<T> extends FlowGraphBlock {
14
13
  /**
15
14
  * Input connection: The value to return if the condition is true.
16
15
  */
17
- readonly trueValue: FlowGraphDataConnection<T>;
16
+ readonly onTrue: FlowGraphDataConnection<T>;
18
17
  /**
19
18
  * Input connection: The value to return if the condition is false.
20
19
  */
21
- readonly falseValue: FlowGraphDataConnection<T>;
20
+ readonly onFalse: FlowGraphDataConnection<T>;
22
21
  /**
23
22
  * Output connection: The value that was returned.
24
23
  */
25
24
  readonly output: FlowGraphDataConnection<T>;
25
+ /**
26
+ * Creates a new instance of the block
27
+ * @param config optional configuration for this block
28
+ */
26
29
  constructor(config?: IFlowGraphBlockConfiguration);
27
30
  /**
28
31
  * @internal
@@ -2,30 +2,36 @@ import { FlowGraphBlock } from "../../flowGraphBlock.js";
2
2
  import { RichTypeBoolean, RichTypeAny } from "../../flowGraphRichTypes.js";
3
3
  import { RegisterClass } from "../../../Misc/typeStore.js";
4
4
  /**
5
- * @experimental
6
5
  * Block that returns a value based on a condition.
7
6
  */
8
7
  export class FlowGraphConditionalDataBlock extends FlowGraphBlock {
8
+ /**
9
+ * Creates a new instance of the block
10
+ * @param config optional configuration for this block
11
+ */
9
12
  constructor(config) {
10
13
  super(config);
11
14
  this.condition = this.registerDataInput("condition", RichTypeBoolean);
12
- this.trueValue = this.registerDataInput("trueValue", RichTypeAny);
13
- this.falseValue = this.registerDataInput("falseValue", RichTypeAny);
15
+ this.onTrue = this.registerDataInput("onTrue", RichTypeAny);
16
+ this.onFalse = this.registerDataInput("onFalse", RichTypeAny);
14
17
  this.output = this.registerDataOutput("output", RichTypeAny);
15
18
  }
16
19
  /**
17
20
  * @internal
18
21
  */
19
22
  _updateOutputs(context) {
20
- this.output.setValue(this.condition.getValue(context) ? this.trueValue.getValue(context) : this.falseValue.getValue(context), context);
23
+ // get the value of the condition
24
+ const condition = this.condition.getValue(context);
25
+ // set the value based on the condition truth-ness.
26
+ this.output.setValue(condition ? this.onTrue.getValue(context) : this.onFalse.getValue(context), context);
21
27
  }
22
28
  /**
23
29
  * Gets the class name of this block
24
30
  * @returns the class name
25
31
  */
26
32
  getClassName() {
27
- return "FGConditionalDataBlock";
33
+ return "FlowGraphConditionalBlock" /* FlowGraphBlockNames.Conditional */;
28
34
  }
29
35
  }
30
- RegisterClass("FGConditionalDataBlock", FlowGraphConditionalDataBlock);
36
+ RegisterClass("FlowGraphConditionalBlock" /* FlowGraphBlockNames.Conditional */, FlowGraphConditionalDataBlock);
31
37
  //# sourceMappingURL=flowGraphConditionalDataBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphConditionalDataBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD;;;GAGG;AACH,MAAM,OAAO,6BAAiC,SAAQ,cAAc;IAmBhE,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;QACtE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;QAClE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;QAEpE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IACjE,CAAC;IAED;;OAEG;IACa,cAAc,CAAC,OAAyB;QACpD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3I,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,wBAAwB,CAAC;IACpC,CAAC;CACJ;AACD,aAAa,CAAC,wBAAwB,EAAE,6BAA6B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { FlowGraphBlock } from \"../../flowGraphBlock\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { RichTypeBoolean, RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Block that returns a value based on a condition.\r\n */\r\nexport class FlowGraphConditionalDataBlock<T> extends FlowGraphBlock {\r\n /**\r\n * Input connection: The condition to check.\r\n */\r\n public readonly condition: FlowGraphDataConnection<boolean>;\r\n /**\r\n * Input connection: The value to return if the condition is true.\r\n */\r\n public readonly trueValue: FlowGraphDataConnection<T>;\r\n /**\r\n * Input connection: The value to return if the condition is false.\r\n */\r\n public readonly falseValue: FlowGraphDataConnection<T>;\r\n\r\n /**\r\n * Output connection: The value that was returned.\r\n */\r\n public readonly output: FlowGraphDataConnection<T>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.condition = this.registerDataInput(\"condition\", RichTypeBoolean);\r\n this.trueValue = this.registerDataInput(\"trueValue\", RichTypeAny);\r\n this.falseValue = this.registerDataInput(\"falseValue\", RichTypeAny);\r\n\r\n this.output = this.registerDataOutput(\"output\", RichTypeAny);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _updateOutputs(context: FlowGraphContext): void {\r\n this.output.setValue(this.condition.getValue(context) ? this.trueValue.getValue(context) : this.falseValue.getValue(context), context);\r\n }\r\n\r\n /**\r\n * Gets the class name of this block\r\n * @returns the class name\r\n */\r\n public override getClassName(): string {\r\n return \"FGConditionalDataBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGConditionalDataBlock\", FlowGraphConditionalDataBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphConditionalDataBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD;;GAEG;AACH,MAAM,OAAO,6BAAiC,SAAQ,cAAc;IAmBhE;;;OAGG;IACH,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;QACtE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QAC5D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QAE9D,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IACjE,CAAC;IAED;;OAEG;IACa,cAAc,CAAC,OAAyB;QACpD,iCAAiC;QACjC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACnD,mDAAmD;QACnD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;IAC9G,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,yEAAuC;IAC3C,CAAC;CACJ;AACD,aAAa,oEAAkC,6BAA6B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { FlowGraphBlock } from \"../../flowGraphBlock\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { RichTypeBoolean, RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\r\n\r\n/**\r\n * Block that returns a value based on a condition.\r\n */\r\nexport class FlowGraphConditionalDataBlock<T> extends FlowGraphBlock {\r\n /**\r\n * Input connection: The condition to check.\r\n */\r\n public readonly condition: FlowGraphDataConnection<boolean>;\r\n /**\r\n * Input connection: The value to return if the condition is true.\r\n */\r\n public readonly onTrue: FlowGraphDataConnection<T>;\r\n /**\r\n * Input connection: The value to return if the condition is false.\r\n */\r\n public readonly onFalse: FlowGraphDataConnection<T>;\r\n\r\n /**\r\n * Output connection: The value that was returned.\r\n */\r\n public readonly output: FlowGraphDataConnection<T>;\r\n\r\n /**\r\n * Creates a new instance of the block\r\n * @param config optional configuration for this block\r\n */\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.condition = this.registerDataInput(\"condition\", RichTypeBoolean);\r\n this.onTrue = this.registerDataInput(\"onTrue\", RichTypeAny);\r\n this.onFalse = this.registerDataInput(\"onFalse\", RichTypeAny);\r\n\r\n this.output = this.registerDataOutput(\"output\", RichTypeAny);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _updateOutputs(context: FlowGraphContext): void {\r\n // get the value of the condition\r\n const condition = this.condition.getValue(context);\r\n // set the value based on the condition truth-ness.\r\n this.output.setValue(condition ? this.onTrue.getValue(context) : this.onFalse.getValue(context), context);\r\n }\r\n\r\n /**\r\n * Gets the class name of this block\r\n * @returns the class name\r\n */\r\n public override getClassName(): string {\r\n return FlowGraphBlockNames.Conditional;\r\n }\r\n}\r\nRegisterClass(FlowGraphBlockNames.Conditional, FlowGraphConditionalDataBlock);\r\n"]}
@@ -3,7 +3,6 @@ import type { FlowGraphContext } from "../../flowGraphContext.js";
3
3
  import type { FlowGraphDataConnection } from "../../flowGraphDataConnection.js";
4
4
  import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock";
5
5
  /**
6
- * @experimental
7
6
  * Configuration for a constant block.
8
7
  */
9
8
  export interface IFlowGraphConstantBlockConfiguration<T> extends IFlowGraphBlockConfiguration {
@@ -13,7 +12,6 @@ export interface IFlowGraphConstantBlockConfiguration<T> extends IFlowGraphBlock
13
12
  value: T;
14
13
  }
15
14
  /**
16
- * @experimental
17
15
  * Block that returns a constant value.
18
16
  */
19
17
  export declare class FlowGraphConstantBlock<T> extends FlowGraphBlock {
@@ -3,7 +3,6 @@ import { getRichTypeFromValue } from "../../flowGraphRichTypes.js";
3
3
  import { RegisterClass } from "../../../Misc/typeStore.js";
4
4
  import { defaultValueSerializationFunction } from "../../serialization.js";
5
5
  /**
6
- * @experimental
7
6
  * Block that returns a constant value.
8
7
  */
9
8
  export class FlowGraphConstantBlock extends FlowGraphBlock {
@@ -24,7 +23,7 @@ export class FlowGraphConstantBlock extends FlowGraphBlock {
24
23
  * @returns the class name
25
24
  */
26
25
  getClassName() {
27
- return "FGConstantBlock";
26
+ return "FlowGraphConstantBlock" /* FlowGraphBlockNames.Constant */;
28
27
  }
29
28
  /**
30
29
  * Serializes this block
@@ -36,5 +35,5 @@ export class FlowGraphConstantBlock extends FlowGraphBlock {
36
35
  valueSerializeFunction("value", this.config.value, serializationObject.config);
37
36
  }
38
37
  }
39
- RegisterClass("FGConstantBlock", FlowGraphConstantBlock);
38
+ RegisterClass("FlowGraphConstantBlock" /* FlowGraphBlockNames.Constant */, FlowGraphConstantBlock);
40
39
  //# sourceMappingURL=flowGraphConstantBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphConstantBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphConstantBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gCAAsC;AAG/D,OAAO,EAAE,oBAAoB,EAAE,oCAA0C;AAEzE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,iCAAiC,EAAE,+BAAqC;AAWjF;;;GAGG;AACH,MAAM,OAAO,sBAA0B,SAAQ,cAAc;IAMzD;IACI;;OAEG;IACa,MAA+C;QAE/D,KAAK,CAAC,MAAM,CAAC,CAAC;QAFE,WAAM,GAAN,MAAM,CAAyC;QAI/D,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACxF,CAAC;IAEe,cAAc,CAAC,OAAyB;QACpD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,iBAAiB,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACa,SAAS,CACrB,sBAA2B,EAAE,EAC7B,yBAAqF,iCAAiC;QAEtH,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,sBAAsB,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACnF,CAAC;CACJ;AACD,aAAa,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import { FlowGraphBlock } from \"core/FlowGraph/flowGraphBlock\";\r\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\r\nimport { getRichTypeFromValue } from \"core/FlowGraph/flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { defaultValueSerializationFunction } from \"core/FlowGraph/serialization\";\r\n/**\r\n * @experimental\r\n * Configuration for a constant block.\r\n */\r\nexport interface IFlowGraphConstantBlockConfiguration<T> extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The value of the constant.\r\n */\r\n value: T;\r\n}\r\n/**\r\n * @experimental\r\n * Block that returns a constant value.\r\n */\r\nexport class FlowGraphConstantBlock<T> extends FlowGraphBlock {\r\n /**\r\n * Output connection: The constant value.\r\n */\r\n public readonly output: FlowGraphDataConnection<T>;\r\n\r\n constructor(\r\n /**\r\n * the configuration of the block\r\n */\r\n public override config: IFlowGraphConstantBlockConfiguration<T>\r\n ) {\r\n super(config);\r\n\r\n this.output = this.registerDataOutput(\"output\", getRichTypeFromValue(config.value));\r\n }\r\n\r\n public override _updateOutputs(context: FlowGraphContext): void {\r\n this.output.setValue(this.config.value, context);\r\n }\r\n\r\n /**\r\n * Gets the class name of this block\r\n * @returns the class name\r\n */\r\n public override getClassName(): string {\r\n return \"FGConstantBlock\";\r\n }\r\n\r\n /**\r\n * Serializes this block\r\n * @param serializationObject the object to serialize to\r\n * @param valueSerializeFunction the function to use to serialize the value\r\n */\r\n public override serialize(\r\n serializationObject: any = {},\r\n valueSerializeFunction: (key: string, value: any, serializationObject: any) => any = defaultValueSerializationFunction\r\n ) {\r\n super.serialize(serializationObject);\r\n valueSerializeFunction(\"value\", this.config.value, serializationObject.config);\r\n }\r\n}\r\nRegisterClass(\"FGConstantBlock\", FlowGraphConstantBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphConstantBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphConstantBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gCAAsC;AAG/D,OAAO,EAAE,oBAAoB,EAAE,oCAA0C;AAEzE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,iCAAiC,EAAE,+BAAqC;AAWjF;;GAEG;AACH,MAAM,OAAO,sBAA0B,SAAQ,cAAc;IAMzD;IACI;;OAEG;IACa,MAA+C;QAE/D,KAAK,CAAC,MAAM,CAAC,CAAC;QAFE,WAAM,GAAN,MAAM,CAAyC;QAI/D,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACxF,CAAC;IAEe,cAAc,CAAC,OAAyB;QACpD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,mEAAoC;IACxC,CAAC;IAED;;;;OAIG;IACa,SAAS,CACrB,sBAA2B,EAAE,EAC7B,yBAAqF,iCAAiC;QAEtH,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,sBAAsB,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACnF,CAAC;CACJ;AACD,aAAa,8DAA+B,sBAAsB,CAAC,CAAC","sourcesContent":["import { FlowGraphBlock } from \"core/FlowGraph/flowGraphBlock\";\r\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\r\nimport { getRichTypeFromValue } from \"core/FlowGraph/flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { defaultValueSerializationFunction } from \"core/FlowGraph/serialization\";\r\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\r\n/**\r\n * Configuration for a constant block.\r\n */\r\nexport interface IFlowGraphConstantBlockConfiguration<T> extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The value of the constant.\r\n */\r\n value: T;\r\n}\r\n/**\r\n * Block that returns a constant value.\r\n */\r\nexport class FlowGraphConstantBlock<T> extends FlowGraphBlock {\r\n /**\r\n * Output connection: The constant value.\r\n */\r\n public readonly output: FlowGraphDataConnection<T>;\r\n\r\n constructor(\r\n /**\r\n * the configuration of the block\r\n */\r\n public override config: IFlowGraphConstantBlockConfiguration<T>\r\n ) {\r\n super(config);\r\n\r\n this.output = this.registerDataOutput(\"output\", getRichTypeFromValue(config.value));\r\n }\r\n\r\n public override _updateOutputs(context: FlowGraphContext): void {\r\n this.output.setValue(this.config.value, context);\r\n }\r\n\r\n /**\r\n * Gets the class name of this block\r\n * @returns the class name\r\n */\r\n public override getClassName(): string {\r\n return FlowGraphBlockNames.Constant;\r\n }\r\n\r\n /**\r\n * Serializes this block\r\n * @param serializationObject the object to serialize to\r\n * @param valueSerializeFunction the function to use to serialize the value\r\n */\r\n public override serialize(\r\n serializationObject: any = {},\r\n valueSerializeFunction: (key: string, value: any, serializationObject: any) => any = defaultValueSerializationFunction\r\n ) {\r\n super.serialize(serializationObject);\r\n valueSerializeFunction(\"value\", this.config.value, serializationObject.config);\r\n }\r\n}\r\nRegisterClass(FlowGraphBlockNames.Constant, FlowGraphConstantBlock);\r\n"]}
@@ -3,19 +3,20 @@ import type { RichType } from "../../flowGraphRichTypes";
3
3
  import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock";
4
4
  import { FlowGraphCachedOperationBlock } from "./flowGraphCachedOperationBlock";
5
5
  /**
6
- * @experimental
7
6
  * Block that outputs a value of type ResultT, resulting of an operation with no inputs.
7
+ * This block is being extended by some math operations and should not be used directly.
8
+ * @internal
8
9
  */
9
10
  export declare class FlowGraphConstantOperationBlock<ResultT> extends FlowGraphCachedOperationBlock<ResultT> {
10
11
  private _operation;
11
12
  private _className;
12
- constructor(richType: RichType<ResultT>, _operation: () => ResultT, _className: string, config?: IFlowGraphBlockConfiguration);
13
+ constructor(richType: RichType<ResultT>, _operation: (context: FlowGraphContext) => ResultT, _className: string, config?: IFlowGraphBlockConfiguration);
13
14
  /**
14
15
  * the operation performed by this block
15
- * @param _context the graph context
16
+ * @param context the graph context
16
17
  * @returns the result of the operation
17
18
  */
18
- _doOperation(_context: FlowGraphContext): ResultT;
19
+ _doOperation(context: FlowGraphContext): ResultT;
19
20
  /**
20
21
  * Gets the class name of this block
21
22
  * @returns the class name
@@ -1,7 +1,8 @@
1
1
  import { FlowGraphCachedOperationBlock } from "./flowGraphCachedOperationBlock.js";
2
2
  /**
3
- * @experimental
4
3
  * Block that outputs a value of type ResultT, resulting of an operation with no inputs.
4
+ * This block is being extended by some math operations and should not be used directly.
5
+ * @internal
5
6
  */
6
7
  export class FlowGraphConstantOperationBlock extends FlowGraphCachedOperationBlock {
7
8
  constructor(richType, _operation, _className, config) {
@@ -11,11 +12,11 @@ export class FlowGraphConstantOperationBlock extends FlowGraphCachedOperationBlo
11
12
  }
12
13
  /**
13
14
  * the operation performed by this block
14
- * @param _context the graph context
15
+ * @param context the graph context
15
16
  * @returns the result of the operation
16
17
  */
17
- _doOperation(_context) {
18
- return this._operation();
18
+ _doOperation(context) {
19
+ return this._operation(context);
19
20
  }
20
21
  /**
21
22
  * Gets the class name of this block
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphConstantOperationBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF;;;GAGG;AACH,MAAM,OAAO,+BAAyC,SAAQ,6BAAsC;IAChG,YACI,QAA2B,EACnB,UAAyB,EACzB,UAAkB,EAC1B,MAAqC;QAErC,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAJhB,eAAU,GAAV,UAAU,CAAe;QACzB,eAAU,GAAV,UAAU,CAAQ;IAI9B,CAAC;IAED;;;;OAIG;IACa,YAAY,CAAC,QAA0B;QACnD,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;CACJ","sourcesContent":["import type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { RichType } from \"../../flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { FlowGraphCachedOperationBlock } from \"./flowGraphCachedOperationBlock\";\r\n/**\r\n * @experimental\r\n * Block that outputs a value of type ResultT, resulting of an operation with no inputs.\r\n */\r\nexport class FlowGraphConstantOperationBlock<ResultT> extends FlowGraphCachedOperationBlock<ResultT> {\r\n constructor(\r\n richType: RichType<ResultT>,\r\n private _operation: () => ResultT,\r\n private _className: string,\r\n config?: IFlowGraphBlockConfiguration\r\n ) {\r\n super(richType, config);\r\n }\r\n\r\n /**\r\n * the operation performed by this block\r\n * @param _context the graph context\r\n * @returns the result of the operation\r\n */\r\n public override _doOperation(_context: FlowGraphContext): ResultT {\r\n return this._operation();\r\n }\r\n\r\n /**\r\n * Gets the class name of this block\r\n * @returns the class name\r\n */\r\n public override getClassName(): string {\r\n return this._className;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"flowGraphConstantOperationBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF;;;;GAIG;AACH,MAAM,OAAO,+BAAyC,SAAQ,6BAAsC;IAChG,YACI,QAA2B,EACnB,UAAkD,EAClD,UAAkB,EAC1B,MAAqC;QAErC,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAJhB,eAAU,GAAV,UAAU,CAAwC;QAClD,eAAU,GAAV,UAAU,CAAQ;IAI9B,CAAC;IAED;;;;OAIG;IACa,YAAY,CAAC,OAAyB;QAClD,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;CACJ","sourcesContent":["import type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { RichType } from \"../../flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { FlowGraphCachedOperationBlock } from \"./flowGraphCachedOperationBlock\";\r\n/**\r\n * Block that outputs a value of type ResultT, resulting of an operation with no inputs.\r\n * This block is being extended by some math operations and should not be used directly.\r\n * @internal\r\n */\r\nexport class FlowGraphConstantOperationBlock<ResultT> extends FlowGraphCachedOperationBlock<ResultT> {\r\n constructor(\r\n richType: RichType<ResultT>,\r\n private _operation: (context: FlowGraphContext) => ResultT,\r\n private _className: string,\r\n config?: IFlowGraphBlockConfiguration\r\n ) {\r\n super(richType, config);\r\n }\r\n\r\n /**\r\n * the operation performed by this block\r\n * @param context the graph context\r\n * @returns the result of the operation\r\n */\r\n public override _doOperation(context: FlowGraphContext): ResultT {\r\n return this._operation(context);\r\n }\r\n\r\n /**\r\n * Gets the class name of this block\r\n * @returns the class name\r\n */\r\n public override getClassName(): string {\r\n return this._className;\r\n }\r\n}\r\n"]}
@@ -0,0 +1,62 @@
1
+ import type { AssetType, FlowGraphAssetType } from "../../flowGraphAssetsContext.js";
2
+ import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock.js";
3
+ import { FlowGraphBlock } from "../../flowGraphBlock.js";
4
+ import type { FlowGraphContext } from "../../flowGraphContext.js";
5
+ import type { FlowGraphDataConnection } from "../../flowGraphDataConnection.js";
6
+ import type { Nullable } from "../../../types.js";
7
+ import { FlowGraphInteger } from "../../CustomTypes/flowGraphInteger.js";
8
+ import type { FlowGraphNumber } from "../../utils.js";
9
+ /**
10
+ * Configuration for the get asset block.
11
+ */
12
+ export interface IFlowGraphGetAssetBlockConfiguration<T> extends IFlowGraphBlockConfiguration {
13
+ /**
14
+ * The type of the asset that will be retrieved.
15
+ */
16
+ type: T;
17
+ /**
18
+ * The index of the asset in the corresponding array in the assets context.
19
+ * If not provided you can still change it using the input connection.
20
+ */
21
+ index?: number | FlowGraphInteger;
22
+ /**
23
+ * If set to true, instead of the index in the array it will search for the unique id of the asset.
24
+ * The value of index will be used as the unique id.
25
+ */
26
+ useIndexAsUniqueId?: boolean;
27
+ }
28
+ /**
29
+ * A block that will deliver an asset as an output, based on its type and place in the assets index.
30
+ *
31
+ * The assets are loaded from the assetsContext defined in the context running this block. The assetsContext is a class extending AbstractClass,
32
+ * meaning it can be a Scene, an AssetsContainers, and any other class that extends AbstractClass.
33
+ */
34
+ export declare class FlowGraphGetAssetBlock<T extends FlowGraphAssetType> extends FlowGraphBlock {
35
+ /**
36
+ * the configuration of the block
37
+ */
38
+ config: IFlowGraphGetAssetBlockConfiguration<T>;
39
+ /**
40
+ * Output connection: The value of the property.
41
+ */
42
+ readonly value: FlowGraphDataConnection<Nullable<AssetType<T>>>;
43
+ /**
44
+ * Input connection: The type of the asset.
45
+ */
46
+ readonly type: FlowGraphDataConnection<T>;
47
+ /**
48
+ * Input connection: The index of the asset in the corresponding array in the assets context.
49
+ */
50
+ readonly index: FlowGraphDataConnection<FlowGraphNumber>;
51
+ constructor(
52
+ /**
53
+ * the configuration of the block
54
+ */
55
+ config: IFlowGraphGetAssetBlockConfiguration<T>);
56
+ _updateOutputs(context: FlowGraphContext): void;
57
+ /**
58
+ * Gets the class name of this block
59
+ * @returns the class name
60
+ */
61
+ getClassName(): string;
62
+ }
@@ -0,0 +1,41 @@
1
+ import { GetFlowGraphAssetWithType } from "../../flowGraphAssetsContext.js";
2
+ import { FlowGraphBlock } from "../../flowGraphBlock.js";
3
+ import { RichTypeAny } from "../../flowGraphRichTypes.js";
4
+ import { RegisterClass } from "../../../Misc/typeStore.js";
5
+ import { FlowGraphInteger } from "../../CustomTypes/flowGraphInteger.js";
6
+ import { getNumericValue } from "../../utils.js";
7
+ /**
8
+ * A block that will deliver an asset as an output, based on its type and place in the assets index.
9
+ *
10
+ * The assets are loaded from the assetsContext defined in the context running this block. The assetsContext is a class extending AbstractClass,
11
+ * meaning it can be a Scene, an AssetsContainers, and any other class that extends AbstractClass.
12
+ */
13
+ export class FlowGraphGetAssetBlock extends FlowGraphBlock {
14
+ constructor(
15
+ /**
16
+ * the configuration of the block
17
+ */
18
+ config) {
19
+ super(config);
20
+ this.config = config;
21
+ this.type = this.registerDataInput("type", RichTypeAny, config.type);
22
+ this.value = this.registerDataOutput("value", RichTypeAny);
23
+ this.index = this.registerDataInput("index", RichTypeAny, new FlowGraphInteger(getNumericValue(config.index ?? -1)));
24
+ }
25
+ _updateOutputs(context) {
26
+ const type = this.type.getValue(context);
27
+ const index = this.index.getValue(context);
28
+ // get the asset from the context
29
+ const asset = GetFlowGraphAssetWithType(context.assetsContext, type, getNumericValue(index), this.config.useIndexAsUniqueId);
30
+ this.value.setValue(asset, context);
31
+ }
32
+ /**
33
+ * Gets the class name of this block
34
+ * @returns the class name
35
+ */
36
+ getClassName() {
37
+ return "FlowGraphGetAssetBlock" /* FlowGraphBlockNames.GetAsset */;
38
+ }
39
+ }
40
+ RegisterClass("FlowGraphGetAssetBlock" /* FlowGraphBlockNames.GetAsset */, FlowGraphGetAssetBlock);
41
+ //# sourceMappingURL=flowGraphGetAssetBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowGraphGetAssetBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphGetAssetBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,wCAA8C;AAElF,OAAO,EAAE,cAAc,EAAE,gCAAsC;AAG/D,OAAO,EAAE,WAAW,EAAE,oCAA0C;AAGhE,OAAO,EAAE,aAAa,EAAE,mCAA4B;AACpD,OAAO,EAAE,gBAAgB,EAAE,8CAAoD;AAE/E,OAAO,EAAE,eAAe,EAAE,uBAA6B;AAuBvD;;;;;GAKG;AACH,MAAM,OAAO,sBAAqD,SAAQ,cAAc;IAgBpF;IACI;;OAEG;IACa,MAA+C;QAE/D,KAAK,CAAC,MAAM,CAAC,CAAC;QAFE,WAAM,GAAN,MAAM,CAAyC;QAG/D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;QACrE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAC3D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,gBAAgB,CAAC,eAAe,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzH,CAAC;IAEe,cAAc,CAAC,OAAyB;QACpD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACzC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC3C,iCAAiC;QACjC,MAAM,KAAK,GAAG,yBAAyB,CAAC,OAAO,CAAC,aAAa,EAAE,IAAI,EAAE,eAAe,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;QAC7H,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,mEAAoC;IACxC,CAAC;CACJ;AAED,aAAa,8DAA+B,sBAAsB,CAAC,CAAC","sourcesContent":["import type { AssetType, FlowGraphAssetType } from \"core/FlowGraph/flowGraphAssetsContext\";\nimport { GetFlowGraphAssetWithType } from \"core/FlowGraph/flowGraphAssetsContext\";\nimport type { IFlowGraphBlockConfiguration } from \"core/FlowGraph/flowGraphBlock\";\nimport { FlowGraphBlock } from \"core/FlowGraph/flowGraphBlock\";\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\nimport { RichTypeAny } from \"core/FlowGraph/flowGraphRichTypes\";\nimport type { Nullable } from \"core/types\";\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport { FlowGraphInteger } from \"core/FlowGraph/CustomTypes/flowGraphInteger\";\nimport type { FlowGraphNumber } from \"core/FlowGraph/utils\";\nimport { getNumericValue } from \"core/FlowGraph/utils\";\n\n/**\n * Configuration for the get asset block.\n */\nexport interface IFlowGraphGetAssetBlockConfiguration<T> extends IFlowGraphBlockConfiguration {\n /**\n * The type of the asset that will be retrieved.\n */\n type: T;\n /**\n * The index of the asset in the corresponding array in the assets context.\n * If not provided you can still change it using the input connection.\n */\n index?: number | FlowGraphInteger;\n\n /**\n * If set to true, instead of the index in the array it will search for the unique id of the asset.\n * The value of index will be used as the unique id.\n */\n useIndexAsUniqueId?: boolean;\n}\n\n/**\n * A block that will deliver an asset as an output, based on its type and place in the assets index.\n *\n * The assets are loaded from the assetsContext defined in the context running this block. The assetsContext is a class extending AbstractClass,\n * meaning it can be a Scene, an AssetsContainers, and any other class that extends AbstractClass.\n */\nexport class FlowGraphGetAssetBlock<T extends FlowGraphAssetType> extends FlowGraphBlock {\n /**\n * Output connection: The value of the property.\n */\n public readonly value: FlowGraphDataConnection<Nullable<AssetType<T>>>;\n\n /**\n * Input connection: The type of the asset.\n */\n public readonly type: FlowGraphDataConnection<T>;\n\n /**\n * Input connection: The index of the asset in the corresponding array in the assets context.\n */\n public readonly index: FlowGraphDataConnection<FlowGraphNumber>;\n\n public constructor(\n /**\n * the configuration of the block\n */\n public override config: IFlowGraphGetAssetBlockConfiguration<T>\n ) {\n super(config);\n this.type = this.registerDataInput(\"type\", RichTypeAny, config.type);\n this.value = this.registerDataOutput(\"value\", RichTypeAny);\n this.index = this.registerDataInput(\"index\", RichTypeAny, new FlowGraphInteger(getNumericValue(config.index ?? -1)));\n }\n\n public override _updateOutputs(context: FlowGraphContext): void {\n const type = this.type.getValue(context);\n const index = this.index.getValue(context);\n // get the asset from the context\n const asset = GetFlowGraphAssetWithType(context.assetsContext, type, getNumericValue(index), this.config.useIndexAsUniqueId);\n this.value.setValue(asset, context);\n }\n\n /**\n * Gets the class name of this block\n * @returns the class name\n */\n public override getClassName(): string {\n return FlowGraphBlockNames.GetAsset;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.GetAsset, FlowGraphGetAssetBlock);\n"]}