@babylonjs/core 7.51.1 → 7.51.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animation.js +2 -1
- package/Animations/animation.js.map +1 -1
- package/Buffers/bufferUtils.d.ts +7 -5
- package/Buffers/bufferUtils.js +13 -9
- package/Buffers/bufferUtils.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +32 -0
- package/Engines/constants.js +33 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/webgpuEngine.js +6 -3
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.d.ts +148 -465
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +394 -691
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.d.ts +142 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.js +342 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.js.map +1 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.d.ts +107 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js +130 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js.map +1 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.d.ts +77 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.js +139 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.js.map +1 -0
- package/FlowGraph/Blocks/Data/Math/index.d.ts +3 -0
- package/FlowGraph/Blocks/Data/Math/index.js +3 -0
- package/FlowGraph/Blocks/Data/Math/index.js.map +1 -1
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.d.ts +85 -0
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js +133 -0
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/Transformers/flowGraphTypeToTypeBlocks.d.ts +49 -0
- package/FlowGraph/Blocks/Data/Transformers/flowGraphTypeToTypeBlocks.js +71 -0
- package/FlowGraph/Blocks/Data/Transformers/flowGraphTypeToTypeBlocks.js.map +1 -0
- package/FlowGraph/Blocks/Data/Transformers/index.d.ts +2 -0
- package/FlowGraph/Blocks/Data/Transformers/index.js +3 -0
- package/FlowGraph/Blocks/Data/Transformers/index.js.map +1 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.d.ts +39 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.js +46 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.d.ts +35 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.js +34 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphContextBlock.d.ts +20 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphContextBlock.js +25 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphContextBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphFunctionReferenceBlock.d.ts +34 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphFunctionReferenceBlock.js +35 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphFunctionReferenceBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphIndexOfBlock.d.ts +39 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphIndexOfBlock.js +42 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphIndexOfBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/Utils/index.d.ts +5 -0
- package/FlowGraph/Blocks/Data/Utils/index.js +6 -0
- package/FlowGraph/Blocks/Data/Utils/index.js.map +1 -0
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.d.ts +0 -1
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js +3 -2
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +4 -4
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.d.ts +6 -3
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js +12 -6
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.d.ts +0 -2
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js +2 -3
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.d.ts +5 -4
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js +5 -4
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetAssetBlock.d.ts +62 -0
- package/FlowGraph/Blocks/Data/flowGraphGetAssetBlock.js +41 -0
- package/FlowGraph/Blocks/Data/flowGraphGetAssetBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.d.ts +38 -33
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js +42 -25
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.d.ts +11 -16
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +9 -17
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js +1 -1
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/{flowGraphCoordinateTransformBlock.d.ts → flowGraphTransformCoordinatesSystemBlock.d.ts} +1 -2
- package/FlowGraph/Blocks/Data/{flowGraphCoordinateTransformBlock.js → flowGraphTransformCoordinatesSystemBlock.js} +4 -5
- package/FlowGraph/Blocks/Data/flowGraphTransformCoordinatesSystemBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/index.d.ts +7 -3
- package/FlowGraph/Blocks/Data/index.js +9 -4
- package/FlowGraph/Blocks/Data/index.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.d.ts +45 -24
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +45 -51
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.d.ts +61 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.js +39 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.js.map +1 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.d.ts +61 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.js +40 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.js.map +1 -0
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +12 -14
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +19 -26
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.d.ts +6 -12
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js +13 -24
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.d.ts +31 -7
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js +22 -20
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/{Execution → Event}/flowGraphSendCustomEventBlock.d.ts +12 -7
- package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.js +39 -0
- package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.js.map +1 -0
- package/FlowGraph/Blocks/Event/index.d.ts +3 -0
- package/FlowGraph/Blocks/Event/index.js +3 -0
- package/FlowGraph/Blocks/Event/index.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.d.ts +44 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.js +46 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphEasingBlock.d.ts +60 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphEasingBlock.js +93 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphEasingBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.d.ts +82 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.js +105 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +2 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +40 -42
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +116 -50
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.d.ts +12 -4
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +86 -8
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/index.d.ts +3 -0
- package/FlowGraph/Blocks/Execution/Animation/index.js +3 -0
- package/FlowGraph/Blocks/Execution/Animation/index.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.d.ts +1 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js +3 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/{Audio/flowGraphStopAudioBlock.d.ts → ControlFlow/flowGraphCancelDelayBlock.d.ts} +6 -8
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js +31 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +5 -5
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.d.ts +0 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +2 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +5 -10
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +11 -15
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.d.ts +11 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js +5 -6
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.d.ts +27 -7
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +28 -30
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.d.ts +13 -16
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js +50 -52
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.d.ts +8 -9
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js +26 -13
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.d.ts +32 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js +84 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.d.ts +20 -6
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js +55 -16
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.d.ts +3 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +36 -13
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +13 -5
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +22 -17
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +12 -16
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +21 -21
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/index.d.ts +2 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/index.js +2 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/index.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.d.ts +4 -5
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js +13 -8
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +33 -36
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +42 -26
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +10 -25
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +38 -24
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/index.d.ts +0 -3
- package/FlowGraph/Blocks/Execution/index.js +0 -3
- package/FlowGraph/Blocks/Execution/index.js.map +1 -1
- package/FlowGraph/Blocks/flowGraphBlockFactory.d.ts +16 -0
- package/FlowGraph/Blocks/flowGraphBlockFactory.js +292 -0
- package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -0
- package/FlowGraph/Blocks/flowGraphBlockNames.d.ts +145 -0
- package/FlowGraph/Blocks/flowGraphBlockNames.js +147 -0
- package/FlowGraph/Blocks/flowGraphBlockNames.js.map +1 -0
- package/FlowGraph/Blocks/index.d.ts +2 -0
- package/FlowGraph/Blocks/index.js +2 -0
- package/FlowGraph/Blocks/index.js.map +1 -1
- package/FlowGraph/{flowGraphInteger.d.ts → CustomTypes/flowGraphInteger.d.ts} +2 -3
- package/FlowGraph/{flowGraphInteger.js → CustomTypes/flowGraphInteger.js} +4 -5
- package/FlowGraph/CustomTypes/flowGraphInteger.js.map +1 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +196 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js +272 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -0
- package/FlowGraph/CustomTypes/index.d.ts +2 -0
- package/FlowGraph/CustomTypes/index.js +3 -0
- package/FlowGraph/CustomTypes/index.js.map +1 -0
- package/FlowGraph/flowGraph.d.ts +29 -34
- package/FlowGraph/flowGraph.js +120 -104
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphAssetsContext.d.ts +29 -0
- package/FlowGraph/flowGraphAssetsContext.js +52 -0
- package/FlowGraph/flowGraphAssetsContext.js.map +1 -0
- package/FlowGraph/flowGraphAsyncExecutionBlock.d.ts +15 -8
- package/FlowGraph/flowGraphAsyncExecutionBlock.js +25 -5
- package/FlowGraph/flowGraphAsyncExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphBlock.d.ts +22 -15
- package/FlowGraph/flowGraphBlock.js +31 -52
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphConnection.d.ts +13 -12
- package/FlowGraph/flowGraphConnection.js +31 -16
- package/FlowGraph/flowGraphConnection.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +89 -13
- package/FlowGraph/flowGraphContext.js +210 -23
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.d.ts +4 -10
- package/FlowGraph/flowGraphCoordinator.js +4 -16
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FlowGraph/flowGraphDataConnection.d.ts +52 -14
- package/FlowGraph/flowGraphDataConnection.js +73 -26
- package/FlowGraph/flowGraphDataConnection.js.map +1 -1
- package/FlowGraph/flowGraphEventBlock.d.ts +17 -1
- package/FlowGraph/flowGraphEventBlock.js +13 -2
- package/FlowGraph/flowGraphEventBlock.js.map +1 -1
- package/FlowGraph/flowGraphEventType.d.ts +16 -0
- package/FlowGraph/flowGraphEventType.js +18 -0
- package/FlowGraph/flowGraphEventType.js.map +1 -0
- package/FlowGraph/flowGraphExecutionBlock.d.ts +11 -1
- package/FlowGraph/flowGraphExecutionBlock.js +21 -2
- package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphExecutionBlockWithOutSignal.d.ts +2 -2
- package/FlowGraph/flowGraphExecutionBlockWithOutSignal.js +0 -1
- package/FlowGraph/flowGraphExecutionBlockWithOutSignal.js.map +1 -1
- package/FlowGraph/flowGraphLogger.d.ts +60 -0
- package/FlowGraph/flowGraphLogger.js +53 -0
- package/FlowGraph/flowGraphLogger.js.map +1 -0
- package/FlowGraph/flowGraphParser.d.ts +85 -0
- package/FlowGraph/flowGraphParser.js +271 -0
- package/FlowGraph/flowGraphParser.js.map +1 -0
- package/FlowGraph/flowGraphPathConverter.d.ts +1 -1
- package/FlowGraph/flowGraphPathConverter.js +3 -2
- package/FlowGraph/flowGraphPathConverter.js.map +1 -1
- package/FlowGraph/flowGraphPathConverterComponent.d.ts +8 -1
- package/FlowGraph/flowGraphPathConverterComponent.js +18 -2
- package/FlowGraph/flowGraphPathConverterComponent.js.map +1 -1
- package/FlowGraph/flowGraphRichTypes.d.ts +51 -9
- package/FlowGraph/flowGraphRichTypes.js +160 -50
- package/FlowGraph/flowGraphRichTypes.js.map +1 -1
- package/FlowGraph/flowGraphSceneEventCoordinator.d.ts +45 -0
- package/FlowGraph/flowGraphSceneEventCoordinator.js +77 -0
- package/FlowGraph/flowGraphSceneEventCoordinator.js.map +1 -0
- package/FlowGraph/flowGraphSignalConnection.d.ts +8 -5
- package/FlowGraph/flowGraphSignalConnection.js +26 -9
- package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
- package/FlowGraph/index.d.ts +6 -1
- package/FlowGraph/index.js +7 -1
- package/FlowGraph/index.js.map +1 -1
- package/FlowGraph/serialization.d.ts +5 -2
- package/FlowGraph/serialization.js +94 -22
- package/FlowGraph/serialization.js.map +1 -1
- package/FlowGraph/typeDefinitions.d.ts +74 -12
- package/FlowGraph/typeDefinitions.js.map +1 -1
- package/FlowGraph/utils.d.ts +47 -0
- package/FlowGraph/utils.js +55 -0
- package/FlowGraph/utils.js.map +1 -1
- package/Maths/math.path.js +3 -0
- package/Maths/math.path.js.map +1 -1
- package/Meshes/geometry.d.ts +2 -1
- package/Meshes/geometry.js +8 -2
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/mesh.d.ts +2 -1
- package/Meshes/mesh.js +3 -2
- package/Meshes/mesh.js.map +1 -1
- package/ObjectModel/objectModelInterfaces.d.ts +2 -2
- package/ObjectModel/objectModelInterfaces.js.map +1 -1
- package/package.json +1 -1
- package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.d.ts +0 -24
- package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js +0 -39
- package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js.map +0 -1
- package/FlowGraph/Blocks/Data/Logic/index.d.ts +0 -1
- package/FlowGraph/Blocks/Data/Logic/index.js +0 -2
- package/FlowGraph/Blocks/Data/Logic/index.js.map +0 -1
- package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js.map +0 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.d.ts +0 -19
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js +0 -26
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +0 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js +0 -25
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +0 -1
- package/FlowGraph/Blocks/Execution/Audio/index.d.ts +0 -2
- package/FlowGraph/Blocks/Execution/Audio/index.js +0 -3
- package/FlowGraph/Blocks/Execution/Audio/index.js.map +0 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.d.ts +0 -31
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js +0 -69
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +0 -1
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +0 -38
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +0 -1
- package/FlowGraph/flowGraphContextLogger.d.ts +0 -9
- package/FlowGraph/flowGraphContextLogger.js +0 -14
- package/FlowGraph/flowGraphContextLogger.js.map +0 -1
- package/FlowGraph/flowGraphInteger.js.map +0 -1
|
@@ -4,17 +4,15 @@ import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnecti
|
|
|
4
4
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
5
5
|
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal";
|
|
6
6
|
/**
|
|
7
|
-
* @experimental
|
|
8
7
|
* Configuration for the while loop block.
|
|
9
8
|
*/
|
|
10
9
|
export interface IFlowGraphWhileLoopBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
11
10
|
/**
|
|
12
11
|
* If true, the loop body will be executed at least once.
|
|
13
12
|
*/
|
|
14
|
-
|
|
13
|
+
doWhile?: boolean;
|
|
15
14
|
}
|
|
16
15
|
/**
|
|
17
|
-
* @experimental
|
|
18
16
|
* A block that executes a branch while a condition is true.
|
|
19
17
|
*/
|
|
20
18
|
export declare class FlowGraphWhileLoopBlock extends FlowGraphExecutionBlockWithOutSignal {
|
|
@@ -22,6 +20,11 @@ export declare class FlowGraphWhileLoopBlock extends FlowGraphExecutionBlockWith
|
|
|
22
20
|
* the configuration of the block
|
|
23
21
|
*/
|
|
24
22
|
config?: IFlowGraphWhileLoopBlockConfiguration | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* The maximum number of iterations allowed in a loop.
|
|
25
|
+
* This can be set to avoid an infinite loop.
|
|
26
|
+
*/
|
|
27
|
+
static MaxLoopCount: number;
|
|
25
28
|
/**
|
|
26
29
|
* Input connection: The condition to evaluate.
|
|
27
30
|
*/
|
|
@@ -29,24 +32,17 @@ export declare class FlowGraphWhileLoopBlock extends FlowGraphExecutionBlockWith
|
|
|
29
32
|
/**
|
|
30
33
|
* Output connection: The loop body.
|
|
31
34
|
*/
|
|
32
|
-
readonly
|
|
35
|
+
readonly executionFlow: FlowGraphSignalConnection;
|
|
36
|
+
/**
|
|
37
|
+
* Output connection: The completed signal. Triggered when condition is false.
|
|
38
|
+
* No out signal is available.
|
|
39
|
+
*/
|
|
40
|
+
readonly completed: FlowGraphSignalConnection;
|
|
33
41
|
constructor(
|
|
34
42
|
/**
|
|
35
43
|
* the configuration of the block
|
|
36
44
|
*/
|
|
37
45
|
config?: IFlowGraphWhileLoopBlockConfiguration | undefined);
|
|
38
46
|
_execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void;
|
|
39
|
-
/**
|
|
40
|
-
* @returns class name of the block.
|
|
41
|
-
*/
|
|
42
47
|
getClassName(): string;
|
|
43
|
-
/**
|
|
44
|
-
* the class name of the block.
|
|
45
|
-
*/
|
|
46
|
-
static ClassName: string;
|
|
47
|
-
/**
|
|
48
|
-
* Serializes the block to a JSON object.
|
|
49
|
-
* @param serializationObject the object to serialize to.
|
|
50
|
-
*/
|
|
51
|
-
serialize(serializationObject?: any): void;
|
|
52
48
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { RichTypeBoolean } from "../../../flowGraphRichTypes.js";
|
|
2
2
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
3
3
|
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal.js";
|
|
4
|
+
import { Logger } from "../../../../Misc/logger.js";
|
|
4
5
|
/**
|
|
5
|
-
* @experimental
|
|
6
6
|
* A block that executes a branch while a condition is true.
|
|
7
7
|
*/
|
|
8
8
|
export class FlowGraphWhileLoopBlock extends FlowGraphExecutionBlockWithOutSignal {
|
|
@@ -14,37 +14,37 @@ export class FlowGraphWhileLoopBlock extends FlowGraphExecutionBlockWithOutSigna
|
|
|
14
14
|
super(config);
|
|
15
15
|
this.config = config;
|
|
16
16
|
this.condition = this.registerDataInput("condition", RichTypeBoolean);
|
|
17
|
-
this.
|
|
17
|
+
this.executionFlow = this._registerSignalOutput("executionFlow");
|
|
18
|
+
this.completed = this._registerSignalOutput("completed");
|
|
19
|
+
// unregister "out" signal
|
|
20
|
+
this._unregisterSignalOutput("out");
|
|
18
21
|
}
|
|
19
22
|
_execute(context, _callingSignal) {
|
|
20
23
|
let conditionValue = this.condition.getValue(context);
|
|
21
|
-
if (this.config?.
|
|
22
|
-
this.
|
|
24
|
+
if (this.config?.doWhile && !conditionValue) {
|
|
25
|
+
this.executionFlow._activateSignal(context);
|
|
23
26
|
}
|
|
27
|
+
let i = 0;
|
|
24
28
|
while (conditionValue) {
|
|
25
|
-
this.
|
|
29
|
+
this.executionFlow._activateSignal(context);
|
|
30
|
+
++i;
|
|
31
|
+
if (i >= FlowGraphWhileLoopBlock.MaxLoopCount) {
|
|
32
|
+
Logger.Warn("FlowGraphWhileLoopBlock: Max loop count reached. Breaking.");
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
26
35
|
conditionValue = this.condition.getValue(context);
|
|
27
36
|
}
|
|
28
|
-
|
|
37
|
+
// out is not triggered - completed is triggered
|
|
38
|
+
this.completed._activateSignal(context);
|
|
29
39
|
}
|
|
30
|
-
/**
|
|
31
|
-
* @returns class name of the block.
|
|
32
|
-
*/
|
|
33
40
|
getClassName() {
|
|
34
|
-
return FlowGraphWhileLoopBlock.
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Serializes the block to a JSON object.
|
|
38
|
-
* @param serializationObject the object to serialize to.
|
|
39
|
-
*/
|
|
40
|
-
serialize(serializationObject) {
|
|
41
|
-
super.serialize(serializationObject);
|
|
42
|
-
serializationObject.isDo = this.config?.isDo;
|
|
41
|
+
return "FlowGraphWhileLoopBlock" /* FlowGraphBlockNames.WhileLoop */;
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
/**
|
|
46
|
-
*
|
|
45
|
+
* The maximum number of iterations allowed in a loop.
|
|
46
|
+
* This can be set to avoid an infinite loop.
|
|
47
47
|
*/
|
|
48
|
-
FlowGraphWhileLoopBlock.
|
|
49
|
-
RegisterClass(FlowGraphWhileLoopBlock.
|
|
48
|
+
FlowGraphWhileLoopBlock.MaxLoopCount = 1000;
|
|
49
|
+
RegisterClass("FlowGraphWhileLoopBlock" /* FlowGraphBlockNames.WhileLoop */, FlowGraphWhileLoopBlock);
|
|
50
50
|
//# sourceMappingURL=flowGraphWhileLoopBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphWhileLoopBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,oCAAoC,EAAE,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"flowGraphWhileLoopBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,oCAAoC,EAAE,MAAM,+CAA+C,CAAC;AACrG,OAAO,EAAE,MAAM,EAAE,mCAAyB;AAY1C;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,oCAAoC;IAsB7E;IACI;;OAEG;IACa,MAA8C;QAE9D,KAAK,CAAC,MAAM,CAAC,CAAC;QAFE,WAAM,GAAN,MAAM,CAAwC;QAI9D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;QACtE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;QACjE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;QACzD,0BAA0B;QAC1B,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAEM,QAAQ,CAAC,OAAyB,EAAE,cAAyC;QAChF,IAAI,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACtD,IAAI,IAAI,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC;YAC1C,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAChD,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,OAAO,cAAc,EAAE,CAAC;YACpB,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YAC5C,EAAE,CAAC,CAAC;YACJ,IAAI,CAAC,IAAI,uBAAuB,CAAC,YAAY,EAAE,CAAC;gBAC5C,MAAM,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC;gBAC1E,MAAM;YACV,CAAC;YACD,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACtD,CAAC;QACD,gDAAgD;QAChD,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAEe,YAAY;QACxB,qEAAqC;IACzC,CAAC;;AAzDD;;;GAGG;AACW,oCAAY,GAAG,IAAI,CAAC;AAwDtC,aAAa,gEAAgC,uBAAuB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { RichTypeBoolean } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphExecutionBlockWithOutSignal\";\r\nimport { Logger } from \"core/Misc/logger\";\r\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\r\n/**\r\n * Configuration for the while loop block.\r\n */\r\nexport interface IFlowGraphWhileLoopBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * If true, the loop body will be executed at least once.\r\n */\r\n doWhile?: boolean;\r\n}\r\n\r\n/**\r\n * A block that executes a branch while a condition is true.\r\n */\r\nexport class FlowGraphWhileLoopBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * The maximum number of iterations allowed in a loop.\r\n * This can be set to avoid an infinite loop.\r\n */\r\n public static MaxLoopCount = 1000;\r\n\r\n /**\r\n * Input connection: The condition to evaluate.\r\n */\r\n public readonly condition: FlowGraphDataConnection<boolean>;\r\n /**\r\n * Output connection: The loop body.\r\n */\r\n public readonly executionFlow: FlowGraphSignalConnection;\r\n\r\n /**\r\n * Output connection: The completed signal. Triggered when condition is false.\r\n * No out signal is available.\r\n */\r\n public readonly completed: FlowGraphSignalConnection;\r\n\r\n constructor(\r\n /**\r\n * the configuration of the block\r\n */\r\n public override config?: IFlowGraphWhileLoopBlockConfiguration\r\n ) {\r\n super(config);\r\n\r\n this.condition = this.registerDataInput(\"condition\", RichTypeBoolean);\r\n this.executionFlow = this._registerSignalOutput(\"executionFlow\");\r\n this.completed = this._registerSignalOutput(\"completed\");\r\n // unregister \"out\" signal\r\n this._unregisterSignalOutput(\"out\");\r\n }\r\n\r\n public _execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void {\r\n let conditionValue = this.condition.getValue(context);\r\n if (this.config?.doWhile && !conditionValue) {\r\n this.executionFlow._activateSignal(context);\r\n }\r\n let i = 0;\r\n while (conditionValue) {\r\n this.executionFlow._activateSignal(context);\r\n ++i;\r\n if (i >= FlowGraphWhileLoopBlock.MaxLoopCount) {\r\n Logger.Warn(\"FlowGraphWhileLoopBlock: Max loop count reached. Breaking.\");\r\n break;\r\n }\r\n conditionValue = this.condition.getValue(context);\r\n }\r\n // out is not triggered - completed is triggered\r\n this.completed._activateSignal(context);\r\n }\r\n\r\n public override getClassName(): string {\r\n return FlowGraphBlockNames.WhileLoop;\r\n }\r\n}\r\n\r\nRegisterClass(FlowGraphBlockNames.WhileLoop, FlowGraphWhileLoopBlock);\r\n"]}
|
|
@@ -2,7 +2,6 @@ export * from "./flowGraphBranchBlock";
|
|
|
2
2
|
export * from "./flowGraphDoNBlock";
|
|
3
3
|
export * from "./flowGraphForLoopBlock";
|
|
4
4
|
export * from "./flowGraphThrottleBlock";
|
|
5
|
-
export * from "./flowGraphTimerBlock";
|
|
6
5
|
export * from "./flowGraphMultiGateBlock";
|
|
7
6
|
export * from "./flowGraphSwitchBlock";
|
|
8
7
|
export * from "./flowGraphWaitAllBlock";
|
|
@@ -11,3 +10,5 @@ export * from "./flowGraphWhileLoopBlock";
|
|
|
11
10
|
export * from "./flowGraphDebounceBlock";
|
|
12
11
|
export * from "./flowGraphFlipFlopBlock";
|
|
13
12
|
export * from "./flowGraphSequenceBlock";
|
|
13
|
+
export * from "./flowGraphSetDelayBlock";
|
|
14
|
+
export * from "./flowGraphCancelDelayBlock";
|
|
@@ -2,7 +2,6 @@ export * from "./flowGraphBranchBlock.js";
|
|
|
2
2
|
export * from "./flowGraphDoNBlock.js";
|
|
3
3
|
export * from "./flowGraphForLoopBlock.js";
|
|
4
4
|
export * from "./flowGraphThrottleBlock.js";
|
|
5
|
-
export * from "./flowGraphTimerBlock.js";
|
|
6
5
|
export * from "./flowGraphMultiGateBlock.js";
|
|
7
6
|
export * from "./flowGraphSwitchBlock.js";
|
|
8
7
|
export * from "./flowGraphWaitAllBlock.js";
|
|
@@ -11,4 +10,6 @@ export * from "./flowGraphWhileLoopBlock.js";
|
|
|
11
10
|
export * from "./flowGraphDebounceBlock.js";
|
|
12
11
|
export * from "./flowGraphFlipFlopBlock.js";
|
|
13
12
|
export * from "./flowGraphSequenceBlock.js";
|
|
13
|
+
export * from "./flowGraphSetDelayBlock.js";
|
|
14
|
+
export * from "./flowGraphCancelDelayBlock.js";
|
|
14
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC","sourcesContent":["export * from \"./flowGraphBranchBlock\";\r\nexport * from \"./flowGraphDoNBlock\";\r\nexport * from \"./flowGraphForLoopBlock\";\r\nexport * from \"./flowGraphThrottleBlock\";\r\nexport * from \"./flowGraphMultiGateBlock\";\r\nexport * from \"./flowGraphSwitchBlock\";\r\nexport * from \"./flowGraphWaitAllBlock\";\r\nexport * from \"./flowGraphCounterBlock\";\r\nexport * from \"./flowGraphWhileLoopBlock\";\r\nexport * from \"./flowGraphDebounceBlock\";\r\nexport * from \"./flowGraphFlipFlopBlock\";\r\nexport * from \"./flowGraphSequenceBlock\";\r\nexport * from \"./flowGraphSetDelayBlock\";\r\nexport * from \"./flowGraphCancelDelayBlock\";\r\n"]}
|
|
@@ -3,7 +3,6 @@ import type { FlowGraphDataConnection } from "../../flowGraphDataConnection";
|
|
|
3
3
|
import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphExecutionBlockWithOutSignal";
|
|
4
4
|
import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock";
|
|
5
5
|
/**
|
|
6
|
-
* @experimental
|
|
7
6
|
* Block that logs a message to the console.
|
|
8
7
|
*/
|
|
9
8
|
export declare class FlowGraphConsoleLogBlock extends FlowGraphExecutionBlockWithOutSignal {
|
|
@@ -11,6 +10,10 @@ export declare class FlowGraphConsoleLogBlock extends FlowGraphExecutionBlockWit
|
|
|
11
10
|
* Input connection: The message to log.
|
|
12
11
|
*/
|
|
13
12
|
readonly message: FlowGraphDataConnection<any>;
|
|
13
|
+
/**
|
|
14
|
+
* Input connection: The log type.
|
|
15
|
+
*/
|
|
16
|
+
readonly logType: FlowGraphDataConnection<"log" | "warn" | "error">;
|
|
14
17
|
constructor(config?: IFlowGraphBlockConfiguration);
|
|
15
18
|
/**
|
|
16
19
|
* @internal
|
|
@@ -20,8 +23,4 @@ export declare class FlowGraphConsoleLogBlock extends FlowGraphExecutionBlockWit
|
|
|
20
23
|
* @returns class name of the block.
|
|
21
24
|
*/
|
|
22
25
|
getClassName(): string;
|
|
23
|
-
/**
|
|
24
|
-
* the class name of the block.
|
|
25
|
-
*/
|
|
26
|
-
static ClassName: string;
|
|
27
26
|
}
|
|
@@ -3,20 +3,29 @@ import { RichTypeAny } from "../../flowGraphRichTypes.js";
|
|
|
3
3
|
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
4
4
|
import { Logger } from "../../../Misc/logger.js";
|
|
5
5
|
/**
|
|
6
|
-
* @experimental
|
|
7
6
|
* Block that logs a message to the console.
|
|
8
7
|
*/
|
|
9
8
|
export class FlowGraphConsoleLogBlock extends FlowGraphExecutionBlockWithOutSignal {
|
|
10
9
|
constructor(config) {
|
|
11
10
|
super(config);
|
|
12
11
|
this.message = this.registerDataInput("message", RichTypeAny);
|
|
12
|
+
this.logType = this.registerDataInput("logType", RichTypeAny, "log");
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
17
|
_execute(context) {
|
|
18
|
+
const typeValue = this.logType.getValue(context);
|
|
18
19
|
const messageValue = this.message.getValue(context);
|
|
19
|
-
|
|
20
|
+
if (typeValue === "warn") {
|
|
21
|
+
Logger.Warn(messageValue);
|
|
22
|
+
}
|
|
23
|
+
else if (typeValue === "error") {
|
|
24
|
+
Logger.Error(messageValue);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
Logger.Log(messageValue);
|
|
28
|
+
}
|
|
20
29
|
// activate the output flow block
|
|
21
30
|
this.out._activateSignal(context);
|
|
22
31
|
}
|
|
@@ -24,12 +33,8 @@ export class FlowGraphConsoleLogBlock extends FlowGraphExecutionBlockWithOutSign
|
|
|
24
33
|
* @returns class name of the block.
|
|
25
34
|
*/
|
|
26
35
|
getClassName() {
|
|
27
|
-
return FlowGraphConsoleLogBlock.
|
|
36
|
+
return "FlowGraphConsoleLogBlock" /* FlowGraphBlockNames.ConsoleLog */;
|
|
28
37
|
}
|
|
29
38
|
}
|
|
30
|
-
|
|
31
|
-
* the class name of the block.
|
|
32
|
-
*/
|
|
33
|
-
FlowGraphConsoleLogBlock.ClassName = "FGConsoleLogBlock";
|
|
34
|
-
RegisterClass(FlowGraphConsoleLogBlock.ClassName, FlowGraphConsoleLogBlock);
|
|
39
|
+
RegisterClass("FlowGraphConsoleLogBlock" /* FlowGraphBlockNames.ConsoleLog */, FlowGraphConsoleLogBlock);
|
|
35
40
|
//# sourceMappingURL=flowGraphConsoleLogBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphConsoleLogBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,gCAAyB;
|
|
1
|
+
{"version":3,"file":"flowGraphConsoleLogBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,gCAAyB;AAG1C;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,oCAAoC;IAW9E,YAAmB,MAAqC;QACpD,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QAC9D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IACzE,CAAC;IAED;;OAEG;IACI,QAAQ,CAAC,OAAyB;QACrC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACpD,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC;YACvB,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC9B,CAAC;aAAM,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;YAC/B,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC/B,CAAC;aAAM,CAAC;YACJ,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC7B,CAAC;QACD,iCAAiC;QACjC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,uEAAsC;IAC1C,CAAC;CACJ;AAED,aAAa,kEAAiC,wBAAwB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../flowGraphExecutionBlockWithOutSignal\";\r\nimport { RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { Logger } from \"core/Misc/logger\";\r\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\r\n\r\n/**\r\n * Block that logs a message to the console.\r\n */\r\nexport class FlowGraphConsoleLogBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The message to log.\r\n */\r\n public readonly message: FlowGraphDataConnection<any>;\r\n\r\n /**\r\n * Input connection: The log type.\r\n */\r\n public readonly logType: FlowGraphDataConnection<\"log\" | \"warn\" | \"error\">;\r\n\r\n public constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.message = this.registerDataInput(\"message\", RichTypeAny);\r\n this.logType = this.registerDataInput(\"logType\", RichTypeAny, \"log\");\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _execute(context: FlowGraphContext): void {\r\n const typeValue = this.logType.getValue(context);\r\n const messageValue = this.message.getValue(context);\r\n if (typeValue === \"warn\") {\r\n Logger.Warn(messageValue);\r\n } else if (typeValue === \"error\") {\r\n Logger.Error(messageValue);\r\n } else {\r\n Logger.Log(messageValue);\r\n }\r\n // activate the output flow block\r\n this.out._activateSignal(context);\r\n }\r\n\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName(): string {\r\n return FlowGraphBlockNames.ConsoleLog;\r\n }\r\n}\r\n\r\nRegisterClass(FlowGraphBlockNames.ConsoleLog, FlowGraphConsoleLogBlock);\r\n"]}
|
|
@@ -1,59 +1,56 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import type { IObjectAccessor } from "../../typeDefinitions";
|
|
8
|
-
/**
|
|
9
|
-
* @experimental
|
|
10
|
-
* Configuration for the set property block.
|
|
11
|
-
*/
|
|
12
|
-
export interface IFlowGraphSetPropertyBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
1
|
+
import type { AssetType, FlowGraphAssetType } from "../../flowGraphAssetsContext.js";
|
|
2
|
+
import type { FlowGraphContext } from "../../flowGraphContext.js";
|
|
3
|
+
import type { FlowGraphDataConnection } from "../../flowGraphDataConnection.js";
|
|
4
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphExecutionBlockWithOutSignal.js";
|
|
5
|
+
import type { FlowGraphSignalConnection } from "../../flowGraphSignalConnection.js";
|
|
6
|
+
export interface IFlowGraphSetPropertyBlockConfiguration<O extends FlowGraphAssetType> {
|
|
13
7
|
/**
|
|
14
|
-
* The
|
|
15
|
-
* entity on the context variables.
|
|
8
|
+
* The name of the property that will be set
|
|
16
9
|
*/
|
|
17
|
-
|
|
10
|
+
propertyName?: string;
|
|
18
11
|
/**
|
|
19
|
-
* The
|
|
12
|
+
* The target asset from which the property will be retrieved
|
|
20
13
|
*/
|
|
21
|
-
|
|
14
|
+
target?: AssetType<O>;
|
|
22
15
|
}
|
|
23
16
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
17
|
+
* This block will set a property on a given target asset.
|
|
18
|
+
* The property name can include dots ("."), which will be interpreted as a path to the property.
|
|
19
|
+
* The target asset is an input and can be changed at any time.
|
|
20
|
+
* The value of the property is an input and can be changed at any time.
|
|
21
|
+
*
|
|
22
|
+
* For example, with an input of a mesh asset, the property name "position.x" will set the x component of the position of the mesh.
|
|
23
|
+
*
|
|
24
|
+
* Note that it is recommended to input the object on which you are working on (i.e. a material) than providing a mesh and then getting the material from it.
|
|
26
25
|
*/
|
|
27
|
-
export declare class FlowGraphSetPropertyBlock<
|
|
26
|
+
export declare class FlowGraphSetPropertyBlock<P extends any, O extends FlowGraphAssetType> extends FlowGraphExecutionBlockWithOutSignal {
|
|
28
27
|
/**
|
|
29
28
|
* the configuration of the block
|
|
30
29
|
*/
|
|
31
|
-
config: IFlowGraphSetPropertyBlockConfiguration
|
|
30
|
+
config: IFlowGraphSetPropertyBlockConfiguration<O>;
|
|
32
31
|
/**
|
|
33
32
|
* Input connection: The value to set on the property.
|
|
34
33
|
*/
|
|
35
|
-
readonly
|
|
34
|
+
readonly value: FlowGraphDataConnection<P>;
|
|
36
35
|
/**
|
|
37
|
-
*
|
|
36
|
+
* Input connection: The target asset from which the property will be retrieved
|
|
38
37
|
*/
|
|
39
|
-
readonly
|
|
40
|
-
constructor(
|
|
38
|
+
readonly object: FlowGraphDataConnection<AssetType<O>>;
|
|
41
39
|
/**
|
|
42
|
-
*
|
|
40
|
+
* Input connection: The name of the property that will be set
|
|
43
41
|
*/
|
|
44
|
-
|
|
45
|
-
_execute(context: FlowGraphContext): void;
|
|
42
|
+
readonly propertyName: FlowGraphDataConnection<string>;
|
|
46
43
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
44
|
+
* Input connection: A function that can be used to set the value of the property.
|
|
45
|
+
* If set it will be used instead of the default set function.
|
|
49
46
|
*/
|
|
50
|
-
|
|
47
|
+
readonly customSetFunction: FlowGraphDataConnection<(target: AssetType<O>, propertyName: string, value: P, context: FlowGraphContext) => void>;
|
|
48
|
+
constructor(
|
|
51
49
|
/**
|
|
52
|
-
*
|
|
50
|
+
* the configuration of the block
|
|
53
51
|
*/
|
|
52
|
+
config: IFlowGraphSetPropertyBlockConfiguration<O>);
|
|
53
|
+
_execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void;
|
|
54
|
+
private _setPropertyValue;
|
|
54
55
|
getClassName(): string;
|
|
55
|
-
/**
|
|
56
|
-
* Class name of the block.
|
|
57
|
-
*/
|
|
58
|
-
static ClassName: string;
|
|
59
56
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { RichTypeAny } from "../../flowGraphRichTypes.js";
|
|
2
1
|
import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphExecutionBlockWithOutSignal.js";
|
|
2
|
+
import { RichTypeAny } from "../../flowGraphRichTypes.js";
|
|
3
3
|
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
4
|
-
import { FlowGraphPathConverterComponent } from "../../flowGraphPathConverterComponent.js";
|
|
5
4
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* This block will set a property on a given target asset.
|
|
6
|
+
* The property name can include dots ("."), which will be interpreted as a path to the property.
|
|
7
|
+
* The target asset is an input and can be changed at any time.
|
|
8
|
+
* The value of the property is an input and can be changed at any time.
|
|
9
|
+
*
|
|
10
|
+
* For example, with an input of a mesh asset, the property name "position.x" will set the x component of the position of the mesh.
|
|
11
|
+
*
|
|
12
|
+
* Note that it is recommended to input the object on which you are working on (i.e. a material) than providing a mesh and then getting the material from it.
|
|
8
13
|
*/
|
|
9
14
|
export class FlowGraphSetPropertyBlock extends FlowGraphExecutionBlockWithOutSignal {
|
|
10
15
|
constructor(
|
|
@@ -14,33 +19,44 @@ export class FlowGraphSetPropertyBlock extends FlowGraphExecutionBlockWithOutSig
|
|
|
14
19
|
config) {
|
|
15
20
|
super(config);
|
|
16
21
|
this.config = config;
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
22
|
+
this.object = this.registerDataInput("object", RichTypeAny, config.target);
|
|
23
|
+
this.value = this.registerDataInput("value", RichTypeAny);
|
|
24
|
+
this.propertyName = this.registerDataInput("propertyName", RichTypeAny, config.propertyName);
|
|
25
|
+
this.customSetFunction = this.registerDataInput("customSetFunction", RichTypeAny);
|
|
19
26
|
}
|
|
20
|
-
_execute(context) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
_execute(context, _callingSignal) {
|
|
28
|
+
try {
|
|
29
|
+
const target = this.object.getValue(context);
|
|
30
|
+
const value = this.value.getValue(context);
|
|
31
|
+
const setFunction = this.customSetFunction.getValue(context);
|
|
32
|
+
if (setFunction) {
|
|
33
|
+
setFunction(target, this.propertyName.getValue(context), value, context);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this._setPropertyValue(target, this.propertyName.getValue(context), value);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
this.error.payload = e;
|
|
41
|
+
this.error._activateSignal(context);
|
|
42
|
+
}
|
|
24
43
|
this.out._activateSignal(context);
|
|
25
44
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
45
|
+
_setPropertyValue(target, propertyName, value) {
|
|
46
|
+
const path = propertyName.split(".");
|
|
47
|
+
let obj = target;
|
|
48
|
+
for (let i = 0; i < path.length - 1; i++) {
|
|
49
|
+
const prop = path[i];
|
|
50
|
+
if (obj[prop] === undefined) {
|
|
51
|
+
obj[prop] = {};
|
|
52
|
+
}
|
|
53
|
+
obj = obj[prop];
|
|
54
|
+
}
|
|
55
|
+
obj[path[path.length - 1]] = value;
|
|
33
56
|
}
|
|
34
|
-
/**
|
|
35
|
-
* @returns class name of the block.
|
|
36
|
-
*/
|
|
37
57
|
getClassName() {
|
|
38
|
-
return FlowGraphSetPropertyBlock.
|
|
58
|
+
return "FlowGraphSetPropertyBlock" /* FlowGraphBlockNames.SetProperty */;
|
|
39
59
|
}
|
|
40
60
|
}
|
|
41
|
-
|
|
42
|
-
* Class name of the block.
|
|
43
|
-
*/
|
|
44
|
-
FlowGraphSetPropertyBlock.ClassName = "FGSetPropertyBlock";
|
|
45
|
-
RegisterClass("FGSetPropertyBlock", FlowGraphSetPropertyBlock);
|
|
61
|
+
RegisterClass("FlowGraphSetPropertyBlock" /* FlowGraphBlockNames.SetProperty */, FlowGraphSetPropertyBlock);
|
|
46
62
|
//# sourceMappingURL=flowGraphSetPropertyBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphSetPropertyBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flowGraphSetPropertyBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oCAAoC,EAAE,sDAA4D;AAC3G,OAAO,EAAE,WAAW,EAAE,oCAA0C;AAEhE,OAAO,EAAE,aAAa,EAAE,mCAA4B;AAepD;;;;;;;;;GASG;AACH,MAAM,OAAO,yBAAuE,SAAQ,oCAAoC;IAsB5H;IACI;;OAEG;IACa,MAAkD;QAElE,KAAK,CAAC,MAAM,CAAC,CAAC;QAFE,WAAM,GAAN,MAAM,CAA4C;QAGlE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QAC3E,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAC1D,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,WAAW,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;QAC7F,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;IACtF,CAAC;IACe,QAAQ,CAAC,OAAyB,EAAE,cAAyC;QACzF,IAAI,CAAC;YACD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAE3C,MAAM,WAAW,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC7D,IAAI,WAAW,EAAE,CAAC;gBACd,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;YAC7E,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC;YAC/E,CAAC;QACL,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC;YACvB,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAEO,iBAAiB,CAAC,MAAoB,EAAE,YAAoB,EAAE,KAAQ;QAC1E,MAAM,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,GAAG,GAAG,MAAa,CAAC;QACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YACvC,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YACrB,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;gBAC1B,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YACnB,CAAC;YACD,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;IACvC,CAAC;IAEe,YAAY;QACxB,yEAAuC;IAC3C,CAAC;CACJ;AAED,aAAa,oEAAkC,yBAAyB,CAAC,CAAC","sourcesContent":["import type { AssetType, FlowGraphAssetType } from \"core/FlowGraph/flowGraphAssetsContext\";\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\nimport { FlowGraphExecutionBlockWithOutSignal } from \"core/FlowGraph/flowGraphExecutionBlockWithOutSignal\";\nimport { RichTypeAny } from \"core/FlowGraph/flowGraphRichTypes\";\nimport type { FlowGraphSignalConnection } from \"core/FlowGraph/flowGraphSignalConnection\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\n\nexport interface IFlowGraphSetPropertyBlockConfiguration<O extends FlowGraphAssetType> {\n /**\n * The name of the property that will be set\n */\n propertyName?: string;\n\n /**\n * The target asset from which the property will be retrieved\n */\n target?: AssetType<O>;\n}\n\n/**\n * This block will set a property on a given target asset.\n * The property name can include dots (\".\"), which will be interpreted as a path to the property.\n * The target asset is an input and can be changed at any time.\n * The value of the property is an input and can be changed at any time.\n *\n * For example, with an input of a mesh asset, the property name \"position.x\" will set the x component of the position of the mesh.\n *\n * Note that it is recommended to input the object on which you are working on (i.e. a material) than providing a mesh and then getting the material from it.\n */\nexport class FlowGraphSetPropertyBlock<P extends any, O extends FlowGraphAssetType> extends FlowGraphExecutionBlockWithOutSignal {\n /**\n * Input connection: The value to set on the property.\n */\n public readonly value: FlowGraphDataConnection<P>;\n\n /**\n * Input connection: The target asset from which the property will be retrieved\n */\n public readonly object: FlowGraphDataConnection<AssetType<O>>;\n\n /**\n * Input connection: The name of the property that will be set\n */\n public readonly propertyName: FlowGraphDataConnection<string>;\n\n /**\n * Input connection: A function that can be used to set the value of the property.\n * If set it will be used instead of the default set function.\n */\n public readonly customSetFunction: FlowGraphDataConnection<(target: AssetType<O>, propertyName: string, value: P, context: FlowGraphContext) => void>;\n\n constructor(\n /**\n * the configuration of the block\n */\n public override config: IFlowGraphSetPropertyBlockConfiguration<O>\n ) {\n super(config);\n this.object = this.registerDataInput(\"object\", RichTypeAny, config.target);\n this.value = this.registerDataInput(\"value\", RichTypeAny);\n this.propertyName = this.registerDataInput(\"propertyName\", RichTypeAny, config.propertyName);\n this.customSetFunction = this.registerDataInput(\"customSetFunction\", RichTypeAny);\n }\n public override _execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void {\n try {\n const target = this.object.getValue(context);\n const value = this.value.getValue(context);\n\n const setFunction = this.customSetFunction.getValue(context);\n if (setFunction) {\n setFunction(target, this.propertyName.getValue(context), value, context);\n } else {\n this._setPropertyValue(target, this.propertyName.getValue(context), value);\n }\n } catch (e) {\n this.error.payload = e;\n this.error._activateSignal(context);\n }\n this.out._activateSignal(context);\n }\n\n private _setPropertyValue(target: AssetType<O>, propertyName: string, value: P): void {\n const path = propertyName.split(\".\");\n let obj = target as any;\n for (let i = 0; i < path.length - 1; i++) {\n const prop = path[i];\n if (obj[prop] === undefined) {\n obj[prop] = {};\n }\n obj = obj[prop];\n }\n obj[path[path.length - 1]] = value;\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.SetProperty;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.SetProperty, FlowGraphSetPropertyBlock);\n"]}
|
|
@@ -1,42 +1,27 @@
|
|
|
1
|
+
import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock";
|
|
1
2
|
import type { FlowGraphContext } from "../../flowGraphContext";
|
|
2
3
|
import type { FlowGraphDataConnection } from "../../flowGraphDataConnection";
|
|
3
4
|
import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphExecutionBlockWithOutSignal";
|
|
4
|
-
import type {
|
|
5
|
+
import type { FlowGraphSignalConnection } from "../../flowGraphSignalConnection";
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
-
* The variable block configuration.
|
|
7
|
+
* The configuration of the FlowGraphGetVariableBlock.
|
|
8
8
|
*/
|
|
9
9
|
export interface IFlowGraphSetVariableBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
10
10
|
/**
|
|
11
11
|
* The name of the variable to set.
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
variable: string;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
* @experimental
|
|
16
|
+
* This block will set a variable on the context.
|
|
18
17
|
*/
|
|
19
18
|
export declare class FlowGraphSetVariableBlock<T> extends FlowGraphExecutionBlockWithOutSignal {
|
|
20
19
|
/**
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
config: IFlowGraphSetVariableBlockConfiguration;
|
|
24
|
-
/**
|
|
25
|
-
* Input connection: The value to set on the variable.
|
|
26
|
-
*/
|
|
27
|
-
readonly input: FlowGraphDataConnection<T>;
|
|
28
|
-
constructor(
|
|
29
|
-
/**
|
|
30
|
-
* the configuration of the block
|
|
31
|
-
*/
|
|
32
|
-
config: IFlowGraphSetVariableBlockConfiguration);
|
|
33
|
-
_execute(context: FlowGraphContext): void;
|
|
34
|
-
/**
|
|
35
|
-
* @returns class name of the block.
|
|
20
|
+
* Input connection: The value to set.
|
|
36
21
|
*/
|
|
22
|
+
readonly value: FlowGraphDataConnection<T>;
|
|
23
|
+
constructor(config: IFlowGraphSetVariableBlockConfiguration);
|
|
24
|
+
_execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void;
|
|
37
25
|
getClassName(): string;
|
|
38
|
-
|
|
39
|
-
* the class name of the block.
|
|
40
|
-
*/
|
|
41
|
-
static ClassName: string;
|
|
26
|
+
serialize(serializationObject?: any): void;
|
|
42
27
|
}
|