@onerjs/core 9.0.0 → 9.0.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.
- package/Animations/animationGroup.pure.js.map +1 -1
- package/Cameras/targetCamera.pure.js +6 -1
- package/Cameras/targetCamera.pure.js.map +1 -1
- package/Engines/Native/nativeHardwareTexture.d.ts +8 -1
- package/Engines/Native/nativeHardwareTexture.js +7 -0
- package/Engines/Native/nativeHardwareTexture.js.map +1 -1
- package/Engines/Native/nativeHelpers.js +56 -1
- package/Engines/Native/nativeHelpers.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +37 -8
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/Native/nativeRenderTargetWrapper.d.ts +40 -0
- package/Engines/Native/nativeRenderTargetWrapper.js +265 -5
- package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
- package/Engines/Processors/shaderCodeCursor.d.ts +1 -0
- package/Engines/Processors/shaderCodeCursor.js +40 -3
- package/Engines/Processors/shaderCodeCursor.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.pure.js +1 -0
- package/Engines/WebGPU/Extensions/engine.renderTarget.pure.js.map +1 -1
- package/Engines/abstractEngine.pure.d.ts +15 -1
- package/Engines/abstractEngine.pure.js +12 -4
- package/Engines/abstractEngine.pure.js.map +1 -1
- package/Engines/engine.pure.d.ts +0 -1
- package/Engines/engine.pure.js +0 -7
- package/Engines/engine.pure.js.map +1 -1
- package/Engines/nativeEngine.pure.js +1 -1
- package/Engines/nativeEngine.pure.js.map +1 -1
- package/Engines/thinEngine.pure.d.ts +1 -0
- package/Engines/thinEngine.pure.js +13 -2
- package/Engines/thinEngine.pure.js.map +1 -1
- package/Engines/thinNativeEngine.pure.d.ts +217 -17
- package/Engines/thinNativeEngine.pure.js +1431 -164
- package/Engines/thinNativeEngine.pure.js.map +1 -1
- package/Engines/thinWebGPUEngine.js +6 -1
- package/Engines/thinWebGPUEngine.js.map +1 -1
- package/Engines/webgpuEngine.pure.d.ts +12 -1
- package/Engines/webgpuEngine.pure.js +8 -0
- package/Engines/webgpuEngine.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.d.ts +10 -0
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.js +24 -12
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.d.ts +7 -0
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.js +43 -0
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.d.ts +16 -4
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js +20 -6
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.js +3 -3
- package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.d.ts +7 -7
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js +52 -35
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.d.ts +12 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js +8 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.pure.js +4 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.d.ts +12 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.js +5 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.js +14 -2
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.d.ts +5 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.js +23 -8
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.js.map +1 -1
- package/FlowGraph/CustomTypes/flowGraphInteger.pure.d.ts +5 -0
- package/FlowGraph/CustomTypes/flowGraphInteger.pure.js +7 -0
- package/FlowGraph/CustomTypes/flowGraphInteger.pure.js.map +1 -1
- package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +10 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js +14 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +2 -1
- package/FlowGraph/flowGraph.js +3 -2
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphAnimationHelpers.d.ts +24 -0
- package/FlowGraph/flowGraphAnimationHelpers.js +21 -0
- package/FlowGraph/flowGraphAnimationHelpers.js.map +1 -0
- package/FlowGraph/flowGraphContext.js +1 -0
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphValidator.js +0 -4
- package/FlowGraph/flowGraphValidator.js.map +1 -1
- package/FlowGraph/index.d.ts +2 -0
- package/FlowGraph/index.js +2 -0
- package/FlowGraph/index.js.map +1 -1
- package/FlowGraph/pure.d.ts +2 -0
- package/FlowGraph/pure.js +2 -0
- package/FlowGraph/pure.js.map +1 -1
- package/FlowGraph/serialization.d.ts +2 -2
- package/FlowGraph/serialization.js +2 -2
- package/FlowGraph/serialization.js.map +1 -1
- package/FlowGraph/typeDefinitions.d.ts +1 -1
- package/FlowGraph/typeDefinitions.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.d.ts +1 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.js +4 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.d.ts +54 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.js +155 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/pure.d.ts +1 -0
- package/FrameGraph/Node/Blocks/Textures/pure.js +1 -0
- package/FrameGraph/Node/Blocks/Textures/pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/allBlocks.pure.js +2 -0
- package/FrameGraph/Node/Blocks/allBlocks.pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/index.d.ts +1 -0
- package/FrameGraph/Node/Blocks/index.js +1 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Node/Blocks/pure.d.ts +1 -0
- package/FrameGraph/Node/Blocks/pure.js +1 -0
- package/FrameGraph/Node/Blocks/pure.js.map +1 -1
- package/FrameGraph/Tasks/Misc/minMaxReducerTask.d.ts +62 -0
- package/FrameGraph/Tasks/Misc/minMaxReducerTask.js +159 -0
- package/FrameGraph/Tasks/Misc/minMaxReducerTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +3 -1
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
- package/FrameGraph/frameGraph.d.ts +4 -0
- package/FrameGraph/frameGraph.js +14 -0
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/index.d.ts +1 -0
- package/FrameGraph/index.js +1 -0
- package/FrameGraph/index.js.map +1 -1
- package/FrameGraph/pure.d.ts +1 -0
- package/FrameGraph/pure.js +1 -0
- package/FrameGraph/pure.js.map +1 -1
- package/Inputs/scene.inputManager.js +1 -1
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Lights/Clustered/clusteredLightingSceneComponent.pure.d.ts +5 -0
- package/Lights/Clustered/clusteredLightingSceneComponent.pure.js +22 -1
- package/Lights/Clustered/clusteredLightingSceneComponent.pure.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.pure.js +7 -3
- package/Lights/Shadows/cascadedShadowGenerator.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.d.ts +7 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.js +8 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.d.ts +54 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.js +81 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.d.ts +7 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.js +8 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.d.ts +60 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.js +90 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.d.ts +31 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js +98 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +2 -2
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.d.ts +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.js +4 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.d.ts +83 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.js +191 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.d.ts +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.js +4 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.d.ts +62 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.js +125 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.js.map +1 -0
- package/Materials/GaussianSplatting/pure.d.ts +4 -0
- package/Materials/GaussianSplatting/pure.js +4 -0
- package/Materials/GaussianSplatting/pure.js.map +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.d.ts +1 -0
- package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js +12 -0
- package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.pure.d.ts +1 -0
- package/Materials/Textures/Procedurals/proceduralTexture.pure.js +31 -7
- package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
- package/Materials/Textures/mirrorTexture.pure.js +3 -1
- package/Materials/Textures/mirrorTexture.pure.js.map +1 -1
- package/Materials/Textures/texture.pure.js +8 -2
- package/Materials/Textures/texture.pure.js.map +1 -1
- package/Materials/effectRenderer.pure.d.ts +4 -0
- package/Materials/effectRenderer.pure.js +3 -2
- package/Materials/effectRenderer.pure.js.map +1 -1
- package/Materials/index.d.ts +4 -0
- package/Materials/index.js +4 -0
- package/Materials/index.js.map +1 -1
- package/Materials/material.pure.js +25 -12
- package/Materials/material.pure.js.map +1 -1
- package/Materials/pure.d.ts +4 -0
- package/Materials/pure.js +4 -0
- package/Materials/pure.js.map +1 -1
- package/Materials/standardMaterial.pure.d.ts +8 -0
- package/Materials/standardMaterial.pure.js +24 -2
- package/Materials/standardMaterial.pure.js.map +1 -1
- package/Meshes/Builders/polygonBuilder.pure.js +1 -1
- package/Meshes/Builders/polygonBuilder.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.d.ts +8 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.js +11 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.d.ts +231 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.js +1212 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.d.ts +14 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.js +15 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.d.ts +285 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.js +812 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +2 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +160 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +219 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +32 -4
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +114 -21
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/pure.d.ts +2 -0
- package/Meshes/GaussianSplatting/pure.js +2 -0
- package/Meshes/GaussianSplatting/pure.js.map +1 -1
- package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js +25 -11
- package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js.map +1 -1
- package/Meshes/abstractMesh.pure.d.ts +12 -0
- package/Meshes/abstractMesh.pure.js +32 -0
- package/Meshes/abstractMesh.pure.js.map +1 -1
- package/Meshes/index.d.ts +1 -0
- package/Meshes/index.js +1 -0
- package/Meshes/index.js.map +1 -1
- package/Meshes/pure.d.ts +1 -0
- package/Meshes/pure.js +1 -0
- package/Meshes/pure.js.map +1 -1
- package/Meshes/subMesh.pure.d.ts +11 -2
- package/Meshes/subMesh.pure.js +20 -5
- package/Meshes/subMesh.pure.js.map +1 -1
- package/Meshes/thinInstanceMesh.pure.js +1 -0
- package/Meshes/thinInstanceMesh.pure.js.map +1 -1
- package/Misc/andOrNotEvaluator.js +4 -0
- package/Misc/andOrNotEvaluator.js.map +1 -1
- package/Misc/minMaxReducer.pure.d.ts +6 -0
- package/Misc/minMaxReducer.pure.js +10 -0
- package/Misc/minMaxReducer.pure.js.map +1 -1
- package/Misc/thinMinMaxReducer.d.ts +19 -2
- package/Misc/thinMinMaxReducer.js +74 -21
- package/Misc/thinMinMaxReducer.js.map +1 -1
- package/Misc/tools.pure.js +1 -1
- package/Misc/tools.pure.js.map +1 -1
- package/Particles/Node/Blocks/Update/updateNoiseBlock.pure.js +19 -7
- package/Particles/Node/Blocks/Update/updateNoiseBlock.pure.js.map +1 -1
- package/Particles/Node/Blocks/particleSourceTextureBlock.pure.js +3 -2
- package/Particles/Node/Blocks/particleSourceTextureBlock.pure.js.map +1 -1
- package/Particles/gpuParticleSystem.pure.d.ts +2 -0
- package/Particles/gpuParticleSystem.pure.js +12 -4
- package/Particles/gpuParticleSystem.pure.js.map +1 -1
- package/Particles/particle.js +3 -2
- package/Particles/particle.js.map +1 -1
- package/Particles/solidParticleSystem.js +7 -1
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.function.d.ts +6 -0
- package/Particles/thinParticleSystem.function.js +144 -88
- package/Particles/thinParticleSystem.function.js.map +1 -1
- package/Particles/thinParticleSystem.pure.d.ts +6 -0
- package/Particles/thinParticleSystem.pure.js +70 -9
- package/Particles/thinParticleSystem.pure.js.map +1 -1
- package/Physics/v2/ragdoll.d.ts +2 -4
- package/Physics/v2/ragdoll.js +11 -4
- package/Physics/v2/ragdoll.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.d.ts +12 -0
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +43 -18
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
- package/Rendering/depthRenderer.pure.d.ts +9 -0
- package/Rendering/depthRenderer.pure.js +12 -0
- package/Rendering/depthRenderer.pure.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +4 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js +6 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +4 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +8 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +3 -0
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.pure.js +4 -1
- package/Rendering/geometryBufferRenderer.pure.js.map +1 -1
- package/Rendering/objectRenderer.js.map +1 -1
- package/Rendering/prePassRenderer.pure.js +3 -3
- package/Rendering/prePassRenderer.pure.js.map +1 -1
- package/Shaders/ShadersInclude/gaussianSplatting.js +3 -1
- package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js +27 -3
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/oitDeclaration.js +1 -1
- package/Shaders/ShadersInclude/oitDeclaration.js.map +1 -1
- package/Shaders/minmaxRedux.fragment.js +6 -1
- package/Shaders/minmaxRedux.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.js +65 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.js +17 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +6 -78
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js +2 -2
- package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.js +79 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js +27 -3
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/ShadersWGSL/gaussianPointSplattingBlit.fragment.d.ts +5 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.fragment.js +22 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.fragment.js.map +1 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.vertex.d.ts +5 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.vertex.js +19 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.vertex.js.map +1 -0
- package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.d.ts +5 -0
- package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.js +21 -0
- package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.js.map +1 -0
- package/ShadersWGSL/gaussianSplatting.vertex.js +2 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianSplattingDepth.vertex.js +2 -1
- package/ShadersWGSL/gaussianSplattingDepth.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianSplattingVoxel.vertex.js +2 -1
- package/ShadersWGSL/gaussianSplattingVoxel.vertex.js.map +1 -1
- package/ShadersWGSL/gpsHiZBuild.compute.d.ts +5 -0
- package/ShadersWGSL/gpsHiZBuild.compute.js +16 -0
- package/ShadersWGSL/gpsHiZBuild.compute.js.map +1 -0
- package/ShadersWGSL/gpsPartition.compute.d.ts +5 -0
- package/ShadersWGSL/gpsPartition.compute.js +27 -0
- package/ShadersWGSL/gpsPartition.compute.js.map +1 -0
- package/ShadersWGSL/gpsPreprocess.compute.d.ts +5 -0
- package/ShadersWGSL/gpsPreprocess.compute.js +86 -0
- package/ShadersWGSL/gpsPreprocess.compute.js.map +1 -0
- package/ShadersWGSL/gpsResolve.compute.d.ts +5 -0
- package/ShadersWGSL/gpsResolve.compute.js +41 -0
- package/ShadersWGSL/gpsResolve.compute.js.map +1 -0
- package/ShadersWGSL/gpsScanAdd.compute.d.ts +5 -0
- package/ShadersWGSL/gpsScanAdd.compute.js +22 -0
- package/ShadersWGSL/gpsScanAdd.compute.js.map +1 -0
- package/ShadersWGSL/gpsScanBlocks.compute.d.ts +5 -0
- package/ShadersWGSL/gpsScanBlocks.compute.js +23 -0
- package/ShadersWGSL/gpsScanBlocks.compute.js.map +1 -0
- package/ShadersWGSL/gpsScanSums.compute.d.ts +5 -0
- package/ShadersWGSL/gpsScanSums.compute.js +30 -0
- package/ShadersWGSL/gpsScanSums.compute.js.map +1 -0
- package/ShadersWGSL/gpsSplat.compute.d.ts +5 -0
- package/ShadersWGSL/gpsSplat.compute.js +37 -0
- package/ShadersWGSL/gpsSplat.compute.js.map +1 -0
- package/ShadersWGSL/minmaxRedux.fragment.js +20 -3
- package/ShadersWGSL/minmaxRedux.fragment.js.map +1 -1
- package/XR/features/WebXRSpaceWarp.pure.js +2 -1
- package/XR/features/WebXRSpaceWarp.pure.js.map +1 -1
- package/assetContainer.d.ts +1 -0
- package/assetContainer.js +5 -1
- package/assetContainer.js.map +1 -1
- package/package.json +1 -1
- package/scene.pure.d.ts +13 -2
- package/scene.pure.js +28 -4
- package/scene.pure.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraph.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAI/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAM9E,OAAO,EAA+B,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAE/G,OAAO,EAAE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;IACK,sBAAsB,CAAC,gBAAsB;QACjD,MAAM,YAAY,GAAQ;YACtB,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,IAAI,CAAC,MAAM;YACtB,uFAAuF;YACvF,sFAAsF;YACtF,4CAA4C;YAC5C,iBAAiB,EAAE,IAAI;YACvB,GAAG,gBAAgB;SACtB,CAAC;QACF,IAAI,CAAC,mBAAmB,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAChE,CAAC;;AAloBD;;GAEG;AACW,mBAAS,GAAG,GAAG,KAAK,CAAC,cAAc,KAAK,cAAc,CAAC,OAAO,6CAA6C,AAAlG,CAAmG","sourcesContent":["import { type Observer, Observable } from \"../Misc/observable\";\r\nimport { type Nullable } from \"../types\";\r\nimport { type Scene } from \"../scene\";\r\nimport { type FlowGraphEventBlock } from \"./flowGraphEventBlock\";\r\nimport { FlowGraphContext } from \"./flowGraphContext\";\r\nimport { type FlowGraphBlock } from \"./flowGraphBlock\";\r\nimport { FlowGraphExecutionBlock } from \"./flowGraphExecutionBlock\";\r\nimport { FlowGraphAsyncExecutionBlock } from \"./flowGraphAsyncExecutionBlock\";\r\nimport { type FlowGraphCoordinator } from \"./flowGraphCoordinator\";\r\nimport { type IObjectAccessor } from \"./typeDefinitions\";\r\nimport { type IPathToObjectConverter } from \"../ObjectModel/objectModelInterfaces\";\r\nimport { type IAssetContainer } from \"core/IAssetContainer\";\r\nimport { FlowGraphEventType } from \"./flowGraphEventType\";\r\nimport { type IFlowGraphEventTrigger, FlowGraphSceneEventCoordinator } from \"./flowGraphSceneEventCoordinator\";\r\nimport { type FlowGraphMeshPickEventBlock } from \"./Blocks/Event/flowGraphMeshPickEventBlock\";\r\nimport { _IsDescendantOf } from \"./utils\";\r\nimport { type IFlowGraphValidationResult, ValidateFlowGraphWithBlockList } from \"./flowGraphValidator\";\r\nimport { RandomGUID } from \"../Misc/guid\";\r\nimport { Tools } from \"../Misc/tools.pure\";\r\nimport { AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport { type AbstractMesh } from \"../Meshes/abstractMesh.pure\";\r\n\r\n// UMD global names for the flow graph editor bundle (mirrors nodeGeometry.ts / nodeRenderGraph.ts).\r\ndeclare let FLOWGRAPHEDITOR: any;\r\ndeclare let BABYLON: any;\r\n\r\n/**\r\n * Interface used to configure the launch of the flow graph editor.\r\n */\r\nexport interface IFlowGraphEditorLaunchOptions {\r\n /** Define the URL to load the flow graph editor script from */\r\n editorURL?: string;\r\n /** Additional configuration forwarded to `FlowGraphEditor.Show()` (e.g. hostScene, hostElement) */\r\n flowGraphEditorConfig?: {\r\n hostScene?: Scene;\r\n hostElement?: HTMLElement;\r\n attachToLiveScene?: boolean;\r\n };\r\n}\r\n\r\nexport const enum FlowGraphState {\r\n /**\r\n * The graph is stopped\r\n */\r\n Stopped,\r\n /**\r\n * The graph is running\r\n */\r\n Started,\r\n /**\r\n * The graph is paused (contexts kept, pending tasks cancelled)\r\n */\r\n Paused,\r\n}\r\n\r\n/**\r\n * Parameters used to create a flow graph.\r\n */\r\nexport interface IFlowGraphParams {\r\n /**\r\n * The scene that the flow graph belongs to.\r\n */\r\n scene: Scene;\r\n /**\r\n * The event coordinator used by the flow graph.\r\n */\r\n coordinator: FlowGraphCoordinator;\r\n /**\r\n * Optional human-readable name for the graph.\r\n * Defaults to \"Graph\" if not provided.\r\n */\r\n name?: string;\r\n /**\r\n * Optional unique identifier for the graph.\r\n * If not provided, a random UUID is generated.\r\n */\r\n uniqueId?: string;\r\n}\r\n\r\n/**\r\n * Options for parsing a flow graph.\r\n */\r\nexport interface IFlowGraphParseOptions {\r\n /**\r\n * A function that parses complex values in a scene.\r\n * @param key the key of the value\r\n * @param serializationObject the object to read the value from\r\n * @param assetsContainer the assets container to read assets from\r\n * @param scene the scene to read the value from\r\n */\r\n valueParseFunction?: (key: string, serializationObject: any, assetsContainer: IAssetContainer, scene: Scene) => any;\r\n /**\r\n * The flow graph coordinator.\r\n */\r\n coordinator: FlowGraphCoordinator;\r\n /**\r\n * A function that converts a path to an object accessor.\r\n */\r\n pathConverter?: IPathToObjectConverter<IObjectAccessor>;\r\n}\r\n/**\r\n * Class used to represent a flow graph.\r\n * A flow graph is a graph of blocks that can be used to create complex logic.\r\n * Blocks can be added to the graph and connected to each other.\r\n * The graph can then be started, which will init and start all of its event blocks.\r\n *\r\n * @experimental FlowGraph is still in development and is subject to change.\r\n */\r\nexport class FlowGraph {\r\n /**\r\n * A human-readable name for this graph.\r\n */\r\n public name: string;\r\n\r\n /**\r\n * A unique identifier for this graph. Auto-generated if not provided.\r\n */\r\n public uniqueId: string;\r\n\r\n /**\r\n * Optional host-format metadata associated with this graph.\r\n */\r\n public metadata?: any;\r\n\r\n /**\r\n * Define the URL to load the flow graph editor script from.\r\n */\r\n public static EditorURL = `${Tools._DefaultCdnUrl}/v${AbstractEngine.Version}/flowGraphEditor/babylon.flowGraphEditor.js`;\r\n\r\n private _BJSFLOWGRAPHEDITOR = this._getGlobalFlowGraphEditor();\r\n\r\n /** @returns the flow graph editor from a UMD bundle or the BABYLON global, or undefined if not loaded */\r\n private _getGlobalFlowGraphEditor(): any {\r\n // UMD global name detection from bundle metadata. rollup-built UMD bundles may expose the\r\n // editor class on `.default.FlowGraphEditor`, so unwrap that case before falling back to\r\n // the BABYLON global emitted from the editor entry point.\r\n if (typeof FLOWGRAPHEDITOR !== \"undefined\") {\r\n if ((FLOWGRAPHEDITOR as any).FlowGraphEditor) {\r\n return FLOWGRAPHEDITOR;\r\n }\r\n if ((FLOWGRAPHEDITOR as any).default?.FlowGraphEditor) {\r\n return (FLOWGRAPHEDITOR as any).default;\r\n }\r\n }\r\n\r\n if (typeof BABYLON !== \"undefined\" && typeof BABYLON.FlowGraphEditor !== \"undefined\") {\r\n return BABYLON;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * An observable that is triggered when the state of the graph changes.\r\n */\r\n public onStateChangedObservable: Observable<FlowGraphState> = new Observable();\r\n /** @internal */\r\n public _eventBlocks: { [keyof in FlowGraphEventType]: FlowGraphEventBlock[] } = {\r\n [FlowGraphEventType.SceneReady]: [],\r\n [FlowGraphEventType.SceneDispose]: [],\r\n [FlowGraphEventType.SceneBeforeRender]: [],\r\n [FlowGraphEventType.MeshPick]: [],\r\n [FlowGraphEventType.PointerDown]: [],\r\n [FlowGraphEventType.PointerUp]: [],\r\n [FlowGraphEventType.PointerMove]: [],\r\n [FlowGraphEventType.PointerOver]: [],\r\n [FlowGraphEventType.PointerOut]: [],\r\n [FlowGraphEventType.KeyDown]: [],\r\n [FlowGraphEventType.KeyUp]: [],\r\n [FlowGraphEventType.SceneAfterRender]: [],\r\n [FlowGraphEventType.NoTrigger]: [],\r\n };\r\n\r\n /**\r\n * All blocks that belong to this graph, including unreachable ones.\r\n * @internal\r\n */\r\n public _allBlocks: FlowGraphBlock[] = [];\r\n /**\r\n * @internal\r\n */\r\n public readonly _scene: Scene;\r\n\r\n /**\r\n * The scene associated with this flow graph.\r\n */\r\n public get scene(): Scene {\r\n return this._scene;\r\n }\r\n private _coordinator: FlowGraphCoordinator;\r\n\r\n /**\r\n * The coordinator that owns this flow graph.\r\n */\r\n public get coordinator(): FlowGraphCoordinator {\r\n return this._coordinator;\r\n }\r\n private _executionContexts: FlowGraphContext[] = [];\r\n private _sceneEventCoordinator: FlowGraphSceneEventCoordinator;\r\n\r\n /**\r\n * The scene event coordinator for this graph.\r\n * Provides access to runtime event state such as currently pressed keys.\r\n */\r\n public get sceneEventCoordinator(): FlowGraphSceneEventCoordinator {\r\n return this._sceneEventCoordinator;\r\n }\r\n\r\n private _eventObserver: Nullable<Observer<IFlowGraphEventTrigger>>;\r\n\r\n /**\r\n * The state of the graph\r\n */\r\n private _state: FlowGraphState = FlowGraphState.Stopped;\r\n\r\n /**\r\n * The state of the graph\r\n */\r\n public get state() {\r\n return this._state;\r\n }\r\n\r\n /**\r\n * The state of the graph\r\n */\r\n public set state(value: FlowGraphState) {\r\n this._state = value;\r\n this.onStateChangedObservable.notifyObservers(value);\r\n }\r\n\r\n /**\r\n * Construct a Flow Graph\r\n * @param params construction parameters. currently only the scene\r\n */\r\n public constructor(params: IFlowGraphParams) {\r\n this._scene = params.scene;\r\n this._sceneEventCoordinator = new FlowGraphSceneEventCoordinator(this._scene);\r\n this._coordinator = params.coordinator;\r\n this.name = params.name ?? \"Graph\";\r\n this.uniqueId = params.uniqueId ?? RandomGUID();\r\n }\r\n\r\n private _attachEventObserver() {\r\n if (this._eventObserver) {\r\n return;\r\n }\r\n this._eventObserver = this._sceneEventCoordinator.onEventTriggeredObservable.add((event, eventState) => {\r\n if (event.type === FlowGraphEventType.SceneDispose) {\r\n this.dispose();\r\n return;\r\n }\r\n\r\n if (this.state !== FlowGraphState.Started) {\r\n return;\r\n }\r\n\r\n const propagationStops =\r\n event.type === FlowGraphEventType.MeshPick || event.type === FlowGraphEventType.PointerOver || event.type === FlowGraphEventType.PointerOut\r\n ? ([] as AbstractMesh[])\r\n : undefined;\r\n const payload = event.payload as { mesh?: AbstractMesh; pickInfo?: { pickedMesh?: AbstractMesh } } | undefined;\r\n const source = payload?.pickInfo?.pickedMesh ?? payload?.mesh;\r\n for (const context of this._executionContexts) {\r\n const order = this._getContextualOrder(event.type, context);\r\n for (const block of order) {\r\n const eventBlock = block as FlowGraphEventBlock & {\r\n _getReferencedMesh?: (context: FlowGraphContext) => AbstractMesh | undefined;\r\n };\r\n const target = eventBlock._getReferencedMesh?.(context);\r\n if (source && target && propagationStops?.some((stoppedTarget) => stoppedTarget !== target && _IsDescendantOf(source, target))) {\r\n continue;\r\n }\r\n const eventKey = eventBlock.eventKey;\r\n this._coordinator._beginEventDispatch(eventKey, eventState);\r\n let shouldContinue: boolean;\r\n let dispatch: ReturnType<FlowGraphCoordinator[\"_endEventDispatch\"]>;\r\n try {\r\n shouldContinue = block._executeEvent(context, event.payload);\r\n } finally {\r\n dispatch = this._coordinator._endEventDispatch();\r\n }\r\n if (dispatch?.propagationStopped && target) {\r\n propagationStops?.push(target);\r\n }\r\n if (eventState.skipNextObservers || !shouldContinue) {\r\n break;\r\n }\r\n }\r\n if (eventState.skipNextObservers) {\r\n break;\r\n }\r\n }\r\n // custom behavior(s) of specific events\r\n switch (event.type) {\r\n case FlowGraphEventType.SceneReady:\r\n this._sceneEventCoordinator.sceneReadyTriggered = true;\r\n break;\r\n case FlowGraphEventType.SceneBeforeRender:\r\n for (const context of this._executionContexts) {\r\n context._notifyOnTick(event.payload);\r\n }\r\n break;\r\n }\r\n });\r\n }\r\n\r\n private _detachEventObserver() {\r\n this._eventObserver?.remove();\r\n this._eventObserver = null;\r\n }\r\n\r\n /**\r\n * Sets a new scene for this flow graph, re-wiring all event listeners.\r\n * This is useful when the scene the flow graph should listen to changes\r\n * (e.g. when a new scene is loaded in an editor preview).\r\n * If the graph is currently running, it will be stopped first and must be\r\n * restarted manually after calling this method.\r\n * @param scene the new scene to attach to\r\n */\r\n public setScene(scene: Scene): void {\r\n if (scene === this._scene) {\r\n return;\r\n }\r\n if (this.state === FlowGraphState.Started) {\r\n this.stop();\r\n }\r\n // Tear down old event coordinator\r\n this._detachEventObserver();\r\n this._sceneEventCoordinator.dispose();\r\n // Clear execution contexts so start() creates fresh ones with the new scene.\r\n // NOTE: This intentionally discards user variables and connection values.\r\n // Callers that need to preserve them (e.g. the Flow Graph Editor) should\r\n // snapshot context state BEFORE calling setScene() and restore it in a\r\n // wrapped createContext() callback after start() re-creates contexts.\r\n this._executionContexts.length = 0;\r\n // Rebuild with the new scene\r\n (this as { _scene: Scene })._scene = scene;\r\n this._scene.constantlyUpdateMeshUnderPointer = true; // ensure pointer info is always up to date for event blocks that need it\r\n // Re-resolve node references (e.g. meshes targeted by Get/Set property blocks) against the\r\n // new scene. This is required when the graph was parsed before its scene was populated (for\r\n // example an editor that loads a graph from a snippet first and the referenced scene second):\r\n // the references would otherwise stay bound to nodes from the old/disposed scene.\r\n for (const block of this._allBlocks) {\r\n for (const input of block.dataInputs) {\r\n input._reresolveDefaultValueForScene(scene);\r\n }\r\n }\r\n this._sceneEventCoordinator = new FlowGraphSceneEventCoordinator(this._scene);\r\n // Pre-attach the event observer so that events from the new\r\n // coordinator are routed to the graph immediately. The handler\r\n // guards against processing events while the graph is stopped,\r\n // but having the observer in place ensures no events are lost\r\n // when start() is called shortly after.\r\n this._attachEventObserver();\r\n }\r\n\r\n /**\r\n * Create a context. A context represents one self contained execution for the graph, with its own variables.\r\n * @returns the context, where you can get and set variables\r\n */\r\n public createContext() {\r\n const context = new FlowGraphContext({ scene: this._scene, coordinator: this._coordinator, sceneEventCoordinator: this._sceneEventCoordinator });\r\n this._executionContexts.push(context);\r\n return context;\r\n }\r\n\r\n /**\r\n * Returns the execution context at a given index\r\n * @param index the index of the context\r\n * @returns the execution context at that index\r\n */\r\n public getContext(index: number) {\r\n return this._executionContexts[index];\r\n }\r\n\r\n /**\r\n * Returns the number of execution contexts currently attached to this graph.\r\n */\r\n public get contextCount(): number {\r\n return this._executionContexts.length;\r\n }\r\n\r\n /**\r\n * Remove an execution context by index. Any pending async blocks on\r\n * the context are cleared before removal.\r\n * @param index the index of the context to remove\r\n * @returns the removed context, or undefined if the index was out of range\r\n */\r\n public removeContext(index: number): FlowGraphContext | undefined {\r\n if (index < 0 || index >= this._executionContexts.length) {\r\n return undefined;\r\n }\r\n const [removed] = this._executionContexts.splice(index, 1);\r\n removed._clearPendingBlocks();\r\n return removed;\r\n }\r\n\r\n /**\r\n * Returns all blocks registered in this graph, including disconnected ones.\r\n * @returns a read-only array of all blocks\r\n */\r\n public getAllBlocks(): readonly FlowGraphBlock[] {\r\n return this._allBlocks;\r\n }\r\n\r\n /**\r\n * Register a block with the graph. This does not wire any connections;\r\n * it simply ensures the block is tracked so that serialization, editor\r\n * display, and validation see it even when it is not reachable from an\r\n * event block.\r\n * @param block the block to register\r\n */\r\n public addBlock(block: FlowGraphBlock): void {\r\n if (this._allBlocks.indexOf(block) === -1) {\r\n this._allBlocks.push(block);\r\n }\r\n }\r\n\r\n /**\r\n * Remove a block from the graph. Disconnects all of its ports and, if it\r\n * is an event block, unregisters it from the event-block lists.\r\n * @param block the block to remove\r\n */\r\n public removeBlock(block: FlowGraphBlock): void {\r\n const idx = this._allBlocks.indexOf(block);\r\n if (idx !== -1) {\r\n this._allBlocks.splice(idx, 1);\r\n }\r\n // If it is an event block, remove from the event-block registry\r\n if (block instanceof FlowGraphExecutionBlock && \"type\" in block) {\r\n const eventBlock = block as unknown as FlowGraphEventBlock;\r\n const list = this._eventBlocks[eventBlock.type];\r\n if (list) {\r\n const eIdx = list.indexOf(eventBlock);\r\n if (eIdx !== -1) {\r\n list.splice(eIdx, 1);\r\n }\r\n }\r\n }\r\n // If the block has pending async tasks (e.g. event subscriptions),\r\n // cancel them in all active execution contexts so deletion takes\r\n // effect immediately even while the graph is running.\r\n if (block instanceof FlowGraphAsyncExecutionBlock) {\r\n for (const context of this._executionContexts) {\r\n block._cancelPendingTasks(context);\r\n block._resetAfterCanceled(context);\r\n }\r\n }\r\n // Disconnect all ports\r\n for (const input of block.dataInputs) {\r\n input.disconnectFromAll();\r\n }\r\n for (const output of block.dataOutputs) {\r\n output.disconnectFromAll();\r\n }\r\n if (block instanceof FlowGraphExecutionBlock) {\r\n for (const signalIn of block.signalInputs) {\r\n signalIn.disconnectFromAll();\r\n }\r\n for (const signalOut of block.signalOutputs) {\r\n signalOut.disconnectFromAll();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Add an event block. When the graph is started, it will start listening to events\r\n * from the block and execute the graph when they are triggered.\r\n * @param block the event block to be added\r\n */\r\n public addEventBlock(block: FlowGraphEventBlock): void {\r\n this.addBlock(block);\r\n if (block.type === FlowGraphEventType.PointerOver || block.type === FlowGraphEventType.PointerOut) {\r\n this._scene.constantlyUpdateMeshUnderPointer = true;\r\n }\r\n\r\n this._eventBlocks[block.type].push(block);\r\n\r\n // if already started, sort and add to the pending\r\n if (this.state === FlowGraphState.Started) {\r\n for (const context of this._executionContexts) {\r\n block._startPendingTasks(context);\r\n }\r\n } else {\r\n this.onStateChangedObservable.addOnce((state) => {\r\n if (state === FlowGraphState.Started) {\r\n for (const context of this._executionContexts) {\r\n block._startPendingTasks(context);\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Stops the flow graph. Cancels all pending tasks and clears execution contexts,\r\n * but keeps event blocks so the graph can be restarted.\r\n */\r\n public stop() {\r\n if (this.state === FlowGraphState.Stopped) {\r\n return;\r\n }\r\n this._detachEventObserver();\r\n this.state = FlowGraphState.Stopped;\r\n for (const context of this._executionContexts) {\r\n context._clearPendingBlocks();\r\n context._clearPendingActivation();\r\n }\r\n this._executionContexts.length = 0;\r\n }\r\n\r\n /**\r\n * Pauses the flow graph. Cancels pending tasks but keeps execution contexts and event blocks.\r\n * Call start() to resume.\r\n */\r\n public pause() {\r\n if (this.state !== FlowGraphState.Started) {\r\n return;\r\n }\r\n this._detachEventObserver();\r\n this.state = FlowGraphState.Paused;\r\n for (const context of this._executionContexts) {\r\n context._clearPendingBlocks();\r\n }\r\n }\r\n\r\n /**\r\n * Starts the flow graph. Initializes the event blocks and starts listening to events.\r\n * Can also be called to resume from a paused state.\r\n */\r\n public start() {\r\n if (this.state === FlowGraphState.Started) {\r\n return;\r\n }\r\n const resumingFromPause = this.state === FlowGraphState.Paused;\r\n if (this._executionContexts.length === 0) {\r\n this.createContext();\r\n }\r\n this._attachEventObserver();\r\n this.state = FlowGraphState.Started;\r\n this._startPendingEvents();\r\n // On a fresh start (not resume), fire the SceneReady event.\r\n // The coordinator's own scene-ready observer may have already\r\n // fired (and been lost) while the graph was stopped, so reset\r\n // the flag and handle the ready state ourselves.\r\n if (!resumingFromPause) {\r\n this._sceneEventCoordinator.sceneReadyTriggered = false;\r\n if (this._scene.isReady(true)) {\r\n this._sceneEventCoordinator.sceneReadyTriggered = true;\r\n this._sceneEventCoordinator.onEventTriggeredObservable.notifyObservers({ type: FlowGraphEventType.SceneReady });\r\n } else {\r\n // Scene isn't ready yet (e.g. pending shader compilations after\r\n // a scene swap). Use executeWhenReady(true) which restarts the\r\n // readiness check loop — a plain addOnce on onReadyObservable\r\n // may never fire if the check loop already completed.\r\n this._scene.executeWhenReady(() => {\r\n if (this.state === FlowGraphState.Started && !this._sceneEventCoordinator.sceneReadyTriggered) {\r\n this._sceneEventCoordinator.sceneReadyTriggered = true;\r\n this._sceneEventCoordinator.onEventTriggeredObservable.notifyObservers({ type: FlowGraphEventType.SceneReady });\r\n }\r\n }, true);\r\n }\r\n }\r\n }\r\n\r\n private _startPendingEvents() {\r\n for (const context of this._executionContexts) {\r\n for (const type in this._eventBlocks) {\r\n const order = this._getContextualOrder(type as FlowGraphEventType, context);\r\n for (const block of order) {\r\n block._startPendingTasks(context);\r\n }\r\n }\r\n }\r\n }\r\n\r\n private _getContextualOrder(type: FlowGraphEventType, context: FlowGraphContext): FlowGraphEventBlock[] {\r\n const order = this._eventBlocks[type].sort((a, b) => b.initPriority - a.initPriority);\r\n\r\n if (type === FlowGraphEventType.MeshPick || type === FlowGraphEventType.PointerOver || type === FlowGraphEventType.PointerOut) {\r\n const meshPickOrder = [] as FlowGraphEventBlock[];\r\n for (const block1 of order) {\r\n const mesh1 =\r\n type === FlowGraphEventType.MeshPick\r\n ? (block1 as FlowGraphMeshPickEventBlock).asset.getValue(context)\r\n : (\r\n block1 as FlowGraphEventBlock & {\r\n _getReferencedMesh: (context: FlowGraphContext) => AbstractMesh;\r\n }\r\n )._getReferencedMesh(context);\r\n let i = 0;\r\n for (; i < order.length; i++) {\r\n const block2 = order[i];\r\n const mesh2 =\r\n type === FlowGraphEventType.MeshPick\r\n ? (block2 as FlowGraphMeshPickEventBlock).asset.getValue(context)\r\n : (\r\n block2 as FlowGraphEventBlock & {\r\n _getReferencedMesh: (context: FlowGraphContext) => AbstractMesh;\r\n }\r\n )._getReferencedMesh(context);\r\n if (mesh1 && mesh2 && _IsDescendantOf(mesh1, mesh2)) {\r\n break;\r\n }\r\n }\r\n meshPickOrder.splice(i, 0, block1);\r\n }\r\n return meshPickOrder;\r\n }\r\n return order;\r\n }\r\n\r\n /**\r\n * Disposes of the flow graph. Cancels any pending tasks and removes all event listeners.\r\n */\r\n public dispose() {\r\n // Always release the scene-event wiring, even for a stopped or never-started graph.\r\n // The scene event coordinator attaches per-frame, pointer and keyboard observers to the\r\n // scene in its constructor, so a graph that is removed from its coordinator (or disposed)\r\n // while stopped would otherwise leak those observers and keep incurring per-frame overhead.\r\n this._detachEventObserver();\r\n this._sceneEventCoordinator.dispose();\r\n if (this.state === FlowGraphState.Stopped) {\r\n // Nothing is executing, so there is no run state to clear. Authored blocks are left\r\n // intact on purpose: the editor re-points a stopped graph across preview scenes via\r\n // setScene(), and each preview scene disposal raises a SceneDispose event that calls\r\n // dispose() here. Wiping the blocks would destroy the user's graph on every reset.\r\n return;\r\n }\r\n this.state = FlowGraphState.Stopped;\r\n for (const context of this._executionContexts) {\r\n context._clearPendingBlocks();\r\n context._clearPendingActivation();\r\n }\r\n this._executionContexts.length = 0;\r\n for (const type in this._eventBlocks) {\r\n this._eventBlocks[type as FlowGraphEventType].length = 0;\r\n }\r\n this._allBlocks.length = 0;\r\n }\r\n\r\n /**\r\n * Executes a function in all blocks of a flow graph, starting with the event blocks.\r\n * @param visitor the function to execute.\r\n */\r\n public visitAllBlocks(visitor: (block: FlowGraphBlock) => void) {\r\n const visitList: FlowGraphBlock[] = [];\r\n const idsAddedToVisitList = new Set<string>();\r\n for (const type in this._eventBlocks) {\r\n for (const block of this._eventBlocks[type as FlowGraphEventType]) {\r\n visitList.push(block);\r\n idsAddedToVisitList.add(block.uniqueId);\r\n }\r\n }\r\n\r\n while (visitList.length > 0) {\r\n const block = visitList.pop()!;\r\n visitor(block);\r\n\r\n for (const dataIn of block.dataInputs) {\r\n for (const connection of dataIn._connectedPoint) {\r\n if (!idsAddedToVisitList.has(connection._ownerBlock.uniqueId)) {\r\n visitList.push(connection._ownerBlock);\r\n idsAddedToVisitList.add(connection._ownerBlock.uniqueId);\r\n }\r\n }\r\n }\r\n if (block instanceof FlowGraphExecutionBlock) {\r\n for (const signalOut of block.signalOutputs) {\r\n for (const connection of signalOut._connectedPoint) {\r\n if (!idsAddedToVisitList.has(connection._ownerBlock.uniqueId)) {\r\n visitList.push(connection._ownerBlock);\r\n idsAddedToVisitList.add(connection._ownerBlock.uniqueId);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Validates the flow graph and returns all issues found.\r\n * Uses the tracked block list for complete validation including unreachable block detection.\r\n * @returns The validation result containing errors and warnings.\r\n */\r\n public validate(): IFlowGraphValidationResult {\r\n return ValidateFlowGraphWithBlockList(this, this._allBlocks);\r\n }\r\n\r\n /**\r\n * Serializes a graph\r\n * @param serializationObject the object to write the values in\r\n * @param valueSerializeFunction a function to serialize complex values\r\n */\r\n public serialize(serializationObject: any = {}, valueSerializeFunction?: (key: string, value: any, serializationObject: any) => void) {\r\n serializationObject.name = this.name;\r\n serializationObject.uniqueId = this.uniqueId;\r\n if (this.metadata !== undefined) {\r\n serializationObject.metadata = this.metadata;\r\n }\r\n serializationObject.allBlocks = [];\r\n // Collect all blocks: traversal-reachable ones plus any registered\r\n // orphans in _allBlocks (e.g. disconnected blocks in the editor).\r\n const seen = new Set<string>();\r\n const serializeBlock = (block: FlowGraphBlock) => {\r\n if (seen.has(block.uniqueId)) {\r\n return;\r\n }\r\n seen.add(block.uniqueId);\r\n const serializedBlock: any = {};\r\n block.serialize(serializedBlock);\r\n serializationObject.allBlocks.push(serializedBlock);\r\n };\r\n this.visitAllBlocks(serializeBlock);\r\n for (const block of this._allBlocks) {\r\n serializeBlock(block);\r\n }\r\n serializationObject.executionContexts = [];\r\n for (const context of this._executionContexts) {\r\n const serializedContext: any = {};\r\n context.serialize(serializedContext, valueSerializeFunction);\r\n serializationObject.executionContexts.push(serializedContext);\r\n }\r\n }\r\n\r\n /**\r\n * Launches the flow graph editor for this graph.\r\n * The editor is lazy-loaded from {@link FlowGraph.EditorURL} the first time it is used.\r\n * @param config defines the configuration of the editor\r\n * @returns a promise fulfilled when the editor is visible\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public async edit(config?: IFlowGraphEditorLaunchOptions): Promise<void> {\r\n return await new Promise((resolve) => {\r\n this._BJSFLOWGRAPHEDITOR = this._BJSFLOWGRAPHEDITOR || this._getGlobalFlowGraphEditor();\r\n if (typeof this._BJSFLOWGRAPHEDITOR === \"undefined\") {\r\n const editorUrl = config && config.editorURL ? config.editorURL : FlowGraph.EditorURL;\r\n\r\n // Load the editor bundle and add it to the DOM.\r\n Tools.LoadBabylonScript(editorUrl, () => {\r\n this._BJSFLOWGRAPHEDITOR = this._BJSFLOWGRAPHEDITOR || this._getGlobalFlowGraphEditor();\r\n this._createFlowGraphEditor(config?.flowGraphEditorConfig);\r\n resolve();\r\n });\r\n } else {\r\n this._createFlowGraphEditor(config?.flowGraphEditorConfig);\r\n resolve();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Creates the flow graph editor window.\r\n * @param additionalConfig additional configuration forwarded to `FlowGraphEditor.Show()`\r\n */\r\n private _createFlowGraphEditor(additionalConfig?: any) {\r\n const editorConfig: any = {\r\n flowGraph: this,\r\n hostScene: this._scene,\r\n // edit() always targets the developer's own live graph and scene, so the editor should\r\n // attach to that scene instead of spinning up a throwaway preview scene. A caller can\r\n // still override this via additionalConfig.\r\n attachToLiveScene: true,\r\n ...additionalConfig,\r\n };\r\n this._BJSFLOWGRAPHEDITOR.FlowGraphEditor.Show(editorConfig);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"flowGraph.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAI/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAM9E,O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BAAqB,CAAC,CAAC;gBAC3D,OAAO,EAAE,CAAC;YACd,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;OAGG;IACK,sBAAsB,CAAC,gBAAsB;QACjD,MAAM,YAAY,GAAQ;YACtB,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,IAAI,CAAC,MAAM;YACtB,uFAAuF;YACvF,sFAAsF;YACtF,4CAA4C;YAC5C,iBAAiB,EAAE,IAAI;YACvB,GAAG,gBAAgB;SACtB,CAAC;QACF,IAAI,CAAC,mBAAmB,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAChE,CAAC;;AAnoBD;;GAEG;AACW,mBAAS,GAAG,GAAG,KAAK,CAAC,cAAc,KAAK,cAAc,CAAC,OAAO,6CAA6C,AAAlG,CAAmG","sourcesContent":["import { type Observer, Observable } from \"../Misc/observable\";\r\nimport { type Nullable } from \"../types\";\r\nimport { type Scene } from \"../scene\";\r\nimport { type FlowGraphEventBlock } from \"./flowGraphEventBlock\";\r\nimport { FlowGraphContext } from \"./flowGraphContext\";\r\nimport { type FlowGraphBlock } from \"./flowGraphBlock\";\r\nimport { FlowGraphExecutionBlock } from \"./flowGraphExecutionBlock\";\r\nimport { FlowGraphAsyncExecutionBlock } from \"./flowGraphAsyncExecutionBlock\";\r\nimport { type FlowGraphCoordinator } from \"./flowGraphCoordinator\";\r\nimport { type IObjectAccessor } from \"./typeDefinitions\";\r\nimport { type IPathToObjectConverter } from \"../ObjectModel/objectModelInterfaces\";\r\nimport { type IAssetContainer } from \"core/IAssetContainer\";\r\nimport { FlowGraphEventType } from \"./flowGraphEventType\";\r\nimport { type IFlowGraphEventTrigger, FlowGraphSceneEventCoordinator } from \"./flowGraphSceneEventCoordinator\";\r\nimport { type FlowGraphMeshPickEventBlock } from \"./Blocks/Event/flowGraphMeshPickEventBlock\";\r\nimport { _IsDescendantOf } from \"./utils\";\r\nimport { type IFlowGraphValidationResult, ValidateFlowGraphWithBlockList } from \"./flowGraphValidator\";\r\nimport { RandomGUID } from \"../Misc/guid\";\r\nimport { Tools } from \"../Misc/tools.pure\";\r\nimport { AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport { type AbstractMesh } from \"../Meshes/abstractMesh.pure\";\r\n\r\n// UMD global names for the flow graph editor bundle (mirrors nodeGeometry.ts / nodeRenderGraph.ts).\r\ndeclare let FLOWGRAPHEDITOR: any;\r\ndeclare let BABYLON: any;\r\n\r\n/**\r\n * Interface used to configure the launch of the flow graph editor.\r\n */\r\nexport interface IFlowGraphEditorLaunchOptions {\r\n /** Define the URL to load the flow graph editor script from */\r\n editorURL?: string;\r\n /** Additional configuration forwarded to `FlowGraphEditor.Show()` (e.g. hostScene, hostElement) */\r\n flowGraphEditorConfig?: {\r\n hostScene?: Scene;\r\n hostElement?: HTMLElement;\r\n attachToLiveScene?: boolean;\r\n };\r\n}\r\n\r\nexport const enum FlowGraphState {\r\n /**\r\n * The graph is stopped\r\n */\r\n Stopped,\r\n /**\r\n * The graph is running\r\n */\r\n Started,\r\n /**\r\n * The graph is paused (contexts kept, pending tasks cancelled)\r\n */\r\n Paused,\r\n}\r\n\r\n/**\r\n * Parameters used to create a flow graph.\r\n */\r\nexport interface IFlowGraphParams {\r\n /**\r\n * The scene that the flow graph belongs to.\r\n */\r\n scene: Scene;\r\n /**\r\n * The event coordinator used by the flow graph.\r\n */\r\n coordinator: FlowGraphCoordinator;\r\n /**\r\n * Optional human-readable name for the graph.\r\n * Defaults to \"Graph\" if not provided.\r\n */\r\n name?: string;\r\n /**\r\n * Optional unique identifier for the graph.\r\n * If not provided, a random UUID is generated.\r\n */\r\n uniqueId?: string;\r\n}\r\n\r\n/**\r\n * Options for parsing a flow graph.\r\n */\r\nexport interface IFlowGraphParseOptions {\r\n /**\r\n * A function that parses complex values in a scene.\r\n * @param key the key of the value\r\n * @param serializationObject the object to read the value from\r\n * @param assetsContainer the assets container to read assets from\r\n * @param scene the scene to read the value from\r\n */\r\n valueParseFunction?: (key: string, serializationObject: any, assetsContainer: IAssetContainer, scene: Scene) => any;\r\n /**\r\n * The flow graph coordinator.\r\n */\r\n coordinator: FlowGraphCoordinator;\r\n /**\r\n * A function that converts a path to an object accessor.\r\n */\r\n pathConverter?: IPathToObjectConverter<IObjectAccessor>;\r\n}\r\n/**\r\n * Class used to represent a flow graph.\r\n * A flow graph is a graph of blocks that can be used to create complex logic.\r\n * Blocks can be added to the graph and connected to each other.\r\n * The graph can then be started, which will init and start all of its event blocks.\r\n *\r\n * @experimental FlowGraph is still in development and is subject to change.\r\n */\r\nexport class FlowGraph {\r\n /**\r\n * A human-readable name for this graph.\r\n */\r\n public name: string;\r\n\r\n /**\r\n * A unique identifier for this graph. Auto-generated if not provided.\r\n */\r\n public uniqueId: string;\r\n\r\n /**\r\n * Optional host-format metadata associated with this graph.\r\n */\r\n public metadata?: any;\r\n\r\n /**\r\n * Define the URL to load the flow graph editor script from.\r\n */\r\n public static EditorURL = `${Tools._DefaultCdnUrl}/v${AbstractEngine.Version}/flowGraphEditor/babylon.flowGraphEditor.js`;\r\n\r\n private _BJSFLOWGRAPHEDITOR = this._getGlobalFlowGraphEditor();\r\n\r\n /** @returns the flow graph editor from a UMD bundle or the BABYLON global, or undefined if not loaded */\r\n private _getGlobalFlowGraphEditor(): any {\r\n // UMD global name detection from bundle metadata. rollup-built UMD bundles may expose the\r\n // editor class on `.default.FlowGraphEditor`, so unwrap that case before falling back to\r\n // the BABYLON global emitted from the editor entry point.\r\n if (typeof FLOWGRAPHEDITOR !== \"undefined\") {\r\n if ((FLOWGRAPHEDITOR as any).FlowGraphEditor) {\r\n return FLOWGRAPHEDITOR;\r\n }\r\n if ((FLOWGRAPHEDITOR as any).default?.FlowGraphEditor) {\r\n return (FLOWGRAPHEDITOR as any).default;\r\n }\r\n }\r\n\r\n if (typeof BABYLON !== \"undefined\" && typeof BABYLON.FlowGraphEditor !== \"undefined\") {\r\n return BABYLON;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * An observable that is triggered when the state of the graph changes.\r\n */\r\n public onStateChangedObservable: Observable<FlowGraphState> = new Observable();\r\n /** @internal */\r\n public _eventBlocks: { [keyof in FlowGraphEventType]: FlowGraphEventBlock[] } = {\r\n [FlowGraphEventType.SceneReady]: [],\r\n [FlowGraphEventType.SceneDispose]: [],\r\n [FlowGraphEventType.SceneBeforeRender]: [],\r\n [FlowGraphEventType.MeshPick]: [],\r\n [FlowGraphEventType.PointerDown]: [],\r\n [FlowGraphEventType.PointerUp]: [],\r\n [FlowGraphEventType.PointerMove]: [],\r\n [FlowGraphEventType.PointerOver]: [],\r\n [FlowGraphEventType.PointerOut]: [],\r\n [FlowGraphEventType.KeyDown]: [],\r\n [FlowGraphEventType.KeyUp]: [],\r\n [FlowGraphEventType.SceneAfterRender]: [],\r\n [FlowGraphEventType.NoTrigger]: [],\r\n };\r\n\r\n /**\r\n * All blocks that belong to this graph, including unreachable ones.\r\n * @internal\r\n */\r\n public _allBlocks: FlowGraphBlock[] = [];\r\n /**\r\n * @internal\r\n */\r\n public readonly _scene: Scene;\r\n\r\n /**\r\n * The scene associated with this flow graph.\r\n */\r\n public get scene(): Scene {\r\n return this._scene;\r\n }\r\n private _coordinator: FlowGraphCoordinator;\r\n\r\n /**\r\n * The coordinator that owns this flow graph.\r\n */\r\n public get coordinator(): FlowGraphCoordinator {\r\n return this._coordinator;\r\n }\r\n private _executionContexts: FlowGraphContext[] = [];\r\n private _sceneEventCoordinator: FlowGraphSceneEventCoordinator;\r\n\r\n /**\r\n * The scene event coordinator for this graph.\r\n * Provides access to runtime event state such as currently pressed keys.\r\n */\r\n public get sceneEventCoordinator(): FlowGraphSceneEventCoordinator {\r\n return this._sceneEventCoordinator;\r\n }\r\n\r\n private _eventObserver: Nullable<Observer<IFlowGraphEventTrigger>>;\r\n\r\n /**\r\n * The state of the graph\r\n */\r\n private _state: FlowGraphState = FlowGraphState.Stopped;\r\n\r\n /**\r\n * The state of the graph\r\n */\r\n public get state() {\r\n return this._state;\r\n }\r\n\r\n /**\r\n * The state of the graph\r\n */\r\n public set state(value: FlowGraphState) {\r\n this._state = value;\r\n this.onStateChangedObservable.notifyObservers(value);\r\n }\r\n\r\n /**\r\n * Construct a Flow Graph\r\n * @param params construction parameters. currently only the scene\r\n */\r\n public constructor(params: IFlowGraphParams) {\r\n this._scene = params.scene;\r\n this._sceneEventCoordinator = new FlowGraphSceneEventCoordinator(this._scene);\r\n this._coordinator = params.coordinator;\r\n this.name = params.name ?? \"Graph\";\r\n this.uniqueId = params.uniqueId ?? RandomGUID();\r\n }\r\n\r\n private _attachEventObserver() {\r\n if (this._eventObserver) {\r\n return;\r\n }\r\n this._eventObserver = this._sceneEventCoordinator.onEventTriggeredObservable.add((event, eventState) => {\r\n if (event.type === FlowGraphEventType.SceneDispose) {\r\n this.dispose();\r\n return;\r\n }\r\n\r\n if (this.state !== FlowGraphState.Started) {\r\n return;\r\n }\r\n\r\n const propagationStops =\r\n event.type === FlowGraphEventType.MeshPick || event.type === FlowGraphEventType.PointerOver || event.type === FlowGraphEventType.PointerOut\r\n ? ([] as AbstractMesh[])\r\n : undefined;\r\n const payload = event.payload as { mesh?: AbstractMesh; pickInfo?: { pickedMesh?: AbstractMesh } } | undefined;\r\n const source = payload?.pickInfo?.pickedMesh ?? payload?.mesh;\r\n for (const context of this._executionContexts) {\r\n const order = this._getContextualOrder(event.type, context);\r\n for (const block of order) {\r\n const eventBlock = block as FlowGraphEventBlock & {\r\n _getReferencedMesh?: (context: FlowGraphContext) => AbstractMesh | undefined;\r\n };\r\n const target = eventBlock._getReferencedMesh?.(context);\r\n if (source && target && propagationStops?.some((stoppedTarget) => stoppedTarget !== target && _IsDescendantOf(source, target))) {\r\n continue;\r\n }\r\n const eventKey = eventBlock.eventKey;\r\n this._coordinator._beginEventDispatch(eventKey, eventState);\r\n let shouldContinue: boolean;\r\n let dispatch: ReturnType<FlowGraphCoordinator[\"_endEventDispatch\"]>;\r\n try {\r\n shouldContinue = block._executeEvent(context, event.payload);\r\n } finally {\r\n dispatch = this._coordinator._endEventDispatch();\r\n }\r\n if (dispatch?.propagationStopped && target) {\r\n propagationStops?.push(target);\r\n }\r\n if (eventState.skipNextObservers || !shouldContinue) {\r\n break;\r\n }\r\n }\r\n if (eventState.skipNextObservers) {\r\n break;\r\n }\r\n }\r\n // custom behavior(s) of specific events\r\n switch (event.type) {\r\n case FlowGraphEventType.SceneReady:\r\n this._sceneEventCoordinator.sceneReadyTriggered = true;\r\n break;\r\n case FlowGraphEventType.SceneBeforeRender:\r\n for (const context of this._executionContexts) {\r\n context._notifyOnTick(event.payload);\r\n }\r\n break;\r\n }\r\n });\r\n }\r\n\r\n private _detachEventObserver() {\r\n this._eventObserver?.remove();\r\n this._eventObserver = null;\r\n }\r\n\r\n /**\r\n * Sets a new scene for this flow graph, re-wiring all event listeners.\r\n * This is useful when the scene the flow graph should listen to changes\r\n * (e.g. when a new scene is loaded in an editor preview).\r\n * If the graph is currently running, it will be stopped first and must be\r\n * restarted manually after calling this method.\r\n * @param scene the new scene to attach to\r\n */\r\n public setScene(scene: Scene): void {\r\n if (scene === this._scene) {\r\n return;\r\n }\r\n if (this.state === FlowGraphState.Started) {\r\n this.stop();\r\n }\r\n // Tear down old event coordinator\r\n this._detachEventObserver();\r\n this._sceneEventCoordinator.dispose();\r\n // Clear execution contexts so start() creates fresh ones with the new scene.\r\n // NOTE: This intentionally discards user variables and connection values.\r\n // Callers that need to preserve them (e.g. the Flow Graph Editor) should\r\n // snapshot context state BEFORE calling setScene() and restore it in a\r\n // wrapped createContext() callback after start() re-creates contexts.\r\n this._executionContexts.length = 0;\r\n // Rebuild with the new scene\r\n (this as { _scene: Scene })._scene = scene;\r\n this._scene.constantlyUpdateMeshUnderPointer = true; // ensure pointer info is always up to date for event blocks that need it\r\n // Re-resolve node references (e.g. meshes targeted by Get/Set property blocks) against the\r\n // new scene. This is required when the graph was parsed before its scene was populated (for\r\n // example an editor that loads a graph from a snippet first and the referenced scene second):\r\n // the references would otherwise stay bound to nodes from the old/disposed scene.\r\n for (const block of this._allBlocks) {\r\n for (const input of block.dataInputs) {\r\n input._reresolveDefaultValueForScene(scene);\r\n }\r\n }\r\n this._sceneEventCoordinator = new FlowGraphSceneEventCoordinator(this._scene);\r\n // Pre-attach the event observer so that events from the new\r\n // coordinator are routed to the graph immediately. The handler\r\n // guards against processing events while the graph is stopped,\r\n // but having the observer in place ensures no events are lost\r\n // when start() is called shortly after.\r\n this._attachEventObserver();\r\n }\r\n\r\n /**\r\n * Create a context. A context represents one self contained execution for the graph, with its own variables.\r\n * @returns the context, where you can get and set variables\r\n */\r\n public createContext() {\r\n const context = new FlowGraphContext({ scene: this._scene, coordinator: this._coordinator, sceneEventCoordinator: this._sceneEventCoordinator });\r\n this._executionContexts.push(context);\r\n return context;\r\n }\r\n\r\n /**\r\n * Returns the execution context at a given index\r\n * @param index the index of the context\r\n * @returns the execution context at that index\r\n */\r\n public getContext(index: number) {\r\n return this._executionContexts[index];\r\n }\r\n\r\n /**\r\n * Returns the number of execution contexts currently attached to this graph.\r\n */\r\n public get contextCount(): number {\r\n return this._executionContexts.length;\r\n }\r\n\r\n /**\r\n * Remove an execution context by index. Any pending async blocks on\r\n * the context are cleared before removal.\r\n * @param index the index of the context to remove\r\n * @returns the removed context, or undefined if the index was out of range\r\n */\r\n public removeContext(index: number): FlowGraphContext | undefined {\r\n if (index < 0 || index >= this._executionContexts.length) {\r\n return undefined;\r\n }\r\n const [removed] = this._executionContexts.splice(index, 1);\r\n removed._clearPendingBlocks();\r\n return removed;\r\n }\r\n\r\n /**\r\n * Returns all blocks registered in this graph, including disconnected ones.\r\n * @returns a read-only array of all blocks\r\n */\r\n public getAllBlocks(): readonly FlowGraphBlock[] {\r\n return this._allBlocks;\r\n }\r\n\r\n /**\r\n * Register a block with the graph. This does not wire any connections;\r\n * it simply ensures the block is tracked so that serialization, editor\r\n * display, and validation see it even when it is not reachable from an\r\n * event block.\r\n * @param block the block to register\r\n */\r\n public addBlock(block: FlowGraphBlock): void {\r\n if (this._allBlocks.indexOf(block) === -1) {\r\n this._allBlocks.push(block);\r\n }\r\n }\r\n\r\n /**\r\n * Remove a block from the graph. Disconnects all of its ports and, if it\r\n * is an event block, unregisters it from the event-block lists.\r\n * @param block the block to remove\r\n */\r\n public removeBlock(block: FlowGraphBlock): void {\r\n const idx = this._allBlocks.indexOf(block);\r\n if (idx !== -1) {\r\n this._allBlocks.splice(idx, 1);\r\n }\r\n // If it is an event block, remove from the event-block registry\r\n if (block instanceof FlowGraphExecutionBlock && \"type\" in block) {\r\n const eventBlock = block as unknown as FlowGraphEventBlock;\r\n const list = this._eventBlocks[eventBlock.type];\r\n if (list) {\r\n const eIdx = list.indexOf(eventBlock);\r\n if (eIdx !== -1) {\r\n list.splice(eIdx, 1);\r\n }\r\n }\r\n }\r\n // If the block has pending async tasks (e.g. event subscriptions),\r\n // cancel them in all active execution contexts so deletion takes\r\n // effect immediately even while the graph is running.\r\n if (block instanceof FlowGraphAsyncExecutionBlock) {\r\n for (const context of this._executionContexts) {\r\n block._cancelPendingTasks(context);\r\n block._resetAfterCanceled(context);\r\n }\r\n }\r\n // Disconnect all ports\r\n for (const input of block.dataInputs) {\r\n input.disconnectFromAll();\r\n }\r\n for (const output of block.dataOutputs) {\r\n output.disconnectFromAll();\r\n }\r\n if (block instanceof FlowGraphExecutionBlock) {\r\n for (const signalIn of block.signalInputs) {\r\n signalIn.disconnectFromAll();\r\n }\r\n for (const signalOut of block.signalOutputs) {\r\n signalOut.disconnectFromAll();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Add an event block. When the graph is started, it will start listening to events\r\n * from the block and execute the graph when they are triggered.\r\n * @param block the event block to be added\r\n */\r\n public addEventBlock(block: FlowGraphEventBlock): void {\r\n this.addBlock(block);\r\n if (block.type === FlowGraphEventType.PointerOver || block.type === FlowGraphEventType.PointerOut) {\r\n this._scene.constantlyUpdateMeshUnderPointer = true;\r\n }\r\n\r\n this._eventBlocks[block.type].push(block);\r\n\r\n // if already started, sort and add to the pending\r\n if (this.state === FlowGraphState.Started) {\r\n for (const context of this._executionContexts) {\r\n block._startPendingTasks(context);\r\n }\r\n } else {\r\n this.onStateChangedObservable.addOnce((state) => {\r\n if (state === FlowGraphState.Started) {\r\n for (const context of this._executionContexts) {\r\n block._startPendingTasks(context);\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Stops the flow graph. Cancels all pending tasks and clears execution contexts,\r\n * but keeps event blocks so the graph can be restarted.\r\n */\r\n public stop() {\r\n if (this.state === FlowGraphState.Stopped) {\r\n return;\r\n }\r\n this._detachEventObserver();\r\n this.state = FlowGraphState.Stopped;\r\n for (const context of this._executionContexts) {\r\n context._clearPendingBlocks();\r\n context._clearPendingActivation();\r\n }\r\n this._executionContexts.length = 0;\r\n }\r\n\r\n /**\r\n * Pauses the flow graph. Cancels pending tasks but keeps execution contexts and event blocks.\r\n * Call start() to resume.\r\n */\r\n public pause() {\r\n if (this.state !== FlowGraphState.Started) {\r\n return;\r\n }\r\n this._detachEventObserver();\r\n this.state = FlowGraphState.Paused;\r\n for (const context of this._executionContexts) {\r\n context._clearPendingBlocks();\r\n }\r\n }\r\n\r\n /**\r\n * Starts the flow graph. Initializes the event blocks and starts listening to events.\r\n * Can also be called to resume from a paused state.\r\n * @param skipSceneReadyCheck whether to activate the startup event immediately even when the scene is not yet ready\r\n */\r\n public start(skipSceneReadyCheck: boolean = false) {\r\n if (this.state === FlowGraphState.Started) {\r\n return;\r\n }\r\n const resumingFromPause = this.state === FlowGraphState.Paused;\r\n if (this._executionContexts.length === 0) {\r\n this.createContext();\r\n }\r\n this._attachEventObserver();\r\n this.state = FlowGraphState.Started;\r\n this._startPendingEvents();\r\n // On a fresh start (not resume), fire the SceneReady event.\r\n // The coordinator's own scene-ready observer may have already\r\n // fired (and been lost) while the graph was stopped, so reset\r\n // the flag and handle the ready state ourselves.\r\n if (!resumingFromPause) {\r\n this._sceneEventCoordinator.sceneReadyTriggered = false;\r\n if (skipSceneReadyCheck || this._scene.isReady(true)) {\r\n this._sceneEventCoordinator.sceneReadyTriggered = true;\r\n this._sceneEventCoordinator.onEventTriggeredObservable.notifyObservers({ type: FlowGraphEventType.SceneReady });\r\n } else {\r\n // Scene isn't ready yet (e.g. pending shader compilations after\r\n // a scene swap). Use executeWhenReady(true) which restarts the\r\n // readiness check loop — a plain addOnce on onReadyObservable\r\n // may never fire if the check loop already completed.\r\n this._scene.executeWhenReady(() => {\r\n if (this.state === FlowGraphState.Started && !this._sceneEventCoordinator.sceneReadyTriggered) {\r\n this._sceneEventCoordinator.sceneReadyTriggered = true;\r\n this._sceneEventCoordinator.onEventTriggeredObservable.notifyObservers({ type: FlowGraphEventType.SceneReady });\r\n }\r\n }, true);\r\n }\r\n }\r\n }\r\n\r\n private _startPendingEvents() {\r\n for (const context of this._executionContexts) {\r\n for (const type in this._eventBlocks) {\r\n const order = this._getContextualOrder(type as FlowGraphEventType, context);\r\n for (const block of order) {\r\n block._startPendingTasks(context);\r\n }\r\n }\r\n }\r\n }\r\n\r\n private _getContextualOrder(type: FlowGraphEventType, context: FlowGraphContext): FlowGraphEventBlock[] {\r\n const order = this._eventBlocks[type].sort((a, b) => b.initPriority - a.initPriority);\r\n\r\n if (type === FlowGraphEventType.MeshPick || type === FlowGraphEventType.PointerOver || type === FlowGraphEventType.PointerOut) {\r\n const meshPickOrder = [] as FlowGraphEventBlock[];\r\n for (const block1 of order) {\r\n const mesh1 =\r\n type === FlowGraphEventType.MeshPick\r\n ? (block1 as FlowGraphMeshPickEventBlock).asset.getValue(context)\r\n : (\r\n block1 as FlowGraphEventBlock & {\r\n _getReferencedMesh: (context: FlowGraphContext) => AbstractMesh;\r\n }\r\n )._getReferencedMesh(context);\r\n let i = 0;\r\n for (; i < order.length; i++) {\r\n const block2 = order[i];\r\n const mesh2 =\r\n type === FlowGraphEventType.MeshPick\r\n ? (block2 as FlowGraphMeshPickEventBlock).asset.getValue(context)\r\n : (\r\n block2 as FlowGraphEventBlock & {\r\n _getReferencedMesh: (context: FlowGraphContext) => AbstractMesh;\r\n }\r\n )._getReferencedMesh(context);\r\n if (mesh1 && mesh2 && _IsDescendantOf(mesh1, mesh2)) {\r\n break;\r\n }\r\n }\r\n meshPickOrder.splice(i, 0, block1);\r\n }\r\n return meshPickOrder;\r\n }\r\n return order;\r\n }\r\n\r\n /**\r\n * Disposes of the flow graph. Cancels any pending tasks and removes all event listeners.\r\n */\r\n public dispose() {\r\n // Always release the scene-event wiring, even for a stopped or never-started graph.\r\n // The scene event coordinator attaches per-frame, pointer and keyboard observers to the\r\n // scene in its constructor, so a graph that is removed from its coordinator (or disposed)\r\n // while stopped would otherwise leak those observers and keep incurring per-frame overhead.\r\n this._detachEventObserver();\r\n this._sceneEventCoordinator.dispose();\r\n if (this.state === FlowGraphState.Stopped) {\r\n // Nothing is executing, so there is no run state to clear. Authored blocks are left\r\n // intact on purpose: the editor re-points a stopped graph across preview scenes via\r\n // setScene(), and each preview scene disposal raises a SceneDispose event that calls\r\n // dispose() here. Wiping the blocks would destroy the user's graph on every reset.\r\n return;\r\n }\r\n this.state = FlowGraphState.Stopped;\r\n for (const context of this._executionContexts) {\r\n context._clearPendingBlocks();\r\n context._clearPendingActivation();\r\n }\r\n this._executionContexts.length = 0;\r\n for (const type in this._eventBlocks) {\r\n this._eventBlocks[type as FlowGraphEventType].length = 0;\r\n }\r\n this._allBlocks.length = 0;\r\n }\r\n\r\n /**\r\n * Executes a function in all blocks of a flow graph, starting with the event blocks.\r\n * @param visitor the function to execute.\r\n */\r\n public visitAllBlocks(visitor: (block: FlowGraphBlock) => void) {\r\n const visitList: FlowGraphBlock[] = [];\r\n const idsAddedToVisitList = new Set<string>();\r\n for (const type in this._eventBlocks) {\r\n for (const block of this._eventBlocks[type as FlowGraphEventType]) {\r\n visitList.push(block);\r\n idsAddedToVisitList.add(block.uniqueId);\r\n }\r\n }\r\n\r\n while (visitList.length > 0) {\r\n const block = visitList.pop()!;\r\n visitor(block);\r\n\r\n for (const dataIn of block.dataInputs) {\r\n for (const connection of dataIn._connectedPoint) {\r\n if (!idsAddedToVisitList.has(connection._ownerBlock.uniqueId)) {\r\n visitList.push(connection._ownerBlock);\r\n idsAddedToVisitList.add(connection._ownerBlock.uniqueId);\r\n }\r\n }\r\n }\r\n if (block instanceof FlowGraphExecutionBlock) {\r\n for (const signalOut of block.signalOutputs) {\r\n for (const connection of signalOut._connectedPoint) {\r\n if (!idsAddedToVisitList.has(connection._ownerBlock.uniqueId)) {\r\n visitList.push(connection._ownerBlock);\r\n idsAddedToVisitList.add(connection._ownerBlock.uniqueId);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Validates the flow graph and returns all issues found.\r\n * Uses the tracked block list for complete validation including unreachable block detection.\r\n * @returns The validation result containing errors and warnings.\r\n */\r\n public validate(): IFlowGraphValidationResult {\r\n return ValidateFlowGraphWithBlockList(this, this._allBlocks);\r\n }\r\n\r\n /**\r\n * Serializes a graph\r\n * @param serializationObject the object to write the values in\r\n * @param valueSerializeFunction a function to serialize complex values\r\n */\r\n public serialize(serializationObject: any = {}, valueSerializeFunction?: (key: string, value: any, serializationObject: any) => void) {\r\n serializationObject.name = this.name;\r\n serializationObject.uniqueId = this.uniqueId;\r\n if (this.metadata !== undefined) {\r\n serializationObject.metadata = this.metadata;\r\n }\r\n serializationObject.allBlocks = [];\r\n // Collect all blocks: traversal-reachable ones plus any registered\r\n // orphans in _allBlocks (e.g. disconnected blocks in the editor).\r\n const seen = new Set<string>();\r\n const serializeBlock = (block: FlowGraphBlock) => {\r\n if (seen.has(block.uniqueId)) {\r\n return;\r\n }\r\n seen.add(block.uniqueId);\r\n const serializedBlock: any = {};\r\n block.serialize(serializedBlock);\r\n serializationObject.allBlocks.push(serializedBlock);\r\n };\r\n this.visitAllBlocks(serializeBlock);\r\n for (const block of this._allBlocks) {\r\n serializeBlock(block);\r\n }\r\n serializationObject.executionContexts = [];\r\n for (const context of this._executionContexts) {\r\n const serializedContext: any = {};\r\n context.serialize(serializedContext, valueSerializeFunction);\r\n serializationObject.executionContexts.push(serializedContext);\r\n }\r\n }\r\n\r\n /**\r\n * Launches the flow graph editor for this graph.\r\n * The editor is lazy-loaded from {@link FlowGraph.EditorURL} the first time it is used.\r\n * @param config defines the configuration of the editor\r\n * @returns a promise fulfilled when the editor is visible\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public async edit(config?: IFlowGraphEditorLaunchOptions): Promise<void> {\r\n return await new Promise((resolve) => {\r\n this._BJSFLOWGRAPHEDITOR = this._BJSFLOWGRAPHEDITOR || this._getGlobalFlowGraphEditor();\r\n if (typeof this._BJSFLOWGRAPHEDITOR === \"undefined\") {\r\n const editorUrl = config && config.editorURL ? config.editorURL : FlowGraph.EditorURL;\r\n\r\n // Load the editor bundle and add it to the DOM.\r\n Tools.LoadBabylonScript(editorUrl, () => {\r\n this._BJSFLOWGRAPHEDITOR = this._BJSFLOWGRAPHEDITOR || this._getGlobalFlowGraphEditor();\r\n this._createFlowGraphEditor(config?.flowGraphEditorConfig);\r\n resolve();\r\n });\r\n } else {\r\n this._createFlowGraphEditor(config?.flowGraphEditorConfig);\r\n resolve();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Creates the flow graph editor window.\r\n * @param additionalConfig additional configuration forwarded to `FlowGraphEditor.Show()`\r\n */\r\n private _createFlowGraphEditor(additionalConfig?: any) {\r\n const editorConfig: any = {\r\n flowGraph: this,\r\n hostScene: this._scene,\r\n // edit() always targets the developer's own live graph and scene, so the editor should\r\n // attach to that scene instead of spinning up a throwaway preview scene. A caller can\r\n // still override this via additionalConfig.\r\n attachToLiveScene: true,\r\n ...additionalConfig,\r\n };\r\n this._BJSFLOWGRAPHEDITOR.FlowGraphEditor.Show(editorConfig);\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type AnimationGroup } from "../Animations/animationGroup.pure.js";
|
|
2
|
+
import { type Observer } from "../Misc/observable.pure.js";
|
|
3
|
+
import { type FlowGraphContext } from "./flowGraphContext.js";
|
|
4
|
+
import { type FlowGraphPlayAnimationBlock } from "./Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js";
|
|
5
|
+
/** Observer ownership for animation groups started by FlowGraph. */
|
|
6
|
+
export interface IFlowGraphAnimationObserverSet {
|
|
7
|
+
/** Block that owns the animation group. */
|
|
8
|
+
block: FlowGraphPlayAnimationBlock;
|
|
9
|
+
/** Group completion observer. */
|
|
10
|
+
groupEnd: Observer<AnimationGroup>;
|
|
11
|
+
/** Animation completion observer. */
|
|
12
|
+
animationEnd: Observer<any>;
|
|
13
|
+
/** Animation loop observer. */
|
|
14
|
+
animationLoop: Observer<any>;
|
|
15
|
+
/** Group loop observer. */
|
|
16
|
+
groupLoop: Observer<AnimationGroup>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Removes observers owned by the play block that started an animation group.
|
|
20
|
+
* @param context active FlowGraph context
|
|
21
|
+
* @param animationGroup animation group being replaced or stopped
|
|
22
|
+
* @returns the owning play block, when one was registered
|
|
23
|
+
*/
|
|
24
|
+
export declare function RemoveFlowGraphAnimationGroupObservers(context: FlowGraphContext, animationGroup: AnimationGroup): FlowGraphPlayAnimationBlock | undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Removes observers owned by the play block that started an animation group.
|
|
3
|
+
* @param context active FlowGraph context
|
|
4
|
+
* @param animationGroup animation group being replaced or stopped
|
|
5
|
+
* @returns the owning play block, when one was registered
|
|
6
|
+
*/
|
|
7
|
+
export function RemoveFlowGraphAnimationGroupObservers(context, animationGroup) {
|
|
8
|
+
const observerSets = context._getGlobalContextVariable("animationGroupObserverSets", new Map());
|
|
9
|
+
const observers = observerSets.get(animationGroup.uniqueId);
|
|
10
|
+
if (!observers) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
animationGroup.onAnimationGroupEndObservable.remove(observers.groupEnd);
|
|
14
|
+
animationGroup.onAnimationEndObservable.remove(observers.animationEnd);
|
|
15
|
+
animationGroup.onAnimationLoopObservable.remove(observers.animationLoop);
|
|
16
|
+
animationGroup.onAnimationGroupLoopObservable.remove(observers.groupLoop);
|
|
17
|
+
observerSets.delete(animationGroup.uniqueId);
|
|
18
|
+
context._setGlobalContextVariable("animationGroupObserverSets", observerSets);
|
|
19
|
+
return observers.block;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=flowGraphAnimationHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowGraphAnimationHelpers.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphAnimationHelpers.ts"],"names":[],"mappings":"AAmBA;;;;;GAKG;AACH,MAAM,UAAU,sCAAsC,CAAC,OAAyB,EAAE,cAA8B;IAC5G,MAAM,YAAY,GAAG,OAAO,CAAC,yBAAyB,CAAC,4BAA4B,EAAE,IAAI,GAAG,EAA0C,CAAC,CAAC;IACxI,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC5D,IAAI,CAAC,SAAS,EAAE,CAAC;QACb,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,cAAc,CAAC,6BAA6B,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACxE,cAAc,CAAC,wBAAwB,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IACvE,cAAc,CAAC,yBAAyB,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IACzE,cAAc,CAAC,8BAA8B,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAC1E,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC7C,OAAO,CAAC,yBAAyB,CAAC,4BAA4B,EAAE,YAAY,CAAC,CAAC;IAC9E,OAAO,SAAS,CAAC,KAAK,CAAC;AAC3B,CAAC","sourcesContent":["import { type AnimationGroup } from \"../Animations/animationGroup.pure\";\r\nimport { type Observer } from \"../Misc/observable.pure\";\r\nimport { type FlowGraphContext } from \"./flowGraphContext\";\r\nimport { type FlowGraphPlayAnimationBlock } from \"./Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure\";\r\n\r\n/** Observer ownership for animation groups started by FlowGraph. */\r\nexport interface IFlowGraphAnimationObserverSet {\r\n /** Block that owns the animation group. */\r\n block: FlowGraphPlayAnimationBlock;\r\n /** Group completion observer. */\r\n groupEnd: Observer<AnimationGroup>;\r\n /** Animation completion observer. */\r\n animationEnd: Observer<any>;\r\n /** Animation loop observer. */\r\n animationLoop: Observer<any>;\r\n /** Group loop observer. */\r\n groupLoop: Observer<AnimationGroup>;\r\n}\r\n\r\n/**\r\n * Removes observers owned by the play block that started an animation group.\r\n * @param context active FlowGraph context\r\n * @param animationGroup animation group being replaced or stopped\r\n * @returns the owning play block, when one was registered\r\n */\r\nexport function RemoveFlowGraphAnimationGroupObservers(context: FlowGraphContext, animationGroup: AnimationGroup): FlowGraphPlayAnimationBlock | undefined {\r\n const observerSets = context._getGlobalContextVariable(\"animationGroupObserverSets\", new Map<number, IFlowGraphAnimationObserverSet>());\r\n const observers = observerSets.get(animationGroup.uniqueId);\r\n if (!observers) {\r\n return undefined;\r\n }\r\n animationGroup.onAnimationGroupEndObservable.remove(observers.groupEnd);\r\n animationGroup.onAnimationEndObservable.remove(observers.animationEnd);\r\n animationGroup.onAnimationLoopObservable.remove(observers.animationLoop);\r\n animationGroup.onAnimationGroupLoopObservable.remove(observers.groupLoop);\r\n observerSets.delete(animationGroup.uniqueId);\r\n context._setGlobalContextVariable(\"animationGroupObserverSets\", observerSets);\r\n return observers.block;\r\n}\r\n"]}
|
|
@@ -476,6 +476,7 @@ let FlowGraphContext = (() => {
|
|
|
476
476
|
}
|
|
477
477
|
_notifyOnTick(framePayload) {
|
|
478
478
|
// set the values as global variables
|
|
479
|
+
this._setGlobalContextVariable("firstTickPayload", this._getGlobalContextVariable("firstTickPayload", framePayload));
|
|
479
480
|
this._setGlobalContextVariable("timeSinceStart", framePayload.timeSinceStart);
|
|
480
481
|
this._setGlobalContextVariable("deltaTime", framePayload.deltaTime);
|
|
481
482
|
// iterate the pending blocks and run each one's onFrame function
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphContext.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphContext.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM1C,OAAO,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AAGpE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAA2C,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAG9G,OAAO,EAAmB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AA8DrE;;;;;GAKG;IACU,gBAAgB;;;;;;;;sBAAhB,gBAAgB;YA6GzB;;eAEG;YACH,IAAW,aAAa;gBACpB,OAAO,IAAI,CAAC,cAAc,CAAC;YAC/B,CAAC;YAED,IAAW,aAAa,CAAC,KAAc;gBACnC,IAAI,IAAI,CAAC,cAAc,KAAK,KAAK,EAAE,CAAC;oBAChC,OAAO;gBACX,CAAC;gBACD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;gBAC5B,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;oBACtB,IAAI,CAAC,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;oBACpC,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;gBACpC,CAAC;qBAAM,CAAC;oBACJ,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;gBACvB,CAAC;YACL,CAAC;YAED,YAAY,MAAsC;gBAhIlD;;mBAEG;gBAEI,aAAQ,mDAAG,UAAU,EAAE,EAAC;gBAC/B;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CAAC,CAAC,CAAC,EAAE,CAAC;wBACpD,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;wBACrD,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;wBACxD,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;wBACtE,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;wBAC1D,cAAc,EAAE,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;wBAClE,cAAc,EAAE,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;qBACrE,CAAC;gBACN,CAAC;YACL,CAAC;YAED;;eAEG;YACI,YAAY;gBACf,OAAO,kBAAkB,CAAC;YAC9B,CAAC;;;;oCA7pBA,SAAS,EAAE;gCAMX,SAAS,EAAE;YALZ,0KAAO,QAAQ,6BAAR,QAAQ,2FAAgB;YAM/B,8JAAO,IAAI,6BAAJ,IAAI,mFAAc;;;;;SAXhB,gBAAgB","sourcesContent":["import { serialize } from \"../Misc/decorators\";\r\nimport { RandomGUID } from \"../Misc/guid\";\r\nimport { type Scene } from \"../scene\";\r\nimport { type FlowGraphAsyncExecutionBlock } from \"./flowGraphAsyncExecutionBlock\";\r\nimport { type FlowGraphBlock } from \"./flowGraphBlock\";\r\nimport { type FlowGraphDataConnection } from \"./flowGraphDataConnection\";\r\nimport { type FlowGraph } from \"./flowGraph\";\r\nimport { defaultValueSerializationFunction } from \"./serialization\";\r\nimport { type FlowGraphCoordinator } from \"./flowGraphCoordinator\";\r\nimport { type FlowGraphSceneEventCoordinator } from \"./flowGraphSceneEventCoordinator\";\r\nimport { Observable } from \"../Misc/observable\";\r\nimport { type AssetType, type FlowGraphAssetType, GetFlowGraphAssetWithType } from \"./flowGraphAssetsContext\";\r\nimport { type IAssetContainer } from \"core/IAssetContainer\";\r\nimport { type Nullable } from \"core/types\";\r\nimport { FlowGraphAction, FlowGraphLogger } from \"./flowGraphLogger\";\r\nimport { type IFlowGraphOnTickEventPayload } from \"./Blocks/Event/flowGraphSceneTickEventBlock\";\r\nimport { type FlowGraphExecutionBlock } from \"./flowGraphExecutionBlock\";\r\nimport { type FlowGraphSignalConnection } from \"./flowGraphSignalConnection\";\r\n\r\n/**\r\n * Represents a pending signal activation that was paused by a breakpoint.\r\n */\r\nexport interface IFlowGraphPendingActivation {\r\n /** The block that was about to execute */\r\n readonly block: FlowGraphExecutionBlock;\r\n /** The context in which execution was paused */\r\n readonly context: FlowGraphContext;\r\n /** The signal connection that triggered the execution */\r\n readonly signal: FlowGraphSignalConnection;\r\n}\r\n/**\r\n * Construction parameters for the context.\r\n */\r\nexport interface IFlowGraphContextConfiguration {\r\n /**\r\n * The scene that the flow graph context belongs to.\r\n */\r\n readonly scene: Scene;\r\n /**\r\n * The event coordinator used by the flow graph context.\r\n */\r\n readonly coordinator: FlowGraphCoordinator;\r\n\r\n /**\r\n * The scene event coordinator that tracks runtime event state\r\n * (e.g. currently pressed keyboard keys).\r\n * When not provided, keyboard polling blocks (e.g. IsKeyPressed) will\r\n * report no keys pressed.\r\n */\r\n readonly sceneEventCoordinator?: FlowGraphSceneEventCoordinator;\r\n\r\n /**\r\n * The assets context used by the flow graph context.\r\n * If none is provided, a default one will be created.\r\n */\r\n readonly assetsContext?: IAssetContainer;\r\n}\r\n\r\n/**\r\n * Options for parsing a context.\r\n */\r\nexport interface IFlowGraphContextParseOptions {\r\n /**\r\n * A function that parses a value from a serialization object.\r\n * @param key the key of the value\r\n * @param serializationObject the object containing the value\r\n * @param assetsContainer the assets container\r\n * @param scene the current scene\r\n * @returns\r\n */\r\n readonly valueParseFunction?: (key: string, serializationObject: any, assetsContainer: IAssetContainer, scene: Scene) => any;\r\n /**\r\n * The graph that the context is being parsed in.\r\n */\r\n readonly graph: FlowGraph;\r\n}\r\n/**\r\n * The context represents the current state and execution of the flow graph.\r\n * It contains both user-defined variables, which are derived from\r\n * a more general variable definition, and execution variables that\r\n * are set by the blocks.\r\n */\r\nexport class FlowGraphContext {\r\n /**\r\n * A randomly generated GUID for each context.\r\n */\r\n @serialize()\r\n public uniqueId = RandomGUID();\r\n /**\r\n * An optional user-facing name for the context.\r\n * Defaults to an empty string; the editor may assign a label like \"Context 0\".\r\n */\r\n @serialize()\r\n public name: string = \"\";\r\n /**\r\n * These are the variables defined by a user.\r\n */\r\n private _userVariables: { [key: string]: any } = {};\r\n /**\r\n * Optional type annotations for user variables.\r\n * Keys are variable names; values are type name strings (e.g. \"number\", \"Vector3\", \"Mesh\").\r\n * This map is maintained by the editor and persisted through serialization so\r\n * that a variable's declared type survives even when its value is undefined.\r\n */\r\n private _variableTypes: { [key: string]: string } = {};\r\n /**\r\n * These are the variables set by the blocks.\r\n */\r\n private _executionVariables: { [key: string]: any } = {};\r\n\r\n /**\r\n * A context-specific global variables, available to all blocks in the context.\r\n */\r\n private _globalContextVariables: { [key: string]: any } = {};\r\n /**\r\n * These are the values for the data connection points\r\n */\r\n private _connectionValues: { [key: string]: any } = {};\r\n /**\r\n * These are the variables set by the graph.\r\n */\r\n private readonly _configuration: IFlowGraphContextConfiguration;\r\n /**\r\n * These are blocks that have currently pending tasks/listeners that need to be cleaned up.\r\n */\r\n private _pendingBlocks: FlowGraphAsyncExecutionBlock[] = [];\r\n /**\r\n * A monotonically increasing ID for each execution.\r\n * Incremented for every block executed.\r\n */\r\n private _executionId = 0;\r\n /**\r\n * Observable that is triggered when a node is executed.\r\n */\r\n public onNodeExecutedObservable: Observable<FlowGraphBlock> = new Observable<FlowGraphBlock>();\r\n\r\n /**\r\n * Observable triggered when a breakpoint is hit.\r\n * Observers receive the pending activation (block, context, signal) that was paused.\r\n */\r\n public onBreakpointHitObservable: Observable<IFlowGraphPendingActivation> = new Observable<IFlowGraphPendingActivation>();\r\n\r\n /**\r\n * A predicate called before each execution block runs.\r\n * If it returns true, execution is paused before the block and a\r\n * pending activation is stored, which can be resumed via\r\n * {@link continueExecution} or {@link stepExecution}.\r\n *\r\n * Set to `null` to disable breakpoint checking.\r\n */\r\n public breakpointPredicate: Nullable<(block: FlowGraphExecutionBlock) => boolean> = null;\r\n\r\n /**\r\n * The activation that is currently paused due to a breakpoint hit.\r\n * `null` when execution is not paused on a breakpoint.\r\n */\r\n private _pendingActivation: Nullable<IFlowGraphPendingActivation> = null;\r\n\r\n /**\r\n * When true, the next activation will pause regardless of the breakpoint predicate.\r\n * Set by {@link stepExecution}.\r\n */\r\n private _stepMode: boolean = false;\r\n\r\n /**\r\n * When set, the breakpoint check is skipped for this specific block uniqueId\r\n * on the very next call to {@link _shouldBreak}. Used by continue/step to avoid\r\n * immediately re-hitting the breakpoint on the block being resumed.\r\n */\r\n private _skipBreakpointForBlockId: Nullable<string> = null;\r\n\r\n /**\r\n * The assets context used by the flow graph context.\r\n * Note that it can be shared between flow graph contexts.\r\n */\r\n public assetsContext: IAssetContainer;\r\n\r\n /**\r\n * Whether to treat data as right-handed.\r\n * This is used when serializing data from a right-handed system, while running the context in a left-handed system, for example in glTF parsing.\r\n * Default is false.\r\n */\r\n public treatDataAsRightHanded = false;\r\n\r\n private _enableLogging = false;\r\n\r\n /**\r\n * The logger used by the context to log actions.\r\n */\r\n public logger: Nullable<FlowGraphLogger>;\r\n\r\n /**\r\n * Enable logging on this context\r\n */\r\n public get enableLogging() {\r\n return this._enableLogging;\r\n }\r\n\r\n public set enableLogging(value: boolean) {\r\n if (this._enableLogging === value) {\r\n return;\r\n }\r\n this._enableLogging = value;\r\n if (this._enableLogging) {\r\n this.logger = new FlowGraphLogger();\r\n this.logger.logToConsole = true;\r\n } else {\r\n this.logger = null;\r\n }\r\n }\r\n\r\n constructor(params: IFlowGraphContextConfiguration) {\r\n this._configuration = params;\r\n this.assetsContext = params.assetsContext ?? params.scene;\r\n }\r\n\r\n /**\r\n * Check if a user-defined variable is defined.\r\n * @param name the name of the variable\r\n * @returns true if the variable is defined\r\n */\r\n public hasVariable(name: string) {\r\n return name in this._userVariables;\r\n }\r\n\r\n /**\r\n * Set a user-defined variable.\r\n * @param name the name of the variable\r\n * @param value the value of the variable\r\n */\r\n public setVariable(name: string, value: any) {\r\n this._userVariables[name] = value;\r\n this.logger?.addLogItem({\r\n time: Date.now(),\r\n className: this.getClassName(),\r\n uniqueId: this.uniqueId,\r\n action: FlowGraphAction.ContextVariableSet,\r\n payload: {\r\n name,\r\n value,\r\n },\r\n });\r\n }\r\n\r\n /**\r\n * Get an assets from the assets context based on its type and index in the array\r\n * @param type The type of the asset\r\n * @param index The index of the asset\r\n * @returns The asset or null if not found\r\n */\r\n public getAsset<T extends FlowGraphAssetType>(type: T, index: number): Nullable<AssetType<T>> {\r\n return GetFlowGraphAssetWithType(this.assetsContext, type, index);\r\n }\r\n\r\n /**\r\n * Get a user-defined variable.\r\n * @param name the name of the variable\r\n * @returns the value of the variable\r\n */\r\n public getVariable(name: string): any {\r\n this.logger?.addLogItem({\r\n time: Date.now(),\r\n className: this.getClassName(),\r\n uniqueId: this.uniqueId,\r\n action: FlowGraphAction.ContextVariableGet,\r\n payload: {\r\n name,\r\n value: this._userVariables[name],\r\n },\r\n });\r\n return this._userVariables[name];\r\n }\r\n\r\n /**\r\n * Gets all user variables map\r\n */\r\n public get userVariables() {\r\n return this._userVariables;\r\n }\r\n\r\n /**\r\n * Set the declared type annotation for a user variable.\r\n * @param name - the variable name\r\n * @param typeName - the type name string (e.g. \"number\", \"Vector3\", \"Mesh\")\r\n */\r\n public setVariableType(name: string, typeName: string): void {\r\n this._variableTypes[name] = typeName;\r\n }\r\n\r\n /**\r\n * Get the declared type annotation for a user variable.\r\n * @param name - the variable name\r\n * @returns the type name string, or undefined if no type was declared\r\n */\r\n public getVariableType(name: string): string | undefined {\r\n return this._variableTypes[name];\r\n }\r\n\r\n /**\r\n * Gets all variable type annotations.\r\n */\r\n public get variableTypes(): { [key: string]: string } {\r\n return this._variableTypes;\r\n }\r\n\r\n /**\r\n * Get the scene that the context belongs to.\r\n * @returns the scene\r\n */\r\n public getScene() {\r\n return this._configuration.scene;\r\n }\r\n\r\n /**\r\n * Encodes an event source key as the opaque reference exposed by event blocks on their `event`\r\n * output. Delegates to the {@link IFlowGraphHostResolver} configured on the coordinator, so the\r\n * reference format is owned by the environment hosting the graph.\r\n * @param key the event source key (e.g. `\"sceneReady\"`, `\"sceneTick\"`, or a custom event id)\r\n * @returns the event reference\r\n */\r\n public getEventReference(key: string): string {\r\n return this._configuration.coordinator._getEventReference(key);\r\n }\r\n\r\n /**\r\n * Decodes the array index denoted by a reference. Returns `undefined` when no host resolver is\r\n * configured or the host does not recognise the value as an indexed reference.\r\n * @param reference the reference to decode\r\n * @param collection optional host collection the reference must address\r\n * @returns the index the reference denotes, or `undefined` when it does not denote one\r\n */\r\n public decodeIndexReference(reference: string, collection?: string): number | undefined {\r\n return this._configuration.coordinator.config.hostResolver?.decodeIndexReference?.(reference, collection);\r\n }\r\n\r\n /**\r\n * Maps a runtime object to the reference the host addresses it by. Returns `undefined` when no\r\n * host resolver is configured or the host cannot address the object.\r\n * @param object the runtime object to address\r\n * @param hint optional disambiguation hint telling the host which kind of reference is wanted\r\n * @returns the reference for the object, or `undefined` when it cannot be addressed\r\n */\r\n public getObjectReference(object: object, hint?: string): string | undefined {\r\n return this._configuration.coordinator.config.hostResolver?.getObjectReference?.(object, hint);\r\n }\r\n\r\n private _getUniqueIdPrefixedName(obj: FlowGraphBlock, name: string): string {\r\n return `${obj.uniqueId}_${name}`;\r\n }\r\n\r\n /**\r\n * @internal\r\n * @param name name of the variable\r\n * @param defaultValue default value to return if the variable is not defined\r\n * @returns the variable value or the default value if the variable is not defined\r\n */\r\n public _getGlobalContextVariable<T>(name: string, defaultValue: T): T {\r\n this.logger?.addLogItem({\r\n time: Date.now(),\r\n className: this.getClassName(),\r\n uniqueId: this.uniqueId,\r\n action: FlowGraphAction.GlobalVariableGet,\r\n payload: {\r\n name,\r\n defaultValue,\r\n possibleValue: this._globalContextVariables[name],\r\n },\r\n });\r\n if (this._hasGlobalContextVariable(name)) {\r\n return this._globalContextVariables[name];\r\n } else {\r\n return defaultValue;\r\n }\r\n }\r\n\r\n /**\r\n * Set a global context variable\r\n * @internal\r\n * @param name the name of the variable\r\n * @param value the value of the variable\r\n */\r\n public _setGlobalContextVariable<T>(name: string, value: T) {\r\n this.logger?.addLogItem({\r\n time: Date.now(),\r\n className: this.getClassName(),\r\n uniqueId: this.uniqueId,\r\n action: FlowGraphAction.GlobalVariableSet,\r\n payload: { name, value },\r\n });\r\n this._globalContextVariables[name] = value;\r\n }\r\n\r\n /**\r\n * Delete a global context variable\r\n * @internal\r\n * @param name the name of the variable\r\n */\r\n public _deleteGlobalContextVariable(name: string) {\r\n this.logger?.addLogItem({\r\n time: Date.now(),\r\n className: this.getClassName(),\r\n uniqueId: this.uniqueId,\r\n action: FlowGraphAction.GlobalVariableDelete,\r\n payload: { name },\r\n });\r\n delete this._globalContextVariables[name];\r\n }\r\n\r\n /**\r\n * Check if a global context variable is defined\r\n * @internal\r\n * @param name the name of the variable\r\n * @returns true if the variable is defined\r\n */\r\n public _hasGlobalContextVariable(name: string) {\r\n return name in this._globalContextVariables;\r\n }\r\n\r\n /**\r\n * Set an internal execution variable\r\n * @internal\r\n * @param name\r\n * @param value\r\n */\r\n public _setExecutionVariable(block: FlowGraphBlock, name: string, value: any) {\r\n this._executionVariables[this._getUniqueIdPrefixedName(block, name)] = value;\r\n }\r\n\r\n /**\r\n * Get an internal execution variable\r\n * @internal\r\n * @param name\r\n * @returns\r\n */\r\n public _getExecutionVariable<T>(block: FlowGraphBlock, name: string, defaultValue: T): T {\r\n if (this._hasExecutionVariable(block, name)) {\r\n return this._executionVariables[this._getUniqueIdPrefixedName(block, name)];\r\n } else {\r\n return defaultValue;\r\n }\r\n }\r\n\r\n /**\r\n * Delete an internal execution variable\r\n * @internal\r\n * @param block\r\n * @param name\r\n */\r\n public _deleteExecutionVariable(block: FlowGraphBlock, name: string) {\r\n delete this._executionVariables[this._getUniqueIdPrefixedName(block, name)];\r\n }\r\n\r\n /**\r\n * Check if an internal execution variable is defined\r\n * @internal\r\n * @param block\r\n * @param name\r\n * @returns\r\n */\r\n public _hasExecutionVariable(block: FlowGraphBlock, name: string) {\r\n return this._getUniqueIdPrefixedName(block, name) in this._executionVariables;\r\n }\r\n\r\n /**\r\n * Check if a connection value is defined\r\n * @internal\r\n * @param connectionPoint\r\n * @returns\r\n */\r\n public _hasConnectionValue(connectionPoint: FlowGraphDataConnection<any>) {\r\n return connectionPoint.uniqueId in this._connectionValues;\r\n }\r\n\r\n /**\r\n * Set a connection value\r\n * @internal\r\n * @param connectionPoint\r\n * @param value\r\n */\r\n public _setConnectionValue<T>(connectionPoint: FlowGraphDataConnection<T>, value: T) {\r\n this._connectionValues[connectionPoint.uniqueId] = value;\r\n this.logger?.addLogItem({\r\n time: Date.now(),\r\n className: this.getClassName(),\r\n uniqueId: this.uniqueId,\r\n action: FlowGraphAction.SetConnectionValue,\r\n payload: {\r\n connectionPointId: connectionPoint.uniqueId,\r\n value,\r\n },\r\n });\r\n }\r\n\r\n /**\r\n * Set a connection value by key\r\n * @internal\r\n * @param key the key of the connection value\r\n * @param value the value of the connection\r\n */\r\n public _setConnectionValueByKey<T>(key: string, value: T) {\r\n this._connectionValues[key] = value;\r\n }\r\n\r\n /**\r\n * Get a connection value\r\n * @internal\r\n * @param connectionPoint\r\n * @returns\r\n */\r\n public _getConnectionValue<T>(connectionPoint: FlowGraphDataConnection<T>): T {\r\n this.logger?.addLogItem({\r\n time: Date.now(),\r\n className: this.getClassName(),\r\n uniqueId: this.uniqueId,\r\n action: FlowGraphAction.GetConnectionValue,\r\n payload: {\r\n connectionPointId: connectionPoint.uniqueId,\r\n value: this._connectionValues[connectionPoint.uniqueId],\r\n },\r\n });\r\n return this._connectionValues[connectionPoint.uniqueId];\r\n }\r\n\r\n /**\r\n * Get the configuration\r\n * @internal\r\n * @param name\r\n * @param value\r\n */\r\n public get configuration() {\r\n return this._configuration;\r\n }\r\n\r\n /**\r\n * Check if there are any pending blocks in this context\r\n * @returns true if there are pending blocks\r\n */\r\n public get hasPendingBlocks() {\r\n return this._pendingBlocks.length > 0;\r\n }\r\n\r\n /**\r\n * Add a block to the list of blocks that have pending tasks.\r\n * @internal\r\n * @param block\r\n */\r\n public _addPendingBlock(block: FlowGraphAsyncExecutionBlock) {\r\n // check if block is already in the array\r\n if (this._pendingBlocks.includes(block)) {\r\n return;\r\n }\r\n this._pendingBlocks.push(block);\r\n // sort pending blocks by priority\r\n this._pendingBlocks.sort((a, b) => a.priority - b.priority);\r\n }\r\n\r\n /**\r\n * Remove a block from the list of blocks that have pending tasks.\r\n * @internal\r\n * @param block\r\n */\r\n public _removePendingBlock(block: FlowGraphAsyncExecutionBlock) {\r\n const index = this._pendingBlocks.indexOf(block);\r\n if (index !== -1) {\r\n this._pendingBlocks.splice(index, 1);\r\n }\r\n }\r\n\r\n /**\r\n * Clear all pending blocks.\r\n * @internal\r\n */\r\n public _clearPendingBlocks() {\r\n for (const block of this._pendingBlocks.slice()) {\r\n block._cancelPendingTasks(this);\r\n }\r\n this._pendingBlocks.length = 0;\r\n }\r\n\r\n /**\r\n * @internal\r\n * Function that notifies the node executed observable\r\n * @param node\r\n */\r\n public _notifyExecuteNode(node: FlowGraphBlock) {\r\n this.onNodeExecutedObservable.notifyObservers(node);\r\n this.logger?.addLogItem({\r\n time: Date.now(),\r\n className: node.getClassName(),\r\n uniqueId: node.uniqueId,\r\n action: FlowGraphAction.ExecuteBlock,\r\n });\r\n }\r\n\r\n public _notifyOnTick(framePayload: IFlowGraphOnTickEventPayload) {\r\n // set the values as global variables\r\n this._setGlobalContextVariable(\"timeSinceStart\", framePayload.timeSinceStart);\r\n this._setGlobalContextVariable(\"deltaTime\", framePayload.deltaTime);\r\n // iterate the pending blocks and run each one's onFrame function\r\n for (const block of this._pendingBlocks) {\r\n block._executeOnTick?.(this);\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _increaseExecutionId() {\r\n this._executionId++;\r\n }\r\n /**\r\n * A monotonically increasing ID for each execution.\r\n * Incremented for every block executed.\r\n */\r\n public get executionId() {\r\n return this._executionId;\r\n }\r\n\r\n // ── Breakpoint API ─────────────────────────────────────────────────\r\n\r\n /**\r\n * Check whether the given block should break before executing.\r\n * Called by the signal connection infrastructure.\r\n * @internal\r\n * @param block the block about to execute\r\n * @param signal the signal that is triggering the execution\r\n * @returns true if execution should be paused (breakpoint hit)\r\n */\r\n public _shouldBreak(block: FlowGraphExecutionBlock, signal: FlowGraphSignalConnection): boolean {\r\n // If continue/step just resumed this specific block, let it through\r\n if (this._skipBreakpointForBlockId === block.uniqueId) {\r\n this._skipBreakpointForBlockId = null;\r\n return false;\r\n }\r\n\r\n // If already paused on a breakpoint, silently block further execution\r\n // without overwriting the pending activation or re-notifying observers.\r\n if (this._pendingActivation) {\r\n return true;\r\n }\r\n\r\n if (this._stepMode) {\r\n this._stepMode = false;\r\n this._pendingActivation = { block, context: this, signal };\r\n this.onBreakpointHitObservable.notifyObservers(this._pendingActivation);\r\n return true;\r\n }\r\n if (this.breakpointPredicate && this.breakpointPredicate(block)) {\r\n this._pendingActivation = { block, context: this, signal };\r\n this.onBreakpointHitObservable.notifyObservers(this._pendingActivation);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Returns the currently paused activation, or null if not paused.\r\n */\r\n public get pendingActivation(): Nullable<IFlowGraphPendingActivation> {\r\n return this._pendingActivation;\r\n }\r\n\r\n /**\r\n * Resume execution from a breakpoint hit.\r\n * The paused block and all downstream blocks will execute normally until\r\n * the next breakpoint (if any) is hit.\r\n */\r\n public continueExecution(): void {\r\n const pending = this._pendingActivation;\r\n if (!pending) {\r\n return;\r\n }\r\n this._pendingActivation = null;\r\n // Tell _shouldBreak to skip the breakpoint for this block on re-entry\r\n this._skipBreakpointForBlockId = pending.block.uniqueId;\r\n pending.signal._activateSignal(this);\r\n // Clear in case no re-entry happened (shouldn't linger)\r\n this._skipBreakpointForBlockId = null;\r\n }\r\n\r\n /**\r\n * Execute exactly the paused block and then pause again before the next\r\n * execution block fires. If no activation is pending, this is a no-op.\r\n */\r\n public stepExecution(): void {\r\n const pending = this._pendingActivation;\r\n if (!pending) {\r\n return;\r\n }\r\n this._pendingActivation = null;\r\n // Enable step mode so the very next input-signal activation will pause\r\n this._stepMode = true;\r\n // Tell _shouldBreak to skip the breakpoint for this block on re-entry\r\n this._skipBreakpointForBlockId = pending.block.uniqueId;\r\n pending.signal._activateSignal(this);\r\n // If nothing further executed (end of chain), clear step mode\r\n this._stepMode = false;\r\n this._skipBreakpointForBlockId = null;\r\n }\r\n\r\n /**\r\n * Discard any pending breakpoint activation without resuming.\r\n * Used when stopping or resetting the graph.\r\n * @internal\r\n */\r\n public _clearPendingActivation(): void {\r\n this._pendingActivation = null;\r\n this._stepMode = false;\r\n this._skipBreakpointForBlockId = null;\r\n }\r\n\r\n /**\r\n * Serializes a context\r\n * @param serializationObject the object to write the values in\r\n * @param valueSerializationFunction a function to serialize complex values\r\n */\r\n public serialize(serializationObject: any = {}, valueSerializationFunction: (key: string, value: any, serializationObject: any) => void = defaultValueSerializationFunction) {\r\n serializationObject.uniqueId = this.uniqueId;\r\n serializationObject.name = this.name;\r\n serializationObject._userVariables = {};\r\n for (const key in this._userVariables) {\r\n valueSerializationFunction(key, this._userVariables[key], serializationObject._userVariables);\r\n }\r\n // Persist variable type annotations (editor metadata)\r\n if (Object.keys(this._variableTypes).length > 0) {\r\n serializationObject._variableTypes = { ...this._variableTypes };\r\n }\r\n serializationObject._connectionValues = {};\r\n for (const key in this._connectionValues) {\r\n valueSerializationFunction(key, this._connectionValues[key], serializationObject._connectionValues);\r\n }\r\n // serialize assets context, if not scene\r\n if (this.assetsContext !== this.getScene()) {\r\n serializationObject._assetsContext = {\r\n meshes: this.assetsContext.meshes.map((m) => m.id),\r\n materials: this.assetsContext.materials.map((m) => m.id),\r\n textures: this.assetsContext.textures.map((m) => m.name),\r\n animations: this.assetsContext.animations.map((m) => m.name),\r\n lights: this.assetsContext.lights.map((m) => m.id),\r\n cameras: this.assetsContext.cameras.map((m) => m.id),\r\n sounds: this.assetsContext.sounds?.map((m) => m.name),\r\n skeletons: this.assetsContext.skeletons.map((m) => m.id),\r\n particleSystems: this.assetsContext.particleSystems.map((m) => m.name),\r\n geometries: this.assetsContext.geometries.map((m) => m.id),\r\n multiMaterials: this.assetsContext.multiMaterials.map((m) => m.id),\r\n transformNodes: this.assetsContext.transformNodes.map((m) => m.id),\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * @returns the class name of the object.\r\n */\r\n public getClassName() {\r\n return \"FlowGraphContext\";\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"flowGraphContext.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphContext.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM1C,OAAO,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AAGpE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAA2C,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAG9G,OAAO,EAAmB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AA8DrE;;;;;GAKG;IACU,gBAAgB;;;;;;;;sBAAhB,gBAAgB;YA6GzB;;eAEG;YACH,IAAW,aA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AAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;wBAClE,cAAc,EAAE,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;qBACrE,CAAC;gBACN,CAAC;YACL,CAAC;YAED;;eAEG;YACI,YAAY;gBACf,OAAO,kBAAkB,CAAC;YAC9B,CAAC;;;;oCA9pBA,SAAS,EAAE;gCAMX,SAAS,EAAE;YALZ,0KAAO,QAAQ,6BAAR,QAAQ,2FAAgB;YAM/B,8JAAO,IAAI,6BAAJ,IAAI,mFAAc;;;;;SAXhB,gBAAgB","sourcesContent":["import { serialize } from \"../Misc/decorators\";\r\nimport { RandomGUID } from \"../Misc/guid\";\r\nimport { type Scene } from \"../scene\";\r\nimport { type FlowGraphAsyncExecutionBlock } from \"./flowGraphAsyncExecutionBlock\";\r\nimport { type FlowGraphBlock } from \"./flowGraphBlock\";\r\nimport { type FlowGraphDataConnection } from \"./flowGraphDataConnection\";\r\nimport { type FlowGraph } from \"./flowGraph\";\r\nimport { defaultValueSerializationFunction } from \"./serialization\";\r\nimport { type FlowGraphCoordinator } from \"./flowGraphCoordinator\";\r\nimport { type FlowGraphSceneEventCoordinator } from \"./flowGraphSceneEventCoordinator\";\r\nimport { Observable } from \"../Misc/observable\";\r\nimport { type AssetType, type FlowGraphAssetType, GetFlowGraphAssetWithType } from \"./flowGraphAssetsContext\";\r\nimport { type IAssetContainer } from \"core/IAssetContainer\";\r\nimport { type Nullable } from \"core/types\";\r\nimport { FlowGraphAction, FlowGraphLogger } from \"./flowGraphLogger\";\r\nimport { type IFlowGraphOnTickEventPayload } from \"./Blocks/Event/flowGraphSceneTickEventBlock\";\r\nimport { type FlowGraphExecutionBlock } from \"./flowGraphExecutionBlock\";\r\nimport { type FlowGraphSignalConnection } from \"./flowGraphSignalConnection\";\r\n\r\n/**\r\n * Represents a pending signal activation that was paused by a breakpoint.\r\n */\r\nexport interface IFlowGraphPendingActivation {\r\n /** The block that was about to execute */\r\n readonly block: FlowGraphExecutionBlock;\r\n /** The context in which execution was paused */\r\n readonly context: FlowGraphContext;\r\n /** The signal connection that triggered the execution */\r\n readonly signal: FlowGraphSignalConnection;\r\n}\r\n/**\r\n * Construction parameters for the context.\r\n */\r\nexport interface IFlowGraphContextConfiguration {\r\n /**\r\n * The scene that the flow graph context belongs to.\r\n */\r\n readonly scene: Scene;\r\n /**\r\n * The event coordinator used by the flow graph context.\r\n */\r\n readonly coordinator: FlowGraphCoordinator;\r\n\r\n /**\r\n * The scene event coordinator that tracks runtime event state\r\n * (e.g. currently pressed keyboard keys).\r\n * When not provided, keyboard polling blocks (e.g. IsKeyPressed) will\r\n * report no keys pressed.\r\n */\r\n readonly sceneEventCoordinator?: FlowGraphSceneEventCoordinator;\r\n\r\n /**\r\n * The assets context used by the flow graph context.\r\n * If none is provided, a default one will be created.\r\n */\r\n readonly assetsContext?: IAssetContainer;\r\n}\r\n\r\n/**\r\n * Options for parsing a context.\r\n */\r\nexport interface IFlowGraphContextParseOptions {\r\n /**\r\n * A function that parses a value from a serialization object.\r\n * @param key the key of the value\r\n * @param serializationObject the object containing the value\r\n * @param assetsContainer the assets container\r\n * @param scene the current scene\r\n * @returns\r\n */\r\n readonly valueParseFunction?: (key: string, serializationObject: any, assetsContainer: IAssetContainer, scene: Scene) => any;\r\n /**\r\n * The graph that the context is being parsed in.\r\n */\r\n readonly graph: FlowGraph;\r\n}\r\n/**\r\n * The context represents the current state and execution of the flow graph.\r\n * It contains both user-defined variables, which are derived from\r\n * a more general variable definition, and execution variables that\r\n * are set by the blocks.\r\n */\r\nexport class FlowGraphContext {\r\n /**\r\n * A randomly generated GUID for each context.\r\n */\r\n @serialize()\r\n public uniqueId = RandomGUID();\r\n /**\r\n * An optional user-facing name for the context.\r\n * Defaults to an empty string; the editor may assign a label like \"Context 0\".\r\n */\r\n @serialize()\r\n public name: string = \"\";\r\n /**\r\n * These are the variables defined by a user.\r\n */\r\n private _userVariables: { [key: string]: any } = {};\r\n /**\r\n * Optional type annotations for user variables.\r\n * Keys are variable names; values are type name strings (e.g. \"number\", \"Vector3\", \"Mesh\").\r\n * This map is maintained by the editor and persisted through serialization so\r\n * that a variable's declared type survives even when its value is undefined.\r\n */\r\n private _variableTypes: { [key: string]: string } = {};\r\n /**\r\n * These are the variables set by the blocks.\r\n */\r\n private _executionVariables: { [key: string]: any } = {};\r\n\r\n /**\r\n * A context-specific global variables, available to all blocks in the context.\r\n */\r\n private _globalContextVariables: { [key: string]: any } = {};\r\n /**\r\n * These are the values for the data connection points\r\n */\r\n private _connectionValues: { [key: string]: any } = {};\r\n /**\r\n * These are the variables set by the graph.\r\n */\r\n private readonly _configuration: IFlowGraphContextConfiguration;\r\n /**\r\n * These are blocks that have currently pending tasks/listeners that need to be cleaned up.\r\n */\r\n private _pendingBlocks: FlowGraphAsyncExecutionBlock[] = [];\r\n /**\r\n * A monotonically increasing ID for each execution.\r\n * Incremented for every block executed.\r\n */\r\n private _executionId = 0;\r\n /**\r\n * Observable that is triggered when a node is executed.\r\n */\r\n public onNodeExecutedObservable: Observable<FlowGraphBlock> = new Observable<FlowGraphBlock>();\r\n\r\n /**\r\n * Observable triggered when a breakpoint is hit.\r\n * Observers receive the pending activation (block, context, signal) that was paused.\r\n */\r\n public onBreakpointHitObservable: Observable<IFlowGraphPendingActivation> = new Observable<IFlowGraphPendingActivation>();\r\n\r\n /**\r\n * A predicate called before each execution block runs.\r\n * If it returns true, execution is paused before the block and a\r\n * pending activation is stored, which can be resumed via\r\n * {@link continueExecution} or {@link stepExecution}.\r\n *\r\n * Set to `null` to disable breakpoint checking.\r\n */\r\n public breakpointPredicate: Nullable<(block: FlowGraphExecutionBlock) => boolean> = null;\r\n\r\n /**\r\n * The activation that is currently paused due to a breakpoint hit.\r\n * `null` when execution is not paused on a breakpoint.\r\n */\r\n private _pendingActivation: Nullable<IFlowGraphPendingActivation> = null;\r\n\r\n /**\r\n * When true, the next activation will pause regardless of the breakpoint predicate.\r\n * Set by {@link stepExecution}.\r\n */\r\n private _stepMode: boolean = false;\r\n\r\n /**\r\n * When set, the breakpoint check is skipped for this specific block uniqueId\r\n * on the very next call to {@link _shouldBreak}. Used by continue/step to avoid\r\n * immediately re-hitting the breakpoint on the block being resumed.\r\n */\r\n private _skipBreakpointForBlockId: Nullable<string> = null;\r\n\r\n /**\r\n * The assets context used by the flow graph context.\r\n * Note that it can be shared between flow graph contexts.\r\n */\r\n public assetsContext: IAssetContainer;\r\n\r\n /**\r\n * Whether to treat data as right-handed.\r\n * This is used when serializing data from a right-handed system, while running the context in a left-handed system, for example in glTF parsing.\r\n * Default is false.\r\n */\r\n public treatDataAsRightHanded = false;\r\n\r\n private _enableLogging = false;\r\n\r\n /**\r\n * The logger used by the context to log actions.\r\n */\r\n public logger: Nullable<FlowGraphLogger>;\r\n\r\n /**\r\n * Enable logging on this context\r\n */\r\n public get enableLogging() {\r\n return this._enableLogging;\r\n }\r\n\r\n public set enableLogging(value: boolean) {\r\n if (this._enableLogging === value) {\r\n return;\r\n }\r\n this._enableLogging = value;\r\n if (this._enableLogging) {\r\n this.logger = new FlowGraphLogger();\r\n this.logger.logToConsole = true;\r\n } else {\r\n this.logger = null;\r\n }\r\n }\r\n\r\n constructor(params: IFlowGraphContextConfiguration) {\r\n this._configuration = params;\r\n this.assetsContext = params.assetsContext ?? params.scene;\r\n }\r\n\r\n /**\r\n * Check if a user-defined variable is defined.\r\n * @param name the name of the variable\r\n * @returns true if the variable is defined\r\n */\r\n public hasVariable(name: string) {\r\n return name in this._userVariables;\r\n }\r\n\r\n /**\r\n * Set a user-defined variable.\r\n * @param name the name of the variable\r\n * @param value the value of the variable\r\n */\r\n public setVariable(name: string, value: any) {\r\n this._userVariables[name] = value;\r\n this.logger?.addLogItem({\r\n time: Date.now(),\r\n className: this.getClassName(),\r\n uniqueId: this.uniqueId,\r\n action: FlowGraphAction.ContextVariableSet,\r\n payload: {\r\n name,\r\n value,\r\n },\r\n });\r\n }\r\n\r\n /**\r\n * Get an assets from the assets context based on its type and index in the array\r\n * @param type The type of the asset\r\n * @param index The index of the asset\r\n * @returns The asset or null if not found\r\n */\r\n public getAsset<T extends FlowGraphAssetType>(type: T, index: number): Nullable<AssetType<T>> {\r\n return GetFlowGraphAssetWithType(this.assetsContext, type, index);\r\n }\r\n\r\n /**\r\n * Get a user-defined variable.\r\n * @param name the name of the variable\r\n * @returns the value of the variable\r\n */\r\n public getVariable(name: string): any {\r\n this.logger?.addLogItem({\r\n time: Date.now(),\r\n className: this.getClassName(),\r\n uniqueId: this.uniqueId,\r\n action: FlowGraphAction.ContextVariableGet,\r\n payload: {\r\n name,\r\n value: this._userVariables[name],\r\n },\r\n });\r\n return this._userVariables[name];\r\n }\r\n\r\n /**\r\n * Gets all user variables map\r\n */\r\n public get userVariables() {\r\n return this._userVariables;\r\n }\r\n\r\n /**\r\n * Set the declared type annotation for a user variable.\r\n * @param name - the variable name\r\n * @param typeName - the type name string (e.g. \"number\", \"Vector3\", \"Mesh\")\r\n */\r\n public setVariableType(name: string, typeName: string): void {\r\n this._variableTypes[name] = typeName;\r\n }\r\n\r\n /**\r\n * Get the declared type annotation for a user variable.\r\n * @param name - the variable name\r\n * @returns the type name string, or undefined if no type was declared\r\n */\r\n public getVariableType(name: string): string | undefined {\r\n return this._variableTypes[name];\r\n }\r\n\r\n /**\r\n * Gets all variable type annotations.\r\n */\r\n public get variableTypes(): { [key: string]: string } {\r\n return this._variableTypes;\r\n }\r\n\r\n /**\r\n * Get the scene that the context belongs to.\r\n * @returns the scene\r\n */\r\n public getScene() {\r\n return this._configuration.scene;\r\n }\r\n\r\n /**\r\n * Encodes an event source key as the opaque reference exposed by event blocks on their `event`\r\n * output. Delegates to the {@link IFlowGraphHostResolver} configured on the coordinator, so the\r\n * reference format is owned by the environment hosting the graph.\r\n * @param key the event source key (e.g. `\"sceneReady\"`, `\"sceneTick\"`, or a custom event id)\r\n * @returns the event reference\r\n */\r\n public getEventReference(key: string): string {\r\n return this._configuration.coordinator._getEventReference(key);\r\n }\r\n\r\n /**\r\n * Decodes the array index denoted by a reference. Returns `undefined` when no host resolver is\r\n * configured or the host does not recognise the value as an indexed reference.\r\n * @param reference the reference to decode\r\n * @param collection optional host collection the reference must address\r\n * @returns the index the reference denotes, or `undefined` when it does not denote one\r\n */\r\n public decodeIndexReference(reference: string, collection?: string): number | undefined {\r\n return this._configuration.coordinator.config.hostResolver?.decodeIndexReference?.(reference, collection);\r\n }\r\n\r\n /**\r\n * Maps a runtime object to the reference the host addresses it by. Returns `undefined` when no\r\n * host resolver is configured or the host cannot address the object.\r\n * @param object the runtime object to address\r\n * @param hint optional disambiguation hint telling the host which kind of reference is wanted\r\n * @returns the reference for the object, or `undefined` when it cannot be addressed\r\n */\r\n public getObjectReference(object: object, hint?: string): string | undefined {\r\n return this._configuration.coordinator.config.hostResolver?.getObjectReference?.(object, hint);\r\n }\r\n\r\n private _getUniqueIdPrefixedName(obj: FlowGraphBlock, name: string): string {\r\n return `${obj.uniqueId}_${name}`;\r\n }\r\n\r\n /**\r\n * @internal\r\n * @param name name of the variable\r\n * @param defaultValue default value to return if the variable is not defined\r\n * @returns the variable value or the default value if the variable is not defined\r\n */\r\n public _getGlobalContextVariable<T>(name: string, defaultValue: T): T {\r\n this.logger?.addLogItem({\r\n time: Date.now(),\r\n className: this.getClassName(),\r\n uniqueId: this.uniqueId,\r\n action: FlowGraphAction.GlobalVariableGet,\r\n payload: {\r\n name,\r\n defaultValue,\r\n possibleValue: this._globalContextVariables[name],\r\n },\r\n });\r\n if (this._hasGlobalContextVariable(name)) {\r\n return this._globalContextVariables[name];\r\n } else {\r\n return defaultValue;\r\n }\r\n }\r\n\r\n /**\r\n * Set a global context variable\r\n * @internal\r\n * @param name the name of the variable\r\n * @param value the value of the variable\r\n */\r\n public _setGlobalContextVariable<T>(name: string, value: T) {\r\n this.logger?.addLogItem({\r\n time: Date.now(),\r\n className: this.getClassName(),\r\n uniqueId: this.uniqueId,\r\n action: FlowGraphAction.GlobalVariableSet,\r\n payload: { name, value },\r\n });\r\n this._globalContextVariables[name] = value;\r\n }\r\n\r\n /**\r\n * Delete a global context variable\r\n * @internal\r\n * @param name the name of the variable\r\n */\r\n public _deleteGlobalContextVariable(name: string) {\r\n this.logger?.addLogItem({\r\n time: Date.now(),\r\n className: this.getClassName(),\r\n uniqueId: this.uniqueId,\r\n action: FlowGraphAction.GlobalVariableDelete,\r\n payload: { name },\r\n });\r\n delete this._globalContextVariables[name];\r\n }\r\n\r\n /**\r\n * Check if a global context variable is defined\r\n * @internal\r\n * @param name the name of the variable\r\n * @returns true if the variable is defined\r\n */\r\n public _hasGlobalContextVariable(name: string) {\r\n return name in this._globalContextVariables;\r\n }\r\n\r\n /**\r\n * Set an internal execution variable\r\n * @internal\r\n * @param name\r\n * @param value\r\n */\r\n public _setExecutionVariable(block: FlowGraphBlock, name: string, value: any) {\r\n this._executionVariables[this._getUniqueIdPrefixedName(block, name)] = value;\r\n }\r\n\r\n /**\r\n * Get an internal execution variable\r\n * @internal\r\n * @param name\r\n * @returns\r\n */\r\n public _getExecutionVariable<T>(block: FlowGraphBlock, name: string, defaultValue: T): T {\r\n if (this._hasExecutionVariable(block, name)) {\r\n return this._executionVariables[this._getUniqueIdPrefixedName(block, name)];\r\n } else {\r\n return defaultValue;\r\n }\r\n }\r\n\r\n /**\r\n * Delete an internal execution variable\r\n * @internal\r\n * @param block\r\n * @param name\r\n */\r\n public _deleteExecutionVariable(block: FlowGraphBlock, name: string) {\r\n delete this._executionVariables[this._getUniqueIdPrefixedName(block, name)];\r\n }\r\n\r\n /**\r\n * Check if an internal execution variable is defined\r\n * @internal\r\n * @param block\r\n * @param name\r\n * @returns\r\n */\r\n public _hasExecutionVariable(block: FlowGraphBlock, name: string) {\r\n return this._getUniqueIdPrefixedName(block, name) in this._executionVariables;\r\n }\r\n\r\n /**\r\n * Check if a connection value is defined\r\n * @internal\r\n * @param connectionPoint\r\n * @returns\r\n */\r\n public _hasConnectionValue(connectionPoint: FlowGraphDataConnection<any>) {\r\n return connectionPoint.uniqueId in this._connectionValues;\r\n }\r\n\r\n /**\r\n * Set a connection value\r\n * @internal\r\n * @param connectionPoint\r\n * @param value\r\n */\r\n public _setConnectionValue<T>(connectionPoint: FlowGraphDataConnection<T>, value: T) {\r\n this._connectionValues[connectionPoint.uniqueId] = value;\r\n this.logger?.addLogItem({\r\n time: Date.now(),\r\n className: this.getClassName(),\r\n uniqueId: this.uniqueId,\r\n action: FlowGraphAction.SetConnectionValue,\r\n payload: {\r\n connectionPointId: connectionPoint.uniqueId,\r\n value,\r\n },\r\n });\r\n }\r\n\r\n /**\r\n * Set a connection value by key\r\n * @internal\r\n * @param key the key of the connection value\r\n * @param value the value of the connection\r\n */\r\n public _setConnectionValueByKey<T>(key: string, value: T) {\r\n this._connectionValues[key] = value;\r\n }\r\n\r\n /**\r\n * Get a connection value\r\n * @internal\r\n * @param connectionPoint\r\n * @returns\r\n */\r\n public _getConnectionValue<T>(connectionPoint: FlowGraphDataConnection<T>): T {\r\n this.logger?.addLogItem({\r\n time: Date.now(),\r\n className: this.getClassName(),\r\n uniqueId: this.uniqueId,\r\n action: FlowGraphAction.GetConnectionValue,\r\n payload: {\r\n connectionPointId: connectionPoint.uniqueId,\r\n value: this._connectionValues[connectionPoint.uniqueId],\r\n },\r\n });\r\n return this._connectionValues[connectionPoint.uniqueId];\r\n }\r\n\r\n /**\r\n * Get the configuration\r\n * @internal\r\n * @param name\r\n * @param value\r\n */\r\n public get configuration() {\r\n return this._configuration;\r\n }\r\n\r\n /**\r\n * Check if there are any pending blocks in this context\r\n * @returns true if there are pending blocks\r\n */\r\n public get hasPendingBlocks() {\r\n return this._pendingBlocks.length > 0;\r\n }\r\n\r\n /**\r\n * Add a block to the list of blocks that have pending tasks.\r\n * @internal\r\n * @param block\r\n */\r\n public _addPendingBlock(block: FlowGraphAsyncExecutionBlock) {\r\n // check if block is already in the array\r\n if (this._pendingBlocks.includes(block)) {\r\n return;\r\n }\r\n this._pendingBlocks.push(block);\r\n // sort pending blocks by priority\r\n this._pendingBlocks.sort((a, b) => a.priority - b.priority);\r\n }\r\n\r\n /**\r\n * Remove a block from the list of blocks that have pending tasks.\r\n * @internal\r\n * @param block\r\n */\r\n public _removePendingBlock(block: FlowGraphAsyncExecutionBlock) {\r\n const index = this._pendingBlocks.indexOf(block);\r\n if (index !== -1) {\r\n this._pendingBlocks.splice(index, 1);\r\n }\r\n }\r\n\r\n /**\r\n * Clear all pending blocks.\r\n * @internal\r\n */\r\n public _clearPendingBlocks() {\r\n for (const block of this._pendingBlocks.slice()) {\r\n block._cancelPendingTasks(this);\r\n }\r\n this._pendingBlocks.length = 0;\r\n }\r\n\r\n /**\r\n * @internal\r\n * Function that notifies the node executed observable\r\n * @param node\r\n */\r\n public _notifyExecuteNode(node: FlowGraphBlock) {\r\n this.onNodeExecutedObservable.notifyObservers(node);\r\n this.logger?.addLogItem({\r\n time: Date.now(),\r\n className: node.getClassName(),\r\n uniqueId: node.uniqueId,\r\n action: FlowGraphAction.ExecuteBlock,\r\n });\r\n }\r\n\r\n public _notifyOnTick(framePayload: IFlowGraphOnTickEventPayload) {\r\n // set the values as global variables\r\n this._setGlobalContextVariable(\"firstTickPayload\", this._getGlobalContextVariable(\"firstTickPayload\", framePayload));\r\n this._setGlobalContextVariable(\"timeSinceStart\", framePayload.timeSinceStart);\r\n this._setGlobalContextVariable(\"deltaTime\", framePayload.deltaTime);\r\n // iterate the pending blocks and run each one's onFrame function\r\n for (const block of this._pendingBlocks) {\r\n block._executeOnTick?.(this);\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _increaseExecutionId() {\r\n this._executionId++;\r\n }\r\n /**\r\n * A monotonically increasing ID for each execution.\r\n * Incremented for every block executed.\r\n */\r\n public get executionId() {\r\n return this._executionId;\r\n }\r\n\r\n // ── Breakpoint API ─────────────────────────────────────────────────\r\n\r\n /**\r\n * Check whether the given block should break before executing.\r\n * Called by the signal connection infrastructure.\r\n * @internal\r\n * @param block the block about to execute\r\n * @param signal the signal that is triggering the execution\r\n * @returns true if execution should be paused (breakpoint hit)\r\n */\r\n public _shouldBreak(block: FlowGraphExecutionBlock, signal: FlowGraphSignalConnection): boolean {\r\n // If continue/step just resumed this specific block, let it through\r\n if (this._skipBreakpointForBlockId === block.uniqueId) {\r\n this._skipBreakpointForBlockId = null;\r\n return false;\r\n }\r\n\r\n // If already paused on a breakpoint, silently block further execution\r\n // without overwriting the pending activation or re-notifying observers.\r\n if (this._pendingActivation) {\r\n return true;\r\n }\r\n\r\n if (this._stepMode) {\r\n this._stepMode = false;\r\n this._pendingActivation = { block, context: this, signal };\r\n this.onBreakpointHitObservable.notifyObservers(this._pendingActivation);\r\n return true;\r\n }\r\n if (this.breakpointPredicate && this.breakpointPredicate(block)) {\r\n this._pendingActivation = { block, context: this, signal };\r\n this.onBreakpointHitObservable.notifyObservers(this._pendingActivation);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Returns the currently paused activation, or null if not paused.\r\n */\r\n public get pendingActivation(): Nullable<IFlowGraphPendingActivation> {\r\n return this._pendingActivation;\r\n }\r\n\r\n /**\r\n * Resume execution from a breakpoint hit.\r\n * The paused block and all downstream blocks will execute normally until\r\n * the next breakpoint (if any) is hit.\r\n */\r\n public continueExecution(): void {\r\n const pending = this._pendingActivation;\r\n if (!pending) {\r\n return;\r\n }\r\n this._pendingActivation = null;\r\n // Tell _shouldBreak to skip the breakpoint for this block on re-entry\r\n this._skipBreakpointForBlockId = pending.block.uniqueId;\r\n pending.signal._activateSignal(this);\r\n // Clear in case no re-entry happened (shouldn't linger)\r\n this._skipBreakpointForBlockId = null;\r\n }\r\n\r\n /**\r\n * Execute exactly the paused block and then pause again before the next\r\n * execution block fires. If no activation is pending, this is a no-op.\r\n */\r\n public stepExecution(): void {\r\n const pending = this._pendingActivation;\r\n if (!pending) {\r\n return;\r\n }\r\n this._pendingActivation = null;\r\n // Enable step mode so the very next input-signal activation will pause\r\n this._stepMode = true;\r\n // Tell _shouldBreak to skip the breakpoint for this block on re-entry\r\n this._skipBreakpointForBlockId = pending.block.uniqueId;\r\n pending.signal._activateSignal(this);\r\n // If nothing further executed (end of chain), clear step mode\r\n this._stepMode = false;\r\n this._skipBreakpointForBlockId = null;\r\n }\r\n\r\n /**\r\n * Discard any pending breakpoint activation without resuming.\r\n * Used when stopping or resetting the graph.\r\n * @internal\r\n */\r\n public _clearPendingActivation(): void {\r\n this._pendingActivation = null;\r\n this._stepMode = false;\r\n this._skipBreakpointForBlockId = null;\r\n }\r\n\r\n /**\r\n * Serializes a context\r\n * @param serializationObject the object to write the values in\r\n * @param valueSerializationFunction a function to serialize complex values\r\n */\r\n public serialize(serializationObject: any = {}, valueSerializationFunction: (key: string, value: any, serializationObject: any) => void = defaultValueSerializationFunction) {\r\n serializationObject.uniqueId = this.uniqueId;\r\n serializationObject.name = this.name;\r\n serializationObject._userVariables = {};\r\n for (const key in this._userVariables) {\r\n valueSerializationFunction(key, this._userVariables[key], serializationObject._userVariables);\r\n }\r\n // Persist variable type annotations (editor metadata)\r\n if (Object.keys(this._variableTypes).length > 0) {\r\n serializationObject._variableTypes = { ...this._variableTypes };\r\n }\r\n serializationObject._connectionValues = {};\r\n for (const key in this._connectionValues) {\r\n valueSerializationFunction(key, this._connectionValues[key], serializationObject._connectionValues);\r\n }\r\n // serialize assets context, if not scene\r\n if (this.assetsContext !== this.getScene()) {\r\n serializationObject._assetsContext = {\r\n meshes: this.assetsContext.meshes.map((m) => m.id),\r\n materials: this.assetsContext.materials.map((m) => m.id),\r\n textures: this.assetsContext.textures.map((m) => m.name),\r\n animations: this.assetsContext.animations.map((m) => m.name),\r\n lights: this.assetsContext.lights.map((m) => m.id),\r\n cameras: this.assetsContext.cameras.map((m) => m.id),\r\n sounds: this.assetsContext.sounds?.map((m) => m.name),\r\n skeletons: this.assetsContext.skeletons.map((m) => m.id),\r\n particleSystems: this.assetsContext.particleSystems.map((m) => m.name),\r\n geometries: this.assetsContext.geometries.map((m) => m.id),\r\n multiMaterials: this.assetsContext.multiMaterials.map((m) => m.id),\r\n transformNodes: this.assetsContext.transformNodes.map((m) => m.id),\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * @returns the class name of the object.\r\n */\r\n public getClassName() {\r\n return \"FlowGraphContext\";\r\n }\r\n}\r\n"]}
|
|
@@ -269,10 +269,6 @@ function _DetectDataCycles(allBlocks, addIssue) {
|
|
|
269
269
|
for (const block of allBlocks) {
|
|
270
270
|
color.set(block.uniqueId, white);
|
|
271
271
|
}
|
|
272
|
-
const blockMap = new Map();
|
|
273
|
-
for (const block of allBlocks) {
|
|
274
|
-
blockMap.set(block.uniqueId, block);
|
|
275
|
-
}
|
|
276
272
|
const reportedCycleBlocks = new Set();
|
|
277
273
|
function dfs(block) {
|
|
278
274
|
color.set(block.uniqueId, gray);
|