@babylonjs/core 7.51.0 → 7.51.2

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 (325) 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/abstractEngine.js +2 -2
  7. package/Engines/abstractEngine.js.map +1 -1
  8. package/Engines/constants.d.ts +32 -0
  9. package/Engines/constants.js +33 -0
  10. package/Engines/constants.js.map +1 -1
  11. package/Engines/webgpuEngine.js +6 -3
  12. package/Engines/webgpuEngine.js.map +1 -1
  13. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.d.ts +148 -465
  14. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +394 -691
  15. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -1
  16. package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.d.ts +142 -0
  17. package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.js +342 -0
  18. package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.js.map +1 -0
  19. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.d.ts +107 -0
  20. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js +130 -0
  21. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js.map +1 -0
  22. package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.d.ts +77 -0
  23. package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.js +139 -0
  24. package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.js.map +1 -0
  25. package/FlowGraph/Blocks/Data/Math/index.d.ts +3 -0
  26. package/FlowGraph/Blocks/Data/Math/index.js +3 -0
  27. package/FlowGraph/Blocks/Data/Math/index.js.map +1 -1
  28. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.d.ts +85 -0
  29. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js +133 -0
  30. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js.map +1 -0
  31. package/FlowGraph/Blocks/Data/Transformers/flowGraphTypeToTypeBlocks.d.ts +49 -0
  32. package/FlowGraph/Blocks/Data/Transformers/flowGraphTypeToTypeBlocks.js +71 -0
  33. package/FlowGraph/Blocks/Data/Transformers/flowGraphTypeToTypeBlocks.js.map +1 -0
  34. package/FlowGraph/Blocks/Data/Transformers/index.d.ts +2 -0
  35. package/FlowGraph/Blocks/Data/Transformers/index.js +3 -0
  36. package/FlowGraph/Blocks/Data/Transformers/index.js.map +1 -0
  37. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.d.ts +39 -0
  38. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.js +46 -0
  39. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.js.map +1 -0
  40. package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.d.ts +35 -0
  41. package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.js +34 -0
  42. package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.js.map +1 -0
  43. package/FlowGraph/Blocks/Data/Utils/flowGraphContextBlock.d.ts +20 -0
  44. package/FlowGraph/Blocks/Data/Utils/flowGraphContextBlock.js +25 -0
  45. package/FlowGraph/Blocks/Data/Utils/flowGraphContextBlock.js.map +1 -0
  46. package/FlowGraph/Blocks/Data/Utils/flowGraphFunctionReferenceBlock.d.ts +34 -0
  47. package/FlowGraph/Blocks/Data/Utils/flowGraphFunctionReferenceBlock.js +35 -0
  48. package/FlowGraph/Blocks/Data/Utils/flowGraphFunctionReferenceBlock.js.map +1 -0
  49. package/FlowGraph/Blocks/Data/Utils/flowGraphIndexOfBlock.d.ts +39 -0
  50. package/FlowGraph/Blocks/Data/Utils/flowGraphIndexOfBlock.js +42 -0
  51. package/FlowGraph/Blocks/Data/Utils/flowGraphIndexOfBlock.js.map +1 -0
  52. package/FlowGraph/Blocks/Data/Utils/index.d.ts +5 -0
  53. package/FlowGraph/Blocks/Data/Utils/index.js +6 -0
  54. package/FlowGraph/Blocks/Data/Utils/index.js.map +1 -0
  55. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.d.ts +0 -1
  56. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js +3 -2
  57. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
  58. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.d.ts +1 -1
  59. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +4 -4
  60. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
  61. package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.d.ts +6 -3
  62. package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js +12 -6
  63. package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js.map +1 -1
  64. package/FlowGraph/Blocks/Data/flowGraphConstantBlock.d.ts +0 -2
  65. package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js +2 -3
  66. package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
  67. package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.d.ts +5 -4
  68. package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js +5 -4
  69. package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js.map +1 -1
  70. package/FlowGraph/Blocks/Data/flowGraphGetAssetBlock.d.ts +62 -0
  71. package/FlowGraph/Blocks/Data/flowGraphGetAssetBlock.js +41 -0
  72. package/FlowGraph/Blocks/Data/flowGraphGetAssetBlock.js.map +1 -0
  73. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.d.ts +38 -33
  74. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js +42 -25
  75. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -1
  76. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.d.ts +11 -16
  77. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +9 -17
  78. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
  79. package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.d.ts +1 -1
  80. package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js +1 -1
  81. package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js.map +1 -1
  82. package/FlowGraph/Blocks/Data/{flowGraphCoordinateTransformBlock.d.ts → flowGraphTransformCoordinatesSystemBlock.d.ts} +1 -2
  83. package/FlowGraph/Blocks/Data/{flowGraphCoordinateTransformBlock.js → flowGraphTransformCoordinatesSystemBlock.js} +4 -5
  84. package/FlowGraph/Blocks/Data/flowGraphTransformCoordinatesSystemBlock.js.map +1 -0
  85. package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.d.ts +1 -1
  86. package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js +1 -1
  87. package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js.map +1 -1
  88. package/FlowGraph/Blocks/Data/index.d.ts +7 -3
  89. package/FlowGraph/Blocks/Data/index.js +9 -4
  90. package/FlowGraph/Blocks/Data/index.js.map +1 -1
  91. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.d.ts +45 -24
  92. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +45 -51
  93. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
  94. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.d.ts +61 -0
  95. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.js +39 -0
  96. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.js.map +1 -0
  97. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.d.ts +61 -0
  98. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.js +40 -0
  99. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.js.map +1 -0
  100. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +12 -14
  101. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +19 -26
  102. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
  103. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.d.ts +6 -12
  104. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js +13 -24
  105. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js.map +1 -1
  106. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.d.ts +31 -7
  107. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js +22 -20
  108. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js.map +1 -1
  109. package/FlowGraph/Blocks/{Execution → Event}/flowGraphSendCustomEventBlock.d.ts +12 -7
  110. package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.js +39 -0
  111. package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.js.map +1 -0
  112. package/FlowGraph/Blocks/Event/index.d.ts +3 -0
  113. package/FlowGraph/Blocks/Event/index.js +3 -0
  114. package/FlowGraph/Blocks/Event/index.js.map +1 -1
  115. package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.d.ts +44 -0
  116. package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.js +46 -0
  117. package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.js.map +1 -0
  118. package/FlowGraph/Blocks/Execution/Animation/flowGraphEasingBlock.d.ts +60 -0
  119. package/FlowGraph/Blocks/Execution/Animation/flowGraphEasingBlock.js +93 -0
  120. package/FlowGraph/Blocks/Execution/Animation/flowGraphEasingBlock.js.map +1 -0
  121. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.d.ts +82 -0
  122. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.js +105 -0
  123. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.js.map +1 -0
  124. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.d.ts +2 -2
  125. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +2 -2
  126. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
  127. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +40 -42
  128. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +116 -50
  129. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
  130. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.d.ts +12 -4
  131. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +86 -8
  132. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
  133. package/FlowGraph/Blocks/Execution/Animation/index.d.ts +3 -0
  134. package/FlowGraph/Blocks/Execution/Animation/index.js +3 -0
  135. package/FlowGraph/Blocks/Execution/Animation/index.js.map +1 -1
  136. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.d.ts +1 -2
  137. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js +3 -4
  138. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js.map +1 -1
  139. package/FlowGraph/Blocks/Execution/{Audio/flowGraphStopAudioBlock.d.ts → ControlFlow/flowGraphCancelDelayBlock.d.ts} +6 -8
  140. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js +31 -0
  141. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js.map +1 -0
  142. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.d.ts +2 -2
  143. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +5 -5
  144. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
  145. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.d.ts +0 -1
  146. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +2 -3
  147. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
  148. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +5 -10
  149. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +11 -15
  150. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
  151. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.d.ts +11 -3
  152. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js +5 -6
  153. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js.map +1 -1
  154. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.d.ts +27 -7
  155. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +28 -30
  156. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
  157. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.d.ts +13 -16
  158. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js +50 -52
  159. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js.map +1 -1
  160. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.d.ts +8 -9
  161. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js +26 -13
  162. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js.map +1 -1
  163. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.d.ts +32 -0
  164. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js +84 -0
  165. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js.map +1 -0
  166. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.d.ts +20 -6
  167. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js +55 -16
  168. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js.map +1 -1
  169. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.d.ts +3 -4
  170. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +36 -13
  171. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
  172. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +13 -5
  173. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +22 -17
  174. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
  175. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +12 -16
  176. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +21 -21
  177. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
  178. package/FlowGraph/Blocks/Execution/ControlFlow/index.d.ts +2 -1
  179. package/FlowGraph/Blocks/Execution/ControlFlow/index.js +2 -1
  180. package/FlowGraph/Blocks/Execution/ControlFlow/index.js.map +1 -1
  181. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.d.ts +4 -5
  182. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js +13 -8
  183. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -1
  184. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +33 -36
  185. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +42 -26
  186. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
  187. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +10 -25
  188. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +38 -24
  189. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
  190. package/FlowGraph/Blocks/Execution/index.d.ts +0 -3
  191. package/FlowGraph/Blocks/Execution/index.js +0 -3
  192. package/FlowGraph/Blocks/Execution/index.js.map +1 -1
  193. package/FlowGraph/Blocks/flowGraphBlockFactory.d.ts +16 -0
  194. package/FlowGraph/Blocks/flowGraphBlockFactory.js +292 -0
  195. package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -0
  196. package/FlowGraph/Blocks/flowGraphBlockNames.d.ts +145 -0
  197. package/FlowGraph/Blocks/flowGraphBlockNames.js +147 -0
  198. package/FlowGraph/Blocks/flowGraphBlockNames.js.map +1 -0
  199. package/FlowGraph/Blocks/index.d.ts +2 -0
  200. package/FlowGraph/Blocks/index.js +2 -0
  201. package/FlowGraph/Blocks/index.js.map +1 -1
  202. package/FlowGraph/{flowGraphInteger.d.ts → CustomTypes/flowGraphInteger.d.ts} +2 -3
  203. package/FlowGraph/{flowGraphInteger.js → CustomTypes/flowGraphInteger.js} +4 -5
  204. package/FlowGraph/CustomTypes/flowGraphInteger.js.map +1 -0
  205. package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +196 -0
  206. package/FlowGraph/CustomTypes/flowGraphMatrix.js +272 -0
  207. package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -0
  208. package/FlowGraph/CustomTypes/index.d.ts +2 -0
  209. package/FlowGraph/CustomTypes/index.js +3 -0
  210. package/FlowGraph/CustomTypes/index.js.map +1 -0
  211. package/FlowGraph/flowGraph.d.ts +29 -34
  212. package/FlowGraph/flowGraph.js +120 -104
  213. package/FlowGraph/flowGraph.js.map +1 -1
  214. package/FlowGraph/flowGraphAssetsContext.d.ts +29 -0
  215. package/FlowGraph/flowGraphAssetsContext.js +52 -0
  216. package/FlowGraph/flowGraphAssetsContext.js.map +1 -0
  217. package/FlowGraph/flowGraphAsyncExecutionBlock.d.ts +15 -8
  218. package/FlowGraph/flowGraphAsyncExecutionBlock.js +25 -5
  219. package/FlowGraph/flowGraphAsyncExecutionBlock.js.map +1 -1
  220. package/FlowGraph/flowGraphBlock.d.ts +22 -15
  221. package/FlowGraph/flowGraphBlock.js +31 -52
  222. package/FlowGraph/flowGraphBlock.js.map +1 -1
  223. package/FlowGraph/flowGraphConnection.d.ts +13 -12
  224. package/FlowGraph/flowGraphConnection.js +31 -16
  225. package/FlowGraph/flowGraphConnection.js.map +1 -1
  226. package/FlowGraph/flowGraphContext.d.ts +89 -13
  227. package/FlowGraph/flowGraphContext.js +210 -23
  228. package/FlowGraph/flowGraphContext.js.map +1 -1
  229. package/FlowGraph/flowGraphCoordinator.d.ts +4 -10
  230. package/FlowGraph/flowGraphCoordinator.js +4 -16
  231. package/FlowGraph/flowGraphCoordinator.js.map +1 -1
  232. package/FlowGraph/flowGraphDataConnection.d.ts +52 -14
  233. package/FlowGraph/flowGraphDataConnection.js +73 -26
  234. package/FlowGraph/flowGraphDataConnection.js.map +1 -1
  235. package/FlowGraph/flowGraphEventBlock.d.ts +17 -1
  236. package/FlowGraph/flowGraphEventBlock.js +13 -2
  237. package/FlowGraph/flowGraphEventBlock.js.map +1 -1
  238. package/FlowGraph/flowGraphEventType.d.ts +16 -0
  239. package/FlowGraph/flowGraphEventType.js +18 -0
  240. package/FlowGraph/flowGraphEventType.js.map +1 -0
  241. package/FlowGraph/flowGraphExecutionBlock.d.ts +11 -1
  242. package/FlowGraph/flowGraphExecutionBlock.js +21 -2
  243. package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
  244. package/FlowGraph/flowGraphExecutionBlockWithOutSignal.d.ts +2 -2
  245. package/FlowGraph/flowGraphExecutionBlockWithOutSignal.js +0 -1
  246. package/FlowGraph/flowGraphExecutionBlockWithOutSignal.js.map +1 -1
  247. package/FlowGraph/flowGraphLogger.d.ts +60 -0
  248. package/FlowGraph/flowGraphLogger.js +53 -0
  249. package/FlowGraph/flowGraphLogger.js.map +1 -0
  250. package/FlowGraph/flowGraphParser.d.ts +85 -0
  251. package/FlowGraph/flowGraphParser.js +271 -0
  252. package/FlowGraph/flowGraphParser.js.map +1 -0
  253. package/FlowGraph/flowGraphPathConverter.d.ts +1 -1
  254. package/FlowGraph/flowGraphPathConverter.js +3 -2
  255. package/FlowGraph/flowGraphPathConverter.js.map +1 -1
  256. package/FlowGraph/flowGraphPathConverterComponent.d.ts +8 -1
  257. package/FlowGraph/flowGraphPathConverterComponent.js +18 -2
  258. package/FlowGraph/flowGraphPathConverterComponent.js.map +1 -1
  259. package/FlowGraph/flowGraphRichTypes.d.ts +51 -9
  260. package/FlowGraph/flowGraphRichTypes.js +160 -50
  261. package/FlowGraph/flowGraphRichTypes.js.map +1 -1
  262. package/FlowGraph/flowGraphSceneEventCoordinator.d.ts +45 -0
  263. package/FlowGraph/flowGraphSceneEventCoordinator.js +77 -0
  264. package/FlowGraph/flowGraphSceneEventCoordinator.js.map +1 -0
  265. package/FlowGraph/flowGraphSignalConnection.d.ts +8 -5
  266. package/FlowGraph/flowGraphSignalConnection.js +26 -9
  267. package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
  268. package/FlowGraph/index.d.ts +6 -1
  269. package/FlowGraph/index.js +7 -1
  270. package/FlowGraph/index.js.map +1 -1
  271. package/FlowGraph/serialization.d.ts +5 -2
  272. package/FlowGraph/serialization.js +94 -22
  273. package/FlowGraph/serialization.js.map +1 -1
  274. package/FlowGraph/typeDefinitions.d.ts +74 -12
  275. package/FlowGraph/typeDefinitions.js.map +1 -1
  276. package/FlowGraph/utils.d.ts +47 -0
  277. package/FlowGraph/utils.js +55 -0
  278. package/FlowGraph/utils.js.map +1 -1
  279. package/Maths/math.path.js +3 -0
  280. package/Maths/math.path.js.map +1 -1
  281. package/Meshes/geometry.d.ts +2 -1
  282. package/Meshes/geometry.js +8 -3
  283. package/Meshes/geometry.js.map +1 -1
  284. package/Meshes/mesh.d.ts +2 -1
  285. package/Meshes/mesh.js +3 -2
  286. package/Meshes/mesh.js.map +1 -1
  287. package/Misc/sceneOptimizer.js +1 -0
  288. package/Misc/sceneOptimizer.js.map +1 -1
  289. package/Misc/screenshotTools.d.ts +4 -2
  290. package/Misc/screenshotTools.js +8 -5
  291. package/Misc/screenshotTools.js.map +1 -1
  292. package/ObjectModel/objectModelInterfaces.d.ts +2 -2
  293. package/ObjectModel/objectModelInterfaces.js.map +1 -1
  294. package/Physics/v2/characterController.d.ts +8 -0
  295. package/Physics/v2/characterController.js +12 -5
  296. package/Physics/v2/characterController.js.map +1 -1
  297. package/Shaders/ShadersInclude/pbrBlockSubSurface.js +1 -1
  298. package/Shaders/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
  299. package/ShadersWGSL/ShadersInclude/pbrBlockSubSurface.js +1 -1
  300. package/ShadersWGSL/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
  301. package/package.json +1 -1
  302. package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.d.ts +0 -24
  303. package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js +0 -39
  304. package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js.map +0 -1
  305. package/FlowGraph/Blocks/Data/Logic/index.d.ts +0 -1
  306. package/FlowGraph/Blocks/Data/Logic/index.js +0 -2
  307. package/FlowGraph/Blocks/Data/Logic/index.js.map +0 -1
  308. package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js.map +0 -1
  309. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.d.ts +0 -19
  310. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js +0 -26
  311. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +0 -1
  312. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js +0 -25
  313. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +0 -1
  314. package/FlowGraph/Blocks/Execution/Audio/index.d.ts +0 -2
  315. package/FlowGraph/Blocks/Execution/Audio/index.js +0 -3
  316. package/FlowGraph/Blocks/Execution/Audio/index.js.map +0 -1
  317. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.d.ts +0 -31
  318. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js +0 -69
  319. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +0 -1
  320. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +0 -38
  321. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +0 -1
  322. package/FlowGraph/flowGraphContextLogger.d.ts +0 -9
  323. package/FlowGraph/flowGraphContextLogger.js +0 -14
  324. package/FlowGraph/flowGraphContextLogger.js.map +0 -1
  325. package/FlowGraph/flowGraphInteger.js.map +0 -1
