@babylonjs/smart-filters 1.0.12 → 8.18.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/dist/blockFoundation/aggregateBlock.d.ts +3 -3
- package/dist/blockFoundation/aggregateBlock.d.ts.map +1 -1
- package/dist/blockFoundation/aggregateBlock.js +1 -2
- package/dist/blockFoundation/aggregateBlock.js.map +1 -1
- package/dist/blockFoundation/baseBlock.d.ts +2 -2
- package/dist/blockFoundation/baseBlock.d.ts.map +1 -1
- package/dist/blockFoundation/baseBlock.js +5 -6
- package/dist/blockFoundation/baseBlock.js.map +1 -1
- package/dist/blockFoundation/customAggregateBlock.d.ts.map +1 -1
- package/dist/blockFoundation/customAggregateBlock.js +2 -2
- package/dist/blockFoundation/customAggregateBlock.js.map +1 -1
- package/dist/blockFoundation/customShaderBlock.d.ts.map +1 -1
- package/dist/blockFoundation/customShaderBlock.js +4 -6
- package/dist/blockFoundation/customShaderBlock.js.map +1 -1
- package/dist/blockFoundation/disableableShaderBlock.d.ts.map +1 -1
- package/dist/blockFoundation/disableableShaderBlock.js +4 -4
- package/dist/blockFoundation/disableableShaderBlock.js.map +1 -1
- package/dist/blockFoundation/index.js +0 -2
- package/dist/blockFoundation/index.js.map +1 -1
- package/dist/blockFoundation/inputBlock.d.ts +8 -8
- package/dist/blockFoundation/inputBlock.d.ts.map +1 -1
- package/dist/blockFoundation/inputBlock.deserializer.d.ts +1 -1
- package/dist/blockFoundation/inputBlock.deserializer.d.ts.map +1 -1
- package/dist/blockFoundation/inputBlock.deserializer.js +1 -1
- package/dist/blockFoundation/inputBlock.deserializer.js.map +1 -1
- package/dist/blockFoundation/inputBlock.js +7 -7
- package/dist/blockFoundation/inputBlock.js.map +1 -1
- package/dist/blockFoundation/inputBlock.serialization.types.d.ts.map +1 -1
- package/dist/blockFoundation/inputBlock.serializer.d.ts +1 -1
- package/dist/blockFoundation/inputBlock.serializer.js +26 -28
- package/dist/blockFoundation/inputBlock.serializer.js.map +1 -1
- package/dist/blockFoundation/outputBlock.d.ts +4 -9
- package/dist/blockFoundation/outputBlock.d.ts.map +1 -1
- package/dist/blockFoundation/outputBlock.js +13 -14
- package/dist/blockFoundation/outputBlock.js.map +1 -1
- package/dist/blockFoundation/shaderBlock.d.ts +4 -4
- package/dist/blockFoundation/shaderBlock.d.ts.map +1 -1
- package/dist/blockFoundation/shaderBlock.js +13 -19
- package/dist/blockFoundation/shaderBlock.js.map +1 -1
- package/dist/blockFoundation/textureOptions.d.ts +1 -1
- package/dist/blockFoundation/textureOptions.js +1 -1
- package/dist/command/command.d.ts +1 -1
- package/dist/command/command.js +1 -1
- package/dist/command/commandBuffer.d.ts +1 -1
- package/dist/command/commandBuffer.d.ts.map +1 -1
- package/dist/command/commandBuffer.js +2 -2
- package/dist/command/commandBufferDebugger.d.ts +2 -2
- package/dist/command/commandBufferDebugger.d.ts.map +1 -1
- package/dist/command/commandBufferDebugger.js +1 -1
- package/dist/command/commandBufferDebugger.js.map +1 -1
- package/dist/command/index.d.ts +3 -1
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +5 -1
- package/dist/command/index.js.map +1 -1
- package/dist/connection/connectionPoint.d.ts +3 -3
- package/dist/connection/connectionPoint.d.ts.map +1 -1
- package/dist/connection/connectionPoint.js +2 -2
- package/dist/connection/connectionPoint.js.map +1 -1
- package/dist/connection/connectionPointCompatibilityState.d.ts +1 -1
- package/dist/connection/connectionPointCompatibilityState.js +1 -1
- package/dist/connection/connectionPointType.d.ts +3 -3
- package/dist/connection/connectionPointType.d.ts.map +1 -1
- package/dist/connection/connectionPointWithDefault.d.ts +3 -3
- package/dist/connection/connectionPointWithDefault.d.ts.map +1 -1
- package/dist/connection/connectionPointWithDefault.js.map +1 -1
- package/dist/connection/index.d.ts +2 -1
- package/dist/connection/index.d.ts.map +1 -1
- package/dist/connection/index.js +3 -3
- package/dist/connection/index.js.map +1 -1
- package/dist/editorUtils/editableInPropertyPage.d.ts +2 -2
- package/dist/editorUtils/editableInPropertyPage.d.ts.map +1 -1
- package/dist/editorUtils/editableInPropertyPage.js +2 -2
- package/dist/editorUtils/editableInPropertyPage.js.map +1 -1
- package/dist/editorUtils/index.d.ts +1 -0
- package/dist/editorUtils/index.d.ts.map +1 -1
- package/dist/editorUtils/index.js +2 -0
- package/dist/editorUtils/index.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/optimization/dependencyGraph.js.map +1 -1
- package/dist/optimization/optimizedShaderBlock.d.ts +4 -4
- package/dist/optimization/optimizedShaderBlock.d.ts.map +1 -1
- package/dist/optimization/optimizedShaderBlock.js.map +1 -1
- package/dist/optimization/smartFilterOptimizer.d.ts +2 -2
- package/dist/optimization/smartFilterOptimizer.d.ts.map +1 -1
- package/dist/optimization/smartFilterOptimizer.js +34 -57
- package/dist/optimization/smartFilterOptimizer.js.map +1 -1
- package/dist/runtime/index.d.ts +2 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +3 -3
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/renderTargetGenerator.d.ts +1 -1
- package/dist/runtime/renderTargetGenerator.d.ts.map +1 -1
- package/dist/runtime/renderTargetGenerator.js +5 -7
- package/dist/runtime/renderTargetGenerator.js.map +1 -1
- package/dist/runtime/shaderRuntime.d.ts +7 -7
- package/dist/runtime/shaderRuntime.d.ts.map +1 -1
- package/dist/runtime/shaderRuntime.js +7 -8
- package/dist/runtime/shaderRuntime.js.map +1 -1
- package/dist/runtime/smartFilterRuntime.d.ts +3 -3
- package/dist/runtime/smartFilterRuntime.d.ts.map +1 -1
- package/dist/runtime/smartFilterRuntime.js.map +1 -1
- package/dist/runtime/strongRef.d.ts +1 -1
- package/dist/runtime/strongRef.js +1 -1
- package/dist/serialization/importCustomBlockDefinition.d.ts +1 -1
- package/dist/serialization/importCustomBlockDefinition.js +8 -9
- package/dist/serialization/importCustomBlockDefinition.js.map +1 -1
- package/dist/serialization/index.d.ts +1 -0
- package/dist/serialization/index.d.ts.map +1 -1
- package/dist/serialization/index.js +3 -0
- package/dist/serialization/index.js.map +1 -1
- package/dist/serialization/serializedBlockDefinition.d.ts +2 -2
- package/dist/serialization/serializedBlockDefinition.d.ts.map +1 -1
- package/dist/serialization/serializedShaderBlockDefinition.d.ts +1 -1
- package/dist/serialization/serializedShaderBlockDefinition.d.ts.map +1 -1
- package/dist/serialization/serializedSmartFilter.d.ts +1 -1
- package/dist/serialization/serializedSmartFilter.d.ts.map +1 -1
- package/dist/serialization/smartFilterDeserializer.d.ts +6 -6
- package/dist/serialization/smartFilterDeserializer.d.ts.map +1 -1
- package/dist/serialization/smartFilterDeserializer.js +14 -12
- package/dist/serialization/smartFilterDeserializer.js.map +1 -1
- package/dist/serialization/smartFilterSerializer.d.ts +2 -2
- package/dist/serialization/smartFilterSerializer.d.ts.map +1 -1
- package/dist/serialization/smartFilterSerializer.js +10 -13
- package/dist/serialization/smartFilterSerializer.js.map +1 -1
- package/dist/serialization/v1/defaultBlockSerializer.d.ts +2 -2
- package/dist/serialization/v1/defaultBlockSerializer.d.ts.map +1 -1
- package/dist/serialization/v1/defaultBlockSerializer.js +3 -1
- package/dist/serialization/v1/defaultBlockSerializer.js.map +1 -1
- package/dist/serialization/v1/index.d.ts +1 -0
- package/dist/serialization/v1/index.d.ts.map +1 -1
- package/dist/serialization/v1/index.js +2 -0
- package/dist/serialization/v1/index.js.map +1 -1
- package/dist/serialization/v1/shaderBlockSerialization.types.d.ts +3 -3
- package/dist/serialization/v1/shaderBlockSerialization.types.d.ts.map +1 -1
- package/dist/serialization/v1/smartFilterSerialization.types.d.ts +5 -2
- package/dist/serialization/v1/smartFilterSerialization.types.d.ts.map +1 -1
- package/dist/smartFilter.d.ts +8 -8
- package/dist/smartFilter.d.ts.map +1 -1
- package/dist/smartFilter.js +6 -7
- package/dist/smartFilter.js.map +1 -1
- package/dist/utils/buildTools/buildShaders.d.ts +3 -2
- package/dist/utils/buildTools/buildShaders.d.ts.map +1 -1
- package/dist/utils/buildTools/buildShaders.js +7 -6
- package/dist/utils/buildTools/buildShaders.js.map +1 -1
- package/dist/utils/buildTools/convertGlslIntoBlock.d.ts +4 -2
- package/dist/utils/buildTools/convertGlslIntoBlock.d.ts.map +1 -1
- package/dist/utils/buildTools/convertGlslIntoBlock.js +136 -141
- package/dist/utils/buildTools/convertGlslIntoBlock.js.map +1 -1
- package/dist/utils/buildTools/convertGlslIntoShaderProgram.d.ts +4 -4
- package/dist/utils/buildTools/convertGlslIntoShaderProgram.d.ts.map +1 -1
- package/dist/utils/buildTools/convertGlslIntoShaderProgram.js +55 -48
- package/dist/utils/buildTools/convertGlslIntoShaderProgram.js.map +1 -1
- package/dist/utils/buildTools/convertShaders.d.ts +8 -5
- package/dist/utils/buildTools/convertShaders.d.ts.map +1 -1
- package/dist/utils/buildTools/convertShaders.js +38 -14
- package/dist/utils/buildTools/convertShaders.js.map +1 -1
- package/dist/utils/buildTools/shaderConverter.d.ts +4 -4
- package/dist/utils/buildTools/shaderConverter.d.ts.map +1 -1
- package/dist/utils/buildTools/shaderConverter.js +17 -21
- package/dist/utils/buildTools/shaderConverter.js.map +1 -1
- package/dist/utils/buildTools/watchShaders.d.ts +3 -2
- package/dist/utils/buildTools/watchShaders.d.ts.map +1 -1
- package/dist/utils/buildTools/watchShaders.js +10 -8
- package/dist/utils/buildTools/watchShaders.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/renderTargetUtils.d.ts +3 -3
- package/dist/utils/renderTargetUtils.d.ts.map +1 -1
- package/dist/utils/renderTargetUtils.js +4 -4
- package/dist/utils/renderTargetUtils.js.map +1 -1
- package/dist/utils/shaderCodeUtils.d.ts +8 -8
- package/dist/utils/shaderCodeUtils.d.ts.map +1 -1
- package/dist/utils/shaderCodeUtils.js +16 -28
- package/dist/utils/shaderCodeUtils.js.map +1 -1
- package/dist/utils/textureLoaders.d.ts +2 -2
- package/dist/utils/textureLoaders.d.ts.map +1 -1
- package/dist/utils/textureLoaders.js +2 -3
- package/dist/utils/textureLoaders.js.map +1 -1
- package/dist/utils/textureUtils.d.ts +5 -5
- package/dist/utils/textureUtils.d.ts.map +1 -1
- package/dist/utils/textureUtils.js +1 -1
- package/dist/utils/textureUtils.js.map +1 -1
- package/dist/version.d.ts +2 -2
- package/dist/version.js +2 -2
- package/license.md +21 -21
- package/package.json +14 -9
- package/src/blockFoundation/aggregateBlock.ts +148 -151
- package/src/blockFoundation/baseBlock.ts +339 -364
- package/src/blockFoundation/customAggregateBlock.ts +88 -104
- package/src/blockFoundation/customShaderBlock.ts +312 -326
- package/src/blockFoundation/disableableShaderBlock.ts +91 -100
- package/src/blockFoundation/index.ts +9 -9
- package/src/blockFoundation/inputBlock.deserializer.ts +72 -97
- package/src/blockFoundation/inputBlock.serialization.types.ts +126 -132
- package/src/blockFoundation/inputBlock.serializer.ts +150 -150
- package/src/blockFoundation/inputBlock.ts +181 -192
- package/src/blockFoundation/outputBlock.ts +144 -151
- package/src/blockFoundation/shaderBlock.ts +156 -163
- package/src/blockFoundation/textureOptions.ts +57 -57
- package/src/command/command.ts +59 -59
- package/src/command/commandBuffer.ts +71 -71
- package/src/command/commandBufferDebugger.ts +14 -14
- package/src/command/index.ts +7 -3
- package/src/connection/connectionPoint.ts +205 -214
- package/src/connection/connectionPointCompatibilityState.ts +31 -31
- package/src/connection/connectionPointType.ts +45 -45
- package/src/connection/connectionPointWithDefault.ts +27 -35
- package/src/connection/index.ts +8 -9
- package/src/editorUtils/editableInPropertyPage.ts +106 -106
- package/src/editorUtils/index.ts +3 -1
- package/src/index.ts +16 -15
- package/src/optimization/dependencyGraph.ts +96 -96
- package/src/optimization/index.ts +1 -1
- package/src/optimization/optimizedShaderBlock.ts +131 -134
- package/src/optimization/smartFilterOptimizer.ts +757 -825
- package/src/runtime/index.ts +8 -6
- package/src/runtime/renderTargetGenerator.ts +222 -248
- package/src/runtime/shaderRuntime.ts +174 -173
- package/src/runtime/smartFilterRuntime.ts +112 -112
- package/src/runtime/strongRef.ts +18 -18
- package/src/serialization/importCustomBlockDefinition.ts +86 -86
- package/src/serialization/index.ts +10 -7
- package/src/serialization/serializedBlockDefinition.ts +12 -12
- package/src/serialization/serializedShaderBlockDefinition.ts +7 -7
- package/src/serialization/serializedSmartFilter.ts +6 -6
- package/src/serialization/smartFilterDeserializer.ts +190 -214
- package/src/serialization/smartFilterSerializer.ts +110 -121
- package/src/serialization/v1/defaultBlockSerializer.ts +21 -19
- package/src/serialization/v1/index.ts +4 -2
- package/src/serialization/v1/shaderBlockSerialization.types.ts +85 -85
- package/src/serialization/v1/smartFilterSerialization.types.ts +129 -129
- package/src/smartFilter.ts +255 -260
- package/src/utils/buildTools/buildShaders.ts +14 -13
- package/src/utils/buildTools/convertGlslIntoBlock.ts +370 -385
- package/src/utils/buildTools/convertGlslIntoShaderProgram.ts +173 -172
- package/src/utils/buildTools/convertShaders.ts +65 -43
- package/src/utils/buildTools/recordVersionNumber.js +17 -0
- package/src/utils/buildTools/shaderConverter.ts +466 -478
- package/src/utils/buildTools/watchShaders.ts +44 -42
- package/src/utils/index.ts +4 -2
- package/src/utils/renderTargetUtils.ts +30 -35
- package/src/utils/shaderCodeUtils.ts +192 -207
- package/src/utils/textureLoaders.ts +31 -43
- package/src/utils/textureUtils.ts +28 -32
- package/src/version.ts +2 -2
- package/dist/utils/buildTools/determineVersion.d.ts +0 -36
- package/dist/utils/buildTools/determineVersion.d.ts.map +0 -1
- package/dist/utils/buildTools/determineVersion.js +0 -109
- package/dist/utils/buildTools/determineVersion.js.map +0 -1
- package/dist/utils/buildTools/versionUp.d.ts +0 -2
- package/dist/utils/buildTools/versionUp.d.ts.map +0 -1
- package/dist/utils/buildTools/versionUp.js +0 -53
- package/dist/utils/buildTools/versionUp.js.map +0 -1
- package/src/utils/buildTools/determineVersion.ts +0 -128
- package/src/utils/buildTools/versionUp.ts +0 -61
|
@@ -1,364 +1,339 @@
|
|
|
1
|
-
import type { Nullable } from "
|
|
2
|
-
import { ConnectionPointType, type ConnectionPointValue } from "../connection/connectionPointType.js";
|
|
3
|
-
import type { InitializationData, SmartFilter } from "../smartFilter.js";
|
|
4
|
-
import type { ICommandOwner } from "../command/command.js";
|
|
5
|
-
import { ConnectionPoint, type RuntimeData } from "../connection/connectionPoint.js";
|
|
6
|
-
import { ConnectionPointWithDefault } from "../connection/connectionPointWithDefault.js";
|
|
7
|
-
import { ConnectionPointDirection } from "../connection/connectionPointDirection.js";
|
|
8
|
-
import { UniqueIdGenerator } from "../utils/uniqueIdGenerator.js";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Defines a callback function that is triggered when visiting a block,
|
|
12
|
-
* It also carries over extra data preventing the need to use global variables or closures.
|
|
13
|
-
*/
|
|
14
|
-
export type BlockVisitor<T extends object> = (block: BaseBlock, extraData: T) => void;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* This class represents the base class for all smart filter blocks.
|
|
18
|
-
*
|
|
19
|
-
* It defines the basic structure of a smart filter block and provides the base implementation for
|
|
20
|
-
* managing the connection points.
|
|
21
|
-
*
|
|
22
|
-
* It enforces common behavior for all smart filter blocks.
|
|
23
|
-
*/
|
|
24
|
-
export abstract class BaseBlock implements ICommandOwner {
|
|
25
|
-
protected static
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* The class name of the block.
|
|
29
|
-
*/
|
|
30
|
-
public static ClassName = "BaseBlock";
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* The namespace of the block, which is used to reduce name collisions between blocks and also to group blocks in the editor UI.
|
|
34
|
-
* By convention, sub namespaces are separated by a period (e.g. "Babylon.Demo.Effects").
|
|
35
|
-
*/
|
|
36
|
-
public static Namespace: Nullable<string> = null;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* The smart filter the block belongs to.
|
|
40
|
-
*/
|
|
41
|
-
public readonly smartFilter: SmartFilter;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Global unique id of the block (This is unique for the current session).
|
|
45
|
-
*/
|
|
46
|
-
public uniqueId: number;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* The name of the block. This is used to identify the block in the smart filter or in debug.
|
|
50
|
-
*/
|
|
51
|
-
public readonly name: string;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* The type of the block - used when serializing / deserializing the block, and in the editor.
|
|
55
|
-
* For programmatically created blocks, this should be the class name of the block.
|
|
56
|
-
* For custom blocks, this is specified in the block definition.
|
|
57
|
-
*/
|
|
58
|
-
public get blockType(): string {
|
|
59
|
-
return this.getClassName();
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* The namespace of the block, which is used to reduce name collisions between blocks and also to group blocks in the editor UI.
|
|
64
|
-
* By convention, sub namespaces are separated by a period (e.g. "Babylon.Demo.Effects").
|
|
65
|
-
*/
|
|
66
|
-
public get namespace(): Nullable<string> {
|
|
67
|
-
// Note that we use a static property instead of doing this.constructor.name to avoid problems with minifiers that would change the name of the class
|
|
68
|
-
return (this.constructor as typeof BaseBlock).Namespace;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* User provided comments about the block. It can be used to document the block.
|
|
73
|
-
*/
|
|
74
|
-
public comments: Nullable<string> = null;
|
|
75
|
-
|
|
76
|
-
private readonly _inputs: ConnectionPoint[] = [];
|
|
77
|
-
private readonly _outputs: ConnectionPoint[] = [];
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Instantiates a new block.
|
|
81
|
-
* @param smartFilter - Defines the smart filter the block belongs to
|
|
82
|
-
* @param name - Defines the name of the block
|
|
83
|
-
* @param disableOptimization - Defines if the block is optimizable or not
|
|
84
|
-
*/
|
|
85
|
-
constructor(
|
|
86
|
-
smartFilter: SmartFilter,
|
|
87
|
-
name: string,
|
|
88
|
-
public readonly disableOptimization = false
|
|
89
|
-
) {
|
|
90
|
-
this.uniqueId = UniqueIdGenerator.UniqueId;
|
|
91
|
-
this.name = name;
|
|
92
|
-
this.smartFilter = smartFilter;
|
|
93
|
-
|
|
94
|
-
// Register the block in the smart filter
|
|
95
|
-
smartFilter.registerBlock(this);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Returns the inputs connection points of the current block.
|
|
100
|
-
*/
|
|
101
|
-
public get inputs(): ReadonlyArray<ConnectionPoint> {
|
|
102
|
-
return this._inputs;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Returns the outputs connection points of the current block.
|
|
107
|
-
*/
|
|
108
|
-
public get outputs(): ReadonlyArray<ConnectionPoint> {
|
|
109
|
-
return this._outputs;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Returns if the block is an input block.
|
|
114
|
-
*/
|
|
115
|
-
public get isInput(): boolean {
|
|
116
|
-
return this._inputs.length === 0;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Returns if the block is an output block.
|
|
121
|
-
*/
|
|
122
|
-
public get isOutput(): boolean {
|
|
123
|
-
return this._outputs.length === 0;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* @returns the class name of the block
|
|
128
|
-
*/
|
|
129
|
-
public getClassName(): string {
|
|
130
|
-
// Note that we use a static property instead of doing this.constructor.name to avoid problems with minifiers that would change the name of the class
|
|
131
|
-
return (this.constructor as typeof BaseBlock).ClassName;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Checks if the block is an "ancestor" of another giving block.
|
|
136
|
-
* @param block - Defines the block to check against
|
|
137
|
-
* @returns True if the block is an ancestor of the given block, otherwise false
|
|
138
|
-
*/
|
|
139
|
-
public isAnAncestorOf(block: BaseBlock): boolean {
|
|
140
|
-
for (const output of this._outputs) {
|
|
141
|
-
if (!output.endpoints.length) {
|
|
142
|
-
continue;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
for (const endpoint of output.endpoints) {
|
|
146
|
-
if (endpoint.ownerBlock === block) {
|
|
147
|
-
return true;
|
|
148
|
-
}
|
|
149
|
-
if (endpoint.ownerBlock.isAnAncestorOf(block)) {
|
|
150
|
-
return true;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
return false;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
protected _visitInputs<T extends object>(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
*
|
|
303
|
-
* @
|
|
304
|
-
* @
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
*
|
|
318
|
-
* @param
|
|
319
|
-
* @
|
|
320
|
-
* @
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
*
|
|
331
|
-
* @
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
initialValue: RuntimeData<U>
|
|
341
|
-
): ConnectionPointWithDefault<U> {
|
|
342
|
-
const output = new ConnectionPointWithDefault(name, this, type, ConnectionPointDirection.Output, initialValue);
|
|
343
|
-
this._outputs.push(output);
|
|
344
|
-
return output;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* Gets the required RuntimeData for the given input, throwing with a clear message if it is null
|
|
349
|
-
* @param input - The input to get the runtime data for
|
|
350
|
-
* @returns The runtimeData or throws if it was undefined
|
|
351
|
-
*/
|
|
352
|
-
protected _confirmRuntimeDataSupplied<U extends ConnectionPointType = ConnectionPointType>(
|
|
353
|
-
input: ConnectionPoint<U>
|
|
354
|
-
): RuntimeData<U> {
|
|
355
|
-
if (!input.runtimeData) {
|
|
356
|
-
throw new Error(
|
|
357
|
-
`The ${ConnectionPointType[input.type]} input named "${
|
|
358
|
-
input.name
|
|
359
|
-
}" is missing for the ${this.getClassName()} named "${this.name}"`
|
|
360
|
-
);
|
|
361
|
-
}
|
|
362
|
-
return input.runtimeData;
|
|
363
|
-
}
|
|
364
|
-
}
|
|
1
|
+
import type { Nullable } from "core/types.js";
|
|
2
|
+
import { ConnectionPointType, type ConnectionPointValue } from "../connection/connectionPointType.js";
|
|
3
|
+
import type { InitializationData, SmartFilter } from "../smartFilter.js";
|
|
4
|
+
import type { ICommandOwner } from "../command/command.js";
|
|
5
|
+
import { ConnectionPoint, type RuntimeData } from "../connection/connectionPoint.js";
|
|
6
|
+
import { ConnectionPointWithDefault } from "../connection/connectionPointWithDefault.js";
|
|
7
|
+
import { ConnectionPointDirection } from "../connection/connectionPointDirection.js";
|
|
8
|
+
import { UniqueIdGenerator } from "../utils/uniqueIdGenerator.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Defines a callback function that is triggered when visiting a block,
|
|
12
|
+
* It also carries over extra data preventing the need to use global variables or closures.
|
|
13
|
+
*/
|
|
14
|
+
export type BlockVisitor<T extends object> = (block: BaseBlock, extraData: T) => void;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* This class represents the base class for all smart filter blocks.
|
|
18
|
+
*
|
|
19
|
+
* It defines the basic structure of a smart filter block and provides the base implementation for
|
|
20
|
+
* managing the connection points.
|
|
21
|
+
*
|
|
22
|
+
* It enforces common behavior for all smart filter blocks.
|
|
23
|
+
*/
|
|
24
|
+
export abstract class BaseBlock implements ICommandOwner {
|
|
25
|
+
protected static _AlreadyVisitedBlocks = new Set<BaseBlock>();
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The class name of the block.
|
|
29
|
+
*/
|
|
30
|
+
public static ClassName = "BaseBlock";
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The namespace of the block, which is used to reduce name collisions between blocks and also to group blocks in the editor UI.
|
|
34
|
+
* By convention, sub namespaces are separated by a period (e.g. "Babylon.Demo.Effects").
|
|
35
|
+
*/
|
|
36
|
+
public static Namespace: Nullable<string> = null;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The smart filter the block belongs to.
|
|
40
|
+
*/
|
|
41
|
+
public readonly smartFilter: SmartFilter;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Global unique id of the block (This is unique for the current session).
|
|
45
|
+
*/
|
|
46
|
+
public uniqueId: number;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The name of the block. This is used to identify the block in the smart filter or in debug.
|
|
50
|
+
*/
|
|
51
|
+
public readonly name: string;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The type of the block - used when serializing / deserializing the block, and in the editor.
|
|
55
|
+
* For programmatically created blocks, this should be the class name of the block.
|
|
56
|
+
* For custom blocks, this is specified in the block definition.
|
|
57
|
+
*/
|
|
58
|
+
public get blockType(): string {
|
|
59
|
+
return this.getClassName();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The namespace of the block, which is used to reduce name collisions between blocks and also to group blocks in the editor UI.
|
|
64
|
+
* By convention, sub namespaces are separated by a period (e.g. "Babylon.Demo.Effects").
|
|
65
|
+
*/
|
|
66
|
+
public get namespace(): Nullable<string> {
|
|
67
|
+
// Note that we use a static property instead of doing this.constructor.name to avoid problems with minifiers that would change the name of the class
|
|
68
|
+
return (this.constructor as typeof BaseBlock).Namespace;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* User provided comments about the block. It can be used to document the block.
|
|
73
|
+
*/
|
|
74
|
+
public comments: Nullable<string> = null;
|
|
75
|
+
|
|
76
|
+
private readonly _inputs: ConnectionPoint[] = [];
|
|
77
|
+
private readonly _outputs: ConnectionPoint[] = [];
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Instantiates a new block.
|
|
81
|
+
* @param smartFilter - Defines the smart filter the block belongs to
|
|
82
|
+
* @param name - Defines the name of the block
|
|
83
|
+
* @param disableOptimization - Defines if the block is optimizable or not
|
|
84
|
+
*/
|
|
85
|
+
constructor(
|
|
86
|
+
smartFilter: SmartFilter,
|
|
87
|
+
name: string,
|
|
88
|
+
public readonly disableOptimization = false
|
|
89
|
+
) {
|
|
90
|
+
this.uniqueId = UniqueIdGenerator.UniqueId;
|
|
91
|
+
this.name = name;
|
|
92
|
+
this.smartFilter = smartFilter;
|
|
93
|
+
|
|
94
|
+
// Register the block in the smart filter
|
|
95
|
+
smartFilter.registerBlock(this);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Returns the inputs connection points of the current block.
|
|
100
|
+
*/
|
|
101
|
+
public get inputs(): ReadonlyArray<ConnectionPoint> {
|
|
102
|
+
return this._inputs;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Returns the outputs connection points of the current block.
|
|
107
|
+
*/
|
|
108
|
+
public get outputs(): ReadonlyArray<ConnectionPoint> {
|
|
109
|
+
return this._outputs;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Returns if the block is an input block.
|
|
114
|
+
*/
|
|
115
|
+
public get isInput(): boolean {
|
|
116
|
+
return this._inputs.length === 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Returns if the block is an output block.
|
|
121
|
+
*/
|
|
122
|
+
public get isOutput(): boolean {
|
|
123
|
+
return this._outputs.length === 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @returns the class name of the block
|
|
128
|
+
*/
|
|
129
|
+
public getClassName(): string {
|
|
130
|
+
// Note that we use a static property instead of doing this.constructor.name to avoid problems with minifiers that would change the name of the class
|
|
131
|
+
return (this.constructor as typeof BaseBlock).ClassName;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Checks if the block is an "ancestor" of another giving block.
|
|
136
|
+
* @param block - Defines the block to check against
|
|
137
|
+
* @returns True if the block is an ancestor of the given block, otherwise false
|
|
138
|
+
*/
|
|
139
|
+
public isAnAncestorOf(block: BaseBlock): boolean {
|
|
140
|
+
for (const output of this._outputs) {
|
|
141
|
+
if (!output.endpoints.length) {
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
for (const endpoint of output.endpoints) {
|
|
146
|
+
if (endpoint.ownerBlock === block) {
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
if (endpoint.ownerBlock.isAnAncestorOf(block)) {
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
protected _visitInputs<T extends object>(extraData: T, callback: BlockVisitor<T>, alreadyVisited: Set<BaseBlock>): void {
|
|
159
|
+
for (const input of this.inputs) {
|
|
160
|
+
if (!input.connectedTo) {
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const block = input.connectedTo.ownerBlock;
|
|
165
|
+
|
|
166
|
+
block.visit(extraData, callback, alreadyVisited);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Visits the block and its inputs recursively.
|
|
172
|
+
* When starting from the smart filter output block, this will visit all the blocks in the smart filter.
|
|
173
|
+
* Note that it's a depth first visit: the callback is called on the block AFTER visiting its inputs.
|
|
174
|
+
* @param extraData - The extra data to pass to the callback
|
|
175
|
+
* @param callback - The callback to call on each block
|
|
176
|
+
* @param alreadyVisitedBlocks - Defines the set of blocks already visited (if not provided, a new set will be created)
|
|
177
|
+
*/
|
|
178
|
+
public visit<T extends object>(extraData: T, callback: BlockVisitor<T>, alreadyVisitedBlocks?: Set<BaseBlock>): void {
|
|
179
|
+
if (!alreadyVisitedBlocks) {
|
|
180
|
+
alreadyVisitedBlocks = BaseBlock._AlreadyVisitedBlocks;
|
|
181
|
+
alreadyVisitedBlocks.clear();
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (!alreadyVisitedBlocks.has(this)) {
|
|
185
|
+
alreadyVisitedBlocks.add(this);
|
|
186
|
+
|
|
187
|
+
this._visitInputs(extraData, callback, alreadyVisitedBlocks);
|
|
188
|
+
|
|
189
|
+
callback(this, extraData);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Finds the input connection point with the given name.
|
|
195
|
+
* @param name - Name of the input to find
|
|
196
|
+
* @returns The connection point with the given name or null if not found
|
|
197
|
+
*/
|
|
198
|
+
public findInput<U extends ConnectionPointType>(name: string): Nullable<ConnectionPoint<U>> {
|
|
199
|
+
for (const input of this._inputs) {
|
|
200
|
+
if (input.name === name) {
|
|
201
|
+
return input as ConnectionPoint<U>;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return null;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Disconnects the block from the graph.
|
|
210
|
+
* @param _disconnectedConnections - Stores the connections that have been broken in the process. You can reconnect them later if needed.
|
|
211
|
+
*/
|
|
212
|
+
public disconnectFromGraph(_disconnectedConnections?: [ConnectionPoint, ConnectionPoint][]): void {}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Prepares the block for runtime.
|
|
216
|
+
* This is called by the smart filter just before creating the smart filter runtime, and by the optimizer.
|
|
217
|
+
*/
|
|
218
|
+
public prepareForRuntime(): void {}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Propagates the runtime data - telling all outputs to propagate their runtime data forward through the graph
|
|
222
|
+
*/
|
|
223
|
+
public propagateRuntimeData(): void {
|
|
224
|
+
for (const output of this._outputs) {
|
|
225
|
+
output.propagateRuntimeData();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Generates the commands needed to execute the block at runtime and gathers promises for initialization work
|
|
231
|
+
* @param initializationData - The initialization data to use
|
|
232
|
+
* @param _finalOutput - Defines if the block is the final output of the smart filter
|
|
233
|
+
*/
|
|
234
|
+
public generateCommandsAndGatherInitPromises(initializationData: InitializationData, _finalOutput: boolean): void {
|
|
235
|
+
// Check if any inputs are Textures which aren't yet ready, and if so, ensure init waits for them to be ready
|
|
236
|
+
for (const input of this._inputs) {
|
|
237
|
+
if (input.type === ConnectionPointType.Texture) {
|
|
238
|
+
const texture = input.runtimeData?.value as ConnectionPointValue<ConnectionPointType.Texture>;
|
|
239
|
+
if (texture && !texture.isReady()) {
|
|
240
|
+
const internalTexture = texture.getInternalTexture();
|
|
241
|
+
if (internalTexture) {
|
|
242
|
+
const textureReadyPromise = new Promise<void>((resolve, reject) => {
|
|
243
|
+
internalTexture.onLoadedObservable.add(() => {
|
|
244
|
+
resolve();
|
|
245
|
+
});
|
|
246
|
+
internalTexture.onErrorObservable.add((error) => {
|
|
247
|
+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
|
|
248
|
+
reject(error);
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
initializationData.initializationPromises.push(textureReadyPromise);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Disconnects all the inputs and outputs from the Block.
|
|
260
|
+
*/
|
|
261
|
+
public disconnect(): void {
|
|
262
|
+
// Detach inputs
|
|
263
|
+
for (const input of this._inputs) {
|
|
264
|
+
input.connectedTo?.disconnectFrom(input);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// Detach outputs
|
|
268
|
+
for (const output of this._outputs) {
|
|
269
|
+
output.disconnectAllEndpoints();
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Registers a new input connection point in the block which must have a connection before the graph can be used.
|
|
275
|
+
* @param name - Defines the name of the input connection point
|
|
276
|
+
* @param type - Defines the type of the input connection point
|
|
277
|
+
* @param defaultValue - Defines the optional default value of the input connection point to use if not connection is made
|
|
278
|
+
* @returns The new ConnectionPoint
|
|
279
|
+
* @internal
|
|
280
|
+
*/
|
|
281
|
+
public _registerInput<U extends ConnectionPointType>(name: string, type: U, defaultValue: Nullable<RuntimeData<U>> = null): ConnectionPoint<U> {
|
|
282
|
+
const input = new ConnectionPoint(name, this, type, ConnectionPointDirection.Input, defaultValue);
|
|
283
|
+
this._inputs.push(input);
|
|
284
|
+
return input;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Registers a new input connection point in the block which doesn't require a connection because it has a default value.
|
|
289
|
+
* @param name - Defines the name of the input connection point
|
|
290
|
+
* @param type - Defines the type of the input connection point
|
|
291
|
+
* @param defaultValue - Defines the default value to use if nothing is connected to this connection point
|
|
292
|
+
* @returns The new ConnectionPointWithDefault
|
|
293
|
+
* @internal
|
|
294
|
+
*/
|
|
295
|
+
public _registerOptionalInput<U extends ConnectionPointType>(name: string, type: U, defaultValue: RuntimeData<U>): ConnectionPointWithDefault<U> {
|
|
296
|
+
const input = new ConnectionPointWithDefault(name, this, type, ConnectionPointDirection.Input, defaultValue);
|
|
297
|
+
this._inputs.push(input);
|
|
298
|
+
return input;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Registers a new output connection point in the block.
|
|
303
|
+
* @param name - Defines the name of the output connection point
|
|
304
|
+
* @param type - Defines the type of the output connection point
|
|
305
|
+
* @returns The new output connection point
|
|
306
|
+
* @internal
|
|
307
|
+
*/
|
|
308
|
+
public _registerOutput<U extends ConnectionPointType>(name: string, type: U): ConnectionPoint<U> {
|
|
309
|
+
const output = new ConnectionPoint(name, this, type, ConnectionPointDirection.Output);
|
|
310
|
+
this._outputs.push(output);
|
|
311
|
+
return output;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Registers a new output connection point in the block that always has runtimeData because it has a default value and doesn't allow it to be overwritten with null.
|
|
316
|
+
* @param name - Defines the name of the output connection point
|
|
317
|
+
* @param type - Defines the type of the output connection point
|
|
318
|
+
* @param initialValue - Defines the initial value of the output connection point
|
|
319
|
+
* @returns The new output connection point with a default value
|
|
320
|
+
* @internal
|
|
321
|
+
*/
|
|
322
|
+
public _registerOutputWithDefault<U extends ConnectionPointType>(name: string, type: U, initialValue: RuntimeData<U>): ConnectionPointWithDefault<U> {
|
|
323
|
+
const output = new ConnectionPointWithDefault(name, this, type, ConnectionPointDirection.Output, initialValue);
|
|
324
|
+
this._outputs.push(output);
|
|
325
|
+
return output;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Gets the required RuntimeData for the given input, throwing with a clear message if it is null
|
|
330
|
+
* @param input - The input to get the runtime data for
|
|
331
|
+
* @returns The runtimeData or throws if it was undefined
|
|
332
|
+
*/
|
|
333
|
+
protected _confirmRuntimeDataSupplied<U extends ConnectionPointType = ConnectionPointType>(input: ConnectionPoint<U>): RuntimeData<U> {
|
|
334
|
+
if (!input.runtimeData) {
|
|
335
|
+
throw new Error(`The ${ConnectionPointType[input.type]} input named "${input.name}" is missing for the ${this.getClassName()} named "${this.name}"`);
|
|
336
|
+
}
|
|
337
|
+
return input.runtimeData;
|
|
338
|
+
}
|
|
339
|
+
}
|