@babylonjs/core 7.52.3 → 7.53.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/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.d.ts +0 -3
- package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js +9 -6
- package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js.map +1 -1
- package/AudioV2/abstractAudio/subProperties/spatialAudio.js +10 -5
- package/AudioV2/abstractAudio/subProperties/spatialAudio.js.map +1 -1
- package/AudioV2/webAudio/subNodes/webAudioBaseSubGraph.js +2 -2
- package/AudioV2/webAudio/subNodes/webAudioBaseSubGraph.js.map +1 -1
- package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js +3 -3
- package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.d.ts +3 -12
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js +16 -36
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.d.ts +5 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +17 -4
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.d.ts +3 -11
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js +5 -14
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +3 -0
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Meshes/Builders/shapeBuilder.d.ts +2 -0
- package/Meshes/Builders/shapeBuilder.js +7 -4
- package/Meshes/Builders/shapeBuilder.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +5 -0
- package/PostProcesses/postProcess.js +10 -2
- package/PostProcesses/postProcess.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { FlowGraphAssetType } from "../../../flowGraphAssetsContext.js";
|
|
2
2
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock.js";
|
|
3
|
-
import { FlowGraphBlock } from "../../../flowGraphBlock.js";
|
|
4
3
|
import type { FlowGraphContext } from "../../../flowGraphContext.js";
|
|
5
4
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection.js";
|
|
6
5
|
import { FlowGraphPathConverterComponent } from "../../../flowGraphPathConverterComponent.js";
|
|
@@ -8,6 +7,7 @@ import type { IObjectAccessor } from "../../../typeDefinitions.js";
|
|
|
8
7
|
import type { IPathToObjectConverter } from "../../../../ObjectModel/objectModelInterfaces.js";
|
|
9
8
|
import type { Animation } from "../../../../Animations/animation.js";
|
|
10
9
|
import type { EasingFunction } from "../../../../Animations/easing.js";
|
|
10
|
+
import { FlowGraphCachedOperationBlock } from "../flowGraphCachedOperationBlock";
|
|
11
11
|
/**
|
|
12
12
|
* Configuration for the JSON pointer parser block.
|
|
13
13
|
*/
|
|
@@ -30,7 +30,7 @@ export interface IFlowGraphJsonPointerParserBlockConfiguration extends IFlowGrap
|
|
|
30
30
|
* The output is an object and a property name.
|
|
31
31
|
* Optionally, the block can also output the value of the property. This is configurable.
|
|
32
32
|
*/
|
|
33
|
-
export declare class FlowGraphJsonPointerParserBlock<P extends any, O extends FlowGraphAssetType> extends
|
|
33
|
+
export declare class FlowGraphJsonPointerParserBlock<P extends any, O extends FlowGraphAssetType> extends FlowGraphCachedOperationBlock<P> {
|
|
34
34
|
/**
|
|
35
35
|
* the configuration of the block
|
|
36
36
|
*/
|
|
@@ -43,11 +43,6 @@ export declare class FlowGraphJsonPointerParserBlock<P extends any, O extends Fl
|
|
|
43
43
|
* Output connection: The property name.
|
|
44
44
|
*/
|
|
45
45
|
readonly propertyName: FlowGraphDataConnection<string>;
|
|
46
|
-
/**
|
|
47
|
-
* Output connection: The value of the property.
|
|
48
|
-
* Note that per default this is not outputted. It can be enabled by setting the outputValue property to true.
|
|
49
|
-
*/
|
|
50
|
-
readonly value: FlowGraphDataConnection<P>;
|
|
51
46
|
/**
|
|
52
47
|
* Output connection: A function that can be used to update the value of the property.
|
|
53
48
|
*/
|
|
@@ -60,10 +55,6 @@ export declare class FlowGraphJsonPointerParserBlock<P extends any, O extends Fl
|
|
|
60
55
|
* Output connection: A function that can be used to get the interpolation animation property info.
|
|
61
56
|
*/
|
|
62
57
|
readonly generateAnimationsFunction: FlowGraphDataConnection<() => (keys: any[], fps: number, easingFunction?: EasingFunction) => Animation[]>;
|
|
63
|
-
/**
|
|
64
|
-
* Output connection: Whether the value is valid.
|
|
65
|
-
*/
|
|
66
|
-
readonly isValid: FlowGraphDataConnection<boolean>;
|
|
67
58
|
/**
|
|
68
59
|
* The component with the templated inputs for the provided path.
|
|
69
60
|
*/
|
|
@@ -73,7 +64,7 @@ export declare class FlowGraphJsonPointerParserBlock<P extends any, O extends Fl
|
|
|
73
64
|
* the configuration of the block
|
|
74
65
|
*/
|
|
75
66
|
config: IFlowGraphJsonPointerParserBlockConfiguration);
|
|
76
|
-
|
|
67
|
+
_doOperation(context: FlowGraphContext): P;
|
|
77
68
|
private _setPropertyValue;
|
|
78
69
|
private _getPropertyValue;
|
|
79
70
|
private _getInterpolationAnimationPropertyInfo;
|
|
@@ -1,63 +1,43 @@
|
|
|
1
|
-
import { FlowGraphBlock } from "../../../flowGraphBlock.js";
|
|
2
1
|
import { FlowGraphPathConverterComponent } from "../../../flowGraphPathConverterComponent.js";
|
|
3
2
|
import { RichTypeAny } from "../../../flowGraphRichTypes.js";
|
|
4
3
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
5
4
|
import { Color3, Color4 } from "../../../../Maths/math.color.js";
|
|
5
|
+
import { FlowGraphCachedOperationBlock } from "../flowGraphCachedOperationBlock.js";
|
|
6
6
|
/**
|
|
7
7
|
* This block will take a JSON pointer and parse it to get the value from the JSON object.
|
|
8
8
|
* The output is an object and a property name.
|
|
9
9
|
* Optionally, the block can also output the value of the property. This is configurable.
|
|
10
10
|
*/
|
|
11
|
-
export class FlowGraphJsonPointerParserBlock extends
|
|
11
|
+
export class FlowGraphJsonPointerParserBlock extends FlowGraphCachedOperationBlock {
|
|
12
12
|
constructor(
|
|
13
13
|
/**
|
|
14
14
|
* the configuration of the block
|
|
15
15
|
*/
|
|
16
16
|
config) {
|
|
17
|
-
super(config);
|
|
17
|
+
super(RichTypeAny, config);
|
|
18
18
|
this.config = config;
|
|
19
19
|
this.object = this.registerDataOutput("object", RichTypeAny);
|
|
20
20
|
this.propertyName = this.registerDataOutput("propertyName", RichTypeAny);
|
|
21
|
-
this.isValid = this.registerDataOutput("isValid", RichTypeAny);
|
|
22
|
-
if (config.outputValue) {
|
|
23
|
-
this.value = this.registerDataOutput("value", RichTypeAny);
|
|
24
|
-
}
|
|
25
21
|
this.setterFunction = this.registerDataOutput("setFunction", RichTypeAny, this._setPropertyValue.bind(this));
|
|
26
22
|
this.getterFunction = this.registerDataOutput("getFunction", RichTypeAny, this._getPropertyValue.bind(this));
|
|
27
23
|
this.generateAnimationsFunction = this.registerDataOutput("generateAnimationsFunction", RichTypeAny, this._getInterpolationAnimationPropertyInfo.bind(this));
|
|
28
24
|
this.templateComponent = new FlowGraphPathConverterComponent(config.jsonPointer, this);
|
|
29
25
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
this.isValid.setValue(false, context);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
this.object.setValue(object, context);
|
|
42
|
-
if (propertyName) {
|
|
43
|
-
this.propertyName.setValue(propertyName, context);
|
|
44
|
-
}
|
|
45
|
-
this.isValid.setValue(true, context);
|
|
46
|
-
}
|
|
47
|
-
if (this.config.outputValue) {
|
|
48
|
-
if (value === undefined) {
|
|
49
|
-
this.isValid.setValue(false, context);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
this.value.setValue(value, context);
|
|
53
|
-
this.isValid.setValue(true, context);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
26
|
+
_doOperation(context) {
|
|
27
|
+
const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);
|
|
28
|
+
const value = accessorContainer.info.get(accessorContainer.object);
|
|
29
|
+
const object = accessorContainer.info.getTarget?.(accessorContainer.object);
|
|
30
|
+
const propertyName = accessorContainer.info.getPropertyName?.[0](accessorContainer.object);
|
|
31
|
+
if (!object) {
|
|
32
|
+
throw new Error("Object is undefined");
|
|
56
33
|
}
|
|
57
|
-
|
|
58
|
-
this.
|
|
59
|
-
|
|
34
|
+
else {
|
|
35
|
+
this.object.setValue(object, context);
|
|
36
|
+
if (propertyName) {
|
|
37
|
+
this.propertyName.setValue(propertyName, context);
|
|
38
|
+
}
|
|
60
39
|
}
|
|
40
|
+
return value;
|
|
61
41
|
}
|
|
62
42
|
_setPropertyValue(_target, _propertyName, value, context) {
|
|
63
43
|
const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphJsonPointerParserBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,mCAAsC;AAG/D,OAAO,EAAE,+BAA+B,EAAE,oDAAuD;AACjG,OAAO,EAAE,WAAW,EAAE,uCAA0C;AAIhE,OAAO,EAAE,aAAa,EAAE,sCAA4B;AAIpD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,wCAA8B;AAqBvD;;;;GAIG;AACH,MAAM,OAAO,+BAA6E,SAAQ,cAAc;I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D,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;gBAChD,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;YAEH,OAAO,UAAU,CAAC;QACtB,CAAC,CAAC;IACN,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,qFAA6C;IACjD,CAAC;CACJ;AAED,SAAS,OAAO,CAAC,KAAU,EAAE,aAAqB;IAC9C,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3C,OAAO,KAAmC,CAAC;IAC/C,CAAC;IACD,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC;SAAM,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,aAAa,gFAAwC,+BAA+B,CAAC,CAAC","sourcesContent":["import type { FlowGraphAssetType } from \"core/FlowGraph/flowGraphAssetsContext\";\nimport type { IFlowGraphBlockConfiguration } from \"core/FlowGraph/flowGraphBlock\";\nimport { FlowGraphBlock } from \"core/FlowGraph/flowGraphBlock\";\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\nimport { FlowGraphPathConverterComponent } from \"core/FlowGraph/flowGraphPathConverterComponent\";\nimport { RichTypeAny } from \"core/FlowGraph/flowGraphRichTypes\";\nimport type { IObjectAccessor } from \"core/FlowGraph/typeDefinitions\";\nimport type { IPathToObjectConverter } from \"core/ObjectModel/objectModelInterfaces\";\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport type { Animation } from \"core/Animations/animation\";\nimport type { EasingFunction } from \"core/Animations/easing\";\nimport type { Vector4 } from \"core/Maths/math.vector\";\nimport { Color3, Color4 } from \"core/Maths/math.color\";\n\n/**\n * Configuration for the JSON pointer parser block.\n */\nexport interface IFlowGraphJsonPointerParserBlockConfiguration extends IFlowGraphBlockConfiguration {\n /**\n * The JSON pointer to parse.\n */\n jsonPointer: string;\n /**\n * The path converter to use to convert the path to an object accessor.\n */\n pathConverter: IPathToObjectConverter<IObjectAccessor>;\n\n /**\n * Whether to output the value of the property.\n */\n outputValue?: boolean;\n}\n\n/**\n * This block will take a JSON pointer and parse it to get the value from the JSON object.\n * The output is an object and a property name.\n * Optionally, the block can also output the value of the property. This is configurable.\n */\nexport class FlowGraphJsonPointerParserBlock<P extends any, O extends FlowGraphAssetType> extends FlowGraphBlock {\n /**\n * Output connection: The object that contains the property.\n */\n public readonly object: FlowGraphDataConnection<O>;\n\n /**\n * Output connection: The property name.\n */\n public readonly propertyName: FlowGraphDataConnection<string>;\n\n /**\n * Output connection: The value of the property.\n * Note that per default this is not outputted. It can be enabled by setting the outputValue property to true.\n */\n public readonly value: FlowGraphDataConnection<P>;\n\n /**\n * Output connection: A function that can be used to update the value of the property.\n */\n public readonly setterFunction: FlowGraphDataConnection<(target: O, propertyName: string, value: P, context: FlowGraphContext) => void>;\n\n /**\n * Output connection: A function that can be used to get the value of the property.\n */\n public readonly getterFunction: FlowGraphDataConnection<(target: O, propertyName: string, context: FlowGraphContext) => P | undefined>;\n\n /**\n * Output connection: A function that can be used to get the interpolation animation property info.\n */\n public readonly generateAnimationsFunction: FlowGraphDataConnection<() => (keys: any[], fps: number, easingFunction?: EasingFunction) => Animation[]>;\n\n /**\n * Output connection: Whether the value is valid.\n */\n public readonly isValid: FlowGraphDataConnection<boolean>;\n\n /**\n * The component with the templated inputs for the provided path.\n */\n public readonly templateComponent: FlowGraphPathConverterComponent;\n\n constructor(\n /**\n * the configuration of the block\n */\n public override config: IFlowGraphJsonPointerParserBlockConfiguration\n ) {\n super(config);\n this.object = this.registerDataOutput(\"object\", RichTypeAny);\n this.propertyName = this.registerDataOutput(\"propertyName\", RichTypeAny);\n this.isValid = this.registerDataOutput(\"isValid\", RichTypeAny);\n if (config.outputValue) {\n this.value = this.registerDataOutput(\"value\", RichTypeAny);\n }\n this.setterFunction = this.registerDataOutput(\"setFunction\", RichTypeAny, this._setPropertyValue.bind(this));\n this.getterFunction = this.registerDataOutput(\"getFunction\", RichTypeAny, this._getPropertyValue.bind(this));\n this.generateAnimationsFunction = this.registerDataOutput(\"generateAnimationsFunction\", RichTypeAny, this._getInterpolationAnimationPropertyInfo.bind(this));\n this.templateComponent = new FlowGraphPathConverterComponent(config.jsonPointer, this);\n }\n\n public override _updateOutputs(context: FlowGraphContext) {\n try {\n const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);\n const value = accessorContainer.info.get(accessorContainer.object);\n const object = accessorContainer.info.getTarget?.(accessorContainer.object);\n const propertyName = accessorContainer.info.getPropertyName?.[0](accessorContainer.object);\n if (!object) {\n this.isValid.setValue(false, context);\n return;\n } else {\n this.object.setValue(object, context);\n if (propertyName) {\n this.propertyName.setValue(propertyName, context);\n }\n this.isValid.setValue(true, context);\n }\n if (this.config.outputValue) {\n if (value === undefined) {\n this.isValid.setValue(false, context);\n } else {\n this.value.setValue(value, context);\n this.isValid.setValue(true, context);\n }\n }\n } catch (e) {\n this.isValid.setValue(false, context);\n return;\n }\n }\n\n private _setPropertyValue(_target: O, _propertyName: string, value: P, context: FlowGraphContext): void {\n const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);\n const type = accessorContainer.info.type;\n if (type.startsWith(\"Color\")) {\n value = ToColor(value as Vector4, type) as unknown as P;\n }\n accessorContainer.info.set?.(value, accessorContainer.object);\n }\n\n private _getPropertyValue(_target: O, _propertyName: string, context: FlowGraphContext): P | undefined {\n const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);\n return accessorContainer.info.get(accessorContainer.object);\n }\n\n private _getInterpolationAnimationPropertyInfo(\n _target: O,\n _propertyName: string,\n context: FlowGraphContext\n ): (keys: any[], fps: number, animationType: number, easingFunction?: EasingFunction) => Animation[] {\n const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);\n return (keys: any[], fps: number, animationType: number, easingFunction?: EasingFunction) => {\n const animations: Animation[] = [];\n // make sure keys are of the right type (in case of float3 color/vector)\n const type = accessorContainer.info.type;\n if (type.startsWith(\"Color\")) {\n keys = keys.map((key) => {\n return {\n frame: key.frame,\n value: ToColor(key.value, type),\n };\n });\n }\n accessorContainer.info.interpolation?.forEach((info, index) => {\n const name = accessorContainer.info.getPropertyName?.[index](accessorContainer.object) || \"Animation-interpolation-\" + index;\n // generate the keys based on interpolation info\n let newKeys: any[] = keys;\n if (animationType !== info.type) {\n // convert the keys to the right type\n newKeys = keys.map((key) => {\n return {\n frame: key.frame,\n value: info.getValue(undefined, key.value.asArray ? key.value.asArray() : [key.value], 0, 1),\n };\n });\n }\n const animationData = info.buildAnimations(accessorContainer.object, name, 60, newKeys);\n animationData.forEach((animation) => {\n if (easingFunction) {\n animation.babylonAnimation.setEasingFunction(easingFunction);\n }\n animations.push(animation.babylonAnimation);\n });\n });\n\n return animations;\n };\n }\n\n /**\n * Gets the class name of this block\n * @returns the class name\n */\n public override getClassName(): string {\n return FlowGraphBlockNames.JsonPointerParser;\n }\n}\n\nfunction ToColor(value: any, expectedValue: string) {\n if (value.getClassName().startsWith(\"Color\")) {\n return value as unknown as Color3 | Color4;\n }\n if (expectedValue === \"Color3\") {\n return new Color3(value.x, value.y, value.z);\n } else if (expectedValue === \"Color4\") {\n return new Color4(value.x, value.y, value.z, value.w);\n }\n return value;\n}\n\nRegisterClass(FlowGraphBlockNames.JsonPointerParser, FlowGraphJsonPointerParserBlock);\n"]}
|
|
1
|
+
{"version":3,"file":"flowGraphJsonPointerParserBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,+BAA+B,EAAE,oDAAuD;AACjG,OAAO,EAAE,WAAW,EAAE,uCAA0C;AAIhE,OAAO,EAAE,aAAa,EAAE,sCAA4B;AAIpD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,wCAA8B;AACvD,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAqBjF;;;;GAIG;AACH,MAAM,OAAO,+BAA6E,SAAQ,6BAAgC;IA+B9H;IACI;;OAEG;IACa,MAAqD;QAErE,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAFX,WAAM,GAAN,MAAM,CAA+C;QAGrE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QAC7D,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;QACzE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,kBAAkB,CAAC,aAAa,EAAE,WAAW,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7G,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,kBAAkB,CAAC,aAAa,EAAE,WAAW,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7G,IAAI,CAAC,0BAA0B,GAAG,IAAI,CAAC,kBAAkB,CAAC,4BAA4B,EAAE,WAAW,EAAE,IAAI,CAAC,sCAAsC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7J,IAAI,CAAC,iBAAiB,GAAG,IAAI,+BAA+B,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,CAA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;QAC7B,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC;SAAM,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,aAAa,gFAAwC,+BAA+B,CAAC,CAAC","sourcesContent":["import type { FlowGraphAssetType } from \"core/FlowGraph/flowGraphAssetsContext\";\nimport type { IFlowGraphBlockConfiguration } from \"core/FlowGraph/flowGraphBlock\";\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\nimport { FlowGraphPathConverterComponent } from \"core/FlowGraph/flowGraphPathConverterComponent\";\nimport { RichTypeAny } from \"core/FlowGraph/flowGraphRichTypes\";\nimport type { IObjectAccessor } from \"core/FlowGraph/typeDefinitions\";\nimport type { IPathToObjectConverter } from \"core/ObjectModel/objectModelInterfaces\";\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport type { Animation } from \"core/Animations/animation\";\nimport type { EasingFunction } from \"core/Animations/easing\";\nimport type { Vector4 } from \"core/Maths/math.vector\";\nimport { Color3, Color4 } from \"core/Maths/math.color\";\nimport { FlowGraphCachedOperationBlock } from \"../flowGraphCachedOperationBlock\";\n\n/**\n * Configuration for the JSON pointer parser block.\n */\nexport interface IFlowGraphJsonPointerParserBlockConfiguration extends IFlowGraphBlockConfiguration {\n /**\n * The JSON pointer to parse.\n */\n jsonPointer: string;\n /**\n * The path converter to use to convert the path to an object accessor.\n */\n pathConverter: IPathToObjectConverter<IObjectAccessor>;\n\n /**\n * Whether to output the value of the property.\n */\n outputValue?: boolean;\n}\n\n/**\n * This block will take a JSON pointer and parse it to get the value from the JSON object.\n * The output is an object and a property name.\n * Optionally, the block can also output the value of the property. This is configurable.\n */\nexport class FlowGraphJsonPointerParserBlock<P extends any, O extends FlowGraphAssetType> extends FlowGraphCachedOperationBlock<P> {\n /**\n * Output connection: The object that contains the property.\n */\n public readonly object: FlowGraphDataConnection<O>;\n\n /**\n * Output connection: The property name.\n */\n public readonly propertyName: FlowGraphDataConnection<string>;\n\n /**\n * Output connection: A function that can be used to update the value of the property.\n */\n public readonly setterFunction: FlowGraphDataConnection<(target: O, propertyName: string, value: P, context: FlowGraphContext) => void>;\n\n /**\n * Output connection: A function that can be used to get the value of the property.\n */\n public readonly getterFunction: FlowGraphDataConnection<(target: O, propertyName: string, context: FlowGraphContext) => P | undefined>;\n\n /**\n * Output connection: A function that can be used to get the interpolation animation property info.\n */\n public readonly generateAnimationsFunction: FlowGraphDataConnection<() => (keys: any[], fps: number, easingFunction?: EasingFunction) => Animation[]>;\n\n /**\n * The component with the templated inputs for the provided path.\n */\n public readonly templateComponent: FlowGraphPathConverterComponent;\n\n constructor(\n /**\n * the configuration of the block\n */\n public override config: IFlowGraphJsonPointerParserBlockConfiguration\n ) {\n super(RichTypeAny, config);\n this.object = this.registerDataOutput(\"object\", RichTypeAny);\n this.propertyName = this.registerDataOutput(\"propertyName\", RichTypeAny);\n this.setterFunction = this.registerDataOutput(\"setFunction\", RichTypeAny, this._setPropertyValue.bind(this));\n this.getterFunction = this.registerDataOutput(\"getFunction\", RichTypeAny, this._getPropertyValue.bind(this));\n this.generateAnimationsFunction = this.registerDataOutput(\"generateAnimationsFunction\", RichTypeAny, this._getInterpolationAnimationPropertyInfo.bind(this));\n this.templateComponent = new FlowGraphPathConverterComponent(config.jsonPointer, this);\n }\n\n public override _doOperation(context: FlowGraphContext): P {\n const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);\n const value = accessorContainer.info.get(accessorContainer.object) as P;\n const object = accessorContainer.info.getTarget?.(accessorContainer.object);\n const propertyName = accessorContainer.info.getPropertyName?.[0](accessorContainer.object);\n if (!object) {\n throw new Error(\"Object is undefined\");\n } else {\n this.object.setValue(object, context);\n if (propertyName) {\n this.propertyName.setValue(propertyName, context);\n }\n }\n return value;\n }\n\n private _setPropertyValue(_target: O, _propertyName: string, value: P, context: FlowGraphContext): void {\n const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);\n const type = accessorContainer.info.type;\n if (type.startsWith(\"Color\")) {\n value = ToColor(value as Vector4, type) as unknown as P;\n }\n accessorContainer.info.set?.(value, accessorContainer.object);\n }\n\n private _getPropertyValue(_target: O, _propertyName: string, context: FlowGraphContext): P | undefined {\n const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);\n return accessorContainer.info.get(accessorContainer.object);\n }\n\n private _getInterpolationAnimationPropertyInfo(\n _target: O,\n _propertyName: string,\n context: FlowGraphContext\n ): (keys: any[], fps: number, animationType: number, easingFunction?: EasingFunction) => Animation[] {\n const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);\n return (keys: any[], fps: number, animationType: number, easingFunction?: EasingFunction) => {\n const animations: Animation[] = [];\n // make sure keys are of the right type (in case of float3 color/vector)\n const type = accessorContainer.info.type;\n if (type.startsWith(\"Color\")) {\n keys = keys.map((key) => {\n return {\n frame: key.frame,\n value: ToColor(key.value, type),\n };\n });\n }\n accessorContainer.info.interpolation?.forEach((info, index) => {\n const name = accessorContainer.info.getPropertyName?.[index](accessorContainer.object) || \"Animation-interpolation-\" + index;\n // generate the keys based on interpolation info\n let newKeys: any[] = keys;\n if (animationType !== info.type) {\n // convert the keys to the right type\n newKeys = keys.map((key) => {\n return {\n frame: key.frame,\n value: info.getValue(undefined, key.value.asArray ? key.value.asArray() : [key.value], 0, 1),\n };\n });\n }\n const animationData = info.buildAnimations(accessorContainer.object, name, 60, newKeys);\n animationData.forEach((animation) => {\n if (easingFunction) {\n animation.babylonAnimation.setEasingFunction(easingFunction);\n }\n animations.push(animation.babylonAnimation);\n });\n });\n\n return animations;\n };\n }\n\n /**\n * Gets the class name of this block\n * @returns the class name\n */\n public override getClassName(): string {\n return FlowGraphBlockNames.JsonPointerParser;\n }\n}\n\nfunction ToColor(value: any, expectedValue: string) {\n if (value.getClassName().startsWith(\"Color\")) {\n return value as unknown as Color3 | Color4;\n }\n if (expectedValue === \"Color3\") {\n return new Color3(value.x, value.y, value.z);\n } else if (expectedValue === \"Color4\") {\n return new Color4(value.x, value.y, value.z, value.w);\n }\n return value;\n}\n\nRegisterClass(FlowGraphBlockNames.JsonPointerParser, FlowGraphJsonPointerParserBlock);\n"]}
|
|
@@ -11,12 +11,16 @@ export declare abstract class FlowGraphCachedOperationBlock<OutputT> extends Flo
|
|
|
11
11
|
* The output of the operation
|
|
12
12
|
*/
|
|
13
13
|
readonly value: FlowGraphDataConnection<OutputT>;
|
|
14
|
+
/**
|
|
15
|
+
* Output connection: Whether the value is valid.
|
|
16
|
+
*/
|
|
17
|
+
readonly isValid: FlowGraphDataConnection<boolean>;
|
|
14
18
|
constructor(outputRichType: RichType<OutputT>, config?: IFlowGraphBlockConfiguration);
|
|
15
19
|
/**
|
|
16
20
|
* @internal
|
|
17
21
|
* Operation to realize
|
|
18
22
|
* @param context the graph context
|
|
19
23
|
*/
|
|
20
|
-
abstract _doOperation(context: FlowGraphContext): OutputT;
|
|
24
|
+
abstract _doOperation(context: FlowGraphContext): OutputT | undefined;
|
|
21
25
|
_updateOutputs(context: FlowGraphContext): void;
|
|
22
26
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FlowGraphBlock } from "../../flowGraphBlock.js";
|
|
2
|
+
import { RichTypeBoolean } from "../../flowGraphRichTypes.js";
|
|
2
3
|
const cacheName = "cachedOperationValue";
|
|
3
4
|
const cacheExecIdName = "cachedExecutionId";
|
|
4
5
|
/**
|
|
@@ -8,18 +9,30 @@ export class FlowGraphCachedOperationBlock extends FlowGraphBlock {
|
|
|
8
9
|
constructor(outputRichType, config) {
|
|
9
10
|
super(config);
|
|
10
11
|
this.value = this.registerDataOutput("value", outputRichType);
|
|
12
|
+
this.isValid = this.registerDataOutput("isValid", RichTypeBoolean);
|
|
11
13
|
}
|
|
12
14
|
_updateOutputs(context) {
|
|
13
15
|
const cachedExecutionId = context._getExecutionVariable(this, cacheExecIdName, -1);
|
|
14
16
|
const cachedValue = context._getExecutionVariable(this, cacheName, null);
|
|
15
17
|
if (cachedValue !== undefined && cachedValue !== null && cachedExecutionId === context.executionId) {
|
|
18
|
+
this.isValid.setValue(true, context);
|
|
16
19
|
this.value.setValue(cachedValue, context);
|
|
17
20
|
}
|
|
18
21
|
else {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
try {
|
|
23
|
+
const calculatedValue = this._doOperation(context);
|
|
24
|
+
if (calculatedValue === undefined || calculatedValue === null) {
|
|
25
|
+
this.isValid.setValue(false, context);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
context._setExecutionVariable(this, cacheName, calculatedValue);
|
|
29
|
+
context._setExecutionVariable(this, cacheExecIdName, context.executionId);
|
|
30
|
+
this.value.setValue(calculatedValue, context);
|
|
31
|
+
this.isValid.setValue(true, context);
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
this.isValid.setValue(false, context);
|
|
35
|
+
}
|
|
23
36
|
}
|
|
24
37
|
}
|
|
25
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphCachedOperationBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"flowGraphCachedOperationBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.ts"],"names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OAAO;gBACX,CAAC;gBACD,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;gBAChE,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;gBAC1E,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;gBAC9C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACzC,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACT,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAC1C,CAAC;QACL,CAAC;IACL,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"../../../types\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { FlowGraphBlock } from \"../../flowGraphBlock\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport type { RichType } from \"../../flowGraphRichTypes\";\r\nimport { RichTypeBoolean } from \"../../flowGraphRichTypes\";\r\n\r\nconst cacheName = \"cachedOperationValue\";\r\nconst cacheExecIdName = \"cachedExecutionId\";\r\n\r\n/**\r\n * A block that will cache the result of an operation and deliver it as an output.\r\n */\r\nexport abstract class FlowGraphCachedOperationBlock<OutputT> extends FlowGraphBlock {\r\n /**\r\n * The output of the operation\r\n */\r\n public readonly value: FlowGraphDataConnection<OutputT>;\r\n\r\n /**\r\n * Output connection: Whether the value is valid.\r\n */\r\n public readonly isValid: FlowGraphDataConnection<boolean>;\r\n\r\n constructor(outputRichType: RichType<OutputT>, config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.value = this.registerDataOutput(\"value\", outputRichType);\r\n this.isValid = this.registerDataOutput(\"isValid\", RichTypeBoolean);\r\n }\r\n\r\n /**\r\n * @internal\r\n * Operation to realize\r\n * @param context the graph context\r\n */\r\n public abstract _doOperation(context: FlowGraphContext): OutputT | undefined;\r\n\r\n public override _updateOutputs(context: FlowGraphContext) {\r\n const cachedExecutionId = context._getExecutionVariable(this, cacheExecIdName, -1);\r\n const cachedValue = context._getExecutionVariable<Nullable<OutputT>>(this, cacheName, null);\r\n if (cachedValue !== undefined && cachedValue !== null && cachedExecutionId === context.executionId) {\r\n this.isValid.setValue(true, context);\r\n this.value.setValue(cachedValue, context);\r\n } else {\r\n try {\r\n const calculatedValue = this._doOperation(context);\r\n if (calculatedValue === undefined || calculatedValue === null) {\r\n this.isValid.setValue(false, context);\r\n return;\r\n }\r\n context._setExecutionVariable(this, cacheName, calculatedValue);\r\n context._setExecutionVariable(this, cacheExecIdName, context.executionId);\r\n this.value.setValue(calculatedValue, context);\r\n this.isValid.setValue(true, context);\r\n } catch (e) {\r\n this.isValid.setValue(false, context);\r\n }\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { AssetType, FlowGraphAssetType } from "../../flowGraphAssetsContext.js";
|
|
2
2
|
import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock.js";
|
|
3
|
-
import { FlowGraphBlock } from "../../flowGraphBlock.js";
|
|
4
3
|
import type { FlowGraphContext } from "../../flowGraphContext.js";
|
|
5
4
|
import type { FlowGraphDataConnection } from "../../flowGraphDataConnection.js";
|
|
5
|
+
import { FlowGraphCachedOperationBlock } from "./flowGraphCachedOperationBlock";
|
|
6
6
|
export interface IFlowGraphGetPropertyBlockConfiguration<O extends FlowGraphAssetType> extends IFlowGraphBlockConfiguration {
|
|
7
7
|
/**
|
|
8
8
|
* The name of the property that will be set
|
|
@@ -25,15 +25,11 @@ export interface IFlowGraphGetPropertyBlockConfiguration<O extends FlowGraphAsse
|
|
|
25
25
|
*
|
|
26
26
|
* Note that it is recommended to input the object on which you are working on (i.e. a material) rather than providing a mesh as object and then getting the material from it.
|
|
27
27
|
*/
|
|
28
|
-
export declare class FlowGraphGetPropertyBlock<P extends any, O extends FlowGraphAssetType> extends
|
|
28
|
+
export declare class FlowGraphGetPropertyBlock<P extends any, O extends FlowGraphAssetType> extends FlowGraphCachedOperationBlock<P> {
|
|
29
29
|
/**
|
|
30
30
|
* the configuration of the block
|
|
31
31
|
*/
|
|
32
32
|
config: IFlowGraphGetPropertyBlockConfiguration<O>;
|
|
33
|
-
/**
|
|
34
|
-
* Output connection: The value of the property.
|
|
35
|
-
*/
|
|
36
|
-
readonly value: FlowGraphDataConnection<P>;
|
|
37
33
|
/**
|
|
38
34
|
* Input connection: The asset from which the property will be retrieved
|
|
39
35
|
*/
|
|
@@ -42,10 +38,6 @@ export declare class FlowGraphGetPropertyBlock<P extends any, O extends FlowGrap
|
|
|
42
38
|
* Input connection: The name of the property that will be set
|
|
43
39
|
*/
|
|
44
40
|
readonly propertyName: FlowGraphDataConnection<string>;
|
|
45
|
-
/**
|
|
46
|
-
* Output connection: Whether the value is valid.
|
|
47
|
-
*/
|
|
48
|
-
readonly isValid: FlowGraphDataConnection<boolean>;
|
|
49
41
|
/**
|
|
50
42
|
* Input connection: A function that can be used to get the value of the property.
|
|
51
43
|
* This will be used if defined, instead of the default get function.
|
|
@@ -56,7 +48,7 @@ export declare class FlowGraphGetPropertyBlock<P extends any, O extends FlowGrap
|
|
|
56
48
|
* the configuration of the block
|
|
57
49
|
*/
|
|
58
50
|
config: IFlowGraphGetPropertyBlockConfiguration<O>);
|
|
59
|
-
|
|
51
|
+
_doOperation(context: FlowGraphContext): P | undefined;
|
|
60
52
|
private _getPropertyValue;
|
|
61
53
|
getClassName(): string;
|
|
62
54
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FlowGraphBlock } from "../../flowGraphBlock.js";
|
|
2
1
|
import { RichTypeAny } from "../../flowGraphRichTypes.js";
|
|
3
2
|
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
3
|
+
import { FlowGraphCachedOperationBlock } from "./flowGraphCachedOperationBlock.js";
|
|
4
4
|
/**
|
|
5
5
|
* This block will deliver a property of an asset, based on the property name and an input asset.
|
|
6
6
|
* The property name can include dots ("."), which will be interpreted as a path to the property.
|
|
@@ -9,21 +9,19 @@ import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
|
9
9
|
*
|
|
10
10
|
* Note that it is recommended to input the object on which you are working on (i.e. a material) rather than providing a mesh as object and then getting the material from it.
|
|
11
11
|
*/
|
|
12
|
-
export class FlowGraphGetPropertyBlock extends
|
|
12
|
+
export class FlowGraphGetPropertyBlock extends FlowGraphCachedOperationBlock {
|
|
13
13
|
constructor(
|
|
14
14
|
/**
|
|
15
15
|
* the configuration of the block
|
|
16
16
|
*/
|
|
17
17
|
config) {
|
|
18
|
-
super(config);
|
|
18
|
+
super(RichTypeAny, config);
|
|
19
19
|
this.config = config;
|
|
20
20
|
this.object = this.registerDataInput("object", RichTypeAny, config.object);
|
|
21
21
|
this.propertyName = this.registerDataInput("propertyName", RichTypeAny, config.propertyName);
|
|
22
|
-
this.value = this.registerDataOutput("value", RichTypeAny);
|
|
23
|
-
this.isValid = this.registerDataOutput("isValid", RichTypeAny, false);
|
|
24
22
|
this.customGetFunction = this.registerDataInput("customGetFunction", RichTypeAny);
|
|
25
23
|
}
|
|
26
|
-
|
|
24
|
+
_doOperation(context) {
|
|
27
25
|
const getter = this.customGetFunction.getValue(context);
|
|
28
26
|
let value;
|
|
29
27
|
if (getter) {
|
|
@@ -34,14 +32,7 @@ export class FlowGraphGetPropertyBlock extends FlowGraphBlock {
|
|
|
34
32
|
const propertyName = this.propertyName.getValue(context);
|
|
35
33
|
value = target && propertyName ? this._getPropertyValue(target, propertyName) : undefined;
|
|
36
34
|
}
|
|
37
|
-
|
|
38
|
-
this.value.resetToDefaultValue(context);
|
|
39
|
-
this.isValid.setValue(false, context);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
this.value.setValue(value, context);
|
|
43
|
-
this.isValid.setValue(true, context);
|
|
44
|
-
}
|
|
35
|
+
return value;
|
|
45
36
|
}
|
|
46
37
|
_getPropertyValue(target, propertyName) {
|
|
47
38
|
const path = propertyName.split(".");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphGetPropertyBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flowGraphGetPropertyBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,oCAA0C;AAChE,OAAO,EAAE,aAAa,EAAE,mCAA4B;AAEpD,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAmBhF;;;;;;;GAOG;AACH,MAAM,OAAO,yBAAuE,SAAQ,6BAAgC;IAiBxH;IACI;;OAEG;IACa,MAAkD;QAElE,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAFX,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,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;IAEe,YAAY,CAAC,OAAyB;QAClD,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACxD,IAAI,KAAK,CAAC;QACV,IAAI,MAAM,EAAE,CAAC;YACT,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;QAChG,CAAC;aAAM,CAAC;YACJ,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC7C,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACzD,KAAK,GAAG,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9F,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAEO,iBAAiB,CAAC,MAAoB,EAAE,YAAoB;QAChE,MAAM,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,KAAK,GAAQ,MAAM,CAAC;QACxB,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;YACtB,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;YACpB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACtB,OAAO;YACX,CAAC;QACL,CAAC;QACD,OAAO,KAAU,CAAC;IACtB,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 { IFlowGraphBlockConfiguration } from \"core/FlowGraph/flowGraphBlock\";\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\nimport { RichTypeAny } from \"core/FlowGraph/flowGraphRichTypes\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\nimport { FlowGraphCachedOperationBlock } from \"./flowGraphCachedOperationBlock\";\n\nexport interface IFlowGraphGetPropertyBlockConfiguration<O extends FlowGraphAssetType> extends IFlowGraphBlockConfiguration {\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 object?: AssetType<O>;\n\n /**\n * If true, the block will reset the output to the default value when the target asset is undefined.\n */\n resetToDefaultWhenUndefined?: boolean;\n}\n\n/**\n * This block will deliver a property of an asset, based on the property name and an input asset.\n * The property name can include dots (\".\"), which will be interpreted as a path to the property.\n *\n * For example, with an input of a mesh asset, the property name \"position.x\" will deliver 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) rather than providing a mesh as object and then getting the material from it.\n */\nexport class FlowGraphGetPropertyBlock<P extends any, O extends FlowGraphAssetType> extends FlowGraphCachedOperationBlock<P> {\n /**\n * Input connection: The 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 get the value of the property.\n * This will be used if defined, instead of the default get function.\n */\n public readonly customGetFunction: FlowGraphDataConnection<(target: AssetType<O>, propertyName: string, context: FlowGraphContext) => P | undefined>;\n\n constructor(\n /**\n * the configuration of the block\n */\n public override config: IFlowGraphGetPropertyBlockConfiguration<O>\n ) {\n super(RichTypeAny, config);\n this.object = this.registerDataInput(\"object\", RichTypeAny, config.object);\n this.propertyName = this.registerDataInput(\"propertyName\", RichTypeAny, config.propertyName);\n this.customGetFunction = this.registerDataInput(\"customGetFunction\", RichTypeAny);\n }\n\n public override _doOperation(context: FlowGraphContext): P | undefined {\n const getter = this.customGetFunction.getValue(context);\n let value;\n if (getter) {\n value = getter(this.object.getValue(context), this.propertyName.getValue(context), context);\n } else {\n const target = this.object.getValue(context);\n const propertyName = this.propertyName.getValue(context);\n value = target && propertyName ? this._getPropertyValue(target, propertyName) : undefined;\n }\n return value;\n }\n\n private _getPropertyValue(target: AssetType<O>, propertyName: string): P | undefined {\n const path = propertyName.split(\".\");\n let value: any = target;\n for (const prop of path) {\n value = value[prop];\n if (value === undefined) {\n return;\n }\n }\n return value as P;\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.GetProperty;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.GetProperty, FlowGraphGetPropertyBlock);\n"]}
|
|
@@ -985,6 +985,9 @@ export class NodeMaterial extends PushMaterial {
|
|
|
985
985
|
postProcess.updateEffect(defines.toString(), this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, { maxSimultaneousLights: this.maxSimultaneousLights }, undefined, undefined, tempName, tempName);
|
|
986
986
|
}
|
|
987
987
|
postProcess.nodeMaterialSource = this;
|
|
988
|
+
postProcess.onDisposeObservable.add(() => {
|
|
989
|
+
dummyMesh.dispose();
|
|
990
|
+
});
|
|
988
991
|
postProcess.onApplyObservable.add((effect) => {
|
|
989
992
|
if (buildId !== this._buildId) {
|
|
990
993
|
delete Effect.ShadersStore[tempName + "VertexShader"];
|