@@ -2,14 +2,14 @@ import type { IFlowGraphBlockConfiguration } from "./flowGraphBlock";
2
2
  import { FlowGraphExecutionBlock } from "./flowGraphExecutionBlock";
3
3
  import type { FlowGraphSignalConnection } from "./flowGraphSignalConnection";
4
4
  /**
5
- * @experimental
6
5
  * An execution block that has an out signal. This signal is triggered when the synchronous execution of this block is done.
7
6
  * Most execution blocks will inherit from this, except for the ones that have multiple signals to be triggered.
8
7
  * (such as if blocks)
9
8
  */
10
9
  export declare abstract class FlowGraphExecutionBlockWithOutSignal extends FlowGraphExecutionBlock {
11
10
  /**
12
- * Output connection: The signal that is triggered when the execution of this block is done.
11
+ * Output connection: The signal that is synchronous triggered when the execution of this block is done.
12
+ * Note that is case of events or async you might want to use the `done` signal instead.
13
13
  */
14
14
  readonly out: FlowGraphSignalConnection;
15
15
  protected constructor(config?: IFlowGraphBlockConfiguration);
@@ -1,6 +1,5 @@
1
1
  import { FlowGraphExecutionBlock } from "./flowGraphExecutionBlock.js";
2
2
  /**
3
- * @experimental
4
3
  * An execution block that has an out signal. This signal is triggered when the synchronous execution of this block is done.
5
4
  * Most execution blocks will inherit from this, except for the ones that have multiple signals to be triggered.
6
5
  * (such as if blocks)
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphExecutionBlockWithOutSignal.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphExecutionBlockWithOutSignal.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE;;;;;GAKG;AACH,MAAM,OAAgB,oCAAqC,SAAQ,uBAAuB;IAMtF,YAAsB,MAAqC;QACvD,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;IACjD,CAAC;CACJ","sourcesContent":["import type { IFlowGraphBlockConfiguration } from \"./flowGraphBlock\";\r\nimport { FlowGraphExecutionBlock } from \"./flowGraphExecutionBlock\";\r\nimport type { FlowGraphSignalConnection } from \"./flowGraphSignalConnection\";\r\n\r\n/**\r\n * @experimental\r\n * An execution block that has an out signal. This signal is triggered when the synchronous execution of this block is done.\r\n * Most execution blocks will inherit from this, except for the ones that have multiple signals to be triggered.\r\n * (such as if blocks)\r\n */\r\nexport abstract class FlowGraphExecutionBlockWithOutSignal extends FlowGraphExecutionBlock {\r\n /**\r\n * Output connection: The signal that is triggered when the execution of this block is done.\r\n */\r\n public readonly out: FlowGraphSignalConnection;\r\n\r\n protected constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.out = this._registerSignalOutput(\"out\");\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"flowGraphExecutionBlockWithOutSignal.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphExecutionBlockWithOutSignal.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE;;;;GAIG;AACH,MAAM,OAAgB,oCAAqC,SAAQ,uBAAuB;IAOtF,YAAsB,MAAqC;QACvD,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;IACjD,CAAC;CACJ","sourcesContent":["import type { IFlowGraphBlockConfiguration } from \"./flowGraphBlock\";\r\nimport { FlowGraphExecutionBlock } from \"./flowGraphExecutionBlock\";\r\nimport type { FlowGraphSignalConnection } from \"./flowGraphSignalConnection\";\r\n\r\n/**\r\n * An execution block that has an out signal. This signal is triggered when the synchronous execution of this block is done.\r\n * Most execution blocks will inherit from this, except for the ones that have multiple signals to be triggered.\r\n * (such as if blocks)\r\n */\r\nexport abstract class FlowGraphExecutionBlockWithOutSignal extends FlowGraphExecutionBlock {\r\n /**\r\n * Output connection: The signal that is synchronous triggered when the execution of this block is done.\r\n * Note that is case of events or async you might want to use the `done` signal instead.\r\n */\r\n public readonly out: FlowGraphSignalConnection;\r\n\r\n protected constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.out = this._registerSignalOutput(\"out\");\r\n }\r\n}\r\n"]}
@@ -0,0 +1,60 @@
1
+ export declare enum FlowGraphAction {
2
+ ExecuteBlock = "ExecuteBlock",
3
+ ExecuteEvent = "ExecuteEvent",
4
+ TriggerConnection = "TriggerConnection",
5
+ ContextVariableSet = "ContextVariableSet",
6
+ GlobalVariableSet = "GlobalVariableSet",
7
+ GlobalVariableDelete = "GlobalVariableDelete",
8
+ GlobalVariableGet = "GlobalVariableGet",
9
+ AddConnection = "AddConnection",
10
+ GetConnectionValue = "GetConnectionValue",
11
+ SetConnectionValue = "SetConnectionValue",
12
+ ActivateSignal = "ActivateSignal",
13
+ ContextVariableGet = "ContextVariableGet"
14
+ }
15
+ /**
16
+ * An item in the flow graph log.
17
+ */
18
+ export interface IFlowGraphLogItem {
19
+ /**
20
+ * The time of the log item.
21
+ */
22
+ time?: number;
23
+ /**
24
+ * The class that triggered the log.
25
+ */
26
+ className: string;
27
+ /**
28
+ * The unique id of the block/module that triggered the log.
29
+ */
30
+ uniqueId: string;
31
+ /**
32
+ * The action that was logged.
33
+ */
34
+ action: FlowGraphAction;
35
+ /**
36
+ * The payload of the log
37
+ * This can be any data that is relevant to the action.
38
+ * For example, the value of a connection, the value of a variable, etc.
39
+ * This is optional.
40
+ */
41
+ payload?: any;
42
+ }
43
+ /**
44
+ * This class will be responsible of logging the flow graph activity.
45
+ * Note that using this class might reduce performance, as it will log every action, according to the configuration.
46
+ * It attaches to a flow graph and uses meta-programming to replace the methods of the flow graph to add logging abilities.
47
+ */
48
+ export declare class FlowGraphLogger {
49
+ /**
50
+ * Whether to log to the console.
51
+ */
52
+ logToConsole: boolean;
53
+ /**
54
+ * The log cache of the flow graph.
55
+ * Each item is a logged item, in order of execution.
56
+ */
57
+ log: IFlowGraphLogItem[];
58
+ addLogItem(item: IFlowGraphLogItem): void;
59
+ getItemsOfType(action: FlowGraphAction): IFlowGraphLogItem[];
60
+ }
@@ -0,0 +1,53 @@
1
+ import { Logger } from "../Misc/logger.js";
2
+ export var FlowGraphAction;
3
+ (function (FlowGraphAction) {
4
+ FlowGraphAction["ExecuteBlock"] = "ExecuteBlock";
5
+ FlowGraphAction["ExecuteEvent"] = "ExecuteEvent";
6
+ FlowGraphAction["TriggerConnection"] = "TriggerConnection";
7
+ FlowGraphAction["ContextVariableSet"] = "ContextVariableSet";
8
+ FlowGraphAction["GlobalVariableSet"] = "GlobalVariableSet";
9
+ FlowGraphAction["GlobalVariableDelete"] = "GlobalVariableDelete";
10
+ FlowGraphAction["GlobalVariableGet"] = "GlobalVariableGet";
11
+ FlowGraphAction["AddConnection"] = "AddConnection";
12
+ FlowGraphAction["GetConnectionValue"] = "GetConnectionValue";
13
+ FlowGraphAction["SetConnectionValue"] = "SetConnectionValue";
14
+ FlowGraphAction["ActivateSignal"] = "ActivateSignal";
15
+ FlowGraphAction["ContextVariableGet"] = "ContextVariableGet";
16
+ })(FlowGraphAction || (FlowGraphAction = {}));
17
+ /**
18
+ * This class will be responsible of logging the flow graph activity.
19
+ * Note that using this class might reduce performance, as it will log every action, according to the configuration.
20
+ * It attaches to a flow graph and uses meta-programming to replace the methods of the flow graph to add logging abilities.
21
+ */
22
+ export class FlowGraphLogger {
23
+ constructor() {
24
+ /**
25
+ * Whether to log to the console.
26
+ */
27
+ this.logToConsole = false;
28
+ /**
29
+ * The log cache of the flow graph.
30
+ * Each item is a logged item, in order of execution.
31
+ */
32
+ this.log = [];
33
+ }
34
+ addLogItem(item) {
35
+ if (!item.time) {
36
+ item.time = Date.now();
37
+ }
38
+ this.log.push(item);
39
+ if (this.logToConsole) {
40
+ const value = item.payload?.value;
41
+ if (typeof value === "object" && value.getClassName) {
42
+ Logger.Log(`[FGLog] ${item.className}:${item.uniqueId.split("-")[0]} ${item.action} - ${JSON.stringify(value.getClassName())}: ${value.toString()}`);
43
+ }
44
+ else {
45
+ Logger.Log(`[FGLog] ${item.className}:${item.uniqueId.split("-")[0]} ${item.action} - ${JSON.stringify(item.payload)}`);
46
+ }
47
+ }
48
+ }
49
+ getItemsOfType(action) {
50
+ return this.log.filter((i) => i.action === action);
51
+ }
52
+ }
53
+ //# sourceMappingURL=flowGraphLogger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowGraphLogger.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,0BAAyB;AAE1C,MAAM,CAAN,IAAkB,eAajB;AAbD,WAAkB,eAAe;IAC7B,gDAA6B,CAAA;IAC7B,gD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AM,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAC5H,CAAC;QACL,CAAC;IACL,CAAC;IAEM,cAAc,CAAC,MAAuB;QACzC,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;IACvD,CAAC;CACJ","sourcesContent":["import { Logger } from \"core/Misc/logger\";\n\nexport const enum FlowGraphAction {\n ExecuteBlock = \"ExecuteBlock\",\n ExecuteEvent = \"ExecuteEvent\",\n TriggerConnection = \"TriggerConnection\",\n ContextVariableSet = \"ContextVariableSet\",\n GlobalVariableSet = \"GlobalVariableSet\",\n GlobalVariableDelete = \"GlobalVariableDelete\",\n GlobalVariableGet = \"GlobalVariableGet\",\n AddConnection = \"AddConnection\",\n GetConnectionValue = \"GetConnectionValue\",\n SetConnectionValue = \"SetConnectionValue\",\n ActivateSignal = \"ActivateSignal\",\n ContextVariableGet = \"ContextVariableGet\",\n}\n\n/**\n * An item in the flow graph log.\n */\nexport interface IFlowGraphLogItem {\n /**\n * The time of the log item.\n */\n time?: number;\n /**\n * The class that triggered the log.\n */\n className: string;\n /**\n * The unique id of the block/module that triggered the log.\n */\n uniqueId: string;\n /**\n * The action that was logged.\n */\n action: FlowGraphAction;\n /**\n * The payload of the log\n * This can be any data that is relevant to the action.\n * For example, the value of a connection, the value of a variable, etc.\n * This is optional.\n */\n payload?: any;\n}\n\n/**\n * This class will be responsible of logging the flow graph activity.\n * Note that using this class might reduce performance, as it will log every action, according to the configuration.\n * It attaches to a flow graph and uses meta-programming to replace the methods of the flow graph to add logging abilities.\n */\nexport class FlowGraphLogger {\n /**\n * Whether to log to the console.\n */\n public logToConsole: boolean = false;\n\n /**\n * The log cache of the flow graph.\n * Each item is a logged item, in order of execution.\n */\n public log: IFlowGraphLogItem[] = [];\n\n public addLogItem(item: IFlowGraphLogItem) {\n if (!item.time) {\n item.time = Date.now();\n }\n this.log.push(item);\n if (this.logToConsole) {\n const value = item.payload?.value;\n if (typeof value === \"object\" && value.getClassName) {\n Logger.Log(`[FGLog] ${item.className}:${item.uniqueId.split(\"-\")[0]} ${item.action} - ${JSON.stringify(value.getClassName())}: ${value.toString()}`);\n } else {\n Logger.Log(`[FGLog] ${item.className}:${item.uniqueId.split(\"-\")[0]} ${item.action} - ${JSON.stringify(item.payload)}`);\n }\n }\n }\n\n public getItemsOfType(action: FlowGraphAction): IFlowGraphLogItem[] {\n return this.log.filter((i) => i.action === action);\n }\n}\n"]}
@@ -0,0 +1,85 @@
1
+ import type { FlowGraph, IFlowGraphParseOptions } from "./flowGraph";
2
+ import type { FlowGraphBlock, IFlowGraphBlockParseOptions } from "./flowGraphBlock";
3
+ import type { FlowGraphContext, IFlowGraphContextParseOptions } from "./flowGraphContext";
4
+ import type { FlowGraphCoordinatorParseOptions } from "./flowGraphCoordinator";
5
+ import { FlowGraphCoordinator } from "./flowGraphCoordinator";
6
+ import type { FlowGraphDataConnection } from "./flowGraphDataConnection";
7
+ import type { FlowGraphSignalConnection } from "./flowGraphSignalConnection";
8
+ import type { ISerializedFlowGraph, ISerializedFlowGraphBlock, ISerializedFlowGraphContext } from "./typeDefinitions";
9
+ import type { FlowGraphConnection } from "./flowGraphConnection";
10
+ /**
11
+ * Given a list of blocks, find an output data connection that has a specific unique id
12
+ * @param blocks a list of flow graph blocks
13
+ * @param uniqueId the unique id of a connection
14
+ * @returns the connection that has this unique id. throws an error if none was found
15
+ */
16
+ export declare function GetDataOutConnectionByUniqueId(blocks: FlowGraphBlock[], uniqueId: string): FlowGraphDataConnection<any>;
17
+ /**
18
+ * Given a list of blocks, find an input signal connection that has a specific unique id
19
+ * @param blocks a list of flow graph blocks
20
+ * @param uniqueId the unique id of a connection
21
+ * @returns the connection that has this unique id. throws an error if none was found
22
+ */
23
+ export declare function GetSignalInConnectionByUniqueId(blocks: FlowGraphBlock[], uniqueId: string): FlowGraphSignalConnection;
24
+ /**
25
+ * Parses a serialized coordinator.
26
+ * @param serializedObject the object to parse
27
+ * @param options the options to use when parsing
28
+ * @returns the parsed coordinator
29
+ */
30
+ export declare function ParseCoordinatorAsync(serializedObject: any, options: FlowGraphCoordinatorParseOptions): Promise<FlowGraphCoordinator>;
31
+ /**
32
+ * Parses a graph from a given serialization object
33
+ * @param serializationObject the object where the values are written
34
+ * @param options options for parsing the graph
35
+ * @returns the parsed graph
36
+ */
37
+ export declare function ParseFlowGraphAsync(serializationObject: ISerializedFlowGraph, options: IFlowGraphParseOptions): Promise<FlowGraph>;
38
+ /**
39
+ * Parses a graph from a given serialization object
40
+ * @param serializationObject the object where the values are written
41
+ * @param options options for parsing the graph
42
+ * @param resolvedClasses the resolved classes for the blocks
43
+ * @returns the parsed graph
44
+ */
45
+ export declare function ParseFlowGraph(serializationObject: ISerializedFlowGraph, options: IFlowGraphParseOptions, resolvedClasses: (typeof FlowGraphBlock)[]): FlowGraph;
46
+ /**
47
+ * Parses a context
48
+ * @param serializationObject the object containing the context serialization values
49
+ * @param options the options for parsing the context
50
+ * @param rightHanded whether the serialized data is right handed
51
+ * @returns
52
+ */
53
+ export declare function ParseFlowGraphContext(serializationObject: ISerializedFlowGraphContext, options: IFlowGraphContextParseOptions, rightHanded?: boolean): FlowGraphContext;
54
+ /**
55
+ * Parses a block from a serialization object
56
+ * This function is async due to the factory method that is used to create the block's class. If you load the class externally use ParseBlockWithClassType
57
+ * @param serializationObject the object to parse from
58
+ * @param parseOptions options for parsing the block
59
+ * @returns the parsed block
60
+ */
61
+ export declare function ParseBlockAsync(serializationObject: ISerializedFlowGraphBlock, parseOptions: IFlowGraphBlockParseOptions): Promise<FlowGraphBlock>;
62
+ /**
63
+ * Parses a block from a serialization object
64
+ * @param serializationObject the object to parse from
65
+ * @param parseOptions options for parsing the block
66
+ * @param classType the class type of the block. This is used when the class is not loaded asynchronously
67
+ * @returns the parsed block
68
+ */
69
+ export declare function ParseFlowGraphBlockWithClassType(serializationObject: ISerializedFlowGraphBlock, parseOptions: IFlowGraphBlockParseOptions, classType: typeof FlowGraphBlock): FlowGraphBlock;
70
+ /**
71
+ * Parses a connection from an object
72
+ * @param serializationObject the object to parse from.
73
+ * @param ownerBlock the block that owns the connection.
74
+ * @param classType the class type of the connection.
75
+ * @returns the parsed connection.
76
+ */
77
+ export declare function ParseGraphConnectionWithClassType<BlockT extends FlowGraphBlock>(serializationObject: any | undefined, ownerBlock: BlockT, classType: typeof FlowGraphConnection): FlowGraphConnection<BlockT, import("./flowGraphConnection").IConnectable>;
78
+ /**
79
+ * Parses a data connection from a serialized object.
80
+ * @param serializationObject the object to parse from
81
+ * @param ownerBlock the block that owns the connection
82
+ * @param classType the class type of the data connection
83
+ * @returns the parsed connection
84
+ */
85
+ export declare function ParseGraphDataConnection(serializationObject: any, ownerBlock: FlowGraphBlock, classType: typeof FlowGraphDataConnection): FlowGraphDataConnection<any>;
@@ -0,0 +1,271 @@
1
+ import { blockFactory } from "./Blocks/flowGraphBlockFactory.js";
2
+ import { FlowGraphCoordinator } from "./flowGraphCoordinator.js";
3
+ import { FlowGraphEventBlock } from "./flowGraphEventBlock.js";
4
+ import { FlowGraphExecutionBlock } from "./flowGraphExecutionBlock.js";
5
+ import { defaultValueParseFunction, needsPathConverter } from "./serialization.js";
6
+ import { getRichTypeByFlowGraphType, RichType } from "./flowGraphRichTypes.js";
7
+ /**
8
+ * Given a list of blocks, find an output data connection that has a specific unique id
9
+ * @param blocks a list of flow graph blocks
10
+ * @param uniqueId the unique id of a connection
11
+ * @returns the connection that has this unique id. throws an error if none was found
12
+ */
13
+ export function GetDataOutConnectionByUniqueId(blocks, uniqueId) {
14
+ for (const block of blocks) {
15
+ for (const dataOut of block.dataOutputs) {
16
+ if (dataOut.uniqueId === uniqueId) {
17
+ return dataOut;
18
+ }
19
+ }
20
+ }
21
+ throw new Error("Could not find data out connection with unique id " + uniqueId);
22
+ }
23
+ /**
24
+ * Given a list of blocks, find an input signal connection that has a specific unique id
25
+ * @param blocks a list of flow graph blocks
26
+ * @param uniqueId the unique id of a connection
27
+ * @returns the connection that has this unique id. throws an error if none was found
28
+ */
29
+ export function GetSignalInConnectionByUniqueId(blocks, uniqueId) {
30
+ for (const block of blocks) {
31
+ if (block instanceof FlowGraphExecutionBlock) {
32
+ for (const signalIn of block.signalInputs) {
33
+ if (signalIn.uniqueId === uniqueId) {
34
+ return signalIn;
35
+ }
36
+ }
37
+ }
38
+ }
39
+ throw new Error("Could not find signal in connection with unique id " + uniqueId);
40
+ }
41
+ /**
42
+ * Parses a serialized coordinator.
43
+ * @param serializedObject the object to parse
44
+ * @param options the options to use when parsing
45
+ * @returns the parsed coordinator
46
+ */
47
+ export async function ParseCoordinatorAsync(serializedObject, options) {
48
+ const valueParseFunction = options.valueParseFunction ?? defaultValueParseFunction;
49
+ const coordinator = new FlowGraphCoordinator({ scene: options.scene });
50
+ await options.scene.whenReadyAsync();
51
+ // if custom default values are defined, set them in the global context
52
+ if (serializedObject._defaultValues) {
53
+ for (const key in serializedObject._defaultValues) {
54
+ // key is the FlowGraphType, value is the default value
55
+ const value = serializedObject._defaultValues[key];
56
+ getRichTypeByFlowGraphType(key).defaultValue = value;
57
+ }
58
+ }
59
+ // async-parse the flow graphs. This can be done in parallel
60
+ await Promise.all(serializedObject._flowGraphs?.map((serializedGraph) => ParseFlowGraphAsync(serializedGraph, { coordinator, valueParseFunction, pathConverter: options.pathConverter })));
61
+ return coordinator;
62
+ }
63
+ /**
64
+ * Parses a graph from a given serialization object
65
+ * @param serializationObject the object where the values are written
66
+ * @param options options for parsing the graph
67
+ * @returns the parsed graph
68
+ */
69
+ export async function ParseFlowGraphAsync(serializationObject, options) {
70
+ // get all classes types needed for the blocks using the block factory
71
+ const resolvedClasses = await Promise.all(serializationObject.allBlocks.map(async (serializedBlock) => {
72
+ const classFactory = blockFactory(serializedBlock.className);
73
+ return classFactory();
74
+ }));
75
+ // async will be used when we start using the block async factory
76
+ return ParseFlowGraph(serializationObject, options, resolvedClasses);
77
+ }
78
+ /**
79
+ * Parses a graph from a given serialization object
80
+ * @param serializationObject the object where the values are written
81
+ * @param options options for parsing the graph
82
+ * @param resolvedClasses the resolved classes for the blocks
83
+ * @returns the parsed graph
84
+ */
85
+ export function ParseFlowGraph(serializationObject, options, resolvedClasses) {
86
+ const graph = options.coordinator.createGraph();
87
+ const blocks = [];
88
+ const valueParseFunction = options.valueParseFunction ?? defaultValueParseFunction;
89
+ // Parse all blocks
90
+ // for (const serializedBlock of serializationObject.allBlocks) {
91
+ for (let i = 0; i < serializationObject.allBlocks.length; i++) {
92
+ const serializedBlock = serializationObject.allBlocks[i];
93
+ const block = ParseFlowGraphBlockWithClassType(serializedBlock, { scene: options.coordinator.config.scene, pathConverter: options.pathConverter, assetsContainer: options.coordinator.config.scene, valueParseFunction }, resolvedClasses[i]);
94
+ blocks.push(block);
95
+ if (block instanceof FlowGraphEventBlock) {
96
+ graph.addEventBlock(block);
97
+ }
98
+ }
99
+ // After parsing all blocks, connect them
100
+ for (const block of blocks) {
101
+ for (const dataIn of block.dataInputs) {
102
+ for (const serializedConnection of dataIn.connectedPointIds) {
103
+ const connection = GetDataOutConnectionByUniqueId(blocks, serializedConnection);
104
+ dataIn.connectTo(connection);
105
+ }
106
+ }
107
+ if (block instanceof FlowGraphExecutionBlock) {
108
+ for (const signalOut of block.signalOutputs) {
109
+ for (const serializedConnection of signalOut.connectedPointIds) {
110
+ const connection = GetSignalInConnectionByUniqueId(blocks, serializedConnection);
111
+ signalOut.connectTo(connection);
112
+ }
113
+ }
114
+ }
115
+ }
116
+ for (const serializedContext of serializationObject.executionContexts) {
117
+ ParseFlowGraphContext(serializedContext, { graph, valueParseFunction }, serializationObject.rightHanded);
118
+ }
119
+ return graph;
120
+ }
121
+ /**
122
+ * Parses a context
123
+ * @param serializationObject the object containing the context serialization values
124
+ * @param options the options for parsing the context
125
+ * @param rightHanded whether the serialized data is right handed
126
+ * @returns
127
+ */
128
+ export function ParseFlowGraphContext(serializationObject, options, rightHanded) {
129
+ const result = options.graph.createContext();
130
+ if (serializationObject.enableLogging) {
131
+ result.enableLogging = true;
132
+ }
133
+ result.treatDataAsRightHanded = rightHanded || false;
134
+ const valueParseFunction = options.valueParseFunction ?? defaultValueParseFunction;
135
+ result.uniqueId = serializationObject.uniqueId;
136
+ const scene = result.getScene();
137
+ // check if assets context is available
138
+ if (serializationObject._assetsContext) {
139
+ const ac = serializationObject._assetsContext;
140
+ const assetsContext = {
141
+ meshes: ac.meshes?.map((m) => scene.getMeshById(m)),
142
+ lights: ac.lights?.map((l) => scene.getLightByName(l)),
143
+ cameras: ac.cameras?.map((c) => scene.getCameraByName(c)),
144
+ materials: ac.materials?.map((m) => scene.getMaterialById(m)),
145
+ textures: ac.textures?.map((t) => scene.getTextureByName(t)),
146
+ animations: ac.animations?.map((a) => scene.animations.find((anim) => anim.name === a)),
147
+ skeletons: ac.skeletons?.map((s) => scene.getSkeletonByName(s)),
148
+ particleSystems: ac.particleSystems?.map((ps) => scene.getParticleSystemById(ps)),
149
+ animationGroups: ac.animationGroups?.map((ag) => scene.getAnimationGroupByName(ag)),
150
+ transformNodes: ac.transformNodes?.map((tn) => scene.getTransformNodeById(tn)),
151
+ rootNodes: [],
152
+ multiMaterials: [],
153
+ morphTargetManagers: [],
154
+ geometries: [],
155
+ actionManagers: [],
156
+ environmentTexture: null,
157
+ postProcesses: [],
158
+ sounds: null,
159
+ effectLayers: [],
160
+ layers: [],
161
+ reflectionProbes: [],
162
+ lensFlareSystems: [],
163
+ proceduralTextures: [],
164
+ getNodes: function () {
165
+ throw new Error("Function not implemented.");
166
+ },
167
+ };
168
+ result.assetsContext = assetsContext;
169
+ }
170
+ for (const key in serializationObject._userVariables) {
171
+ const value = valueParseFunction(key, serializationObject._userVariables, result.assetsContext, scene);
172
+ result.userVariables[key] = value;
173
+ }
174
+ for (const key in serializationObject._connectionValues) {
175
+ const value = valueParseFunction(key, serializationObject._connectionValues, result.assetsContext, scene);
176
+ result._setConnectionValueByKey(key, value);
177
+ }
178
+ return result;
179
+ }
180
+ /**
181
+ * Parses a block from a serialization object
182
+ * This function is async due to the factory method that is used to create the block's class. If you load the class externally use ParseBlockWithClassType
183
+ * @param serializationObject the object to parse from
184
+ * @param parseOptions options for parsing the block
185
+ * @returns the parsed block
186
+ */
187
+ export async function ParseBlockAsync(serializationObject, parseOptions) {
188
+ const classFactory = blockFactory(serializationObject.className);
189
+ const classType = await classFactory();
190
+ return ParseFlowGraphBlockWithClassType(serializationObject, parseOptions, classType);
191
+ }
192
+ /**
193
+ * Parses a block from a serialization object
194
+ * @param serializationObject the object to parse from
195
+ * @param parseOptions options for parsing the block
196
+ * @param classType the class type of the block. This is used when the class is not loaded asynchronously
197
+ * @returns the parsed block
198
+ */
199
+ export function ParseFlowGraphBlockWithClassType(serializationObject, parseOptions, classType) {
200
+ const parsedConfig = {};
201
+ const valueParseFunction = parseOptions.valueParseFunction ?? defaultValueParseFunction;
202
+ if (serializationObject.config) {
203
+ for (const key in serializationObject.config) {
204
+ parsedConfig[key] = valueParseFunction(key, serializationObject.config, parseOptions.assetsContainer || parseOptions.scene, parseOptions.scene);
205
+ }
206
+ }
207
+ if (needsPathConverter(serializationObject.className)) {
208
+ if (!parseOptions.pathConverter) {
209
+ throw new Error("Path converter is required for this block");
210
+ }
211
+ parsedConfig.pathConverter = parseOptions.pathConverter;
212
+ }
213
+ const obj = new classType(parsedConfig);
214
+ obj.uniqueId = serializationObject.uniqueId;
215
+ for (let i = 0; i < serializationObject.dataInputs.length; i++) {
216
+ const dataInput = obj.getDataInput(serializationObject.dataInputs[i].name);
217
+ if (dataInput) {
218
+ dataInput.deserialize(serializationObject.dataInputs[i]);
219
+ }
220
+ else {
221
+ throw new Error("Could not find data input with name " + serializationObject.dataInputs[i].name + " in block " + serializationObject.className);
222
+ }
223
+ }
224
+ for (let i = 0; i < serializationObject.dataOutputs.length; i++) {
225
+ const dataOutput = obj.getDataOutput(serializationObject.dataOutputs[i].name);
226
+ if (dataOutput) {
227
+ dataOutput.deserialize(serializationObject.dataOutputs[i]);
228
+ }
229
+ else {
230
+ throw new Error("Could not find data output with name " + serializationObject.dataOutputs[i].name + " in block " + serializationObject.className);
231
+ }
232
+ }
233
+ obj.metadata = serializationObject.metadata;
234
+ obj.deserialize && obj.deserialize(serializationObject);
235
+ return obj;
236
+ }
237
+ /**
238
+ * Parses a connection from an object
239
+ * @param serializationObject the object to parse from.
240
+ * @param ownerBlock the block that owns the connection.
241
+ * @param classType the class type of the connection.
242
+ * @returns the parsed connection.
243
+ */
244
+ export function ParseGraphConnectionWithClassType(serializationObject = {}, ownerBlock, classType) {
245
+ const connection = new classType(serializationObject.name, serializationObject._connectionType, ownerBlock);
246
+ connection.deserialize(serializationObject);
247
+ return connection;
248
+ }
249
+ /**
250
+ * Parses a data connection from a serialized object.
251
+ * @param serializationObject the object to parse from
252
+ * @param ownerBlock the block that owns the connection
253
+ * @param classType the class type of the data connection
254
+ * @returns the parsed connection
255
+ */
256
+ export function ParseGraphDataConnection(serializationObject, ownerBlock, classType) {
257
+ const richType = ParseRichType(serializationObject.richType);
258
+ const defaultValue = serializationObject.defaultValue;
259
+ const connection = new classType(serializationObject.name, serializationObject._connectionType, ownerBlock, richType, defaultValue, !!serializationObject._optional);
260
+ connection.deserialize(serializationObject);
261
+ return connection;
262
+ }
263
+ /**
264
+ * Parses a rich type from a serialization object.
265
+ * @param serializationObject a serialization object
266
+ * @returns the parsed rich type
267
+ */
268
+ function ParseRichType(serializationObject) {
269
+ return new RichType(serializationObject.typeName, serializationObject.defaultValue);
270
+ }
271
+ //# sourceMappingURL=flowGraphParser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowGraphParser.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphParser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAM9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE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AAyC;IACpI,MAAM,QAAQ,GAAG,aAAa,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC7D,MAAM,YAAY,GAAG,mBAAmB,CAAC,YAAY,CAAC;IACtD,MAAM,UAAU,GAAG,IAAI,SAAS,CAAC,mBAAmB,CAAC,IAAI,EAAE,mBAAmB,CAAC,eAAe,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACrK,UAAU,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC;IAC5C,OAAO,UAAU,CAAC;AACtB,CAAC;AAED;;;;GAIG;AACH,SAAS,aAAa,CAAC,mBAAwB;IAC3C,OAAO,IAAI,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC;AACxF,CAAC","sourcesContent":["import type { IAssetContainer } from \"core/IAssetContainer\";\nimport { blockFactory } from \"./Blocks/flowGraphBlockFactory\";\nimport type { FlowGraphBlockNames } from \"./Blocks/flowGraphBlockNames\";\nimport type { FlowGraph, IFlowGraphParseOptions } from \"./flowGraph\";\nimport type { FlowGraphBlock, IFlowGraphBlockParseOptions } from \"./flowGraphBlock\";\nimport type { FlowGraphContext, IFlowGraphContextParseOptions } from \"./flowGraphContext\";\nimport type { FlowGraphCoordinatorParseOptions } from \"./flowGraphCoordinator\";\nimport { FlowGraphCoordinator } from \"./flowGraphCoordinator\";\nimport type { FlowGraphDataConnection } from \"./flowGraphDataConnection\";\nimport { FlowGraphEventBlock } from \"./flowGraphEventBlock\";\nimport { FlowGraphExecutionBlock } from \"./flowGraphExecutionBlock\";\nimport type { FlowGraphSignalConnection } from \"./flowGraphSignalConnection\";\nimport { defaultValueParseFunction, needsPathConverter } from \"./serialization\";\nimport type { ISerializedFlowGraph, ISerializedFlowGraphBlock, ISerializedFlowGraphContext } from \"./typeDefinitions\";\nimport type { Node } from \"core/node\";\nimport { getRichTypeByFlowGraphType, RichType } from \"./flowGraphRichTypes\";\nimport type { FlowGraphConnection } from \"./flowGraphConnection\";\n\n/**\n * Given a list of blocks, find an output data connection that has a specific unique id\n * @param blocks a list of flow graph blocks\n * @param uniqueId the unique id of a connection\n * @returns the connection that has this unique id. throws an error if none was found\n */\nexport function GetDataOutConnectionByUniqueId(blocks: FlowGraphBlock[], uniqueId: string): FlowGraphDataConnection<any> {\n for (const block of blocks) {\n for (const dataOut of block.dataOutputs) {\n if (dataOut.uniqueId === uniqueId) {\n return dataOut;\n }\n }\n }\n throw new Error(\"Could not find data out connection with unique id \" + uniqueId);\n}\n\n/**\n * Given a list of blocks, find an input signal connection that has a specific unique id\n * @param blocks a list of flow graph blocks\n * @param uniqueId the unique id of a connection\n * @returns the connection that has this unique id. throws an error if none was found\n */\nexport function GetSignalInConnectionByUniqueId(blocks: FlowGraphBlock[], uniqueId: string): FlowGraphSignalConnection {\n for (const block of blocks) {\n if (block instanceof FlowGraphExecutionBlock) {\n for (const signalIn of block.signalInputs) {\n if (signalIn.uniqueId === uniqueId) {\n return signalIn;\n }\n }\n }\n }\n throw new Error(\"Could not find signal in connection with unique id \" + uniqueId);\n}\n\n/**\n * Parses a serialized coordinator.\n * @param serializedObject the object to parse\n * @param options the options to use when parsing\n * @returns the parsed coordinator\n */\nexport async function ParseCoordinatorAsync(serializedObject: any, options: FlowGraphCoordinatorParseOptions) {\n const valueParseFunction = options.valueParseFunction ?? defaultValueParseFunction;\n const coordinator = new FlowGraphCoordinator({ scene: options.scene });\n\n await options.scene.whenReadyAsync();\n // if custom default values are defined, set them in the global context\n if (serializedObject._defaultValues) {\n for (const key in serializedObject._defaultValues) {\n // key is the FlowGraphType, value is the default value\n const value = serializedObject._defaultValues[key];\n getRichTypeByFlowGraphType(key).defaultValue = value;\n }\n }\n // async-parse the flow graphs. This can be done in parallel\n await Promise.all(\n serializedObject._flowGraphs?.map((serializedGraph: any) => ParseFlowGraphAsync(serializedGraph, { coordinator, valueParseFunction, pathConverter: options.pathConverter }))\n );\n return coordinator;\n}\n\n/**\n * Parses a graph from a given serialization object\n * @param serializationObject the object where the values are written\n * @param options options for parsing the graph\n * @returns the parsed graph\n */\nexport async function ParseFlowGraphAsync(serializationObject: ISerializedFlowGraph, options: IFlowGraphParseOptions): Promise<FlowGraph> {\n // get all classes types needed for the blocks using the block factory\n const resolvedClasses = await Promise.all(\n serializationObject.allBlocks.map(async (serializedBlock) => {\n const classFactory = blockFactory(serializedBlock.className as FlowGraphBlockNames);\n return classFactory();\n })\n );\n // async will be used when we start using the block async factory\n return ParseFlowGraph(serializationObject, options, resolvedClasses);\n}\n\n/**\n * Parses a graph from a given serialization object\n * @param serializationObject the object where the values are written\n * @param options options for parsing the graph\n * @param resolvedClasses the resolved classes for the blocks\n * @returns the parsed graph\n */\nexport function ParseFlowGraph(serializationObject: ISerializedFlowGraph, options: IFlowGraphParseOptions, resolvedClasses: (typeof FlowGraphBlock)[]) {\n const graph = options.coordinator.createGraph();\n const blocks: FlowGraphBlock[] = [];\n const valueParseFunction = options.valueParseFunction ?? defaultValueParseFunction;\n // Parse all blocks\n // for (const serializedBlock of serializationObject.allBlocks) {\n for (let i = 0; i < serializationObject.allBlocks.length; i++) {\n const serializedBlock = serializationObject.allBlocks[i];\n const block = ParseFlowGraphBlockWithClassType(\n serializedBlock,\n { scene: options.coordinator.config.scene, pathConverter: options.pathConverter, assetsContainer: options.coordinator.config.scene, valueParseFunction },\n resolvedClasses[i]\n );\n blocks.push(block);\n if (block instanceof FlowGraphEventBlock) {\n graph.addEventBlock(block);\n }\n }\n // After parsing all blocks, connect them\n for (const block of blocks) {\n for (const dataIn of block.dataInputs) {\n for (const serializedConnection of dataIn.connectedPointIds) {\n const connection = GetDataOutConnectionByUniqueId(blocks, serializedConnection);\n dataIn.connectTo(connection);\n }\n }\n if (block instanceof FlowGraphExecutionBlock) {\n for (const signalOut of block.signalOutputs) {\n for (const serializedConnection of signalOut.connectedPointIds) {\n const connection = GetSignalInConnectionByUniqueId(blocks, serializedConnection);\n signalOut.connectTo(connection);\n }\n }\n }\n }\n for (const serializedContext of serializationObject.executionContexts) {\n ParseFlowGraphContext(serializedContext, { graph, valueParseFunction }, serializationObject.rightHanded);\n }\n return graph;\n}\n\n/**\n * Parses a context\n * @param serializationObject the object containing the context serialization values\n * @param options the options for parsing the context\n * @param rightHanded whether the serialized data is right handed\n * @returns\n */\nexport function ParseFlowGraphContext(serializationObject: ISerializedFlowGraphContext, options: IFlowGraphContextParseOptions, rightHanded?: boolean): FlowGraphContext {\n const result = options.graph.createContext();\n if (serializationObject.enableLogging) {\n result.enableLogging = true;\n }\n result.treatDataAsRightHanded = rightHanded || false;\n const valueParseFunction = options.valueParseFunction ?? defaultValueParseFunction;\n result.uniqueId = serializationObject.uniqueId;\n const scene = result.getScene();\n // check if assets context is available\n if (serializationObject._assetsContext) {\n const ac = serializationObject._assetsContext;\n const assetsContext: IAssetContainer = {\n meshes: ac.meshes?.map((m: string) => scene.getMeshById(m)),\n lights: ac.lights?.map((l: string) => scene.getLightByName(l)),\n cameras: ac.cameras?.map((c: string) => scene.getCameraByName(c)),\n materials: ac.materials?.map((m: string) => scene.getMaterialById(m)),\n textures: ac.textures?.map((t: string) => scene.getTextureByName(t)),\n animations: ac.animations?.map((a: string) => scene.animations.find((anim) => anim.name === a)),\n skeletons: ac.skeletons?.map((s: string) => scene.getSkeletonByName(s)),\n particleSystems: ac.particleSystems?.map((ps: string) => scene.getParticleSystemById(ps)),\n animationGroups: ac.animationGroups?.map((ag: string) => scene.getAnimationGroupByName(ag)),\n transformNodes: ac.transformNodes?.map((tn: string) => scene.getTransformNodeById(tn)),\n rootNodes: [],\n multiMaterials: [],\n morphTargetManagers: [],\n geometries: [],\n actionManagers: [],\n environmentTexture: null,\n postProcesses: [],\n sounds: null,\n effectLayers: [],\n layers: [],\n reflectionProbes: [],\n lensFlareSystems: [],\n proceduralTextures: [],\n getNodes: function (): Array<Node> {\n throw new Error(\"Function not implemented.\");\n },\n };\n result.assetsContext = assetsContext;\n }\n for (const key in serializationObject._userVariables) {\n const value = valueParseFunction(key, serializationObject._userVariables, result.assetsContext, scene);\n result.userVariables[key] = value;\n }\n for (const key in serializationObject._connectionValues) {\n const value = valueParseFunction(key, serializationObject._connectionValues, result.assetsContext, scene);\n result._setConnectionValueByKey(key, value);\n }\n\n return result;\n}\n\n/**\n * Parses a block from a serialization object\n * This function is async due to the factory method that is used to create the block's class. If you load the class externally use ParseBlockWithClassType\n * @param serializationObject the object to parse from\n * @param parseOptions options for parsing the block\n * @returns the parsed block\n */\nexport async function ParseBlockAsync(serializationObject: ISerializedFlowGraphBlock, parseOptions: IFlowGraphBlockParseOptions): Promise<FlowGraphBlock> {\n const classFactory = blockFactory(serializationObject.className as FlowGraphBlockNames);\n const classType = await classFactory();\n return ParseFlowGraphBlockWithClassType(serializationObject, parseOptions, classType);\n}\n\n/**\n * Parses a block from a serialization object\n * @param serializationObject the object to parse from\n * @param parseOptions options for parsing the block\n * @param classType the class type of the block. This is used when the class is not loaded asynchronously\n * @returns the parsed block\n */\nexport function ParseFlowGraphBlockWithClassType(\n serializationObject: ISerializedFlowGraphBlock,\n parseOptions: IFlowGraphBlockParseOptions,\n classType: typeof FlowGraphBlock\n): FlowGraphBlock {\n const parsedConfig: any = {};\n const valueParseFunction = parseOptions.valueParseFunction ?? defaultValueParseFunction;\n if (serializationObject.config) {\n for (const key in serializationObject.config) {\n parsedConfig[key] = valueParseFunction(key, serializationObject.config, parseOptions.assetsContainer || parseOptions.scene, parseOptions.scene);\n }\n }\n if (needsPathConverter(serializationObject.className)) {\n if (!parseOptions.pathConverter) {\n throw new Error(\"Path converter is required for this block\");\n }\n parsedConfig.pathConverter = parseOptions.pathConverter;\n }\n const obj = new classType(parsedConfig);\n obj.uniqueId = serializationObject.uniqueId;\n for (let i = 0; i < serializationObject.dataInputs.length; i++) {\n const dataInput = obj.getDataInput(serializationObject.dataInputs[i].name);\n if (dataInput) {\n dataInput.deserialize(serializationObject.dataInputs[i]);\n } else {\n throw new Error(\"Could not find data input with name \" + serializationObject.dataInputs[i].name + \" in block \" + serializationObject.className);\n }\n }\n for (let i = 0; i < serializationObject.dataOutputs.length; i++) {\n const dataOutput = obj.getDataOutput(serializationObject.dataOutputs[i].name);\n if (dataOutput) {\n dataOutput.deserialize(serializationObject.dataOutputs[i]);\n } else {\n throw new Error(\"Could not find data output with name \" + serializationObject.dataOutputs[i].name + \" in block \" + serializationObject.className);\n }\n }\n obj.metadata = serializationObject.metadata;\n obj.deserialize && obj.deserialize(serializationObject);\n return obj;\n}\n\n/**\n * Parses a connection from an object\n * @param serializationObject the object to parse from.\n * @param ownerBlock the block that owns the connection.\n * @param classType the class type of the connection.\n * @returns the parsed connection.\n */\nexport function ParseGraphConnectionWithClassType<BlockT extends FlowGraphBlock>(serializationObject: any = {}, ownerBlock: BlockT, classType: typeof FlowGraphConnection) {\n const connection = new classType(serializationObject.name, serializationObject._connectionType, ownerBlock);\n connection.deserialize(serializationObject);\n return connection;\n}\n\n/**\n * Parses a data connection from a serialized object.\n * @param serializationObject the object to parse from\n * @param ownerBlock the block that owns the connection\n * @param classType the class type of the data connection\n * @returns the parsed connection\n */\nexport function ParseGraphDataConnection(serializationObject: any, ownerBlock: FlowGraphBlock, classType: typeof FlowGraphDataConnection): FlowGraphDataConnection<any> {\n const richType = ParseRichType(serializationObject.richType);\n const defaultValue = serializationObject.defaultValue;\n const connection = new classType(serializationObject.name, serializationObject._connectionType, ownerBlock, richType, defaultValue, !!serializationObject._optional);\n connection.deserialize(serializationObject);\n return connection;\n}\n\n/**\n * Parses a rich type from a serialization object.\n * @param serializationObject a serialization object\n * @returns the parsed rich type\n */\nfunction ParseRichType(serializationObject: any): RichType<any> {\n return new RichType(serializationObject.typeName, serializationObject.defaultValue);\n}\n"]}
@@ -2,7 +2,7 @@ import type { FlowGraphContext } from "./flowGraphContext";
2
2
  import type { IPathToObjectConverter, IObjectInfo } from "../ObjectModel/objectModelInterfaces";
3
3
  import type { IObjectAccessor } from "./typeDefinitions";
4
4
  /**
5
- * @experimental
5
+ * @deprecated Avoid using this on the flow-graph (glTF only)
6
6
  * A path converter that converts a path on the flow graph context variables to an object accessor.
7
7
  */
8
8
  export declare class FlowGraphPathConverter implements IPathToObjectConverter<IObjectAccessor> {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @experimental
2
+ * @deprecated Avoid using this on the flow-graph (glTF only)
3
3
  * A path converter that converts a path on the flow graph context variables to an object accessor.
4
4
  */
5
5
  export class FlowGraphPathConverter {
@@ -23,7 +23,8 @@ export class FlowGraphPathConverter {
23
23
  type: "object",
24
24
  get: () => currentObject[property],
25
25
  set: (value) => (currentObject[property] = value),
26
- getObject: () => currentObject,
26
+ getTarget: () => currentObject,
27
+ getPropertyName: [() => property],
27
28
  },
28
29
  };
29
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphPathConverter.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphPathConverter.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,OAAO,sBAAsB;IAC/B,YACY,QAA0B,EAC1B,aAAqB,GAAG;QADxB,aAAQ,GAAR,QAAQ,CAAkB;QAC1B,eAAU,GAAV,UAAU,CAAc;IACjC,CAAC;IAEG,OAAO,CAAC,IAAY;QACvB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1C,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,aAAa,CAAC,CAAC;QAC/C,CAAC;QACD,IAAI,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACxD,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YACxC,aAAa,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO;YACH,MAAM,EAAE,aAAa;YACrB,IAAI,EAAE;gBACF,IAAI,EAAE,QAAQ;gBACd,GAAG,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC;gBAClC,GAAG,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC;gBACtD,SAAS,EAAE,GAAG,EAAE,CAAC,aAAa;aACjC;SACJ,CAAC;IACN,CAAC;CACJ","sourcesContent":["import type { FlowGraphContext } from \"./flowGraphContext\";\r\nimport type { IPathToObjectConverter, IObjectInfo } from \"../ObjectModel/objectModelInterfaces\";\r\nimport type { IObjectAccessor } from \"./typeDefinitions\";\r\n\r\n/**\r\n * @experimental\r\n * A path converter that converts a path on the flow graph context variables to an object accessor.\r\n */\r\nexport class FlowGraphPathConverter implements IPathToObjectConverter<IObjectAccessor> {\r\n public constructor(\r\n private _context: FlowGraphContext,\r\n private _separator: string = \"/\"\r\n ) {}\r\n\r\n public convert(path: string): IObjectInfo<IObjectAccessor> {\r\n const parts = path.split(this._separator);\r\n if (parts.length < 2) {\r\n throw new Error(`Path ${path} is invalid`);\r\n }\r\n let currentObject = this._context.getVariable(parts[0]);\r\n const property = parts[parts.length - 1];\r\n for (let i = 1; i < parts.length - 1; i++) {\r\n currentObject = currentObject[parts[i]];\r\n }\r\n return {\r\n object: currentObject,\r\n info: {\r\n type: \"object\",\r\n get: () => currentObject[property],\r\n set: (value: any) => (currentObject[property] = value),\r\n getObject: () => currentObject,\r\n },\r\n };\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"flowGraphPathConverter.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphPathConverter.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,OAAO,sBAAsB;IAC/B,YACY,QAA0B,EAC1B,aAAqB,GAAG;QADxB,aAAQ,GAAR,QAAQ,CAAkB;QAC1B,eAAU,GAAV,UAAU,CAAc;IACjC,CAAC;IAEG,OAAO,CAAC,IAAY;QACvB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1C,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,aAAa,CAAC,CAAC;QAC/C,CAAC;QACD,IAAI,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACxD,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YACxC,aAAa,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO;YACH,MAAM,EAAE,aAAa;YACrB,IAAI,EAAE;gBACF,IAAI,EAAE,QAAQ;gBACd,GAAG,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC;gBAClC,GAAG,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC;gBACtD,SAAS,EAAE,GAAG,EAAE,CAAC,aAAa;gBAC9B,eAAe,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC;aACpC;SACJ,CAAC;IACN,CAAC;CACJ","sourcesContent":["import type { FlowGraphContext } from \"./flowGraphContext\";\r\nimport type { IPathToObjectConverter, IObjectInfo } from \"../ObjectModel/objectModelInterfaces\";\r\nimport type { IObjectAccessor } from \"./typeDefinitions\";\r\n\r\n/**\r\n * @deprecated Avoid using this on the flow-graph (glTF only)\r\n * A path converter that converts a path on the flow graph context variables to an object accessor.\r\n */\r\nexport class FlowGraphPathConverter implements IPathToObjectConverter<IObjectAccessor> {\r\n public constructor(\r\n private _context: FlowGraphContext,\r\n private _separator: string = \"/\"\r\n ) {}\r\n\r\n public convert(path: string): IObjectInfo<IObjectAccessor> {\r\n const parts = path.split(this._separator);\r\n if (parts.length < 2) {\r\n throw new Error(`Path ${path} is invalid`);\r\n }\r\n let currentObject = this._context.getVariable(parts[0]);\r\n const property = parts[parts.length - 1];\r\n for (let i = 1; i < parts.length - 1; i++) {\r\n currentObject = currentObject[parts[i]];\r\n }\r\n return {\r\n object: currentObject,\r\n info: {\r\n type: \"object\",\r\n get: () => currentObject[property],\r\n set: (value: any) => (currentObject[property] = value),\r\n getTarget: () => currentObject,\r\n getPropertyName: [() => property],\r\n },\r\n };\r\n }\r\n}\r\n"]}
@@ -2,7 +2,7 @@ import type { IObjectInfo, IPathToObjectConverter } from "../ObjectModel/objectM
2
2
  import type { FlowGraphBlock } from "./flowGraphBlock";
3
3
  import type { FlowGraphContext } from "./flowGraphContext";
4
4
  import type { FlowGraphDataConnection } from "./flowGraphDataConnection";
5
- import type { FlowGraphInteger } from "./flowGraphInteger";
5
+ import { FlowGraphInteger } from "./CustomTypes/flowGraphInteger";
6
6
  import type { IObjectAccessor } from "./typeDefinitions";
7
7
  /**
8
8
  * @experimental
@@ -16,5 +16,12 @@ export declare class FlowGraphPathConverterComponent {
16
16
  */
17
17
  readonly templatedInputs: FlowGraphDataConnection<FlowGraphInteger>[];
18
18
  constructor(path: string, ownerBlock: FlowGraphBlock);
19
+ /**
20
+ * Get the accessor for the path.
21
+ * @param pathConverter the path converter to use to convert the path to an object accessor.
22
+ * @param context the context to use.
23
+ * @returns the accessor for the path.
24
+ * @throws if the value for a templated input is invalid.
25
+ */
19
26
  getAccessor(pathConverter: IPathToObjectConverter<IObjectAccessor>, context: FlowGraphContext): IObjectInfo<IObjectAccessor>;
20
27
  }