@babylonjs/core 6.36.0 → 6.37.0
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/Cameras/Inputs/arcRotateCameraGamepadInput.js +4 -0
- package/Cameras/Inputs/arcRotateCameraGamepadInput.js.map +1 -1
- package/Engines/Extensions/engine.dynamicTexture.d.ts +2 -2
- package/Engines/Extensions/engine.dynamicTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.dynamicTexture.js +28 -3
- package/Engines/WebGPU/Extensions/engine.dynamicTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.js +4 -0
- package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js +6 -2
- package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheBindGroups.d.ts +1 -0
- package/Engines/WebGPU/webgpuCacheBindGroups.js +12 -0
- package/Engines/WebGPU/webgpuCacheBindGroups.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +2 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipelineTree.d.ts +2 -2
- package/Engines/WebGPU/webgpuCacheRenderPipelineTree.js +5 -2
- package/Engines/WebGPU/webgpuCacheRenderPipelineTree.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheSampler.js +3 -0
- package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
- package/Engines/WebGPU/webgpuClearQuad.js +2 -1
- package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.d.ts +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js +23 -5
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuPipelineContext.js +4 -5
- package/Engines/WebGPU/webgpuPipelineContext.js.map +1 -1
- package/Engines/WebGPU/webgpuQuerySet.js +10 -4
- package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.d.ts +8 -53
- package/Engines/WebGPU/webgpuTextureHelper.js +4 -996
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.d.ts +56 -0
- package/Engines/WebGPU/webgpuTextureManager.js +1012 -0
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -0
- package/Engines/engine.d.ts +1 -0
- package/Engines/engine.js +9 -2
- package/Engines/engine.js.map +1 -1
- package/Engines/renderTargetWrapper.d.ts +1 -0
- package/Engines/renderTargetWrapper.js +5 -1
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.d.ts +1 -0
- package/Engines/thinEngine.js +11 -7
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +9 -2
- package/Engines/webgpuEngine.js +75 -3
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.d.ts +23 -6
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js +14 -3
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.d.ts +14 -3
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +12 -11
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +22 -7
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +15 -9
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +13 -5
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +9 -5
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +24 -6
- package/FlowGraph/flowGraph.js +12 -12
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphBlock.d.ts +31 -2
- package/FlowGraph/flowGraphBlock.js +8 -3
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +5 -1
- package/FlowGraph/flowGraphContext.js +4 -2
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.d.ts +22 -2
- package/FlowGraph/flowGraphCoordinator.js +7 -11
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FlowGraph/{flowGraphWithOnDoneExecutionBlock.js → flowGraphExecutionBlockWithOutSignal.js} +1 -1
- package/FlowGraph/flowGraphExecutionBlockWithOutSignal.js.map +1 -0
- package/FlowGraph/flowGraphPathConverter.d.ts +13 -0
- package/FlowGraph/flowGraphPathConverter.js +31 -0
- package/FlowGraph/flowGraphPathConverter.js.map +1 -0
- package/FlowGraph/flowGraphPathConverterComponent.d.ts +19 -0
- package/FlowGraph/flowGraphPathConverterComponent.js +31 -0
- package/FlowGraph/flowGraphPathConverterComponent.js.map +1 -0
- package/FlowGraph/index.d.ts +0 -1
- package/FlowGraph/index.js +0 -1
- package/FlowGraph/index.js.map +1 -1
- package/FlowGraph/serialization.d.ts +8 -0
- package/FlowGraph/serialization.js +12 -4
- package/FlowGraph/serialization.js.map +1 -1
- package/FlowGraph/typeDefinitions.d.ts +86 -1
- package/FlowGraph/typeDefinitions.js.map +1 -1
- package/Materials/Textures/dynamicTexture.js +2 -1
- package/Materials/Textures/dynamicTexture.js.map +1 -1
- package/Materials/Textures/hardwareTextureWrapper.d.ts +1 -1
- package/Materials/Textures/hardwareTextureWrapper.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +6 -2
- package/Materials/Textures/internalTexture.js +6 -4
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.js +10 -10
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/material.d.ts +1 -1
- package/Materials/material.js +3 -1
- package/Materials/material.js.map +1 -1
- package/Materials/shaderMaterial.js +2 -2
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/uniformBuffer.d.ts +2 -0
- package/Materials/uniformBuffer.js +16 -0
- package/Materials/uniformBuffer.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineMesh.d.ts +2 -1
- package/Meshes/GreasedLine/greasedLineMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.d.ts +2 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
- package/Meshes/WebGPU/webgpuDataBuffer.d.ts +1 -0
- package/Meshes/WebGPU/webgpuDataBuffer.js +2 -0
- package/Meshes/WebGPU/webgpuDataBuffer.js.map +1 -1
- package/Meshes/geometry.js +3 -3
- package/Meshes/geometry.js.map +1 -1
- package/Misc/brdfTextureTools.js +9 -7
- package/Misc/brdfTextureTools.js.map +1 -1
- package/Misc/rgbdTextureTools.js +37 -37
- package/Misc/rgbdTextureTools.js.map +1 -1
- package/ObjectModel/index.d.ts +1 -0
- package/ObjectModel/index.js +2 -0
- package/ObjectModel/index.js.map +1 -0
- package/ObjectModel/objectModelInterfaces.d.ts +21 -0
- package/ObjectModel/objectModelInterfaces.js +2 -0
- package/ObjectModel/objectModelInterfaces.js.map +1 -0
- package/Particles/computeShaderParticleSystem.js +2 -2
- package/Particles/computeShaderParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.js +1 -1
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particleSystem.js +2 -5
- package/Particles/particleSystem.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderer.js +1 -6
- package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
- package/Rendering/renderingManager.js +1 -1
- package/Rendering/renderingManager.js.map +1 -1
- package/XR/features/WebXRControllerTeleportation.d.ts +9 -1
- package/XR/features/WebXRControllerTeleportation.js +10 -0
- package/XR/features/WebXRControllerTeleportation.js.map +1 -1
- package/XR/webXRCamera.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +5 -1
- package/types.js +0 -2
- package/types.js.map +1 -1
- package/FlowGraph/flowGraphPath.d.ts +0 -45
- package/FlowGraph/flowGraphPath.js +0 -156
- package/FlowGraph/flowGraphPath.js.map +0 -1
- package/FlowGraph/flowGraphPathComponent.d.ts +0 -42
- package/FlowGraph/flowGraphPathComponent.js +0 -51
- package/FlowGraph/flowGraphPathComponent.js.map +0 -1
- package/FlowGraph/flowGraphWithOnDoneExecutionBlock.js.map +0 -1
- /package/FlowGraph/{flowGraphWithOnDoneExecutionBlock.d.ts → flowGraphExecutionBlockWithOutSignal.d.ts} +0 -0
|
@@ -2,24 +2,41 @@ import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock";
|
|
|
2
2
|
import { FlowGraphBlock } from "../../flowGraphBlock";
|
|
3
3
|
import type { FlowGraphContext } from "../../flowGraphContext";
|
|
4
4
|
import type { FlowGraphDataConnection } from "../../flowGraphDataConnection";
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
5
|
+
import type { IPathToObjectConverter } from "../../../ObjectModel/objectModelInterfaces";
|
|
6
|
+
import { FlowGraphPathConverterComponent } from "../../flowGraphPathConverterComponent";
|
|
7
|
+
import type { IObjectAccessor } from "../../typeDefinitions";
|
|
7
8
|
/**
|
|
8
9
|
* @experimental
|
|
9
10
|
*/
|
|
10
11
|
export interface IFlowGraphGetPropertyBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
11
12
|
/**
|
|
12
|
-
* The
|
|
13
|
-
* entity on the context variables with that variable name.
|
|
13
|
+
* The complete path to the property that will be set
|
|
14
14
|
*/
|
|
15
|
-
path:
|
|
15
|
+
path: string;
|
|
16
|
+
/**
|
|
17
|
+
* The path converter to use to convert the path to an object accessor.
|
|
18
|
+
*/
|
|
19
|
+
pathConverter: IPathToObjectConverter<IObjectAccessor>;
|
|
16
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* @experimental
|
|
23
|
+
*/
|
|
17
24
|
export declare class FlowGraphGetPropertyBlock extends FlowGraphBlock {
|
|
18
25
|
config: IFlowGraphGetPropertyBlockConfiguration;
|
|
26
|
+
/**
|
|
27
|
+
* Output connection: The value of the property.
|
|
28
|
+
*/
|
|
19
29
|
readonly value: FlowGraphDataConnection<any>;
|
|
20
|
-
|
|
30
|
+
/**
|
|
31
|
+
* The component with the templated inputs for the provided path.
|
|
32
|
+
*/
|
|
33
|
+
readonly templateComponent: FlowGraphPathConverterComponent;
|
|
21
34
|
constructor(config: IFlowGraphGetPropertyBlockConfiguration);
|
|
22
35
|
_updateOutputs(context: FlowGraphContext): void;
|
|
23
36
|
getClassName(): string;
|
|
37
|
+
serialize(serializationObject?: any): void;
|
|
38
|
+
/**
|
|
39
|
+
* Class name of the block.
|
|
40
|
+
*/
|
|
24
41
|
static ClassName: string;
|
|
25
42
|
}
|
|
@@ -1,22 +1,33 @@
|
|
|
1
1
|
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
2
2
|
import { FlowGraphBlock } from "../../flowGraphBlock.js";
|
|
3
3
|
import { RichTypeAny } from "../../flowGraphRichTypes.js";
|
|
4
|
-
import {
|
|
4
|
+
import { FlowGraphPathConverterComponent } from "../../flowGraphPathConverterComponent.js";
|
|
5
|
+
/**
|
|
6
|
+
* @experimental
|
|
7
|
+
*/
|
|
5
8
|
export class FlowGraphGetPropertyBlock extends FlowGraphBlock {
|
|
6
9
|
constructor(config) {
|
|
7
10
|
super(config);
|
|
8
11
|
this.config = config;
|
|
9
12
|
this.value = this.registerDataOutput("value", RichTypeAny);
|
|
10
|
-
this.templateComponent = new
|
|
13
|
+
this.templateComponent = new FlowGraphPathConverterComponent(config.path, this);
|
|
11
14
|
}
|
|
12
15
|
_updateOutputs(context) {
|
|
13
|
-
const
|
|
16
|
+
const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);
|
|
17
|
+
const value = accessorContainer.info.get(accessorContainer.object);
|
|
14
18
|
this.value.setValue(value, context);
|
|
15
19
|
}
|
|
16
20
|
getClassName() {
|
|
17
21
|
return FlowGraphGetPropertyBlock.ClassName;
|
|
18
22
|
}
|
|
23
|
+
serialize(serializationObject = {}) {
|
|
24
|
+
super.serialize(serializationObject);
|
|
25
|
+
serializationObject.config.path = this.config.path;
|
|
26
|
+
}
|
|
19
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Class name of the block.
|
|
30
|
+
*/
|
|
20
31
|
FlowGraphGetPropertyBlock.ClassName = "FGGetPropertyBlock";
|
|
21
32
|
RegisterClass(FlowGraphGetPropertyBlock.ClassName, FlowGraphGetPropertyBlock);
|
|
22
33
|
//# sourceMappingURL=flowGraphGetPropertyBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphGetPropertyBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"flowGraphGetPropertyBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AAiBxF;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,cAAc;IAUzD,YAA0B,MAA+C;QACrE,KAAK,CAAC,MAAM,CAAC,CAAC;QADQ,WAAM,GAAN,MAAM,CAAyC;QAErE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAC3D,IAAI,CAAC,iBAAiB,GAAG,IAAI,+BAA+B,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACpF,CAAC;IAEM,cAAc,CAAC,OAAyB;QAC3C,MAAM,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACjG,MAAM,KAAK,GAAG,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACnE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IAEM,YAAY;QACf,OAAO,yBAAyB,CAAC,SAAS,CAAC;IAC/C,CAAC;IAEM,SAAS,CAAC,sBAA2B,EAAE;QAC1C,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,mBAAmB,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IACvD,CAAC;;AAED;;GAEG;AACW,mCAAS,GAAG,oBAAoB,CAAC;AAEnD,aAAa,CAAC,yBAAyB,CAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { FlowGraphBlock } from \"../../flowGraphBlock\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport type { IPathToObjectConverter } from \"../../../ObjectModel/objectModelInterfaces\";\r\nimport { FlowGraphPathConverterComponent } from \"../../flowGraphPathConverterComponent\";\r\nimport type { IObjectAccessor } from \"../../typeDefinitions\";\r\n\r\n/**\r\n * @experimental\r\n */\r\nexport interface IFlowGraphGetPropertyBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The complete path to the property that will be set\r\n */\r\n path: string;\r\n /**\r\n * The path converter to use to convert the path to an object accessor.\r\n */\r\n pathConverter: IPathToObjectConverter<IObjectAccessor>;\r\n}\r\n\r\n/**\r\n * @experimental\r\n */\r\nexport class FlowGraphGetPropertyBlock extends FlowGraphBlock {\r\n /**\r\n * Output connection: The value of the property.\r\n */\r\n public readonly value: FlowGraphDataConnection<any>;\r\n /**\r\n * The component with the templated inputs for the provided path.\r\n */\r\n public readonly templateComponent: FlowGraphPathConverterComponent;\r\n\r\n public constructor(public config: IFlowGraphGetPropertyBlockConfiguration) {\r\n super(config);\r\n this.value = this.registerDataOutput(\"value\", RichTypeAny);\r\n this.templateComponent = new FlowGraphPathConverterComponent(config.path, this);\r\n }\r\n\r\n public _updateOutputs(context: FlowGraphContext) {\r\n const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);\r\n const value = accessorContainer.info.get(accessorContainer.object);\r\n this.value.setValue(value, context);\r\n }\r\n\r\n public getClassName(): string {\r\n return FlowGraphGetPropertyBlock.ClassName;\r\n }\r\n\r\n public serialize(serializationObject: any = {}) {\r\n super.serialize(serializationObject);\r\n serializationObject.config.path = this.config.path;\r\n }\r\n\r\n /**\r\n * Class name of the block.\r\n */\r\n public static ClassName = \"FGGetPropertyBlock\";\r\n}\r\nRegisterClass(FlowGraphGetPropertyBlock.ClassName, FlowGraphGetPropertyBlock);\r\n"]}
|
|
@@ -2,12 +2,20 @@ import { AbstractMesh } from "../../../Meshes/abstractMesh";
|
|
|
2
2
|
import { FlowGraphEventBlock } from "../../flowGraphEventBlock";
|
|
3
3
|
import type { FlowGraphContext } from "../../flowGraphContext";
|
|
4
4
|
import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock";
|
|
5
|
-
import type {
|
|
5
|
+
import type { IPathToObjectConverter } from "../../../ObjectModel/objectModelInterfaces";
|
|
6
|
+
import type { IObjectAccessor } from "../../typeDefinitions";
|
|
6
7
|
/**
|
|
7
8
|
* @experimental
|
|
8
9
|
*/
|
|
9
10
|
export interface IFlowGraphMeshPickEventBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
10
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The path of the mesh to pick.
|
|
13
|
+
*/
|
|
14
|
+
path: string;
|
|
15
|
+
/**
|
|
16
|
+
* The path converter to use to convert the path to an object accessor.
|
|
17
|
+
*/
|
|
18
|
+
pathConverter: IPathToObjectConverter<IObjectAccessor>;
|
|
11
19
|
}
|
|
12
20
|
/**
|
|
13
21
|
* @experimental
|
|
@@ -16,7 +24,7 @@ export interface IFlowGraphMeshPickEventBlockConfiguration extends IFlowGraphBlo
|
|
|
16
24
|
export declare class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {
|
|
17
25
|
config: IFlowGraphMeshPickEventBlockConfiguration;
|
|
18
26
|
constructor(config: IFlowGraphMeshPickEventBlockConfiguration);
|
|
19
|
-
_getReferencedMesh(
|
|
27
|
+
_getReferencedMesh(): AbstractMesh;
|
|
20
28
|
/**
|
|
21
29
|
* @internal
|
|
22
30
|
*/
|
|
@@ -28,5 +36,8 @@ export declare class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {
|
|
|
28
36
|
_cancelPendingTasks(context: FlowGraphContext): void;
|
|
29
37
|
getClassName(): string;
|
|
30
38
|
serialize(serializationObject?: any): void;
|
|
39
|
+
/**
|
|
40
|
+
* Class name of the block.
|
|
41
|
+
*/
|
|
31
42
|
static ClassName: string;
|
|
32
43
|
}
|
|
@@ -2,7 +2,6 @@ import { AbstractMesh } from "../../../Meshes/abstractMesh.js";
|
|
|
2
2
|
import { FlowGraphEventBlock } from "../../flowGraphEventBlock.js";
|
|
3
3
|
import { PointerEventTypes } from "../../../Events/pointerEvents.js";
|
|
4
4
|
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
5
|
-
import { Tools } from "../../../Misc/tools.js";
|
|
6
5
|
import { _isADescendantOf } from "../../utils.js";
|
|
7
6
|
/**
|
|
8
7
|
* @experimental
|
|
@@ -10,14 +9,16 @@ import { _isADescendantOf } from "../../utils.js";
|
|
|
10
9
|
*/
|
|
11
10
|
export class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {
|
|
12
11
|
constructor(config) {
|
|
13
|
-
if (config.path.hasTemplateStrings) {
|
|
14
|
-
Tools.Warn("Template strings are not supported in the path of mesh pick event blocks.");
|
|
15
|
-
}
|
|
16
12
|
super(config);
|
|
17
13
|
this.config = config;
|
|
18
14
|
}
|
|
19
|
-
_getReferencedMesh(
|
|
20
|
-
|
|
15
|
+
_getReferencedMesh() {
|
|
16
|
+
const iAccessor = this.config.pathConverter.convert(this.config.path);
|
|
17
|
+
const mesh = iAccessor.info.getObject(iAccessor.object);
|
|
18
|
+
if (!mesh || !(mesh instanceof AbstractMesh)) {
|
|
19
|
+
throw new Error("Mesh pick event block requires a valid mesh");
|
|
20
|
+
}
|
|
21
|
+
return mesh;
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* @internal
|
|
@@ -25,10 +26,7 @@ export class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {
|
|
|
25
26
|
_preparePendingTasks(context) {
|
|
26
27
|
let pickObserver = context._getExecutionVariable(this, "meshPickObserver");
|
|
27
28
|
if (!pickObserver) {
|
|
28
|
-
const mesh = this.
|
|
29
|
-
if (!mesh || !(mesh instanceof AbstractMesh)) {
|
|
30
|
-
throw new Error("Mesh pick event block requires a valid mesh");
|
|
31
|
-
}
|
|
29
|
+
const mesh = this._getReferencedMesh();
|
|
32
30
|
context._setExecutionVariable(this, "mesh", mesh);
|
|
33
31
|
pickObserver = mesh.getScene().onPointerObservable.add((pointerInfo) => {
|
|
34
32
|
var _a, _b, _c;
|
|
@@ -65,9 +63,12 @@ export class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {
|
|
|
65
63
|
}
|
|
66
64
|
serialize(serializationObject) {
|
|
67
65
|
super.serialize(serializationObject);
|
|
68
|
-
serializationObject.config.path = this.config.path
|
|
66
|
+
serializationObject.config.path = this.config.path;
|
|
69
67
|
}
|
|
70
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Class name of the block.
|
|
71
|
+
*/
|
|
71
72
|
FlowGraphMeshPickEventBlock.ClassName = "FGMeshPickEventBlock";
|
|
72
73
|
RegisterClass(FlowGraphMeshPickEventBlock.ClassName, FlowGraphMeshPickEventBlock);
|
|
73
74
|
//# sourceMappingURL=flowGraphMeshPickEventBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphMeshPickEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGlE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"flowGraphMeshPickEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGlE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAgB/C;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ,mBAAmB;IAChE,YAA0B,MAAiD;QACvE,KAAK,CAAC,MAAM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AC;;AAED;;GAEG;AACW,qCAAS,GAAG,sBAAsB,CAAC;AAErD,aAAa,CAAC,2BAA2B,CAAC,SAAS,EAAE,2BAA2B,CAAC,CAAC","sourcesContent":["import { AbstractMesh } from \"../../../Meshes/abstractMesh\";\r\nimport { FlowGraphEventBlock } from \"../../flowGraphEventBlock\";\r\nimport { PointerEventTypes } from \"../../../Events/pointerEvents\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { _isADescendantOf } from \"../../utils\";\r\nimport type { IPathToObjectConverter } from \"../../../ObjectModel/objectModelInterfaces\";\r\nimport type { IObjectAccessor } from \"../../typeDefinitions\";\r\n/**\r\n * @experimental\r\n */\r\nexport interface IFlowGraphMeshPickEventBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The path of the mesh to pick.\r\n */\r\n path: string;\r\n /**\r\n * The path converter to use to convert the path to an object accessor.\r\n */\r\n pathConverter: IPathToObjectConverter<IObjectAccessor>;\r\n}\r\n/**\r\n * @experimental\r\n * A block that activates when a mesh is picked.\r\n */\r\nexport class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {\r\n public constructor(public config: IFlowGraphMeshPickEventBlockConfiguration) {\r\n super(config);\r\n }\r\n\r\n public _getReferencedMesh(): AbstractMesh {\r\n const iAccessor = this.config.pathConverter.convert(this.config.path);\r\n\r\n const mesh = iAccessor.info.getObject(iAccessor.object) as AbstractMesh;\r\n if (!mesh || !(mesh instanceof AbstractMesh)) {\r\n throw new Error(\"Mesh pick event block requires a valid mesh\");\r\n }\r\n return mesh;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _preparePendingTasks(context: FlowGraphContext): void {\r\n let pickObserver = context._getExecutionVariable(this, \"meshPickObserver\");\r\n if (!pickObserver) {\r\n const mesh = this._getReferencedMesh();\r\n context._setExecutionVariable(this, \"mesh\", mesh);\r\n pickObserver = mesh.getScene().onPointerObservable.add((pointerInfo) => {\r\n if (\r\n pointerInfo.type === PointerEventTypes.POINTERPICK &&\r\n pointerInfo.pickInfo?.pickedMesh &&\r\n (pointerInfo.pickInfo?.pickedMesh === mesh || _isADescendantOf(pointerInfo.pickInfo?.pickedMesh, mesh))\r\n ) {\r\n this._execute(context);\r\n }\r\n });\r\n const disposeObserver = mesh.onDisposeObservable.add(() => this._onDispose);\r\n context._setExecutionVariable(this, \"meshPickObserver\", pickObserver);\r\n context._setExecutionVariable(this, \"meshDisposeObserver\", disposeObserver);\r\n }\r\n }\r\n\r\n public _onDispose(context: FlowGraphContext) {\r\n this._cancelPendingTasks(context);\r\n context._removePendingBlock(this);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _cancelPendingTasks(context: FlowGraphContext): void {\r\n const mesh = context._getExecutionVariable(this, \"mesh\");\r\n const pickObserver = context._getExecutionVariable(this, \"meshPickObserver\");\r\n const disposeObserver = context._getExecutionVariable(this, \"meshDisposeObserver\");\r\n\r\n mesh.getScene().onPointerObservable.remove(pickObserver);\r\n mesh.onDisposeObservable.remove(disposeObserver);\r\n\r\n context._deleteExecutionVariable(this, \"mesh\");\r\n context._deleteExecutionVariable(this, \"meshPickObserver\");\r\n context._deleteExecutionVariable(this, \"meshDisposeObserver\");\r\n }\r\n\r\n public getClassName(): string {\r\n return FlowGraphMeshPickEventBlock.ClassName;\r\n }\r\n\r\n public serialize(serializationObject?: any): void {\r\n super.serialize(serializationObject);\r\n serializationObject.config.path = this.config.path;\r\n }\r\n\r\n /**\r\n * Class name of the block.\r\n */\r\n public static ClassName = \"FGMeshPickEventBlock\";\r\n}\r\nRegisterClass(FlowGraphMeshPickEventBlock.ClassName, FlowGraphMeshPickEventBlock);\r\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
2
2
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
3
|
-
import { FlowGraphExecutionBlockWithOutSignal } from "../../../
|
|
3
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal";
|
|
4
4
|
import type { Animatable } from "../../../../Animations";
|
|
5
5
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
6
6
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FlowGraphExecutionBlockWithOutSignal } from "../../../
|
|
1
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal.js";
|
|
2
2
|
import { RichTypeAny } from "../../../flowGraphRichTypes.js";
|
|
3
3
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
4
4
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphPauseAnimationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"flowGraphPauseAnimationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,+CAA+C,CAAC;AAErG,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D;;;GAGG;AACH,MAAM,OAAO,4BAA6B,SAAQ,oCAAoC;IAMlF,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC;IACpF,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACtE,qBAAqB,CAAC,KAAK,EAAE,CAAC;QAC9B,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAEM,YAAY;QACf,OAAO,uBAAuB,CAAC;IACnC,CAAC;CACJ;AACD,aAAa,CAAC,uBAAuB,EAAE,4BAA4B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphExecutionBlockWithOutSignal\";\r\nimport type { Animatable } from \"../../../../Animations\";\r\nimport { RichTypeAny } from \"../../../flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Block that stops a running animation\r\n */\r\nexport class FlowGraphPauseAnimationBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n *\r\n */\r\n public readonly animationToPause: FlowGraphDataConnection<Animatable>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.animationToPause = this.registerDataInput(\"animationToPause\", RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const animationToPauseValue = this.animationToPause.getValue(context);\r\n animationToPauseValue.pause();\r\n this.out._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGPauseAnimationBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGPauseAnimationBlock\", FlowGraphPauseAnimationBlock);\r\n"]}
|
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
2
|
-
import type { Animatable } from "../../../../Animations";
|
|
2
|
+
import type { Animatable } from "../../../../Animations/animatable";
|
|
3
3
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
4
4
|
import { FlowGraphAsyncExecutionBlock } from "../../../flowGraphAsyncExecutionBlock";
|
|
5
5
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
6
|
-
import type {
|
|
7
|
-
import {
|
|
6
|
+
import type { IPathToObjectConverter } from "../../../../ObjectModel/objectModelInterfaces";
|
|
7
|
+
import { FlowGraphPathConverterComponent } from "../../../flowGraphPathConverterComponent";
|
|
8
|
+
import type { IObjectAccessor } from "../../../typeDefinitions";
|
|
8
9
|
/**
|
|
9
10
|
* @experimental
|
|
10
11
|
*/
|
|
11
12
|
export interface IFlowGraphPlayAnimationBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* The path to the target object that will be animated.
|
|
15
|
+
*/
|
|
16
|
+
targetPath: string;
|
|
17
|
+
/**
|
|
18
|
+
* The path to the animation that will be played.
|
|
19
|
+
*/
|
|
20
|
+
animationPath: string;
|
|
21
|
+
/**
|
|
22
|
+
* The path converter to use to convert the path to an object accessor.
|
|
23
|
+
*/
|
|
24
|
+
pathConverter: IPathToObjectConverter<IObjectAccessor>;
|
|
14
25
|
}
|
|
15
26
|
/**
|
|
16
27
|
* @experimental
|
|
@@ -21,11 +32,11 @@ export declare class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecution
|
|
|
21
32
|
/**
|
|
22
33
|
* The substitution inputs for template strings in the target
|
|
23
34
|
*/
|
|
24
|
-
readonly templateTargetComponent:
|
|
35
|
+
readonly templateTargetComponent: FlowGraphPathConverterComponent;
|
|
25
36
|
/**
|
|
26
37
|
* The substitution inputs for template strings in the animation
|
|
27
38
|
*/
|
|
28
|
-
readonly templateAnimationComponent:
|
|
39
|
+
readonly templateAnimationComponent: FlowGraphPathConverterComponent;
|
|
29
40
|
/**
|
|
30
41
|
* Input connection: The speed of the animation.
|
|
31
42
|
*/
|
|
@@ -61,4 +72,8 @@ export declare class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecution
|
|
|
61
72
|
_cancelPendingTasks(context: FlowGraphContext): void;
|
|
62
73
|
getClassName(): string;
|
|
63
74
|
serialize(serializationObject?: any): void;
|
|
75
|
+
/**
|
|
76
|
+
* Class name of the block.
|
|
77
|
+
*/
|
|
78
|
+
static ClassName: string;
|
|
64
79
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FlowGraphAsyncExecutionBlock } from "../../../flowGraphAsyncExecutionBlock.js";
|
|
2
2
|
import { RichTypeAny, RichTypeNumber, RichTypeBoolean } from "../../../flowGraphRichTypes.js";
|
|
3
3
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
4
|
-
import {
|
|
4
|
+
import { FlowGraphPathConverterComponent } from "../../../flowGraphPathConverterComponent.js";
|
|
5
5
|
/**
|
|
6
6
|
* @experimental
|
|
7
7
|
* A block that plays an animation on an animatable object.
|
|
@@ -10,8 +10,8 @@ export class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {
|
|
|
10
10
|
constructor(config) {
|
|
11
11
|
super(config);
|
|
12
12
|
this.config = config;
|
|
13
|
-
this.templateTargetComponent = new
|
|
14
|
-
this.templateAnimationComponent = new
|
|
13
|
+
this.templateTargetComponent = new FlowGraphPathConverterComponent(config.targetPath, this);
|
|
14
|
+
this.templateAnimationComponent = new FlowGraphPathConverterComponent(config.animationPath, this);
|
|
15
15
|
this.speed = this.registerDataInput("speed", RichTypeNumber);
|
|
16
16
|
this.loop = this.registerDataInput("loop", RichTypeBoolean);
|
|
17
17
|
this.from = this.registerDataInput("from", RichTypeNumber);
|
|
@@ -24,8 +24,10 @@ export class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {
|
|
|
24
24
|
*/
|
|
25
25
|
_preparePendingTasks(context) {
|
|
26
26
|
var _a;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
27
|
+
const targetAccessor = this.templateTargetComponent.getAccessor(this.config.pathConverter, context);
|
|
28
|
+
const targetValue = targetAccessor.info.getObject(targetAccessor.object);
|
|
29
|
+
const animationAccessor = this.templateAnimationComponent.getAccessor(this.config.pathConverter, context);
|
|
30
|
+
const animationValue = animationAccessor.info.get(animationAccessor.object);
|
|
29
31
|
if (!targetValue || !animationValue) {
|
|
30
32
|
throw new Error("Cannot play animation without target or animation");
|
|
31
33
|
}
|
|
@@ -70,13 +72,17 @@ export class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {
|
|
|
70
72
|
context._deleteExecutionVariable(this, "runningAnimatables");
|
|
71
73
|
}
|
|
72
74
|
getClassName() {
|
|
73
|
-
return
|
|
75
|
+
return FlowGraphPlayAnimationBlock.ClassName;
|
|
74
76
|
}
|
|
75
77
|
serialize(serializationObject = {}) {
|
|
76
78
|
super.serialize(serializationObject);
|
|
77
|
-
serializationObject.config.targetPath = this.config.targetPath
|
|
78
|
-
serializationObject.config.animationPath = this.config.animationPath
|
|
79
|
+
serializationObject.config.targetPath = this.config.targetPath;
|
|
80
|
+
serializationObject.config.animationPath = this.config.animationPath;
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Class name of the block.
|
|
85
|
+
*/
|
|
86
|
+
FlowGraphPlayAnimationBlock.ClassName = "FGPlayAnimationBlock";
|
|
87
|
+
RegisterClass(FlowGraphPlayAnimationBlock.ClassName, FlowGraphPlayAnimationBlock);
|
|
82
88
|
//# sourceMappingURL=flowGraphPlayAnimationBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphPlayAnimationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,6BAA6B,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,mCAAI,EAAE,CAAC;QACvG,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC/C,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YACd,YAAY,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;SACjC;QACD,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACI,mBAAmB,CAAC,OAAyB;;QAChD,MAAM,YAAY,GAAG,MAAC,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,oBAAoB,CAAkB,mCAAI,EAAE,CAAC;QACvG,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE;YAC7B,IAAI,CAAC,IAAI,EAAE,CAAC;SACf;QACD,OAAO,CAAC,wBAAwB,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;IACjE,CAAC;IAEM,YAAY;QACf,OAAO,sBAAsB,CAAC;IAClC,CAAC;IAEM,SAAS,CAAC,sBAA2B,EAAE;QAC1C,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,mBAAmB,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;QAC3E,mBAAmB,CAAC,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC;IACrF,CAAC;CACJ;AAED,aAAa,CAAC,sBAAsB,EAAE,2BAA2B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { Animatable } from \"../../../../Animations\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphAsyncExecutionBlock } from \"../../../flowGraphAsyncExecutionBlock\";\r\nimport { RichTypeAny, RichTypeNumber, RichTypeBoolean } from \"../../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport type { FlowGraphPath } from \"../../../flowGraphPath\";\r\nimport { FlowGraphPathComponent } from \"../../../flowGraphPathComponent\";\r\n\r\n/**\r\n * @experimental\r\n */\r\nexport interface IFlowGraphPlayAnimationBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n targetPath: FlowGraphPath;\r\n animationPath: FlowGraphPath;\r\n}\r\n/**\r\n * @experimental\r\n * A block that plays an animation on an animatable object.\r\n */\r\nexport class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {\r\n /**\r\n * The substitution inputs for template strings in the target\r\n */\r\n public readonly templateTargetComponent: FlowGraphPathComponent;\r\n /**\r\n * The substitution inputs for template strings in the animation\r\n */\r\n public readonly templateAnimationComponent: FlowGraphPathComponent;\r\n /**\r\n * Input connection: The speed of the animation.\r\n */\r\n public readonly speed: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: Should the animation loop?\r\n */\r\n public readonly loop: FlowGraphDataConnection<boolean>;\r\n /**\r\n * Input connection: The starting frame of the animation.\r\n */\r\n public readonly from: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The ending frame of the animation.\r\n */\r\n public readonly to: FlowGraphDataConnection<number>;\r\n\r\n /**\r\n * Output connection: The animatable that is currently running.\r\n */\r\n public readonly runningAnimatable: FlowGraphDataConnection<Animatable>;\r\n\r\n public constructor(public config: IFlowGraphPlayAnimationBlockConfiguration) {\r\n super(config);\r\n\r\n this.templateTargetComponent = new FlowGraphPathComponent(config.targetPath, this);\r\n this.templateAnimationComponent = new FlowGraphPathComponent(config.animationPath, this);\r\n\r\n this.speed = this.registerDataInput(\"speed\", RichTypeNumber);\r\n this.loop = this.registerDataInput(\"loop\", RichTypeBoolean);\r\n this.from = this.registerDataInput(\"from\", RichTypeNumber);\r\n this.to = this.registerDataInput(\"to\", RichTypeNumber);\r\n\r\n this.runningAnimatable = this.registerDataOutput(\"runningAnimatable\", RichTypeAny);\r\n }\r\n\r\n /**\r\n * @internal\r\n * @param context\r\n */\r\n public _preparePendingTasks(context: FlowGraphContext): void {\r\n const targetValue = this.templateTargetComponent.getProperty(context);\r\n const animationValue = this.templateAnimationComponent.getProperty(context);\r\n\r\n if (!targetValue || !animationValue) {\r\n throw new Error(\"Cannot play animation without target or animation\");\r\n }\r\n\r\n const contextAnimatables = (context._getExecutionVariable(this, \"runningAnimatables\") as Animatable[]) ?? [];\r\n\r\n // was an animation started on this target already and was just paused? if so, we can unpause it.\r\n const existingAnimatable = this.runningAnimatable.getValue(context);\r\n if (existingAnimatable && existingAnimatable.paused) {\r\n existingAnimatable.restart();\r\n } else {\r\n const scene = context.configuration.scene;\r\n const animatable = scene.beginDirectAnimation(\r\n targetValue,\r\n [animationValue],\r\n this.from.getValue(context),\r\n this.to.getValue(context),\r\n this.loop.getValue(context),\r\n this.speed.getValue(context),\r\n () => this._onAnimationEnd(animatable, context)\r\n );\r\n this.runningAnimatable.setValue(animatable, context);\r\n contextAnimatables.push(animatable);\r\n }\r\n\r\n context._setExecutionVariable(this, \"runningAnimatables\", contextAnimatables);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n this._startPendingTasks(context);\r\n\r\n this.out._activateSignal(context);\r\n }\r\n\r\n private _onAnimationEnd(animatable: Animatable, context: FlowGraphContext) {\r\n const contextAnims = (context._getExecutionVariable(this, \"runningAnimatables\") as Animatable[]) ?? [];\r\n const index = contextAnims.indexOf(animatable);\r\n if (index !== -1) {\r\n contextAnims.splice(index, 1);\r\n }\r\n context._removePendingBlock(this);\r\n this.done._activateSignal(context);\r\n }\r\n\r\n /**\r\n * @internal\r\n * Stop any currently running animations.\r\n */\r\n public _cancelPendingTasks(context: FlowGraphContext): void {\r\n const contextAnims = (context._getExecutionVariable(this, \"runningAnimatables\") as Animatable[]) ?? [];\r\n for (const anim of contextAnims) {\r\n anim.stop();\r\n }\r\n context._deleteExecutionVariable(this, \"runningAnimatables\");\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGPlayAnimationBlock\";\r\n }\r\n\r\n public serialize(serializationObject: any = {}) {\r\n super.serialize(serializationObject);\r\n serializationObject.config.targetPath = this.config.targetPath.serialize();\r\n serializationObject.config.animationPath = this.config.animationPath.serialize();\r\n }\r\n}\r\n\r\nRegisterClass(\"FGPlayAnimationBlock\", FlowGraphPlayAnimationBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"flowGraphPlayAnimationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAoB3F;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ,4BAA4B;IA+BzE,YAA0B,MAAiD;QACvE,KAAK,CAAC,MAAM,CAAC,CAAC;QADQ,WAAM,GAAN,MAAM,CAA2C;QAGvE,IAAI,CAAC,uBAAuB,GAAG,IAAI,+BAA+B,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAC5F,IAAI,CAAC,0BAA0B,GAAG,IAAI,+BAA+B,CAAC,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;QAElG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAC7D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;QAC5D,IAAI,CAAC,IAAI,GAAG,IAAI,C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AAqB,CAAC,IAAI,EAAE,oBAAoB,CAAkB,mCAAI,EAAE,CAAC;QACvG,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE;YAC7B,IAAI,CAAC,IAAI,EAAE,CAAC;SACf;QACD,OAAO,CAAC,wBAAwB,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;IACjE,CAAC;IAEM,YAAY;QACf,OAAO,2BAA2B,CAAC,SAAS,CAAC;IACjD,CAAC;IAEM,SAAS,CAAC,sBAA2B,EAAE;QAC1C,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,mBAAmB,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;QAC/D,mBAAmB,CAAC,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;IACzE,CAAC;;AAED;;GAEG;AACW,qCAAS,GAAG,sBAAsB,CAAC;AAGrD,aAAa,CAAC,2BAA2B,CAAC,SAAS,EAAE,2BAA2B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { Animatable } from \"../../../../Animations/animatable\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphAsyncExecutionBlock } from \"../../../flowGraphAsyncExecutionBlock\";\r\nimport { RichTypeAny, RichTypeNumber, RichTypeBoolean } from \"../../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport type { IPathToObjectConverter } from \"../../../../ObjectModel/objectModelInterfaces\";\r\nimport { FlowGraphPathConverterComponent } from \"../../../flowGraphPathConverterComponent\";\r\nimport type { IObjectAccessor } from \"../../../typeDefinitions\";\r\n\r\n/**\r\n * @experimental\r\n */\r\nexport interface IFlowGraphPlayAnimationBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The path to the target object that will be animated.\r\n */\r\n targetPath: string;\r\n /**\r\n * The path to the animation that will be played.\r\n */\r\n animationPath: string;\r\n /**\r\n * The path converter to use to convert the path to an object accessor.\r\n */\r\n pathConverter: IPathToObjectConverter<IObjectAccessor>;\r\n}\r\n/**\r\n * @experimental\r\n * A block that plays an animation on an animatable object.\r\n */\r\nexport class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {\r\n /**\r\n * The substitution inputs for template strings in the target\r\n */\r\n public readonly templateTargetComponent: FlowGraphPathConverterComponent;\r\n /**\r\n * The substitution inputs for template strings in the animation\r\n */\r\n public readonly templateAnimationComponent: FlowGraphPathConverterComponent;\r\n /**\r\n * Input connection: The speed of the animation.\r\n */\r\n public readonly speed: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: Should the animation loop?\r\n */\r\n public readonly loop: FlowGraphDataConnection<boolean>;\r\n /**\r\n * Input connection: The starting frame of the animation.\r\n */\r\n public readonly from: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The ending frame of the animation.\r\n */\r\n public readonly to: FlowGraphDataConnection<number>;\r\n\r\n /**\r\n * Output connection: The animatable that is currently running.\r\n */\r\n public readonly runningAnimatable: FlowGraphDataConnection<Animatable>;\r\n\r\n public constructor(public config: IFlowGraphPlayAnimationBlockConfiguration) {\r\n super(config);\r\n\r\n this.templateTargetComponent = new FlowGraphPathConverterComponent(config.targetPath, this);\r\n this.templateAnimationComponent = new FlowGraphPathConverterComponent(config.animationPath, this);\r\n\r\n this.speed = this.registerDataInput(\"speed\", RichTypeNumber);\r\n this.loop = this.registerDataInput(\"loop\", RichTypeBoolean);\r\n this.from = this.registerDataInput(\"from\", RichTypeNumber);\r\n this.to = this.registerDataInput(\"to\", RichTypeNumber);\r\n\r\n this.runningAnimatable = this.registerDataOutput(\"runningAnimatable\", RichTypeAny);\r\n }\r\n\r\n /**\r\n * @internal\r\n * @param context\r\n */\r\n public _preparePendingTasks(context: FlowGraphContext): void {\r\n const targetAccessor = this.templateTargetComponent.getAccessor(this.config.pathConverter, context);\r\n const targetValue = targetAccessor.info.getObject(targetAccessor.object);\r\n const animationAccessor = this.templateAnimationComponent.getAccessor(this.config.pathConverter, context);\r\n const animationValue = animationAccessor.info.get(animationAccessor.object);\r\n\r\n if (!targetValue || !animationValue) {\r\n throw new Error(\"Cannot play animation without target or animation\");\r\n }\r\n\r\n const contextAnimatables = (context._getExecutionVariable(this, \"runningAnimatables\") as Animatable[]) ?? [];\r\n\r\n // was an animation started on this target already and was just paused? if so, we can unpause it.\r\n const existingAnimatable = this.runningAnimatable.getValue(context);\r\n if (existingAnimatable && existingAnimatable.paused) {\r\n existingAnimatable.restart();\r\n } else {\r\n const scene = context.configuration.scene;\r\n const animatable = scene.beginDirectAnimation(\r\n targetValue,\r\n [animationValue],\r\n this.from.getValue(context),\r\n this.to.getValue(context),\r\n this.loop.getValue(context),\r\n this.speed.getValue(context),\r\n () => this._onAnimationEnd(animatable, context)\r\n );\r\n this.runningAnimatable.setValue(animatable, context);\r\n contextAnimatables.push(animatable);\r\n }\r\n\r\n context._setExecutionVariable(this, \"runningAnimatables\", contextAnimatables);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n this._startPendingTasks(context);\r\n\r\n this.out._activateSignal(context);\r\n }\r\n\r\n private _onAnimationEnd(animatable: Animatable, context: FlowGraphContext) {\r\n const contextAnims = (context._getExecutionVariable(this, \"runningAnimatables\") as Animatable[]) ?? [];\r\n const index = contextAnims.indexOf(animatable);\r\n if (index !== -1) {\r\n contextAnims.splice(index, 1);\r\n }\r\n context._removePendingBlock(this);\r\n this.done._activateSignal(context);\r\n }\r\n\r\n /**\r\n * @internal\r\n * Stop any currently running animations.\r\n */\r\n public _cancelPendingTasks(context: FlowGraphContext): void {\r\n const contextAnims = (context._getExecutionVariable(this, \"runningAnimatables\") as Animatable[]) ?? [];\r\n for (const anim of contextAnims) {\r\n anim.stop();\r\n }\r\n context._deleteExecutionVariable(this, \"runningAnimatables\");\r\n }\r\n\r\n public getClassName(): string {\r\n return FlowGraphPlayAnimationBlock.ClassName;\r\n }\r\n\r\n public serialize(serializationObject: any = {}) {\r\n super.serialize(serializationObject);\r\n serializationObject.config.targetPath = this.config.targetPath;\r\n serializationObject.config.animationPath = this.config.animationPath;\r\n }\r\n\r\n /**\r\n * Class name of the block.\r\n */\r\n public static ClassName = \"FGPlayAnimationBlock\";\r\n}\r\n\r\nRegisterClass(FlowGraphPlayAnimationBlock.ClassName, FlowGraphPlayAnimationBlock);\r\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
2
2
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
3
|
-
import { FlowGraphExecutionBlockWithOutSignal } from "../../../
|
|
3
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal";
|
|
4
4
|
import type { Animatable } from "../../../../Animations";
|
|
5
5
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
6
6
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FlowGraphExecutionBlockWithOutSignal } from "../../../
|
|
1
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal.js";
|
|
2
2
|
import { RichTypeAny } from "../../../flowGraphRichTypes.js";
|
|
3
3
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
4
4
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphStopAnimationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"flowGraphStopAnimationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,+CAA+C,CAAC;AAErG,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ,oCAAoC;IAMjF,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC;IAClF,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,oBAAoB,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACpE,oBAAoB,CAAC,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAEM,YAAY;QACf,OAAO,sBAAsB,CAAC;IAClC,CAAC;CACJ;AACD,aAAa,CAAC,sBAAsB,EAAE,2BAA2B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphExecutionBlockWithOutSignal\";\r\nimport type { Animatable } from \"../../../../Animations\";\r\nimport { RichTypeAny } from \"../../../flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Block that stops a running animation\r\n */\r\nexport class FlowGraphStopAnimationBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n *\r\n */\r\n public readonly animationToStop: FlowGraphDataConnection<Animatable>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.animationToStop = this.registerDataInput(\"animationToStop\", RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const animationToStopValue = this.animationToStop.getValue(context);\r\n animationToStopValue.stop();\r\n this.out._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGStopAnimationBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGStopAnimationBlock\", FlowGraphStopAnimationBlock);\r\n"]}
|
|
@@ -2,7 +2,7 @@ import { Sound } from "../../../../Audio/sound";
|
|
|
2
2
|
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
3
3
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
4
4
|
import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
|
|
5
|
-
import { FlowGraphExecutionBlockWithOutSignal } from "../../../
|
|
5
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal";
|
|
6
6
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
7
7
|
/**
|
|
8
8
|
* @experimental
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Sound } from "../../../../Audio/sound.js";
|
|
2
2
|
import { RichTypeAny } from "../../../flowGraphRichTypes.js";
|
|
3
|
-
import { FlowGraphExecutionBlockWithOutSignal } from "../../../
|
|
3
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal.js";
|
|
4
4
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
5
5
|
/**
|
|
6
6
|
* @experimental
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphPlayAudioBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGhD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,oCAAoC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"flowGraphPlayAudioBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGhD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,oCAAoC,EAAE,MAAM,+CAA+C,CAAC;AAErG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,oCAAoC;IAM7E,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC9D,CAAC;IAEM,QAAQ,CAAC,OAAyB,EAAE,cAAyC;QAChF,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,UAAU,YAAY,KAAK,EAAE;YAC7B,UAAU,CAAC,IAAI,EAAE,CAAC;SACrB;QACD,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAEM,YAAY;QACf,OAAO,kBAAkB,CAAC;IAC9B,CAAC;CACJ;AACD,aAAa,CAAC,kBAAkB,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { Sound } from \"../../../../Audio/sound\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { RichTypeAny } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphExecutionBlockWithOutSignal\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * A block that plays an audio.\r\n */\r\nexport class FlowGraphPlayAudioBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The audio to play.\r\n */\r\n public readonly audio: FlowGraphDataConnection<Sound>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.audio = this.registerDataInput(\"audio\", RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void {\r\n const audioValue = this.audio.getValue(context);\r\n if (audioValue instanceof Sound) {\r\n audioValue.play();\r\n }\r\n this.out._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGPlayAudioBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGPlayAudioBlock\", FlowGraphPlayAudioBlock);\r\n"]}
|
|
@@ -2,7 +2,7 @@ import { Sound } from "../../../../Audio/sound";
|
|
|
2
2
|
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
3
3
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
4
4
|
import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
|
|
5
|
-
import { FlowGraphExecutionBlockWithOutSignal } from "../../../
|
|
5
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal";
|
|
6
6
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
7
7
|
/**
|
|
8
8
|
* Stops an audio.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Sound } from "../../../../Audio/sound.js";
|
|
2
2
|
import { RichTypeAny } from "../../../flowGraphRichTypes.js";
|
|
3
|
-
import { FlowGraphExecutionBlockWithOutSignal } from "../../../
|
|
3
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal.js";
|
|
4
4
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
5
5
|
/**
|
|
6
6
|
* Stops an audio.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphStopAudioBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGhD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,oCAAoC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"flowGraphStopAudioBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGhD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,oCAAoC,EAAE,MAAM,+CAA+C,CAAC;AAErG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,oCAAoC;IAM7E,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC9D,CAAC;IAEM,QAAQ,CAAC,OAAyB,EAAE,cAAyC;QAChF,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,UAAU,YAAY,KAAK,EAAE;YAC7B,UAAU,CAAC,IAAI,EAAE,CAAC;SACrB;IACL,CAAC;IAEM,YAAY;QACf,OAAO,kBAAkB,CAAC;IAC9B,CAAC;CACJ;AACD,aAAa,CAAC,kBAAkB,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { Sound } from \"../../../../Audio/sound\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { RichTypeAny } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphExecutionBlockWithOutSignal\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * Stops an audio.\r\n * @experimental\r\n */\r\nexport class FlowGraphStopAudioBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The audio to stop.\r\n */\r\n public readonly audio: FlowGraphDataConnection<Sound>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.audio = this.registerDataInput(\"audio\", RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void {\r\n const audioValue = this.audio.getValue(context);\r\n if (audioValue instanceof Sound) {\r\n audioValue.stop();\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGStopAudioBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGStopAudioBlock\", FlowGraphStopAudioBlock);\r\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
2
2
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
3
3
|
import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
|
|
4
|
-
import { FlowGraphExecutionBlockWithOutSignal } from "../../../
|
|
4
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal";
|
|
5
5
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
6
6
|
/**
|
|
7
7
|
* @experimental
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RichTypeNumber } from "../../../flowGraphRichTypes.js";
|
|
2
|
-
import { FlowGraphExecutionBlockWithOutSignal } from "../../../
|
|
2
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal.js";
|
|
3
3
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
4
4
|
/**
|
|
5
5
|
* @experimental
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphCounterBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,oCAAoC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"flowGraphCounterBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,oCAAoC,EAAE,MAAM,+CAA+C,CAAC;AACrG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,oCAAoC;IAU3E,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAC9D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAEM,QAAQ,CAAC,OAAyB,EAAE,aAAwC;;QAC/E,IAAI,aAAa,KAAK,IAAI,CAAC,KAAK,EAAE;YAC9B,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;YAChD,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YAChC,OAAO;SACV;QACD,MAAM,UAAU,GAAG,CAAC,MAAA,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,OAAO,CAAC,mCAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QAE3E,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACzD,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAEM,YAAY;QACf,OAAO,gBAAgB,CAAC;IAC5B,CAAC;CACJ;AACD,aAAa,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { RichTypeNumber } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphExecutionBlockWithOutSignal\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\n/**\r\n * @experimental\r\n * A block that counts the number of times it has been called.\r\n */\r\nexport class FlowGraphCounterBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Output connection: The number of times the block has been called.\r\n */\r\n public readonly count: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: Resets the counter.\r\n */\r\n public readonly reset: FlowGraphSignalConnection;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.count = this.registerDataOutput(\"count\", RichTypeNumber);\r\n this.reset = this._registerSignalInput(\"reset\");\r\n }\r\n\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n if (callingSignal === this.reset) {\r\n context._setExecutionVariable(this, \"count\", 0);\r\n this.count.setValue(0, context);\r\n return;\r\n }\r\n const countValue = (context._getExecutionVariable(this, \"count\") ?? 0) + 1;\r\n\r\n context._setExecutionVariable(this, \"count\", countValue);\r\n this.count.setValue(countValue, context);\r\n this.out._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGCounterBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGCounterBlock\", FlowGraphCounterBlock);\r\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FlowGraphContext } from "../../../flowGraphContext.js";
|
|
2
2
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection.js";
|
|
3
3
|
import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection.js";
|
|
4
|
-
import { FlowGraphExecutionBlockWithOutSignal } from "../../../
|
|
4
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal.js";
|
|
5
5
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
6
6
|
/**
|
|
7
7
|
* @experimental
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RichTypeNumber } from "../../../flowGraphRichTypes.js";
|
|
2
|
-
import { FlowGraphExecutionBlockWithOutSignal } from "../../../
|
|
2
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal.js";
|
|
3
3
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
4
4
|
/**
|
|
5
5
|
* @experimental
|