497169d97843c8eb5bb3e4b3949e794d579b2af0c22b25124b7130b0315ceb0f.json 48 KB

1
  1. {"ast":null,"code":"import { __decorate } from \"../../tslib.es6.js\";\nimport { GetClass } from \"../../Misc/typeStore.js\";\nimport { serialize } from \"../../Misc/decorators.js\";\nimport { UniqueIdGenerator } from \"../../Misc/uniqueIdGenerator.js\";\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"./Types/nodeRenderGraphTypes.js\";\nimport { Observable } from \"../../Misc/observable.js\";\nimport { Logger } from \"../../Misc/logger.js\";\nimport { NodeRenderGraphConnectionPoint } from \"./nodeRenderGraphBlockConnectionPoint.js\";\n/**\n * Defines a block that can be used inside a node render graph\n */\nexport class NodeRenderGraphBlock {\n /**\n * Gets or sets the disable flag of the task associated with this block\n */\n get disabled() {\n var _this$_frameGraphTask;\n return !!((_this$_frameGraphTask = this._frameGraphTask) !== null && _this$_frameGraphTask !== void 0 && _this$_frameGraphTask.disabled);\n }\n set disabled(value) {\n if (this._frameGraphTask) {\n this._frameGraphTask.disabled = value;\n }\n }\n /**\n * Gets the frame graph task associated with this block\n */\n get task() {\n return this._frameGraphTask;\n }\n /**\n * Gets the list of input points\n */\n get inputs() {\n return this._inputs;\n }\n /** Gets the list of output points */\n get outputs() {\n return this._outputs;\n }\n /**\n * Gets or set the name of the block\n */\n get name() {\n return this._name;\n }\n set name(value) {\n this._name = value;\n }\n /**\n * Gets a boolean indicating if this block is an input\n */\n get isInput() {\n return this._isInput;\n }\n /**\n * Gets a boolean indicating if this block is a teleport out\n */\n get isTeleportOut() {\n return this._isTeleportOut;\n }\n /**\n * Gets a boolean indicating if this block is a teleport in\n */\n get isTeleportIn() {\n return this._isTeleportIn;\n }\n /**\n * Gets a boolean indicating if this block is a debug block\n */\n get isDebug() {\n return this._isDebug;\n }\n /**\n * Gets a boolean indicating that this block can only be used once per node render graph\n */\n get isUnique() {\n return this._isUnique;\n }\n /**\n * Gets the current class name e.g. \"NodeRenderGraphBlock\"\n * @returns the class name\n */\n getClassName() {\n return \"NodeRenderGraphBlock\";\n }\n _inputRename(name) {\n return name;\n }\n _outputRename(name) {\n return name;\n }\n /**\n * Checks if the current block is an ancestor of a given block\n * @param block defines the potential descendant block to check\n * @returns true if block is a descendant\n */\n isAnAncestorOf(block) {\n for (const output of this._outputs) {\n if (!output.hasEndpoints) {\n continue;\n }\n for (const endpoint of output.endpoints) {\n if (endpoint.ownerBlock === block) {\n return true;\n }\n if (endpoint.ownerBlock.isAnAncestorOf(block)) {\n return true;\n }\n }\n }\n return false;\n }\n /**\n * Checks if the current block is an ancestor of a given type\n * @param type defines the potential type to check\n * @returns true if block is a descendant\n */\n isAnAncestorOfType(type) {\n if (this.getClassName() === type) {\n return true;\n }\n for (const output of this._outputs) {\n if (!output.hasEndpoints) {\n continue;\n }\n for (const endpoint of output.endpoints) {\n if (endpoint.ownerBlock.isAnAncestorOfType(type)) {\n return true;\n }\n }\n }\n return false;\n }\n /**\n * Get the first descendant using a predicate\n * @param predicate defines the predicate to check\n * @returns descendant or null if none found\n */\n getDescendantOfPredicate(predicate) {\n if (predicate(this)) {\n return this;\n }\n for (const output of this._outputs) {\n if (!output.hasEndpoints) {\n continue;\n }\n for (const endpoint of output.endpoints) {\n const descendant = endpoint.ownerBlock.getDescendantOfPredicate(predicate);\n if (descendant) {\n return descendant;\n }\n }\n }\n return null;\n }\n /**\n * Creates a new NodeRenderGraphBlock\n * @param name defines the block name\n * @param frameGraph defines the hosting frame graph\n * @param scene defines the hosting scene\n * @param _additionalConstructionParameters defines additional parameters to pass to the block constructor\n */\n constructor(name, frameGraph, scene, ..._additionalConstructionParameters) {\n this._name = \"\";\n this._isInput = false;\n this._isTeleportOut = false;\n this._isTeleportIn = false;\n this._isDebug = false;\n this._isUnique = false;\n /**\n * Gets an observable raised when the block is built\n */\n this.onBuildObservable = new Observable();\n /** @internal */\n this._inputs = new Array();\n /** @internal */\n this._outputs = new Array();\n /** @internal */\n this._codeVariableName = \"\";\n /** @internal */\n this._additionalConstructionParameters = null;\n /** Gets or sets a boolean indicating that this input can be edited from a collapsed frame */\n this.visibleOnFrame = false;\n this._name = name;\n this._frameGraph = frameGraph;\n this._scene = scene;\n this._engine = scene.getEngine();\n this.uniqueId = UniqueIdGenerator.UniqueId;\n }\n /**\n * Register a new input. Must be called inside a block constructor\n * @param name defines the connection point name\n * @param type defines the connection point type\n * @param isOptional defines a boolean indicating that this input can be omitted\n * @param point an already created connection point. If not provided, create a new one\n * @returns the current block\n */\n registerInput(name, type, isOptional = false, point) {\n var _point;\n point = (_point = point) !== null && _point !== void 0 ? _point : new NodeRenderGraphConnectionPoint(name, this, 0 /* NodeRenderGraphConnectionPointDirection.Input */);\n point.type = type;\n point.isOptional = isOptional;\n this._inputs.push(point);\n return this;\n }\n /**\n * Register a new output. Must be called inside a block constructor\n * @param name defines the connection point name\n * @param type defines the connection point type\n * @param point an already created connection point. If not provided, create a new one\n * @returns the current block\n */\n registerOutput(name, type, point) {\n var _point2;\n point = (_point2 = point) !== null && _point2 !== void 0 ? _point2 : new NodeRenderGraphConnectionPoint(name, this, 1 /* NodeRenderGraphConnectionPointDirection.Output */);\n point.type = type;\n this._outputs.push(point);\n return this;\n }\n _buildBlock(_state) {\n // Empty. Must be defined by child nodes\n }\n _customBuildStep(_state) {\n // Must be implemented by children\n }\n _propagateInputValueToOutput(inputConnectionPoint, outputConnectionPoint) {\n if (inputConnectionPoint.connectedPoint) {\n outputConnectionPoint.value = inputConnectionPoint.connectedPoint.value;\n }\n }\n /**\n * Build the current node and generate the vertex data\n * @param state defines the current generation state\n * @returns true if already built\n */\n build(state) {\n if (this._buildId === state.buildId) {\n return true;\n }\n this._buildId = state.buildId;\n // Check if \"parent\" blocks are compiled\n for (const input of this._inputs) {\n if (!input.connectedPoint) {\n if (!input.isOptional) {\n // Emit a warning\n state._notConnectedNonOptionalInputs.push(input);\n }\n continue;\n }\n const block = input.connectedPoint.ownerBlock;\n if (block && block !== this) {\n block.build(state);\n }\n }\n this._customBuildStep(state);\n // Logs\n if (state.verbose) {\n Logger.Log(`Building ${this.name} [${this.getClassName()}]`);\n }\n this._buildBlock(state);\n if (this._frameGraphTask) {\n this._frameGraph.addTask(this._frameGraphTask);\n }\n this.onBuildObservable.notifyObservers(this);\n return false;\n }\n _linkConnectionTypes(inputIndex0, inputIndex1, looseCoupling = false) {\n if (looseCoupling) {\n this._inputs[inputIndex1]._acceptedConnectionPointType = this._inputs[inputIndex0];\n } else {\n this._inputs[inputIndex0]._linkedConnectionSource = this._inputs[inputIndex1];\n }\n this._inputs[inputIndex1]._linkedConnectionSource = this._inputs[inputIndex0];\n }\n /**\n * Initialize the block and prepare the context for build\n */\n initialize() {\n // Do nothing\n }\n /**\n * Lets the block try to connect some inputs automatically\n */\n autoConfigure() {\n // Do nothing\n }\n /**\n * Find an input by its name\n * @param name defines the name of the input to look for\n * @returns the input or null if not found\n */\n getInputByName(name) {\n const filter = this._inputs.filter(e => e.name === name);\n if (filter.length) {\n return filter[0];\n }\n return null;\n }\n /**\n * Find an output by its name\n * @param name defines the name of the output to look for\n * @returns the output or null if not found\n */\n getOutputByName(name) {\n const filter = this._outputs.filter(e => e.name === name);\n if (filter.length) {\n return filter[0];\n }\n return null;\n }\n /**\n * Serializes this block in a JSON representation\n * @returns the serialized block object\n */\n serialize() {\n const serializationObject = {};\n serializationObject.customType = \"BABYLON.\" + this.getClassName();\n serializationObject.id = this.uniqueId;\n serializationObject.name = this.name;\n serializationObject.visibleOnFrame = this.visibleOnFrame;\n serializationObject.disabled = this.disabled;\n if (this._additionalConstructionParameters) {\n serializationObject.additionalConstructionParameters = this._additionalConstructionParameters;\n }\n serializationObject.inputs = [];\n serializationObject.outputs = [];\n for (const input of this.inputs) {\n serializationObject.inputs.push(input.serialize());\n }\n for (const output of this.outputs) {\n serializationObject.outputs.push(output.serialize(false));\n }\n return serializationObject;\n }\n /**\n * @internal\n */\n _deserialize(serializationObject) {\n this._name = serializationObject.name;\n this.comments = serializationObject.comments;\n this.visibleOnFrame = serializationObject.visibleOnFrame;\n this.disabled = serializationObject.disabled;\n this._deserializePortDisplayNamesAndExposedOnFrame(serializationObject);\n }\n _deserializePortDisplayNamesAndExposedOnFrame(serializationObject) {\n const serializedInputs = serializationObject.inputs;\n const serializedOutputs = serializationObject.outputs;\n if (serializedInputs) {\n serializedInputs.forEach(port => {\n const input = this.inputs.find(i => i.name === port.name);\n if (!input) {\n return;\n }\n if (port.displayName) {\n input.displayName = port.displayName;\n }\n if (port.isExposedOnFrame) {\n input.isExposedOnFrame = port.isExposedOnFrame;\n input.exposedPortPosition = port.exposedPortPosition;\n }\n });\n }\n if (serializedOutputs) {\n serializedOutputs.forEach((port, i) => {\n if (port.displayName) {\n this.outputs[i].displayName = port.displayName;\n }\n if (port.isExposedOnFrame) {\n this.outputs[i].isExposedOnFrame = port.isExposedOnFrame;\n this.outputs[i].exposedPortPosition = port.exposedPortPosition;\n }\n });\n }\n }\n _dumpPropertiesCode() {\n const variableName = this._codeVariableName;\n return `${variableName}.visibleOnFrame = ${this.visibleOnFrame};\\n${variableName}.disabled = ${this.disabled};\\n`;\n }\n /**\n * @internal\n */\n _dumpCodeForOutputConnections(alreadyDumped) {\n let codeString = \"\";\n if (alreadyDumped.indexOf(this) !== -1) {\n return codeString;\n }\n alreadyDumped.push(this);\n for (const input of this.inputs) {\n if (!input.isConnected) {\n continue;\n }\n const connectedOutput = input.connectedPoint;\n const connectedBlock = connectedOutput.ownerBlock;\n codeString += connectedBlock._dumpCodeForOutputConnections(alreadyDumped);\n codeString += `${connectedBlock._codeVariableName}.${connectedBlock._outputRename(connectedOutput.name)}.connectTo(${this._codeVariableName}.${this._inputRename(input.name)});\\n`;\n }\n return codeString;\n }\n /**\n * @internal\n */\n _dumpCode(uniqueNames, alreadyDumped) {\n alreadyDumped.push(this);\n // Get unique name\n const nameAsVariableName = this.name.replace(/[^A-Za-z_]+/g, \"\");\n this._codeVariableName = nameAsVariableName || `${this.getClassName()}_${this.uniqueId}`;\n if (uniqueNames.indexOf(this._codeVariableName) !== -1) {\n let index = 0;\n do {\n index++;\n this._codeVariableName = nameAsVariableName + index;\n } while (uniqueNames.indexOf(this._codeVariableName) !== -1);\n }\n uniqueNames.push(this._codeVariableName);\n // Declaration\n let codeString = `\\n// ${this.getClassName()}\\n`;\n if (this.comments) {\n codeString += `// ${this.comments}\\n`;\n }\n const className = this.getClassName();\n if (className === \"RenderGraphInputBlock\") {\n const block = this;\n const blockType = block.type;\n codeString += `var ${this._codeVariableName} = new BABYLON.NodeRenderGraphInputBlock(\"${this.name}\", nodeRenderGraph.frameGraph, scene, BABYLON.NodeRenderGraphBlockConnectionPointTypes.${NodeRenderGraphBlockConnectionPointTypes[blockType]});\\n`;\n } else {\n if (this._additionalConstructionParameters) {\n codeString += `var ${this._codeVariableName} = new BABYLON.${className}(\"${this.name}\", nodeRenderGraph.frameGraph, scene, ...${JSON.stringify(this._additionalConstructionParameters)});\\n`;\n } else {\n codeString += `var ${this._codeVariableName} = new BABYLON.${className}(\"${this.name}\", nodeRenderGraph.frameGraph, scene);\\n`;\n }\n }\n // Properties\n codeString += this._dumpPropertiesCode() + \"\\n\";\n // Inputs\n for (const input of this.inputs) {\n if (!input.isConnected) {\n continue;\n }\n const connectedOutput = input.connectedPoint;\n const connectedBlock = connectedOutput.ownerBlock;\n if (alreadyDumped.indexOf(connectedBlock) === -1) {\n codeString += connectedBlock._dumpCode(uniqueNames, alreadyDumped);\n }\n }\n // Outputs\n for (const output of this.outputs) {\n if (!output.hasEndpoints) {\n continue;\n }\n for (const endpoint of output.endpoints) {\n const connectedBlock = endpoint.ownerBlock;\n if (connectedBlock && alreadyDumped.indexOf(connectedBlock) === -1) {\n codeString += connectedBlock._dumpCode(uniqueNames, alreadyDumped);\n }\n }\n }\n return codeString;\n }\n /**\n * Clone the current block to a new identical block\n * @returns a copy of the current block\n */\n clone() {\n const serializationObject = this.serialize();\n const blockType = GetClass(serializationObject.customType);\n if (blockType) {\n const additionalConstructionParameters = serializationObject.additionalConstructionParameters;\n const block = additionalConstructionParameters ? new blockType(\"\", this._frameGraph, this._scene, ...additionalConstructionParameters) : new blockType(\"\", this._frameGraph, this._scene);\n block._deserialize(serializationObject);\n return block;\n }\n return null;\n }\n /**\n * Release resources\n */\n dispose() {\n var _this$_frameGraphTask2;\n for (const input of this.inputs) {\n input.dispose();\n }\n for (const output of this.outputs) {\n output.dispose();\n }\n (_this$_frameGraphTask2 = this._frameGraphTask) === null || _this$_frameGraphTask2 === void 0 || _this$_frameGraphTask2.dispose();\n this._frameGraphTask = undefined;\n this.onBuildObservable.clear();\n }\n}\n__decorate([serialize(\"comment\")], NodeRenderGraphBlock.prototype, \"comments\", void 0);","map":{"version":3,"names":["__decorate","GetClass","serialize","UniqueIdGenerator","NodeRenderGraphBlockConnectionPointTypes","Observable","Logger","NodeRenderGraphConnectionPoint","NodeRenderGraphBlock","disabled","_this$_frameGraphTask","_frameGraphTask","value","task","inputs","_inputs","outputs","_outputs","name","_name","isInput","_isInput","isTeleportOut","_isTeleportOut","isTeleportIn","_isTeleportIn","isDebug","_isDebug","isUnique","_isUnique","getClassName","_inputRename","_outputRename","isAnAncestorOf","block","output","hasEndpoints","endpoint","endpoints","ownerBlock","isAnAncestorOfType","type","getDescendantOfPredicate","predicate","descendant","constructor","frameGraph","scene","_additionalConstructionParameters","onBuildObservable","Array","_codeVariableName","visibleOnFrame","_frameGraph","_scene","_engine","getEngine","uniqueId","UniqueId","registerInput","isOptional","point","_point","push","registerOutput","_point2","_buildBlock","_state","_customBuildStep","_propagateInputValueToOutput","inputConnectionPoint","outputConnectionPoint","connectedPoint","build","state","_buildId","buildId","input","_notConnectedNonOptionalInputs","verbose","Log","addTask","notifyObservers","_linkConnectionTypes","inputIndex0","inputIndex1","looseCoupling","_acceptedConnectionPointType","_linkedConnectionSource","initialize","autoConfigure","getInputByName","filter","e","length","getOutputByName","serializationObject","customType","id","additionalConstructionParameters","_deserialize","comments","_deserializePortDisplayNamesAndExposedOnFrame","serializedInputs","serializedOutputs","forEach","port","find","i","displayName","isExposedOnFrame","exposedPortPosition","_dumpPropertiesCode","variableName","_dumpCodeForOutputConnections","alreadyDumped","codeString","indexOf","isConnected","connectedOutput","connectedBlock","_dumpCode","uniqueNames","nameAsVariableName","replace","index","className","blockType","JSON","stringify","clone","dispose","_this$_frameGraphTask2","undefined","clear","prototype"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/FrameGraph/Node/nodeRenderGraphBlock.js"],"sourcesContent":["import { __decorate } from \"../../tslib.es6.js\";\nimport { GetClass } from \"../../Misc/typeStore.js\";\nimport { serialize } from \"../../Misc/decorators.js\";\nimport { UniqueIdGenerator } from \"../../Misc/uniqueIdGenerator.js\";\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"./Types/nodeRenderGraphTypes.js\";\nimport { Observable } from \"../../Misc/observable.js\";\nimport { Logger } from \"../../Misc/logger.js\";\nimport { NodeRenderGraphConnectionPoint } from \"./nodeRenderGraphBlockConnectionPoint.js\";\n/**\n * Defines a block that can be used inside a node render graph\n */\nexport class NodeRenderGraphBlock {\n /**\n * Gets or sets the disable flag of the task associated with this block\n */\n get disabled() {\n return !!this._frameGraphTask?.disabled;\n }\n set disabled(value) {\n if (this._frameGraphTask) {\n this._frameGraphTask.disabled = value;\n }\n }\n /**\n * Gets the frame graph task associated with this block\n */\n get task() {\n return this._frameGraphTask;\n }\n /**\n * Gets the list of input points\n */\n get inputs() {\n return this._inputs;\n }\n /** Gets the list of output points */\n get outputs() {\n return this._outputs;\n }\n /**\n * Gets or set the name of the block\n */\n get name() {\n return this._name;\n }\n set name(value) {\n this._name = value;\n }\n /**\n * Gets a boolean indicating if this block is an input\n */\n get isInput() {\n return this._isInput;\n }\n /**\n * Gets a boolean indicating if this block is a teleport out\n */\n get isTeleportOut() {\n return this._isTeleportOut;\n }\n /**\n * Gets a boolean indicating if this block is a teleport in\n */\n get isTeleportIn() {\n return this._isTeleportIn;\n }\n /**\n * Gets a boolean indicating if this block is a debug block\n */\n get isDebug() {\n return this._isDebug;\n }\n /**\n * Gets a boolean indicating that this block can only be used once per node render graph\n */\n get isUnique() {\n return this._isUnique;\n }\n /**\n * Gets the current class name e.g. \"NodeRenderGraphBlock\"\n * @returns the class name\n */\n getClassName() {\n return \"NodeRenderGraphBlock\";\n }\n _inputRename(name) {\n return name;\n }\n _outputRename(name) {\n return name;\n }\n /**\n * Checks if the current block is an ancestor of a given block\n * @param block defines the potential descendant block to check\n * @returns true if block is a descendant\n */\n isAnAncestorOf(block) {\n for (const output of this._outputs) {\n if (!output.hasEndpoints) {\n continue;\n }\n for (const endpoint of output.endpoints) {\n if (endpoint.ownerBlock === block) {\n return true;\n }\n if (endpoint.ownerBlock.isAnAncestorOf(block)) {\n return true;\n }\n }\n }\n return false;\n }\n /**\n * Checks if the current block is an ancestor of a given type\n * @param type defines the potential type to check\n * @returns true if block is a descendant\n */\n isAnAncestorOfType(type) {\n if (this.getClassName() === type) {\n return true;\n }\n for (const output of this._outputs) {\n if (!output.hasEndpoints) {\n continue;\n }\n for (const endpoint of output.endpoints) {\n if (endpoint.ownerBlock.isAnAncestorOfType(type)) {\n return true;\n }\n }\n }\n return false;\n }\n /**\n * Get the first descendant using a predicate\n * @param predicate defines the predicate to check\n * @returns descendant or null if none found\n */\n getDescendantOfPredicate(predicate) {\n if (predicate(this)) {\n return this;\n }\n for (const output of this._outputs) {\n if (!output.hasEndpoints) {\n continue;\n }\n for (const endpoint of output.endpoints) {\n const descendant = endpoint.ownerBlock.getDescendantOfPredicate(predicate);\n if (descendant) {\n return descendant;\n }\n }\n }\n return null;\n }\n /**\n * Creates a new NodeRenderGraphBlock\n * @param name defines the block name\n * @param frameGraph defines the hosting frame graph\n * @param scene defines the hosting scene\n * @param _additionalConstructionParameters defines additional parameters to pass to the block constructor\n */\n constructor(name, frameGraph, scene, ..._additionalConstructionParameters) {\n this._name = \"\";\n this._isInput = false;\n this._isTeleportOut = false;\n this._isTeleportIn = false;\n this._isDebug = false;\n this._isUnique = false;\n /**\n * Gets an observable raised when the block is built\n */\n this.onBuildObservable = new Observable();\n /** @internal */\n this._inputs = new Array();\n /** @internal */\n this._outputs = new Array();\n /** @internal */\n this._codeVariableName = \"\";\n /** @internal */\n this._additionalConstructionParameters = null;\n /** Gets or sets a boolean indicating that this input can be edited from a collapsed frame */\n this.visibleOnFrame = false;\n this._name = name;\n this._frameGraph = frameGraph;\n this._scene = scene;\n this._engine = scene.getEngine();\n this.uniqueId = UniqueIdGenerator.UniqueId;\n }\n /**\n * Register a new input. Must be called inside a block constructor\n * @param name defines the connection point name\n * @param type defines the connection point type\n * @param isOptional defines a boolean indicating that this input can be omitted\n * @param point an already created connection point. If not provided, create a new one\n * @returns the current block\n */\n registerInput(name, type, isOptional = false, point) {\n point = point ?? new NodeRenderGraphConnectionPoint(name, this, 0 /* NodeRenderGraphConnectionPointDirection.Input */);\n point.type = type;\n point.isOptional = isOptional;\n this._inputs.push(point);\n return this;\n }\n /**\n * Register a new output. Must be called inside a block constructor\n * @param name defines the connection point name\n * @param type defines the connection point type\n * @param point an already created connection point. If not provided, create a new one\n * @returns the current block\n */\n registerOutput(name, type, point) {\n point = point ?? new NodeRenderGraphConnectionPoint(name, this, 1 /* NodeRenderGraphConnectionPointDirection.Output */);\n point.type = type;\n this._outputs.push(point);\n return this;\n }\n _buildBlock(_state) {\n // Empty. Must be defined by child nodes\n }\n _customBuildStep(_state) {\n // Must be implemented by children\n }\n _propagateInputValueToOutput(inputConnectionPoint, outputConnectionPoint) {\n if (inputConnectionPoint.connectedPoint) {\n outputConnectionPoint.value = inputConnectionPoint.connectedPoint.value;\n }\n }\n /**\n * Build the current node and generate the vertex data\n * @param state defines the current generation state\n * @returns true if already built\n */\n build(state) {\n if (this._buildId === state.buildId) {\n return true;\n }\n this._buildId = state.buildId;\n // Check if \"parent\" blocks are compiled\n for (const input of this._inputs) {\n if (!input.connectedPoint) {\n if (!input.isOptional) {\n // Emit a warning\n state._notConnectedNonOptionalInputs.push(input);\n }\n continue;\n }\n const block = input.connectedPoint.ownerBlock;\n if (block && block !== this) {\n block.build(state);\n }\n }\n this._customBuildStep(state);\n // Logs\n if (state.verbose) {\n Logger.Log(`Building ${this.name} [${this.getClassName()}]`);\n }\n this._buildBlock(state);\n if (this._frameGraphTask) {\n this._frameGraph.addTask(this._frameGraphTask);\n }\n this.onBuildObservable.notifyObservers(this);\n return false;\n }\n _linkConnectionTypes(inputIndex0, inputIndex1, looseCoupling = false) {\n if (looseCoupling) {\n this._inputs[inputIndex1]._acceptedConnectionPointType = this._inputs[inputIndex0];\n }\n else {\n this._inputs[inputIndex0]._linkedConnectionSource = this._inputs[inputIndex1];\n }\n this._inputs[inputIndex1]._linkedConnectionSource = this._inputs[inputIndex0];\n }\n /**\n * Initialize the block and prepare the context for build\n */\n initialize() {\n // Do nothing\n }\n /**\n * Lets the block try to connect some inputs automatically\n */\n autoConfigure() {\n // Do nothing\n }\n /**\n * Find an input by its name\n * @param name defines the name of the input to look for\n * @returns the input or null if not found\n */\n getInputByName(name) {\n const filter = this._inputs.filter((e) => e.name === name);\n if (filter.length) {\n return filter[0];\n }\n return null;\n }\n /**\n * Find an output by its name\n * @param name defines the name of the output to look for\n * @returns the output or null if not found\n */\n getOutputByName(name) {\n const filter = this._outputs.filter((e) => e.name === name);\n if (filter.length) {\n return filter[0];\n }\n return null;\n }\n /**\n * Serializes this block in a JSON representation\n * @returns the serialized block object\n */\n serialize() {\n const serializationObject = {};\n serializationObject.customType = \"BABYLON.\" + this.getClassName();\n serializationObject.id = this.uniqueId;\n serializationObject.name = this.name;\n serializationObject.visibleOnFrame = this.visibleOnFrame;\n serializationObject.disabled = this.disabled;\n if (this._additionalConstructionParameters) {\n serializationObject.additionalConstructionParameters = this._additionalConstructionParameters;\n }\n serializationObject.inputs = [];\n serializationObject.outputs = [];\n for (const input of this.inputs) {\n serializationObject.inputs.push(input.serialize());\n }\n for (const output of this.outputs) {\n serializationObject.outputs.push(output.serialize(false));\n }\n return serializationObject;\n }\n /**\n * @internal\n */\n _deserialize(serializationObject) {\n this._name = serializationObject.name;\n this.comments = serializationObject.comments;\n this.visibleOnFrame = serializationObject.visibleOnFrame;\n this.disabled = serializationObject.disabled;\n this._deserializePortDisplayNamesAndExposedOnFrame(serializationObject);\n }\n _deserializePortDisplayNamesAndExposedOnFrame(serializationObject) {\n const serializedInputs = serializationObject.inputs;\n const serializedOutputs = serializationObject.outputs;\n if (serializedInputs) {\n serializedInputs.forEach((port) => {\n const input = this.inputs.find((i) => i.name === port.name);\n if (!input) {\n return;\n }\n if (port.displayName) {\n input.displayName = port.displayName;\n }\n if (port.isExposedOnFrame) {\n input.isExposedOnFrame = port.isExposedOnFrame;\n input.exposedPortPosition = port.exposedPortPosition;\n }\n });\n }\n if (serializedOutputs) {\n serializedOutputs.forEach((port, i) => {\n if (port.displayName) {\n this.outputs[i].displayName = port.displayName;\n }\n if (port.isExposedOnFrame) {\n this.outputs[i].isExposedOnFrame = port.isExposedOnFrame;\n this.outputs[i].exposedPortPosition = port.exposedPortPosition;\n }\n });\n }\n }\n _dumpPropertiesCode() {\n const variableName = this._codeVariableName;\n return `${variableName}.visibleOnFrame = ${this.visibleOnFrame};\\n${variableName}.disabled = ${this.disabled};\\n`;\n }\n /**\n * @internal\n */\n _dumpCodeForOutputConnections(alreadyDumped) {\n let codeString = \"\";\n if (alreadyDumped.indexOf(this) !== -1) {\n return codeString;\n }\n alreadyDumped.push(this);\n for (const input of this.inputs) {\n if (!input.isConnected) {\n continue;\n }\n const connectedOutput = input.connectedPoint;\n const connectedBlock = connectedOutput.ownerBlock;\n codeString += connectedBlock._dumpCodeForOutputConnections(alreadyDumped);\n codeString += `${connectedBlock._codeVariableName}.${connectedBlock._outputRename(connectedOutput.name)}.connectTo(${this._codeVariableName}.${this._inputRename(input.name)});\\n`;\n }\n return codeString;\n }\n /**\n * @internal\n */\n _dumpCode(uniqueNames, alreadyDumped) {\n alreadyDumped.push(this);\n // Get unique name\n const nameAsVariableName = this.name.replace(/[^A-Za-z_]+/g, \"\");\n this._codeVariableName = nameAsVariableName || `${this.getClassName()}_${this.uniqueId}`;\n if (uniqueNames.indexOf(this._codeVariableName) !== -1) {\n let index = 0;\n do {\n index++;\n this._codeVariableName = nameAsVariableName + index;\n } while (uniqueNames.indexOf(this._codeVariableName) !== -1);\n }\n uniqueNames.push(this._codeVariableName);\n // Declaration\n let codeString = `\\n// ${this.getClassName()}\\n`;\n if (this.comments) {\n codeString += `// ${this.comments}\\n`;\n }\n const className = this.getClassName();\n if (className === \"RenderGraphInputBlock\") {\n const block = this;\n const blockType = block.type;\n codeString += `var ${this._codeVariableName} = new BABYLON.NodeRenderGraphInputBlock(\"${this.name}\", nodeRenderGraph.frameGraph, scene, BABYLON.NodeRenderGraphBlockConnectionPointTypes.${NodeRenderGraphBlockConnectionPointTypes[blockType]});\\n`;\n }\n else {\n if (this._additionalConstructionParameters) {\n codeString += `var ${this._codeVariableName} = new BABYLON.${className}(\"${this.name}\", nodeRenderGraph.frameGraph, scene, ...${JSON.stringify(this._additionalConstructionParameters)});\\n`;\n }\n else {\n codeString += `var ${this._codeVariableName} = new BABYLON.${className}(\"${this.name}\", nodeRenderGraph.frameGraph, scene);\\n`;\n }\n }\n // Properties\n codeString += this._dumpPropertiesCode() + \"\\n\";\n // Inputs\n for (const input of this.inputs) {\n if (!input.isConnected) {\n continue;\n }\n const connectedOutput = input.connectedPoint;\n const connectedBlock = connectedOutput.ownerBlock;\n if (alreadyDumped.indexOf(connectedBlock) === -1) {\n codeString += connectedBlock._dumpCode(uniqueNames, alreadyDumped);\n }\n }\n // Outputs\n for (const output of this.outputs) {\n if (!output.hasEndpoints) {\n continue;\n }\n for (const endpoint of output.endpoints) {\n const connectedBlock = endpoint.ownerBlock;\n if (connectedBlock && alreadyDumped.indexOf(connectedBlock) === -1) {\n codeString += connectedBlock._dumpCode(uniqueNames, alreadyDumped);\n }\n }\n }\n return codeString;\n }\n /**\n * Clone the current block to a new identical block\n * @returns a copy of the current block\n */\n clone() {\n const serializationObject = this.serialize();\n const blockType = GetClass(serializationObject.customType);\n if (blockType) {\n const additionalConstructionParameters = serializationObject.additionalConstructionParameters;\n const block = additionalConstructionParameters\n ? new blockType(\"\", this._frameGraph, this._scene, ...additionalConstructionParameters)\n : new blockType(\"\", this._frameGraph, this._scene);\n block._deserialize(serializationObject);\n return block;\n }\n return null;\n }\n /**\n * Release resources\n */\n dispose() {\n for (const input of this.inputs) {\n input.dispose();\n }\n for (const output of this.outputs) {\n output.dispose();\n }\n this._frameGraphTask?.dispose();\n this._frameGraphTask = undefined;\n this.onBuildObservable.clear();\n }\n}\n__decorate([\n serialize(\"comment\")\n], NodeRenderGraphBlock.prototype, \"comments\", void 0);\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,QAAQ,QAAQ,yBAAyB;AAClD,SAASC,SAAS,QAAQ,0BAA0B;AACpD,SAASC,iBAAiB,QAAQ,iCAAiC;AACnE,SAASC,wCAAwC,QAAQ,iCAAiC;AAC1F,SAASC,UAAU,QAAQ,0BAA0B;AACrD,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,SAASC,8BAA8B,QAAQ,0CAA0C;AACzF;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,CAAC;EAC9B;AACJ;AACA;EACI,IAAIC,QAAQA,CAAA,EAAG;IAAA,IAAAC,qBAAA;IACX,OAAO,CAAC,GAAAA,qBAAA,GAAC,IAAI,CAACC,eAAe,cAAAD,qBAAA,eAApBA,qBAAA,CAAsBD,QAAQ;EAC3C;EACA,IAAIA,QAAQA,CAACG,KAAK,EAAE;IAChB,IAAI,IAAI,CAACD,eAAe,EAAE;MACtB,IAAI,CAACA,eAAe,CAACF,QAAQ,GAAGG,KAAK;IACzC;EACJ;EACA;AACJ;AACA;EACI,IAAIC,IAAIA,CAAA,EAAG;IACP,OAAO,IAAI,CAACF,eAAe;EAC/B;EACA;AACJ;AACA;EACI,IAAIG,MAAMA,CAAA,EAAG;IACT,OAAO,IAAI,CAACC,OAAO;EACvB;EACA;EAC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