@onerjs/core 8.28.4 → 8.28.6
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/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.d.ts +1 -0
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.d.ts +1 -0
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.d.ts +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/convolutionPostProcessBlock.d.ts +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/convolutionPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/ssao2PostProcessBlock.d.ts +94 -0
- package/FrameGraph/Node/Blocks/PostProcesses/ssao2PostProcessBlock.js +312 -0
- package/FrameGraph/Node/Blocks/PostProcesses/ssao2PostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.d.ts +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/tonemapPostProcessBlock.d.ts +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/tonemapPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +1 -0
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.d.ts +1 -0
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/taaObjectRendererBlock.js +1 -1
- package/FrameGraph/Node/Blocks/Rendering/taaObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/index.d.ts +1 -0
- package/FrameGraph/Node/Blocks/index.js +1 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Tasks/Layers/baseLayerTask.js +1 -7
- package/FrameGraph/Tasks/Layers/baseLayerTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js +0 -6
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js +3 -4
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js +3 -4
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js +3 -4
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +0 -8
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +3 -5
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/ssao2BlurTask.d.ts +13 -0
- package/FrameGraph/Tasks/PostProcesses/ssao2BlurTask.js +25 -0
- package/FrameGraph/Tasks/PostProcesses/ssao2BlurTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/ssao2RenderingPipelineTask.d.ts +76 -0
- package/FrameGraph/Tasks/PostProcesses/ssao2RenderingPipelineTask.js +147 -0
- package/FrameGraph/Tasks/PostProcesses/ssao2RenderingPipelineTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/ssao2Task.d.ts +14 -0
- package/FrameGraph/Tasks/PostProcesses/ssao2Task.js +29 -0
- package/FrameGraph/Tasks/PostProcesses/ssao2Task.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js +2 -11
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/ssrTask.js +8 -9
- package/FrameGraph/Tasks/PostProcesses/ssrTask.js.map +1 -1
- package/FrameGraph/index.d.ts +1 -0
- package/FrameGraph/index.js +1 -0
- package/FrameGraph/index.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.d.ts +4 -0
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +6 -0
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +1 -1
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/PBR/openPbrMaterial.js +5 -5
- package/Materials/PBR/openPbrMaterial.js.map +1 -1
- package/Meshes/Node/nodeGeometry.js +1 -1
- package/Meshes/Node/nodeGeometry.js.map +1 -1
- package/Particles/Node/nodeParticleSystemSet.d.ts +14 -6
- package/Particles/Node/nodeParticleSystemSet.js +38 -7
- package/Particles/Node/nodeParticleSystemSet.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.d.ts +21 -30
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +163 -256
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.d.ts +1 -3
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/thinSSAO2RenderingPipeline.d.ts +130 -0
- package/PostProcesses/RenderPipeline/Pipelines/thinSSAO2RenderingPipeline.js +193 -0
- package/PostProcesses/RenderPipeline/Pipelines/thinSSAO2RenderingPipeline.js.map +1 -0
- package/PostProcesses/thinSSAO2BlurPostProcess.d.ts +26 -0
- package/PostProcesses/thinSSAO2BlurPostProcess.js +81 -0
- package/PostProcesses/thinSSAO2BlurPostProcess.js.map +1 -0
- package/PostProcesses/thinSSAO2CombinePostProcess.d.ts +15 -0
- package/PostProcesses/thinSSAO2CombinePostProcess.js +48 -0
- package/PostProcesses/thinSSAO2CombinePostProcess.js.map +1 -0
- package/PostProcesses/thinSSAO2PostProcess.d.ts +45 -0
- package/PostProcesses/thinSSAO2PostProcess.js +208 -0
- package/PostProcesses/thinSSAO2PostProcess.js.map +1 -0
- package/Shaders/ShadersInclude/shadowsFragmentFunctions.js +29 -4
- package/Shaders/ShadersInclude/shadowsFragmentFunctions.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeGeometry.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Node/nodeGeometry.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGzD,OAAO,EAAE,KAA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;AAMb;IADN,SAAS,CAAC,SAAS,CAAC;6CACE","sourcesContent":["import { Observable } from \"../../Misc/observable\";\r\nimport type { Nullable } from \"../../types\";\r\nimport { Mesh } from \"../mesh\";\r\nimport type { VertexData } from \"../mesh.vertexData\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { GeometryOutputBlock } from \"./Blocks/geometryOutputBlock\";\r\nimport type { NodeGeometryBlock } from \"./nodeGeometryBlock\";\r\nimport { NodeGeometryBuildState } from \"./nodeGeometryBuildState\";\r\nimport { GetClass } from \"../../Misc/typeStore\";\r\nimport { serialize } from \"../../Misc/decorators\";\r\nimport { SerializationHelper } from \"../../Misc/decorators.serialization\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport { WebRequest } from \"../../Misc/webRequest\";\r\nimport { BoxBlock } from \"./Blocks/Sources/boxBlock\";\r\nimport type { GeometryInputBlock } from \"./Blocks/geometryInputBlock\";\r\nimport { PrecisionDate } from \"../../Misc/precisionDate\";\r\nimport type { TeleportOutBlock } from \"./Blocks/Teleport/teleportOutBlock\";\r\nimport type { TeleportInBlock } from \"./Blocks/Teleport/teleportInBlock\";\r\nimport { Tools } from \"../../Misc/tools\";\r\nimport type { Color4 } from \"../../Maths/math.color\";\r\nimport { AbstractEngine } from \"core/Engines/abstractEngine\";\r\n\r\n// declare NODEGEOMETRYEDITOR namespace for compilation issue\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\ndeclare let NODEGEOMETRYEDITOR: any;\r\ndeclare let BABYLON: any;\r\n\r\n/**\r\n * Interface used to configure the node geometry editor\r\n */\r\nexport interface INodeGeometryEditorOptions {\r\n /** Define the URL to load node editor script from */\r\n editorURL?: string;\r\n /** Additional configuration for the NGE */\r\n nodeGeometryEditorConfig?: {\r\n backgroundColor?: Color4;\r\n hostScene?: Scene;\r\n hostMesh?: Mesh;\r\n };\r\n}\r\n\r\n/**\r\n * Defines a node based geometry\r\n * @see demo at https://playground.babylonjs.com#PYY6XE#69\r\n */\r\nexport class NodeGeometry {\r\n private static _BuildIdGenerator: number = 0;\r\n private _buildId: number = NodeGeometry._BuildIdGenerator++;\r\n private _buildWasSuccessful = false;\r\n private _vertexData: Nullable<VertexData> = null;\r\n private _buildExecutionTime: number = 0;\r\n\r\n /** Define the Url to load node editor script */\r\n public static EditorURL = `${Tools._DefaultCdnUrl}/v${AbstractEngine.Version}/nodeGeometryEditor/babylon.nodeGeometryEditor.js`;\r\n\r\n /** Define the Url to load snippets */\r\n public static SnippetUrl = Constants.SnippetUrl;\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private BJSNODEGEOMETRYEDITOR = this._getGlobalNodeGeometryEditor();\r\n\r\n /** @returns the inspector from bundle or global */\r\n private _getGlobalNodeGeometryEditor(): any {\r\n // UMD Global name detection from Webpack Bundle UMD Name.\r\n if (typeof NODEGEOMETRYEDITOR !== \"undefined\") {\r\n return NODEGEOMETRYEDITOR;\r\n }\r\n\r\n // In case of module let's check the global emitted from the editor entry point.\r\n if (typeof BABYLON !== \"undefined\" && typeof BABYLON.NodeGeometryEditor !== \"undefined\") {\r\n return BABYLON;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Gets the time spent to build this block (in ms)\r\n */\r\n public get buildExecutionTime() {\r\n return this._buildExecutionTime;\r\n }\r\n\r\n /**\r\n * Gets or sets data used by visual editor\r\n * @see https://nge.babylonjs.com\r\n */\r\n public editorData: any = null;\r\n\r\n /**\r\n * Gets an array of blocks that needs to be serialized even if they are not yet connected\r\n */\r\n public attachedBlocks: NodeGeometryBlock[] = [];\r\n\r\n /**\r\n * Observable raised when the geometry is built\r\n */\r\n public onBuildObservable = new Observable<NodeGeometry>();\r\n\r\n /** Gets or sets the GeometryOutputBlock used to gather the final geometry data */\r\n public outputBlock: Nullable<GeometryOutputBlock> = null;\r\n\r\n /**\r\n * Snippet ID if the material was created from the snippet server\r\n */\r\n public snippetId: string;\r\n\r\n /**\r\n * The name of the geometry\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * A free comment about the geometry\r\n */\r\n @serialize(\"comment\")\r\n public comment: string;\r\n\r\n /**\r\n * Creates a new geometry\r\n * @param name defines the name of the geometry\r\n */\r\n public constructor(name: string) {\r\n this.name = name;\r\n }\r\n\r\n /**\r\n * Gets the current class name of the geometry e.g. \"NodeGeometry\"\r\n * @returns the class name\r\n */\r\n public getClassName(): string {\r\n return \"NodeGeometry\";\r\n }\r\n\r\n /**\r\n * Gets the vertex data. This needs to be done after build() was called.\r\n * This is used to access vertexData when creating a mesh is not required.\r\n */\r\n public get vertexData() {\r\n return this._vertexData;\r\n }\r\n\r\n /**\r\n * Get a block by its name\r\n * @param name defines the name of the block to retrieve\r\n * @returns the required block or null if not found\r\n */\r\n public getBlockByName(name: string) {\r\n let result = null;\r\n for (const block of this.attachedBlocks) {\r\n if (block.name === name) {\r\n if (!result) {\r\n result = block;\r\n } else {\r\n Tools.Warn(\"More than one block was found with the name `\" + name + \"`\");\r\n return result;\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Get a block using a predicate\r\n * @param predicate defines the predicate used to find the good candidate\r\n * @returns the required block or null if not found\r\n */\r\n public getBlockByPredicate(predicate: (block: NodeGeometryBlock) => boolean) {\r\n for (const block of this.attachedBlocks) {\r\n if (predicate(block)) {\r\n return block;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets the list of input blocks attached to this material\r\n * @returns an array of InputBlocks\r\n */\r\n public getInputBlocks() {\r\n const blocks: GeometryInputBlock[] = [];\r\n for (const block of this.attachedBlocks) {\r\n if (block.isInput) {\r\n blocks.push(block as GeometryInputBlock);\r\n }\r\n }\r\n\r\n return blocks;\r\n }\r\n\r\n /**\r\n * Launch the node geometry editor\r\n * @param config Define the configuration of the editor\r\n * @returns a promise fulfilled when the node editor is visible\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public async edit(config?: INodeGeometryEditorOptions): Promise<void> {\r\n return await new Promise((resolve) => {\r\n this.BJSNODEGEOMETRYEDITOR = this.BJSNODEGEOMETRYEDITOR || this._getGlobalNodeGeometryEditor();\r\n if (typeof this.BJSNODEGEOMETRYEDITOR == \"undefined\") {\r\n const editorUrl = config && config.editorURL ? config.editorURL : NodeGeometry.EditorURL;\r\n\r\n // Load editor and add it to the DOM\r\n Tools.LoadBabylonScript(editorUrl, () => {\r\n this.BJSNODEGEOMETRYEDITOR = this.BJSNODEGEOMETRYEDITOR || this._getGlobalNodeGeometryEditor();\r\n this._createNodeEditor(config?.nodeGeometryEditorConfig);\r\n resolve();\r\n });\r\n } else {\r\n // Otherwise creates the editor\r\n this._createNodeEditor(config?.nodeGeometryEditorConfig);\r\n resolve();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Creates the node editor window.\r\n * @param additionalConfig Additional configuration for the NGE\r\n */\r\n private _createNodeEditor(additionalConfig?: any) {\r\n const nodeEditorConfig: any = {\r\n nodeGeometry: this,\r\n ...additionalConfig,\r\n };\r\n this.BJSNODEGEOMETRYEDITOR.NodeGeometryEditor.Show(nodeEditorConfig);\r\n }\r\n\r\n /**\r\n * Build the final geometry. Please note that the geometry MAY not be ready until the onBuildObservable is raised.\r\n * @param verbose defines if the build should log activity\r\n * @param updateBuildId defines if the internal build Id should be updated (default is true)\r\n * @param autoConfigure defines if the autoConfigure method should be called when initializing blocks (default is false)\r\n */\r\n public build(verbose: boolean = false, updateBuildId = true, autoConfigure = false) {\r\n this._buildWasSuccessful = false;\r\n\r\n if (!this.outputBlock) {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"You must define the outputBlock property before building the geometry\";\r\n }\r\n const now = PrecisionDate.Now;\r\n // Initialize blocks\r\n this._initializeBlock(this.outputBlock, autoConfigure);\r\n\r\n // Check async states\r\n const promises: Promise<void>[] = [];\r\n for (const block of this.attachedBlocks) {\r\n if (block._isReadyState) {\r\n promises.push(block._isReadyState);\r\n }\r\n }\r\n\r\n if (promises.length) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises, github/no-then\r\n Promise.all(promises).then(() => {\r\n this.build(verbose, updateBuildId, autoConfigure);\r\n });\r\n return;\r\n }\r\n\r\n // Build\r\n const state = new NodeGeometryBuildState();\r\n\r\n state.buildId = this._buildId;\r\n state.verbose = verbose;\r\n\r\n try {\r\n this.outputBlock.build(state);\r\n } finally {\r\n if (updateBuildId) {\r\n this._buildId = NodeGeometry._BuildIdGenerator++;\r\n }\r\n }\r\n\r\n this._buildExecutionTime = PrecisionDate.Now - now;\r\n\r\n // Errors\r\n state.emitErrors();\r\n\r\n this._buildWasSuccessful = true;\r\n this._vertexData = state.vertexData;\r\n this.onBuildObservable.notifyObservers(this);\r\n }\r\n\r\n /**\r\n * Creates a mesh from the geometry blocks\r\n * @param name defines the name of the mesh\r\n * @param scene The scene the mesh is scoped to\r\n * @returns The new mesh\r\n */\r\n public createMesh(name: string, scene: Nullable<Scene> = null): Nullable<Mesh> {\r\n if (!this._buildWasSuccessful) {\r\n this.build();\r\n }\r\n\r\n if (!this._vertexData) {\r\n return null;\r\n }\r\n\r\n const mesh = new Mesh(name, scene);\r\n this._vertexData.applyToMesh(mesh);\r\n\r\n mesh._internalMetadata = mesh._internalMetadata || {};\r\n mesh._internalMetadata.nodeGeometry = this;\r\n\r\n return mesh;\r\n }\r\n\r\n /**\r\n * Creates a mesh from the geometry blocks\r\n * @param mesh the mesh to update\r\n * @returns True if successfully updated\r\n */\r\n public updateMesh(mesh: Mesh) {\r\n if (!this._buildWasSuccessful) {\r\n this.build();\r\n }\r\n\r\n if (!this._vertexData) {\r\n return false;\r\n }\r\n\r\n this._vertexData.applyToMesh(mesh);\r\n\r\n mesh._internalMetadata = mesh._internalMetadata || {};\r\n mesh._internalMetadata.nodeGeometry = this;\r\n\r\n return mesh;\r\n }\r\n\r\n private _initializeBlock(node: NodeGeometryBlock, autoConfigure = true) {\r\n node.initialize();\r\n if (autoConfigure) {\r\n node.autoConfigure(this);\r\n }\r\n node._preparationId = this._buildId;\r\n\r\n if (this.attachedBlocks.indexOf(node) === -1) {\r\n this.attachedBlocks.push(node);\r\n }\r\n\r\n for (const input of node.inputs) {\r\n const connectedPoint = input.connectedPoint;\r\n if (connectedPoint) {\r\n const block = connectedPoint.ownerBlock;\r\n if (block !== node) {\r\n this._initializeBlock(block, autoConfigure);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current geometry\r\n */\r\n public clear() {\r\n this.outputBlock = null;\r\n this.attachedBlocks.length = 0;\r\n }\r\n\r\n /**\r\n * Remove a block from the current geometry\r\n * @param block defines the block to remove\r\n */\r\n public removeBlock(block: NodeGeometryBlock) {\r\n const attachedBlockIndex = this.attachedBlocks.indexOf(block);\r\n if (attachedBlockIndex > -1) {\r\n this.attachedBlocks.splice(attachedBlockIndex, 1);\r\n }\r\n\r\n if (block === this.outputBlock) {\r\n this.outputBlock = null;\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current graph and load a new one from a serialization object\r\n * @param source defines the JSON representation of the geometry\r\n * @param merge defines whether or not the source must be merged or replace the current content\r\n */\r\n public parseSerializedObject(source: any, merge = false) {\r\n if (!merge) {\r\n this.clear();\r\n }\r\n\r\n const map: { [key: number]: NodeGeometryBlock } = {};\r\n\r\n // Create blocks\r\n for (const parsedBlock of source.blocks) {\r\n const blockType = GetClass(parsedBlock.customType);\r\n if (blockType) {\r\n const block: NodeGeometryBlock = new blockType();\r\n block._deserialize(parsedBlock);\r\n map[parsedBlock.id] = block;\r\n\r\n this.attachedBlocks.push(block);\r\n }\r\n }\r\n\r\n // Reconnect teleportation\r\n for (const block of this.attachedBlocks) {\r\n if (block.isTeleportOut) {\r\n const teleportOut = block as TeleportOutBlock;\r\n const id = teleportOut._tempEntryPointUniqueId;\r\n if (id) {\r\n const source = map[id] as TeleportInBlock;\r\n if (source) {\r\n source.attachToEndpoint(teleportOut);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Connections - Starts with input blocks only (except if in \"merge\" mode where we scan all blocks)\r\n for (let blockIndex = 0; blockIndex < source.blocks.length; blockIndex++) {\r\n const parsedBlock = source.blocks[blockIndex];\r\n const block = map[parsedBlock.id];\r\n\r\n if (!block) {\r\n continue;\r\n }\r\n\r\n if (block.inputs.length && parsedBlock.inputs.some((i: any) => i.targetConnectionName) && !merge) {\r\n continue;\r\n }\r\n this._restoreConnections(block, source, map);\r\n }\r\n\r\n // Outputs\r\n if (source.outputNodeId) {\r\n this.outputBlock = map[source.outputNodeId] as GeometryOutputBlock;\r\n }\r\n\r\n // UI related info\r\n if (source.locations || (source.editorData && source.editorData.locations)) {\r\n const locations: {\r\n blockId: number;\r\n x: number;\r\n y: number;\r\n isCollapsed: boolean;\r\n }[] = source.locations || source.editorData.locations;\r\n\r\n for (const location of locations) {\r\n if (map[location.blockId]) {\r\n location.blockId = map[location.blockId].uniqueId;\r\n }\r\n }\r\n\r\n if (merge && this.editorData && this.editorData.locations) {\r\n locations.concat(this.editorData.locations);\r\n }\r\n\r\n if (source.locations) {\r\n this.editorData = {\r\n locations: locations,\r\n };\r\n } else {\r\n this.editorData = source.editorData;\r\n this.editorData.locations = locations;\r\n }\r\n\r\n const blockMap: number[] = [];\r\n\r\n for (const key in map) {\r\n blockMap[key] = map[key].uniqueId;\r\n }\r\n\r\n this.editorData.map = blockMap;\r\n }\r\n\r\n this.comment = source.comment;\r\n }\r\n\r\n private _restoreConnections(block: NodeGeometryBlock, source: any, map: { [key: number]: NodeGeometryBlock }) {\r\n for (const outputPoint of block.outputs) {\r\n for (const candidate of source.blocks) {\r\n const target = map[candidate.id];\r\n\r\n if (!target) {\r\n continue;\r\n }\r\n\r\n for (const input of candidate.inputs) {\r\n if (map[input.targetBlockId] === block && input.targetConnectionName === outputPoint.name) {\r\n const inputPoint = target.getInputByName(input.inputName);\r\n if (!inputPoint || inputPoint.isConnected) {\r\n continue;\r\n }\r\n\r\n outputPoint.connectTo(inputPoint, true);\r\n this._restoreConnections(target, source, map);\r\n continue;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Generate a string containing the code declaration required to create an equivalent of this geometry\r\n * @returns a string\r\n */\r\n public generateCode() {\r\n let alreadyDumped: NodeGeometryBlock[] = [];\r\n const blocks: NodeGeometryBlock[] = [];\r\n const uniqueNames: string[] = [\"const\", \"var\", \"let\"];\r\n // Gets active blocks\r\n if (this.outputBlock) {\r\n this._gatherBlocks(this.outputBlock, blocks);\r\n }\r\n\r\n // Generate\r\n let codeString = `let nodeGeometry = new BABYLON.NodeGeometry(\"${this.name || \"node geometry\"}\");\\n`;\r\n for (const node of blocks) {\r\n if (node.isInput && alreadyDumped.indexOf(node) === -1) {\r\n codeString += node._dumpCode(uniqueNames, alreadyDumped);\r\n }\r\n }\r\n\r\n if (this.outputBlock) {\r\n // Connections\r\n alreadyDumped = [];\r\n codeString += \"// Connections\\n\";\r\n codeString += this.outputBlock._dumpCodeForOutputConnections(alreadyDumped);\r\n\r\n // Output nodes\r\n codeString += \"// Output nodes\\n\";\r\n codeString += `nodeGeometry.outputBlock = ${this.outputBlock._codeVariableName};\\n`;\r\n codeString += `nodeGeometry.build();\\n`;\r\n }\r\n\r\n return codeString;\r\n }\r\n\r\n private _gatherBlocks(rootNode: NodeGeometryBlock, list: NodeGeometryBlock[]) {\r\n if (list.indexOf(rootNode) !== -1) {\r\n return;\r\n }\r\n list.push(rootNode);\r\n\r\n for (const input of rootNode.inputs) {\r\n const connectedPoint = input.connectedPoint;\r\n if (connectedPoint) {\r\n const block = connectedPoint.ownerBlock;\r\n if (block !== rootNode) {\r\n this._gatherBlocks(block, list);\r\n }\r\n }\r\n }\r\n\r\n // Teleportation\r\n if (rootNode.isTeleportOut) {\r\n const block = rootNode as TeleportOutBlock;\r\n if (block.entryPoint) {\r\n this._gatherBlocks(block.entryPoint, list);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current geometry and set it to a default state\r\n */\r\n public setToDefault() {\r\n this.clear();\r\n\r\n this.editorData = null;\r\n\r\n // Source\r\n const dataBlock = new BoxBlock(\"Box\");\r\n dataBlock.autoConfigure();\r\n\r\n // Final output\r\n const output = new GeometryOutputBlock(\"Geometry Output\");\r\n dataBlock.geometry.connectTo(output.geometry);\r\n\r\n this.outputBlock = output;\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current geometry.\r\n * @param name defines the name to use for the new geometry\r\n * @returns the new geometry\r\n */\r\n public clone(name: string): NodeGeometry {\r\n const serializationObject = this.serialize();\r\n\r\n const clone = SerializationHelper.Clone(() => new NodeGeometry(name), this);\r\n clone.name = name;\r\n\r\n clone.parseSerializedObject(serializationObject);\r\n clone._buildId = this._buildId;\r\n clone.build(false);\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Serializes this geometry in a JSON representation\r\n * @param selectedBlocks defines the list of blocks to save (if null the whole geometry will be saved)\r\n * @returns the serialized geometry object\r\n */\r\n public serialize(selectedBlocks?: NodeGeometryBlock[]): any {\r\n const serializationObject = selectedBlocks ? {} : SerializationHelper.Serialize(this);\r\n serializationObject.editorData = JSON.parse(JSON.stringify(this.editorData)); // Copy\r\n\r\n let blocks: NodeGeometryBlock[] = [];\r\n\r\n if (selectedBlocks) {\r\n blocks = selectedBlocks;\r\n } else {\r\n serializationObject.customType = \"BABYLON.NodeGeometry\";\r\n if (this.outputBlock) {\r\n serializationObject.outputNodeId = this.outputBlock.uniqueId;\r\n }\r\n }\r\n\r\n // Blocks\r\n serializationObject.blocks = [];\r\n\r\n for (const block of blocks) {\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n\r\n if (!selectedBlocks) {\r\n for (const block of this.attachedBlocks) {\r\n if (blocks.indexOf(block) !== -1) {\r\n continue;\r\n }\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Disposes the resources\r\n */\r\n public dispose(): void {\r\n for (const block of this.attachedBlocks) {\r\n block.dispose();\r\n }\r\n\r\n this.attachedBlocks.length = 0;\r\n this.onBuildObservable.clear();\r\n }\r\n\r\n /**\r\n * Creates a new node geometry set to default basic configuration\r\n * @param name defines the name of the geometry\r\n * @returns a new NodeGeometry\r\n */\r\n public static CreateDefault(name: string) {\r\n const nodeGeometry = new NodeGeometry(name);\r\n\r\n nodeGeometry.setToDefault();\r\n nodeGeometry.build();\r\n\r\n return nodeGeometry;\r\n }\r\n\r\n /**\r\n * Creates a node geometry from parsed geometry data\r\n * @param source defines the JSON representation of the geometry\r\n * @returns a new node geometry\r\n */\r\n public static Parse(source: any): NodeGeometry {\r\n const nodeGeometry = SerializationHelper.Parse(() => new NodeGeometry(source.name), source, null);\r\n\r\n nodeGeometry.parseSerializedObject(source);\r\n nodeGeometry.build();\r\n\r\n return nodeGeometry;\r\n }\r\n\r\n /**\r\n * Creates a node geometry from a snippet saved by the node geometry editor\r\n * @param snippetId defines the snippet to load\r\n * @param nodeGeometry defines a node geometry to update (instead of creating a new one)\r\n * @param skipBuild defines whether to build the node geometry\r\n * @returns a promise that will resolve to the new node geometry\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public static ParseFromSnippetAsync(snippetId: string, nodeGeometry?: NodeGeometry, skipBuild: boolean = false): Promise<NodeGeometry> {\r\n if (snippetId === \"_BLANK\") {\r\n return Promise.resolve(NodeGeometry.CreateDefault(\"blank\"));\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n const serializationObject = JSON.parse(snippet.nodeGeometry);\r\n\r\n if (!nodeGeometry) {\r\n nodeGeometry = SerializationHelper.Parse(() => new NodeGeometry(snippetId), serializationObject, null);\r\n }\r\n\r\n nodeGeometry.parseSerializedObject(serializationObject);\r\n nodeGeometry.snippetId = snippetId;\r\n\r\n try {\r\n if (!skipBuild) {\r\n nodeGeometry.build();\r\n }\r\n resolve(nodeGeometry);\r\n } catch (err) {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(err);\r\n }\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the snippet \" + snippetId);\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", this.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\r\n request.send();\r\n });\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"nodeGeometry.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Node/nodeGeometry.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGzD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAqB7D;;;GAGG;AACH,MAAM,OAAO,YAAY;IAgBrB,mDAAmD;IAC3C,4BAA4B;QAChC,0DAA0D;QAC1D,IAAI,OAAO,kBAAkB,KAAK,WAAW,EAAE,CAAC;YAC5C,OAAO,kBAAkB,CAAC;QAC9B,CAAC;QAED,gFAAgF;QAChF,IAAI,OAAO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AAC;wBAED,YAAY,CAAC,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;wBACxD,YAAY,CAAC,SAAS,GAAG,SAAS,CAAC;wBAEnC,IAAI,CAAC;4BACD,IAAI,CAAC,SAAS,EAAE,CAAC;gCACb,YAAY,CAAC,KAAK,EAAE,CAAC;4BACzB,CAAC;4BACD,OAAO,CAAC,YAAY,CAAC,CAAC;wBAC1B,CAAC;wBAAC,OAAO,GAAG,EAAE,CAAC;4BACX,2EAA2E;4BAC3E,MAAM,CAAC,GAAG,CAAC,CAAC;wBAChB,CAAC;oBACL,CAAC;yBAAM,CAAC;wBACJ,2EAA2E;wBAC3E,MAAM,CAAC,6BAA6B,GAAG,SAAS,CAAC,CAAC;oBACtD,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,GAAG,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;YAC1E,OAAO,CAAC,IAAI,EAAE,CAAC;QACnB,CAAC,CAAC,CAAC;IACP,CAAC;;AAzqBc,8BAAiB,GAAW,CAAC,AAAZ,CAAa;AAM7C,gDAAgD;AAClC,sBAAS,GAAG,GAAG,KAAK,CAAC,cAAc,KAAK,cAAc,CAAC,OAAO,mDAAmD,AAAxG,CAAyG;AAEhI,sCAAsC;AACxB,uBAAU,GAAG,SAAS,CAAC,UAAU,AAAvB,CAAwB;AAuDzC;IADN,SAAS,EAAE;0CACQ;AAMb;IADN,SAAS,CAAC,SAAS,CAAC;6CACE","sourcesContent":["import { Observable } from \"../../Misc/observable\";\r\nimport type { Nullable } from \"../../types\";\r\nimport { Mesh } from \"../mesh\";\r\nimport type { VertexData } from \"../mesh.vertexData\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { GeometryOutputBlock } from \"./Blocks/geometryOutputBlock\";\r\nimport type { NodeGeometryBlock } from \"./nodeGeometryBlock\";\r\nimport { NodeGeometryBuildState } from \"./nodeGeometryBuildState\";\r\nimport { GetClass } from \"../../Misc/typeStore\";\r\nimport { serialize } from \"../../Misc/decorators\";\r\nimport { SerializationHelper } from \"../../Misc/decorators.serialization\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport { WebRequest } from \"../../Misc/webRequest\";\r\nimport { BoxBlock } from \"./Blocks/Sources/boxBlock\";\r\nimport type { GeometryInputBlock } from \"./Blocks/geometryInputBlock\";\r\nimport { PrecisionDate } from \"../../Misc/precisionDate\";\r\nimport type { TeleportOutBlock } from \"./Blocks/Teleport/teleportOutBlock\";\r\nimport type { TeleportInBlock } from \"./Blocks/Teleport/teleportInBlock\";\r\nimport { Tools } from \"../../Misc/tools\";\r\nimport type { Color4 } from \"../../Maths/math.color\";\r\nimport { AbstractEngine } from \"core/Engines/abstractEngine\";\r\n\r\n// declare NODEGEOMETRYEDITOR namespace for compilation issue\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\ndeclare let NODEGEOMETRYEDITOR: any;\r\ndeclare let BABYLON: any;\r\n\r\n/**\r\n * Interface used to configure the node geometry editor\r\n */\r\nexport interface INodeGeometryEditorOptions {\r\n /** Define the URL to load node editor script from */\r\n editorURL?: string;\r\n /** Additional configuration for the NGE */\r\n nodeGeometryEditorConfig?: {\r\n backgroundColor?: Color4;\r\n hostScene?: Scene;\r\n hostMesh?: Mesh;\r\n };\r\n}\r\n\r\n/**\r\n * Defines a node based geometry\r\n * @see demo at https://playground.babylonjs.com#PYY6XE#69\r\n */\r\nexport class NodeGeometry {\r\n private static _BuildIdGenerator: number = 0;\r\n private _buildId: number = NodeGeometry._BuildIdGenerator++;\r\n private _buildWasSuccessful = false;\r\n private _vertexData: Nullable<VertexData> = null;\r\n private _buildExecutionTime: number = 0;\r\n\r\n /** Define the Url to load node editor script */\r\n public static EditorURL = `${Tools._DefaultCdnUrl}/v${AbstractEngine.Version}/nodeGeometryEditor/babylon.nodeGeometryEditor.js`;\r\n\r\n /** Define the Url to load snippets */\r\n public static SnippetUrl = Constants.SnippetUrl;\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private BJSNODEGEOMETRYEDITOR = this._getGlobalNodeGeometryEditor();\r\n\r\n /** @returns the inspector from bundle or global */\r\n private _getGlobalNodeGeometryEditor(): any {\r\n // UMD Global name detection from Webpack Bundle UMD Name.\r\n if (typeof NODEGEOMETRYEDITOR !== \"undefined\") {\r\n return NODEGEOMETRYEDITOR;\r\n }\r\n\r\n // In case of module let's check the global emitted from the editor entry point.\r\n if (typeof BABYLON !== \"undefined\" && typeof BABYLON.NodeGeometryEditor !== \"undefined\") {\r\n return BABYLON;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Gets the time spent to build this block (in ms)\r\n */\r\n public get buildExecutionTime() {\r\n return this._buildExecutionTime;\r\n }\r\n\r\n /**\r\n * Gets or sets data used by visual editor\r\n * @see https://nge.babylonjs.com\r\n */\r\n public editorData: any = null;\r\n\r\n /**\r\n * Gets an array of blocks that needs to be serialized even if they are not yet connected\r\n */\r\n public attachedBlocks: NodeGeometryBlock[] = [];\r\n\r\n /**\r\n * Observable raised when the geometry is built\r\n */\r\n public onBuildObservable = new Observable<NodeGeometry>();\r\n\r\n /** Gets or sets the GeometryOutputBlock used to gather the final geometry data */\r\n public outputBlock: Nullable<GeometryOutputBlock> = null;\r\n\r\n /**\r\n * Snippet ID if the material was created from the snippet server\r\n */\r\n public snippetId: string;\r\n\r\n /**\r\n * The name of the geometry\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * A free comment about the geometry\r\n */\r\n @serialize(\"comment\")\r\n public comment: string;\r\n\r\n /**\r\n * Creates a new geometry\r\n * @param name defines the name of the geometry\r\n */\r\n public constructor(name: string) {\r\n this.name = name;\r\n }\r\n\r\n /**\r\n * Gets the current class name of the geometry e.g. \"NodeGeometry\"\r\n * @returns the class name\r\n */\r\n public getClassName(): string {\r\n return \"NodeGeometry\";\r\n }\r\n\r\n /**\r\n * Gets the vertex data. This needs to be done after build() was called.\r\n * This is used to access vertexData when creating a mesh is not required.\r\n */\r\n public get vertexData() {\r\n return this._vertexData;\r\n }\r\n\r\n /**\r\n * Get a block by its name\r\n * @param name defines the name of the block to retrieve\r\n * @returns the required block or null if not found\r\n */\r\n public getBlockByName(name: string) {\r\n let result = null;\r\n for (const block of this.attachedBlocks) {\r\n if (block.name === name) {\r\n if (!result) {\r\n result = block;\r\n } else {\r\n Tools.Warn(\"More than one block was found with the name `\" + name + \"`\");\r\n return result;\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Get a block using a predicate\r\n * @param predicate defines the predicate used to find the good candidate\r\n * @returns the required block or null if not found\r\n */\r\n public getBlockByPredicate(predicate: (block: NodeGeometryBlock) => boolean) {\r\n for (const block of this.attachedBlocks) {\r\n if (predicate(block)) {\r\n return block;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets the list of input blocks attached to this material\r\n * @returns an array of InputBlocks\r\n */\r\n public getInputBlocks() {\r\n const blocks: GeometryInputBlock[] = [];\r\n for (const block of this.attachedBlocks) {\r\n if (block.isInput) {\r\n blocks.push(block as GeometryInputBlock);\r\n }\r\n }\r\n\r\n return blocks;\r\n }\r\n\r\n /**\r\n * Launch the node geometry editor\r\n * @param config Define the configuration of the editor\r\n * @returns a promise fulfilled when the node editor is visible\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public async edit(config?: INodeGeometryEditorOptions): Promise<void> {\r\n return await new Promise((resolve) => {\r\n this.BJSNODEGEOMETRYEDITOR = this.BJSNODEGEOMETRYEDITOR || this._getGlobalNodeGeometryEditor();\r\n if (typeof this.BJSNODEGEOMETRYEDITOR == \"undefined\") {\r\n const editorUrl = config && config.editorURL ? config.editorURL : NodeGeometry.EditorURL;\r\n\r\n // Load editor and add it to the DOM\r\n Tools.LoadBabylonScript(editorUrl, () => {\r\n this.BJSNODEGEOMETRYEDITOR = this.BJSNODEGEOMETRYEDITOR || this._getGlobalNodeGeometryEditor();\r\n this._createNodeEditor(config?.nodeGeometryEditorConfig);\r\n resolve();\r\n });\r\n } else {\r\n // Otherwise creates the editor\r\n this._createNodeEditor(config?.nodeGeometryEditorConfig);\r\n resolve();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Creates the node editor window.\r\n * @param additionalConfig Additional configuration for the NGE\r\n */\r\n private _createNodeEditor(additionalConfig?: any) {\r\n const nodeEditorConfig: any = {\r\n nodeGeometry: this,\r\n ...additionalConfig,\r\n };\r\n this.BJSNODEGEOMETRYEDITOR.NodeGeometryEditor.Show(nodeEditorConfig);\r\n }\r\n\r\n /**\r\n * Build the final geometry. Please note that the geometry MAY not be ready until the onBuildObservable is raised.\r\n * @param verbose defines if the build should log activity\r\n * @param updateBuildId defines if the internal build Id should be updated (default is true)\r\n * @param autoConfigure defines if the autoConfigure method should be called when initializing blocks (default is false)\r\n */\r\n public build(verbose: boolean = false, updateBuildId = true, autoConfigure = false) {\r\n this._buildWasSuccessful = false;\r\n\r\n if (!this.outputBlock) {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"You must define the outputBlock property before building the geometry\";\r\n }\r\n const now = PrecisionDate.Now;\r\n // Initialize blocks\r\n this._initializeBlock(this.outputBlock, autoConfigure);\r\n\r\n // Check async states\r\n const promises: Promise<void>[] = [];\r\n for (const block of this.attachedBlocks) {\r\n if (block._isReadyState) {\r\n promises.push(block._isReadyState);\r\n }\r\n }\r\n\r\n if (promises.length) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises, github/no-then\r\n Promise.all(promises).then(() => {\r\n this.build(verbose, updateBuildId, autoConfigure);\r\n });\r\n return;\r\n }\r\n\r\n // Build\r\n const state = new NodeGeometryBuildState();\r\n\r\n state.buildId = this._buildId;\r\n state.verbose = verbose;\r\n\r\n try {\r\n this.outputBlock.build(state);\r\n } finally {\r\n if (updateBuildId) {\r\n this._buildId = NodeGeometry._BuildIdGenerator++;\r\n }\r\n }\r\n\r\n this._buildExecutionTime = PrecisionDate.Now - now;\r\n\r\n // Errors\r\n state.emitErrors();\r\n\r\n this._buildWasSuccessful = true;\r\n this._vertexData = state.vertexData;\r\n this.onBuildObservable.notifyObservers(this);\r\n }\r\n\r\n /**\r\n * Creates a mesh from the geometry blocks\r\n * @param name defines the name of the mesh\r\n * @param scene The scene the mesh is scoped to\r\n * @returns The new mesh\r\n */\r\n public createMesh(name: string, scene: Nullable<Scene> = null): Nullable<Mesh> {\r\n if (!this._buildWasSuccessful) {\r\n this.build();\r\n }\r\n\r\n if (!this._vertexData) {\r\n return null;\r\n }\r\n\r\n const mesh = new Mesh(name, scene);\r\n this._vertexData.applyToMesh(mesh);\r\n\r\n mesh._internalMetadata = mesh._internalMetadata || {};\r\n mesh._internalMetadata.nodeGeometry = this;\r\n\r\n return mesh;\r\n }\r\n\r\n /**\r\n * Creates a mesh from the geometry blocks\r\n * @param mesh the mesh to update\r\n * @returns True if successfully updated\r\n */\r\n public updateMesh(mesh: Mesh) {\r\n if (!this._buildWasSuccessful) {\r\n this.build();\r\n }\r\n\r\n if (!this._vertexData) {\r\n return false;\r\n }\r\n\r\n this._vertexData.applyToMesh(mesh);\r\n\r\n mesh._internalMetadata = mesh._internalMetadata || {};\r\n mesh._internalMetadata.nodeGeometry = this;\r\n\r\n return mesh;\r\n }\r\n\r\n private _initializeBlock(node: NodeGeometryBlock, autoConfigure = true) {\r\n node.initialize();\r\n if (autoConfigure) {\r\n node.autoConfigure(this);\r\n }\r\n node._preparationId = this._buildId;\r\n\r\n if (this.attachedBlocks.indexOf(node) === -1) {\r\n this.attachedBlocks.push(node);\r\n }\r\n\r\n for (const input of node.inputs) {\r\n const connectedPoint = input.connectedPoint;\r\n if (connectedPoint) {\r\n const block = connectedPoint.ownerBlock;\r\n if (block !== node) {\r\n this._initializeBlock(block, autoConfigure);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current geometry\r\n */\r\n public clear() {\r\n this.outputBlock = null;\r\n this.attachedBlocks.length = 0;\r\n }\r\n\r\n /**\r\n * Remove a block from the current geometry\r\n * @param block defines the block to remove\r\n */\r\n public removeBlock(block: NodeGeometryBlock) {\r\n const attachedBlockIndex = this.attachedBlocks.indexOf(block);\r\n if (attachedBlockIndex > -1) {\r\n this.attachedBlocks.splice(attachedBlockIndex, 1);\r\n }\r\n\r\n if (block === this.outputBlock) {\r\n this.outputBlock = null;\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current graph and load a new one from a serialization object\r\n * @param source defines the JSON representation of the geometry\r\n * @param merge defines whether or not the source must be merged or replace the current content\r\n */\r\n public parseSerializedObject(source: any, merge = false) {\r\n if (!merge) {\r\n this.clear();\r\n }\r\n\r\n const map: { [key: number]: NodeGeometryBlock } = {};\r\n\r\n // Create blocks\r\n for (const parsedBlock of source.blocks) {\r\n const blockType = GetClass(parsedBlock.customType);\r\n if (blockType) {\r\n const block: NodeGeometryBlock = new blockType();\r\n block._deserialize(parsedBlock);\r\n map[parsedBlock.id] = block;\r\n\r\n this.attachedBlocks.push(block);\r\n }\r\n }\r\n\r\n // Reconnect teleportation\r\n for (const block of this.attachedBlocks) {\r\n if (block.isTeleportOut) {\r\n const teleportOut = block as TeleportOutBlock;\r\n const id = teleportOut._tempEntryPointUniqueId;\r\n if (id) {\r\n const source = map[id] as TeleportInBlock;\r\n if (source) {\r\n source.attachToEndpoint(teleportOut);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Connections - Starts with input blocks only (except if in \"merge\" mode where we scan all blocks)\r\n for (let blockIndex = 0; blockIndex < source.blocks.length; blockIndex++) {\r\n const parsedBlock = source.blocks[blockIndex];\r\n const block = map[parsedBlock.id];\r\n\r\n if (!block) {\r\n continue;\r\n }\r\n\r\n if (block.inputs.length && parsedBlock.inputs.some((i: any) => i.targetConnectionName) && !merge) {\r\n continue;\r\n }\r\n this._restoreConnections(block, source, map);\r\n }\r\n\r\n // Outputs\r\n if (source.outputNodeId) {\r\n this.outputBlock = map[source.outputNodeId] as GeometryOutputBlock;\r\n }\r\n\r\n // UI related info\r\n if (source.locations || (source.editorData && source.editorData.locations)) {\r\n const locations: {\r\n blockId: number;\r\n x: number;\r\n y: number;\r\n isCollapsed: boolean;\r\n }[] = source.locations || source.editorData.locations;\r\n\r\n for (const location of locations) {\r\n if (map[location.blockId]) {\r\n location.blockId = map[location.blockId].uniqueId;\r\n }\r\n }\r\n\r\n if (merge && this.editorData && this.editorData.locations) {\r\n locations.concat(this.editorData.locations);\r\n }\r\n\r\n if (source.locations) {\r\n this.editorData = {\r\n locations: locations,\r\n };\r\n } else {\r\n this.editorData = source.editorData;\r\n this.editorData.locations = locations;\r\n }\r\n\r\n const blockMap: { [key: number]: number } = {};\r\n\r\n for (const key in map) {\r\n blockMap[key] = map[key].uniqueId;\r\n }\r\n\r\n this.editorData.map = blockMap;\r\n }\r\n\r\n this.comment = source.comment;\r\n }\r\n\r\n private _restoreConnections(block: NodeGeometryBlock, source: any, map: { [key: number]: NodeGeometryBlock }) {\r\n for (const outputPoint of block.outputs) {\r\n for (const candidate of source.blocks) {\r\n const target = map[candidate.id];\r\n\r\n if (!target) {\r\n continue;\r\n }\r\n\r\n for (const input of candidate.inputs) {\r\n if (map[input.targetBlockId] === block && input.targetConnectionName === outputPoint.name) {\r\n const inputPoint = target.getInputByName(input.inputName);\r\n if (!inputPoint || inputPoint.isConnected) {\r\n continue;\r\n }\r\n\r\n outputPoint.connectTo(inputPoint, true);\r\n this._restoreConnections(target, source, map);\r\n continue;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Generate a string containing the code declaration required to create an equivalent of this geometry\r\n * @returns a string\r\n */\r\n public generateCode() {\r\n let alreadyDumped: NodeGeometryBlock[] = [];\r\n const blocks: NodeGeometryBlock[] = [];\r\n const uniqueNames: string[] = [\"const\", \"var\", \"let\"];\r\n // Gets active blocks\r\n if (this.outputBlock) {\r\n this._gatherBlocks(this.outputBlock, blocks);\r\n }\r\n\r\n // Generate\r\n let codeString = `let nodeGeometry = new BABYLON.NodeGeometry(\"${this.name || \"node geometry\"}\");\\n`;\r\n for (const node of blocks) {\r\n if (node.isInput && alreadyDumped.indexOf(node) === -1) {\r\n codeString += node._dumpCode(uniqueNames, alreadyDumped);\r\n }\r\n }\r\n\r\n if (this.outputBlock) {\r\n // Connections\r\n alreadyDumped = [];\r\n codeString += \"// Connections\\n\";\r\n codeString += this.outputBlock._dumpCodeForOutputConnections(alreadyDumped);\r\n\r\n // Output nodes\r\n codeString += \"// Output nodes\\n\";\r\n codeString += `nodeGeometry.outputBlock = ${this.outputBlock._codeVariableName};\\n`;\r\n codeString += `nodeGeometry.build();\\n`;\r\n }\r\n\r\n return codeString;\r\n }\r\n\r\n private _gatherBlocks(rootNode: NodeGeometryBlock, list: NodeGeometryBlock[]) {\r\n if (list.indexOf(rootNode) !== -1) {\r\n return;\r\n }\r\n list.push(rootNode);\r\n\r\n for (const input of rootNode.inputs) {\r\n const connectedPoint = input.connectedPoint;\r\n if (connectedPoint) {\r\n const block = connectedPoint.ownerBlock;\r\n if (block !== rootNode) {\r\n this._gatherBlocks(block, list);\r\n }\r\n }\r\n }\r\n\r\n // Teleportation\r\n if (rootNode.isTeleportOut) {\r\n const block = rootNode as TeleportOutBlock;\r\n if (block.entryPoint) {\r\n this._gatherBlocks(block.entryPoint, list);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current geometry and set it to a default state\r\n */\r\n public setToDefault() {\r\n this.clear();\r\n\r\n this.editorData = null;\r\n\r\n // Source\r\n const dataBlock = new BoxBlock(\"Box\");\r\n dataBlock.autoConfigure();\r\n\r\n // Final output\r\n const output = new GeometryOutputBlock(\"Geometry Output\");\r\n dataBlock.geometry.connectTo(output.geometry);\r\n\r\n this.outputBlock = output;\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current geometry.\r\n * @param name defines the name to use for the new geometry\r\n * @returns the new geometry\r\n */\r\n public clone(name: string): NodeGeometry {\r\n const serializationObject = this.serialize();\r\n\r\n const clone = SerializationHelper.Clone(() => new NodeGeometry(name), this);\r\n clone.name = name;\r\n\r\n clone.parseSerializedObject(serializationObject);\r\n clone._buildId = this._buildId;\r\n clone.build(false);\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Serializes this geometry in a JSON representation\r\n * @param selectedBlocks defines the list of blocks to save (if null the whole geometry will be saved)\r\n * @returns the serialized geometry object\r\n */\r\n public serialize(selectedBlocks?: NodeGeometryBlock[]): any {\r\n const serializationObject = selectedBlocks ? {} : SerializationHelper.Serialize(this);\r\n serializationObject.editorData = JSON.parse(JSON.stringify(this.editorData)); // Copy\r\n\r\n let blocks: NodeGeometryBlock[] = [];\r\n\r\n if (selectedBlocks) {\r\n blocks = selectedBlocks;\r\n } else {\r\n serializationObject.customType = \"BABYLON.NodeGeometry\";\r\n if (this.outputBlock) {\r\n serializationObject.outputNodeId = this.outputBlock.uniqueId;\r\n }\r\n }\r\n\r\n // Blocks\r\n serializationObject.blocks = [];\r\n\r\n for (const block of blocks) {\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n\r\n if (!selectedBlocks) {\r\n for (const block of this.attachedBlocks) {\r\n if (blocks.indexOf(block) !== -1) {\r\n continue;\r\n }\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Disposes the resources\r\n */\r\n public dispose(): void {\r\n for (const block of this.attachedBlocks) {\r\n block.dispose();\r\n }\r\n\r\n this.attachedBlocks.length = 0;\r\n this.onBuildObservable.clear();\r\n }\r\n\r\n /**\r\n * Creates a new node geometry set to default basic configuration\r\n * @param name defines the name of the geometry\r\n * @returns a new NodeGeometry\r\n */\r\n public static CreateDefault(name: string) {\r\n const nodeGeometry = new NodeGeometry(name);\r\n\r\n nodeGeometry.setToDefault();\r\n nodeGeometry.build();\r\n\r\n return nodeGeometry;\r\n }\r\n\r\n /**\r\n * Creates a node geometry from parsed geometry data\r\n * @param source defines the JSON representation of the geometry\r\n * @returns a new node geometry\r\n */\r\n public static Parse(source: any): NodeGeometry {\r\n const nodeGeometry = SerializationHelper.Parse(() => new NodeGeometry(source.name), source, null);\r\n\r\n nodeGeometry.parseSerializedObject(source);\r\n nodeGeometry.build();\r\n\r\n return nodeGeometry;\r\n }\r\n\r\n /**\r\n * Creates a node geometry from a snippet saved by the node geometry editor\r\n * @param snippetId defines the snippet to load\r\n * @param nodeGeometry defines a node geometry to update (instead of creating a new one)\r\n * @param skipBuild defines whether to build the node geometry\r\n * @returns a promise that will resolve to the new node geometry\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public static ParseFromSnippetAsync(snippetId: string, nodeGeometry?: NodeGeometry, skipBuild: boolean = false): Promise<NodeGeometry> {\r\n if (snippetId === \"_BLANK\") {\r\n return Promise.resolve(NodeGeometry.CreateDefault(\"blank\"));\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n const serializationObject = JSON.parse(snippet.nodeGeometry);\r\n\r\n if (!nodeGeometry) {\r\n nodeGeometry = SerializationHelper.Parse(() => new NodeGeometry(snippetId), serializationObject, null);\r\n }\r\n\r\n nodeGeometry.parseSerializedObject(serializationObject);\r\n nodeGeometry.snippetId = snippetId;\r\n\r\n try {\r\n if (!skipBuild) {\r\n nodeGeometry.build();\r\n }\r\n resolve(nodeGeometry);\r\n } catch (err) {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(err);\r\n }\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the snippet \" + snippetId);\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", this.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\r\n request.send();\r\n });\r\n }\r\n}\r\n"]}
|
|
@@ -87,7 +87,7 @@ export declare class NodeParticleSystemSet {
|
|
|
87
87
|
*/
|
|
88
88
|
constructor(name: string);
|
|
89
89
|
/**
|
|
90
|
-
* Gets the current class name of the
|
|
90
|
+
* Gets the current class name of the node particle set e.g. "NodeParticleSystemSet"
|
|
91
91
|
* @returns the class name
|
|
92
92
|
*/
|
|
93
93
|
getClassName(): string;
|
|
@@ -115,7 +115,7 @@ export declare class NodeParticleSystemSet {
|
|
|
115
115
|
*/
|
|
116
116
|
buildAsync(scene: Scene, verbose?: boolean): Promise<ParticleSystemSet>;
|
|
117
117
|
/**
|
|
118
|
-
* Clear the current
|
|
118
|
+
* Clear the current node particle set
|
|
119
119
|
*/
|
|
120
120
|
clear(): void;
|
|
121
121
|
/**
|
|
@@ -135,8 +135,8 @@ export declare class NodeParticleSystemSet {
|
|
|
135
135
|
parseSerializedObject(source: any, merge?: boolean): void;
|
|
136
136
|
private _restoreConnections;
|
|
137
137
|
/**
|
|
138
|
-
* Serializes this
|
|
139
|
-
* @param selectedBlocks defines the list of blocks to save (if null the whole
|
|
138
|
+
* Serializes this node particle set in a JSON representation
|
|
139
|
+
* @param selectedBlocks defines the list of blocks to save (if null the whole node particle set will be saved)
|
|
140
140
|
* @returns the serialized particle system set object
|
|
141
141
|
*/
|
|
142
142
|
serialize(selectedBlocks?: NodeParticleBlock[]): any;
|
|
@@ -163,10 +163,18 @@ export declare class NodeParticleSystemSet {
|
|
|
163
163
|
*/
|
|
164
164
|
static Parse(source: any): NodeParticleSystemSet;
|
|
165
165
|
/**
|
|
166
|
-
* Creates a node particle set from a snippet saved
|
|
166
|
+
* Creates a node particle set from a snippet saved in a remote file
|
|
167
|
+
* @param name defines the name of the node particle set to create
|
|
168
|
+
* @param url defines the url to load from
|
|
169
|
+
* @param nodeParticleSet defines a node particle set to update (instead of creating a new one)
|
|
170
|
+
* @returns a promise that will resolve to the new node particle set
|
|
171
|
+
*/
|
|
172
|
+
static ParseFromFileAsync(name: string, url: string, nodeParticleSet?: NodeParticleSystemSet): Promise<NodeParticleSystemSet>;
|
|
173
|
+
/**
|
|
174
|
+
* Creates a node particle set from a snippet saved by the node particle editor
|
|
167
175
|
* @param snippetId defines the snippet to load
|
|
168
176
|
* @param nodeParticleSet defines a node particle set to update (instead of creating a new one)
|
|
169
|
-
* @returns a promise that will resolve to the new node
|
|
177
|
+
* @returns a promise that will resolve to the new node particle set
|
|
170
178
|
*/
|
|
171
179
|
static ParseFromSnippetAsync(snippetId: string, nodeParticleSet?: NodeParticleSystemSet): Promise<NodeParticleSystemSet>;
|
|
172
180
|
}
|
|
@@ -112,7 +112,7 @@ export class NodeParticleSystemSet {
|
|
|
112
112
|
this.name = name;
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
115
|
-
* Gets the current class name of the
|
|
115
|
+
* Gets the current class name of the node particle set e.g. "NodeParticleSystemSet"
|
|
116
116
|
* @returns the class name
|
|
117
117
|
*/
|
|
118
118
|
getClassName() {
|
|
@@ -211,7 +211,7 @@ export class NodeParticleSystemSet {
|
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
213
|
/**
|
|
214
|
-
* Clear the current
|
|
214
|
+
* Clear the current node particle set
|
|
215
215
|
*/
|
|
216
216
|
clear() {
|
|
217
217
|
this.attachedBlocks.length = 0;
|
|
@@ -335,7 +335,7 @@ export class NodeParticleSystemSet {
|
|
|
335
335
|
this.editorData = source.editorData;
|
|
336
336
|
this.editorData.locations = locations;
|
|
337
337
|
}
|
|
338
|
-
const blockMap =
|
|
338
|
+
const blockMap = {};
|
|
339
339
|
for (const key in map) {
|
|
340
340
|
blockMap[key] = map[key].uniqueId;
|
|
341
341
|
}
|
|
@@ -365,8 +365,8 @@ export class NodeParticleSystemSet {
|
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
/**
|
|
368
|
-
* Serializes this
|
|
369
|
-
* @param selectedBlocks defines the list of blocks to save (if null the whole
|
|
368
|
+
* Serializes this node particle set in a JSON representation
|
|
369
|
+
* @param selectedBlocks defines the list of blocks to save (if null the whole node particle set will be saved)
|
|
370
370
|
* @returns the serialized particle system set object
|
|
371
371
|
*/
|
|
372
372
|
serialize(selectedBlocks) {
|
|
@@ -439,10 +439,41 @@ export class NodeParticleSystemSet {
|
|
|
439
439
|
return nodeParticleSet;
|
|
440
440
|
}
|
|
441
441
|
/**
|
|
442
|
-
* Creates a node particle set from a snippet saved
|
|
442
|
+
* Creates a node particle set from a snippet saved in a remote file
|
|
443
|
+
* @param name defines the name of the node particle set to create
|
|
444
|
+
* @param url defines the url to load from
|
|
445
|
+
* @param nodeParticleSet defines a node particle set to update (instead of creating a new one)
|
|
446
|
+
* @returns a promise that will resolve to the new node particle set
|
|
447
|
+
*/
|
|
448
|
+
// eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax
|
|
449
|
+
static ParseFromFileAsync(name, url, nodeParticleSet) {
|
|
450
|
+
return new Promise((resolve, reject) => {
|
|
451
|
+
const request = new WebRequest();
|
|
452
|
+
request.addEventListener("readystatechange", () => {
|
|
453
|
+
if (request.readyState == 4) {
|
|
454
|
+
if (request.status == 200) {
|
|
455
|
+
const serializationObject = JSON.parse(request.responseText);
|
|
456
|
+
if (!nodeParticleSet) {
|
|
457
|
+
nodeParticleSet = SerializationHelper.Parse(() => new NodeParticleSystemSet(name), serializationObject, null);
|
|
458
|
+
}
|
|
459
|
+
nodeParticleSet.parseSerializedObject(serializationObject);
|
|
460
|
+
resolve(nodeParticleSet);
|
|
461
|
+
}
|
|
462
|
+
else {
|
|
463
|
+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
|
|
464
|
+
reject("Unable to load the node particle system set");
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
request.open("GET", url);
|
|
469
|
+
request.send();
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* Creates a node particle set from a snippet saved by the node particle editor
|
|
443
474
|
* @param snippetId defines the snippet to load
|
|
444
475
|
* @param nodeParticleSet defines a node particle set to update (instead of creating a new one)
|
|
445
|
-
* @returns a promise that will resolve to the new node
|
|
476
|
+
* @returns a promise that will resolve to the new node particle set
|
|
446
477
|
*/
|
|
447
478
|
// eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax
|
|
448
479
|
static ParseFromSnippetAsync(snippetId, nodeParticleSet) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeParticleSystemSet.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles/Node/nodeParticleSystemSet.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,iCAA6B;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,+CAA2C;AACzE,OAAO,EAAE,UAAU,EAAE,iCAA6B;AAClD,OAAO,EAAE,QAAQ,EAAE,gCAA4B;AAC/C,OAAO,EAAE,UAAU,EAAE,iCAA6B;AAClD,OAAO,EAAE,SAAS,EAAE,mCAA+B;AACnD,OAAO,EAAE,KAAK,EAAE,4BAAwB;AACxC,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAG5F,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAoB5E;;;;GAIG;AACH,MAAM,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AAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;wBAE7D,IAAI,CAAC,eAAe,EAAE,CAAC;4BACnB,eAAe,GAAG,mBAAmB,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,qBAAqB,CAAC,SAAS,CAAC,EAAE,mBAAmB,EAAE,IAAI,CAAC,CAAC;wBACvH,CAAC;wBAED,eAAe,CAAC,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;wBAC3D,eAAe,CAAC,SAAS,GAAG,SAAS,CAAC;wBAEtC,IAAI,CAAC;4BACD,OAAO,CAAC,eAAe,CAAC,CAAC;wBAC7B,CAAC;wBAAC,OAAO,GAAG,EAAE,CAAC;4BACX,2EAA2E;4BAC3E,MAAM,CAAC,GAAG,CAAC,CAAC;wBAChB,CAAC;oBACL,CAAC;yBAAM,CAAC;wBACJ,2EAA2E;wBAC3E,MAAM,CAAC,6BAA6B,GAAG,SAAS,CAAC,CAAC;oBACtD,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,GAAG,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;YAC1E,OAAO,CAAC,IAAI,EAAE,CAAC;QACnB,CAAC,CAAC,CAAC;IACP,CAAC;;AAnjBD,gDAAgD;AAClC,+BAAS,GAAG,GAAG,KAAK,CAAC,cAAc,KAAK,cAAc,CAAC,OAAO,mDAAmD,AAAxG,CAAyG;AAEhI,sCAAsC;AACxB,gCAAU,GAAG,SAAS,CAAC,UAAU,AAAvB,CAAwB;AA2BzC;IADN,SAAS,EAAE;mDACQ;AAMb;IADN,SAAS,CAAC,SAAS,CAAC;sDACE","sourcesContent":["import { serialize } from \"core/Misc/decorators\";\r\nimport { ParticleSystemSet } from \"../particleSystemSet\";\r\nimport { SystemBlock } from \"./Blocks/systemBlock\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { NodeParticleBuildState } from \"./nodeParticleBuildState\";\r\nimport type { NodeParticleBlock } from \"./nodeParticleBlock\";\r\nimport { SerializationHelper } from \"core/Misc/decorators.serialization\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { GetClass } from \"core/Misc/typeStore\";\r\nimport { WebRequest } from \"core/Misc/webRequest\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport { AbstractEngine } from \"core/Engines/abstractEngine\";\r\nimport { ParticleInputBlock } from \"./Blocks/particleInputBlock\";\r\nimport { ParticleTextureSourceBlock } from \"./Blocks/particleSourceTextureBlock\";\r\nimport { NodeParticleContextualSources } from \"./Enums/nodeParticleContextualSources\";\r\nimport { UpdatePositionBlock } from \"./Blocks/Update/updatePositionBlock\";\r\nimport { ParticleMathBlock, ParticleMathBlockOperations } from \"./Blocks/particleMathBlock\";\r\nimport type { ParticleTeleportOutBlock } from \"./Blocks/Teleport/particleTeleportOutBlock\";\r\nimport type { ParticleTeleportInBlock } from \"./Blocks/Teleport/particleTeleportInBlock\";\r\nimport { BoxShapeBlock } from \"./Blocks/Emitters/boxShapeBlock\";\r\nimport { CreateParticleBlock } from \"./Blocks/Emitters/createParticleBlock\";\r\nimport type { Color4 } from \"core/Maths/math.color\";\r\nimport type { Nullable } from \"../../types\";\r\n\r\n// declare NODEPARTICLEEDITOR namespace for compilation issue\r\ndeclare let NODEPARTICLEEDITOR: any;\r\ndeclare let BABYLON: any;\r\n\r\n/**\r\n * Interface used to configure the node particle editor\r\n */\r\nexport interface INodeParticleEditorOptions {\r\n /** Define the URL to load node editor script from */\r\n editorURL?: string;\r\n /** Additional configuration for the NPE */\r\n nodeEditorConfig?: {\r\n backgroundColor?: Color4;\r\n };\r\n}\r\n\r\n/**\r\n * Defines a set of particle systems defined as a node graph.\r\n * NPE: #K6F1ZB#1\r\n * PG: #ZT509U#1\r\n */\r\nexport class NodeParticleSystemSet {\r\n private _systemBlocks: SystemBlock[] = [];\r\n private _buildId: number = 0;\r\n\r\n /** Define the Url to load node editor script */\r\n public static EditorURL = `${Tools._DefaultCdnUrl}/v${AbstractEngine.Version}/nodeParticleEditor/babylon.nodeParticleEditor.js`;\r\n\r\n /** Define the Url to load snippets */\r\n public static SnippetUrl = Constants.SnippetUrl;\r\n\r\n /**\r\n * Snippet ID if the material was created from the snippet server\r\n */\r\n public snippetId: string;\r\n\r\n /**\r\n * Gets an array of blocks that needs to be serialized even if they are not yet connected\r\n */\r\n public attachedBlocks: NodeParticleBlock[] = [];\r\n\r\n /**\r\n * Gets or sets data used by visual editor\r\n * @see https://npe.babylonjs.com\r\n */\r\n public editorData: any = null;\r\n\r\n /**\r\n * Observable raised when the particle set is built\r\n */\r\n public onBuildObservable = new Observable<NodeParticleSystemSet>();\r\n\r\n /**\r\n * The name of the set\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * A free comment about the set\r\n */\r\n @serialize(\"comment\")\r\n public comment: string;\r\n\r\n /**\r\n * Gets the system blocks\r\n */\r\n public get systemBlocks(): SystemBlock[] {\r\n return this._systemBlocks;\r\n }\r\n\r\n /**\r\n * Gets the list of input blocks attached to this material\r\n * @returns an array of InputBlocks\r\n */\r\n public get inputBlocks() {\r\n const blocks: ParticleInputBlock[] = [];\r\n for (const block of this.attachedBlocks) {\r\n if (block.isInput) {\r\n blocks.push(block as ParticleInputBlock);\r\n }\r\n }\r\n\r\n return blocks;\r\n }\r\n\r\n /**\r\n * Get a block by its name\r\n * @param name defines the name of the block to retrieve\r\n * @returns the required block or null if not found\r\n */\r\n public getBlockByName(name: string) {\r\n let result = null;\r\n for (const block of this.attachedBlocks) {\r\n if (block.name === name) {\r\n if (!result) {\r\n result = block;\r\n } else {\r\n Tools.Warn(\"More than one block was found with the name `\" + name + \"`\");\r\n return result;\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Get a block using a predicate\r\n * @param predicate defines the predicate used to find the good candidate\r\n * @returns the required block or null if not found\r\n */\r\n public getBlockByPredicate(predicate: (block: NodeParticleBlock) => boolean) {\r\n for (const block of this.attachedBlocks) {\r\n if (predicate(block)) {\r\n return block;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Get an input block using a predicate\r\n * @param predicate defines the predicate used to find the good candidate\r\n * @returns the required input block or null if not found\r\n */\r\n public getInputBlockByPredicate(predicate: (block: ParticleInputBlock) => boolean): Nullable<ParticleInputBlock> {\r\n for (const block of this.attachedBlocks) {\r\n if (block.isInput && predicate(block as ParticleInputBlock)) {\r\n return block as ParticleInputBlock;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n /**\r\n * Creates a new set\r\n * @param name defines the name of the set\r\n */\r\n public constructor(name: string) {\r\n this.name = name;\r\n }\r\n\r\n /**\r\n * Gets the current class name of the geometry e.g. \"NodeParticleSystemSet\"\r\n * @returns the class name\r\n */\r\n public getClassName(): string {\r\n return \"NodeParticleSystemSet\";\r\n }\r\n\r\n private _initializeBlock(node: NodeParticleBlock, autoConfigure = true) {\r\n if (this.attachedBlocks.indexOf(node) === -1) {\r\n this.attachedBlocks.push(node);\r\n }\r\n\r\n for (const input of node.inputs) {\r\n const connectedPoint = input.connectedPoint;\r\n if (connectedPoint) {\r\n const block = connectedPoint.ownerBlock;\r\n if (block !== node) {\r\n this._initializeBlock(block, autoConfigure);\r\n }\r\n }\r\n }\r\n }\r\n\r\n private BJSNODEPARTICLEEDITOR = this._getGlobalNodeParticleEditor();\r\n\r\n /** Get the editor from bundle or global\r\n * @returns the global NPE\r\n */\r\n private _getGlobalNodeParticleEditor(): any {\r\n // UMD Global name detection from Webpack Bundle UMD Name.\r\n if (typeof NODEPARTICLEEDITOR !== \"undefined\") {\r\n return NODEPARTICLEEDITOR;\r\n }\r\n\r\n // In case of module let's check the global emitted from the editor entry point.\r\n if (typeof BABYLON !== \"undefined\" && typeof BABYLON.NodeParticleEditor !== \"undefined\") {\r\n return BABYLON;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /** Creates the node editor window.\r\n * @param additionalConfig Define the configuration of the editor\r\n */\r\n private _createNodeParticleEditor(additionalConfig?: any) {\r\n const nodeEditorConfig: any = {\r\n nodeParticleSet: this,\r\n ...additionalConfig,\r\n };\r\n this.BJSNODEPARTICLEEDITOR.NodeParticleEditor.Show(nodeEditorConfig);\r\n }\r\n\r\n /**\r\n * Launch the node particle editor\r\n * @param config Define the configuration of the editor\r\n * @returns a promise fulfilled when the node editor is visible\r\n */\r\n public async editAsync(config?: INodeParticleEditorOptions): Promise<void> {\r\n return await new Promise((resolve) => {\r\n this.BJSNODEPARTICLEEDITOR = this.BJSNODEPARTICLEEDITOR || this._getGlobalNodeParticleEditor();\r\n if (typeof this.BJSNODEPARTICLEEDITOR == \"undefined\") {\r\n const editorUrl = config && config.editorURL ? config.editorURL : NodeParticleSystemSet.EditorURL;\r\n\r\n // Load editor and add it to the DOM\r\n Tools.LoadBabylonScript(editorUrl, () => {\r\n this.BJSNODEPARTICLEEDITOR = this.BJSNODEPARTICLEEDITOR || this._getGlobalNodeParticleEditor();\r\n this._createNodeParticleEditor(config?.nodeEditorConfig);\r\n resolve();\r\n });\r\n } else {\r\n // Otherwise creates the editor\r\n this._createNodeParticleEditor(config?.nodeEditorConfig);\r\n resolve();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Builds the particle system set from the defined blocks.\r\n * @param scene defines the hosting scene\r\n * @param verbose defines whether to log detailed information during the build process (false by default)\r\n * @returns a promise that resolves to the built particle system set\r\n */\r\n public async buildAsync(scene: Scene, verbose = false): Promise<ParticleSystemSet> {\r\n return await new Promise<ParticleSystemSet>((resolve) => {\r\n const output = new ParticleSystemSet();\r\n\r\n // Initialize all blocks\r\n for (const block of this._systemBlocks) {\r\n this._initializeBlock(block);\r\n }\r\n\r\n // Build the blocks\r\n for (const block of this.systemBlocks) {\r\n const state = new NodeParticleBuildState();\r\n state.buildId = this._buildId++;\r\n state.scene = scene;\r\n state.verbose = verbose;\r\n\r\n const system = block.createSystem(state);\r\n system._source = this;\r\n system._blockReference = block._internalId;\r\n\r\n // Errors\r\n state.emitErrors();\r\n\r\n output.systems.push(system);\r\n }\r\n\r\n this.onBuildObservable.notifyObservers(this);\r\n\r\n resolve(output);\r\n });\r\n }\r\n\r\n /**\r\n * Clear the current geometry\r\n */\r\n public clear() {\r\n this.attachedBlocks.length = 0;\r\n this._systemBlocks.length = 0;\r\n }\r\n\r\n /**\r\n * Clear the current set and restore it to a default state\r\n */\r\n public setToDefault() {\r\n this.clear();\r\n\r\n this.editorData = null;\r\n\r\n // Main system\r\n const system = new SystemBlock(\"Particle system\");\r\n\r\n // Update position\r\n const updatePositionBlock = new UpdatePositionBlock(\"Update position\");\r\n updatePositionBlock.output.connectTo(system.particle);\r\n\r\n // Contextual inputs\r\n const positionBlock = new ParticleInputBlock(\"Position\");\r\n positionBlock.contextualValue = NodeParticleContextualSources.Position;\r\n const directionBlock = new ParticleInputBlock(\"Scaled direction\");\r\n directionBlock.contextualValue = NodeParticleContextualSources.ScaledDirection;\r\n\r\n // Add\r\n const addBlock = new ParticleMathBlock(\"Add\");\r\n addBlock.operation = ParticleMathBlockOperations.Add;\r\n positionBlock.output.connectTo(addBlock.left);\r\n directionBlock.output.connectTo(addBlock.right);\r\n addBlock.output.connectTo(updatePositionBlock.position);\r\n\r\n // Create particle\r\n const createParticleBlock = new CreateParticleBlock(\"Create particle\");\r\n\r\n // Shape\r\n const emitterShape = new BoxShapeBlock(\"Box shape\");\r\n createParticleBlock.particle.connectTo(emitterShape.particle);\r\n emitterShape.output.connectTo(updatePositionBlock.particle);\r\n\r\n // Texture\r\n const textureBlock = new ParticleTextureSourceBlock(\"Texture\");\r\n textureBlock.texture.connectTo(system.texture);\r\n textureBlock.url = \"https://assets.babylonjs.com/textures/flare.png\";\r\n\r\n this._systemBlocks.push(system);\r\n }\r\n\r\n /**\r\n * Remove a block from the current system set\r\n * @param block defines the block to remove\r\n */\r\n public removeBlock(block: NodeParticleBlock) {\r\n const attachedBlockIndex = this.attachedBlocks.indexOf(block);\r\n if (attachedBlockIndex > -1) {\r\n this.attachedBlocks.splice(attachedBlockIndex, 1);\r\n }\r\n\r\n if (block.isSystem) {\r\n const index = this._systemBlocks.indexOf(block as SystemBlock);\r\n if (index > -1) {\r\n this._systemBlocks.splice(index, 1);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current graph and load a new one from a serialization object\r\n * @param source defines the JSON representation of the particle set\r\n * @param merge defines whether or not the source must be merged or replace the current content\r\n */\r\n public parseSerializedObject(source: any, merge = false) {\r\n if (!merge) {\r\n this.clear();\r\n }\r\n\r\n const map: { [key: number]: NodeParticleBlock } = {};\r\n\r\n // Create blocks\r\n for (const parsedBlock of source.blocks) {\r\n const blockType = GetClass(parsedBlock.customType);\r\n if (blockType) {\r\n const block: NodeParticleBlock = new blockType();\r\n block._deserialize(parsedBlock);\r\n map[parsedBlock.id] = block;\r\n\r\n this.attachedBlocks.push(block);\r\n\r\n if (block.isSystem) {\r\n this._systemBlocks.push(block as SystemBlock);\r\n }\r\n }\r\n }\r\n\r\n // Reconnect teleportation\r\n for (const block of this.attachedBlocks) {\r\n if (block.isTeleportOut) {\r\n const teleportOut = block as ParticleTeleportOutBlock;\r\n const id = teleportOut._tempEntryPointUniqueId;\r\n if (id) {\r\n const source = map[id] as ParticleTeleportInBlock;\r\n if (source) {\r\n source.attachToEndpoint(teleportOut);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Connections - Starts with input blocks only (except if in \"merge\" mode where we scan all blocks)\r\n for (let blockIndex = 0; blockIndex < source.blocks.length; blockIndex++) {\r\n const parsedBlock = source.blocks[blockIndex];\r\n const block = map[parsedBlock.id];\r\n\r\n if (!block) {\r\n continue;\r\n }\r\n\r\n if (block.inputs.length && parsedBlock.inputs.some((i: any) => i.targetConnectionName) && !merge) {\r\n continue;\r\n }\r\n this._restoreConnections(block, source, map);\r\n }\r\n\r\n // UI related info\r\n if (source.locations || (source.editorData && source.editorData.locations)) {\r\n const locations: {\r\n blockId: number;\r\n x: number;\r\n y: number;\r\n isCollapsed: boolean;\r\n }[] = source.locations || source.editorData.locations;\r\n\r\n for (const location of locations) {\r\n if (map[location.blockId]) {\r\n location.blockId = map[location.blockId].uniqueId;\r\n }\r\n }\r\n\r\n if (merge && this.editorData && this.editorData.locations) {\r\n locations.concat(this.editorData.locations);\r\n }\r\n\r\n if (source.locations) {\r\n this.editorData = {\r\n locations: locations,\r\n };\r\n } else {\r\n this.editorData = source.editorData;\r\n this.editorData.locations = locations;\r\n }\r\n\r\n const blockMap: number[] = [];\r\n\r\n for (const key in map) {\r\n blockMap[key] = map[key].uniqueId;\r\n }\r\n\r\n this.editorData.map = blockMap;\r\n }\r\n\r\n this.comment = source.comment;\r\n }\r\n\r\n private _restoreConnections(block: NodeParticleBlock, source: any, map: { [key: number]: NodeParticleBlock }) {\r\n for (const outputPoint of block.outputs) {\r\n for (const candidate of source.blocks) {\r\n const target = map[candidate.id];\r\n\r\n if (!target) {\r\n continue;\r\n }\r\n\r\n for (const input of candidate.inputs) {\r\n if (map[input.targetBlockId] === block && input.targetConnectionName === outputPoint.name) {\r\n const inputPoint = target.getInputByName(input.inputName);\r\n if (!inputPoint || inputPoint.isConnected) {\r\n continue;\r\n }\r\n\r\n outputPoint.connectTo(inputPoint, true);\r\n this._restoreConnections(target, source, map);\r\n continue;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Serializes this geometry in a JSON representation\r\n * @param selectedBlocks defines the list of blocks to save (if null the whole geometry will be saved)\r\n * @returns the serialized particle system set object\r\n */\r\n public serialize(selectedBlocks?: NodeParticleBlock[]): any {\r\n const serializationObject = selectedBlocks ? {} : SerializationHelper.Serialize(this);\r\n serializationObject.editorData = JSON.parse(JSON.stringify(this.editorData)); // Copy\r\n\r\n let blocks: NodeParticleBlock[] = [];\r\n\r\n if (selectedBlocks) {\r\n blocks = selectedBlocks;\r\n } else {\r\n serializationObject.customType = \"BABYLON.NodeParticleSystemSet\";\r\n }\r\n\r\n // Blocks\r\n serializationObject.blocks = [];\r\n\r\n for (const block of blocks) {\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n\r\n if (!selectedBlocks) {\r\n for (const block of this.attachedBlocks) {\r\n if (blocks.indexOf(block) !== -1) {\r\n continue;\r\n }\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current particle system set.\r\n * @param name defines the name to use for the new particle system set\r\n * @returns the cloned particle system set\r\n */\r\n public clone(name: string): NodeParticleSystemSet {\r\n const serializationObject = this.serialize();\r\n\r\n const clone = SerializationHelper.Clone(() => new NodeParticleSystemSet(name), this);\r\n clone.name = name;\r\n clone.snippetId = this.snippetId;\r\n\r\n clone.parseSerializedObject(serializationObject);\r\n clone._buildId = this._buildId;\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Disposes the resources\r\n */\r\n public dispose(): void {\r\n for (const block of this.attachedBlocks) {\r\n block.dispose();\r\n }\r\n\r\n this.attachedBlocks.length = 0;\r\n this.onBuildObservable.clear();\r\n }\r\n\r\n /**\r\n * Creates a new node particle set set to default basic configuration\r\n * @param name defines the name of the particle set\r\n * @returns a new NodeParticleSystemSet\r\n */\r\n public static CreateDefault(name: string) {\r\n const nodeParticleSet = new NodeParticleSystemSet(name);\r\n\r\n nodeParticleSet.setToDefault();\r\n\r\n return nodeParticleSet;\r\n }\r\n\r\n /**\r\n * Creates a node particle set from parsed data\r\n * @param source defines the JSON representation of the particle set\r\n * @returns a new node particle set\r\n */\r\n public static Parse(source: any): NodeParticleSystemSet {\r\n const nodeParticleSet = SerializationHelper.Parse(() => new NodeParticleSystemSet(source.name), source, null);\r\n\r\n nodeParticleSet.parseSerializedObject(source);\r\n\r\n return nodeParticleSet;\r\n }\r\n\r\n /**\r\n * Creates a node particle set from a snippet saved by the node geometry editor\r\n * @param snippetId defines the snippet to load\r\n * @param nodeParticleSet defines a node particle set to update (instead of creating a new one)\r\n * @returns a promise that will resolve to the new node geometry\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public static ParseFromSnippetAsync(snippetId: string, nodeParticleSet?: NodeParticleSystemSet): Promise<NodeParticleSystemSet> {\r\n if (snippetId === \"_BLANK\") {\r\n return Promise.resolve(NodeParticleSystemSet.CreateDefault(\"blank\"));\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n const serializationObject = JSON.parse(snippet.nodeParticle);\r\n\r\n if (!nodeParticleSet) {\r\n nodeParticleSet = SerializationHelper.Parse(() => new NodeParticleSystemSet(snippetId), serializationObject, null);\r\n }\r\n\r\n nodeParticleSet.parseSerializedObject(serializationObject);\r\n nodeParticleSet.snippetId = snippetId;\r\n\r\n try {\r\n resolve(nodeParticleSet);\r\n } catch (err) {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(err);\r\n }\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the snippet \" + snippetId);\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", this.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\r\n request.send();\r\n });\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"nodeParticleSystemSet.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles/Node/nodeParticleSystemSet.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,iCAA6B;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,E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AAC,CAAC;YAC1E,OAAO,CAAC,IAAI,EAAE,CAAC;QACnB,CAAC,CAAC,CAAC;IACP,CAAC;;AArlBD,gDAAgD;AAClC,+BAAS,GAAG,GAAG,KAAK,CAAC,cAAc,KAAK,cAAc,CAAC,OAAO,mDAAmD,AAAxG,CAAyG;AAEhI,sCAAsC;AACxB,gCAAU,GAAG,SAAS,CAAC,UAAU,AAAvB,CAAwB;AA2BzC;IADN,SAAS,EAAE;mDACQ;AAMb;IADN,SAAS,CAAC,SAAS,CAAC;sDACE","sourcesContent":["import { serialize } from \"core/Misc/decorators\";\r\nimport { ParticleSystemSet } from \"../particleSystemSet\";\r\nimport { SystemBlock } from \"./Blocks/systemBlock\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { NodeParticleBuildState } from \"./nodeParticleBuildState\";\r\nimport type { NodeParticleBlock } from \"./nodeParticleBlock\";\r\nimport { SerializationHelper } from \"core/Misc/decorators.serialization\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { GetClass } from \"core/Misc/typeStore\";\r\nimport { WebRequest } from \"core/Misc/webRequest\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport { AbstractEngine } from \"core/Engines/abstractEngine\";\r\nimport { ParticleInputBlock } from \"./Blocks/particleInputBlock\";\r\nimport { ParticleTextureSourceBlock } from \"./Blocks/particleSourceTextureBlock\";\r\nimport { NodeParticleContextualSources } from \"./Enums/nodeParticleContextualSources\";\r\nimport { UpdatePositionBlock } from \"./Blocks/Update/updatePositionBlock\";\r\nimport { ParticleMathBlock, ParticleMathBlockOperations } from \"./Blocks/particleMathBlock\";\r\nimport type { ParticleTeleportOutBlock } from \"./Blocks/Teleport/particleTeleportOutBlock\";\r\nimport type { ParticleTeleportInBlock } from \"./Blocks/Teleport/particleTeleportInBlock\";\r\nimport { BoxShapeBlock } from \"./Blocks/Emitters/boxShapeBlock\";\r\nimport { CreateParticleBlock } from \"./Blocks/Emitters/createParticleBlock\";\r\nimport type { Color4 } from \"core/Maths/math.color\";\r\nimport type { Nullable } from \"../../types\";\r\n\r\n// declare NODEPARTICLEEDITOR namespace for compilation issue\r\ndeclare let NODEPARTICLEEDITOR: any;\r\ndeclare let BABYLON: any;\r\n\r\n/**\r\n * Interface used to configure the node particle editor\r\n */\r\nexport interface INodeParticleEditorOptions {\r\n /** Define the URL to load node editor script from */\r\n editorURL?: string;\r\n /** Additional configuration for the NPE */\r\n nodeEditorConfig?: {\r\n backgroundColor?: Color4;\r\n };\r\n}\r\n\r\n/**\r\n * Defines a set of particle systems defined as a node graph.\r\n * NPE: #K6F1ZB#1\r\n * PG: #ZT509U#1\r\n */\r\nexport class NodeParticleSystemSet {\r\n private _systemBlocks: SystemBlock[] = [];\r\n private _buildId: number = 0;\r\n\r\n /** Define the Url to load node editor script */\r\n public static EditorURL = `${Tools._DefaultCdnUrl}/v${AbstractEngine.Version}/nodeParticleEditor/babylon.nodeParticleEditor.js`;\r\n\r\n /** Define the Url to load snippets */\r\n public static SnippetUrl = Constants.SnippetUrl;\r\n\r\n /**\r\n * Snippet ID if the material was created from the snippet server\r\n */\r\n public snippetId: string;\r\n\r\n /**\r\n * Gets an array of blocks that needs to be serialized even if they are not yet connected\r\n */\r\n public attachedBlocks: NodeParticleBlock[] = [];\r\n\r\n /**\r\n * Gets or sets data used by visual editor\r\n * @see https://npe.babylonjs.com\r\n */\r\n public editorData: any = null;\r\n\r\n /**\r\n * Observable raised when the particle set is built\r\n */\r\n public onBuildObservable = new Observable<NodeParticleSystemSet>();\r\n\r\n /**\r\n * The name of the set\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * A free comment about the set\r\n */\r\n @serialize(\"comment\")\r\n public comment: string;\r\n\r\n /**\r\n * Gets the system blocks\r\n */\r\n public get systemBlocks(): SystemBlock[] {\r\n return this._systemBlocks;\r\n }\r\n\r\n /**\r\n * Gets the list of input blocks attached to this material\r\n * @returns an array of InputBlocks\r\n */\r\n public get inputBlocks() {\r\n const blocks: ParticleInputBlock[] = [];\r\n for (const block of this.attachedBlocks) {\r\n if (block.isInput) {\r\n blocks.push(block as ParticleInputBlock);\r\n }\r\n }\r\n\r\n return blocks;\r\n }\r\n\r\n /**\r\n * Get a block by its name\r\n * @param name defines the name of the block to retrieve\r\n * @returns the required block or null if not found\r\n */\r\n public getBlockByName(name: string) {\r\n let result = null;\r\n for (const block of this.attachedBlocks) {\r\n if (block.name === name) {\r\n if (!result) {\r\n result = block;\r\n } else {\r\n Tools.Warn(\"More than one block was found with the name `\" + name + \"`\");\r\n return result;\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Get a block using a predicate\r\n * @param predicate defines the predicate used to find the good candidate\r\n * @returns the required block or null if not found\r\n */\r\n public getBlockByPredicate(predicate: (block: NodeParticleBlock) => boolean) {\r\n for (const block of this.attachedBlocks) {\r\n if (predicate(block)) {\r\n return block;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Get an input block using a predicate\r\n * @param predicate defines the predicate used to find the good candidate\r\n * @returns the required input block or null if not found\r\n */\r\n public getInputBlockByPredicate(predicate: (block: ParticleInputBlock) => boolean): Nullable<ParticleInputBlock> {\r\n for (const block of this.attachedBlocks) {\r\n if (block.isInput && predicate(block as ParticleInputBlock)) {\r\n return block as ParticleInputBlock;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n /**\r\n * Creates a new set\r\n * @param name defines the name of the set\r\n */\r\n public constructor(name: string) {\r\n this.name = name;\r\n }\r\n\r\n /**\r\n * Gets the current class name of the node particle set e.g. \"NodeParticleSystemSet\"\r\n * @returns the class name\r\n */\r\n public getClassName(): string {\r\n return \"NodeParticleSystemSet\";\r\n }\r\n\r\n private _initializeBlock(node: NodeParticleBlock, autoConfigure = true) {\r\n if (this.attachedBlocks.indexOf(node) === -1) {\r\n this.attachedBlocks.push(node);\r\n }\r\n\r\n for (const input of node.inputs) {\r\n const connectedPoint = input.connectedPoint;\r\n if (connectedPoint) {\r\n const block = connectedPoint.ownerBlock;\r\n if (block !== node) {\r\n this._initializeBlock(block, autoConfigure);\r\n }\r\n }\r\n }\r\n }\r\n\r\n private BJSNODEPARTICLEEDITOR = this._getGlobalNodeParticleEditor();\r\n\r\n /** Get the editor from bundle or global\r\n * @returns the global NPE\r\n */\r\n private _getGlobalNodeParticleEditor(): any {\r\n // UMD Global name detection from Webpack Bundle UMD Name.\r\n if (typeof NODEPARTICLEEDITOR !== \"undefined\") {\r\n return NODEPARTICLEEDITOR;\r\n }\r\n\r\n // In case of module let's check the global emitted from the editor entry point.\r\n if (typeof BABYLON !== \"undefined\" && typeof BABYLON.NodeParticleEditor !== \"undefined\") {\r\n return BABYLON;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /** Creates the node editor window.\r\n * @param additionalConfig Define the configuration of the editor\r\n */\r\n private _createNodeParticleEditor(additionalConfig?: any) {\r\n const nodeEditorConfig: any = {\r\n nodeParticleSet: this,\r\n ...additionalConfig,\r\n };\r\n this.BJSNODEPARTICLEEDITOR.NodeParticleEditor.Show(nodeEditorConfig);\r\n }\r\n\r\n /**\r\n * Launch the node particle editor\r\n * @param config Define the configuration of the editor\r\n * @returns a promise fulfilled when the node editor is visible\r\n */\r\n public async editAsync(config?: INodeParticleEditorOptions): Promise<void> {\r\n return await new Promise((resolve) => {\r\n this.BJSNODEPARTICLEEDITOR = this.BJSNODEPARTICLEEDITOR || this._getGlobalNodeParticleEditor();\r\n if (typeof this.BJSNODEPARTICLEEDITOR == \"undefined\") {\r\n const editorUrl = config && config.editorURL ? config.editorURL : NodeParticleSystemSet.EditorURL;\r\n\r\n // Load editor and add it to the DOM\r\n Tools.LoadBabylonScript(editorUrl, () => {\r\n this.BJSNODEPARTICLEEDITOR = this.BJSNODEPARTICLEEDITOR || this._getGlobalNodeParticleEditor();\r\n this._createNodeParticleEditor(config?.nodeEditorConfig);\r\n resolve();\r\n });\r\n } else {\r\n // Otherwise creates the editor\r\n this._createNodeParticleEditor(config?.nodeEditorConfig);\r\n resolve();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Builds the particle system set from the defined blocks.\r\n * @param scene defines the hosting scene\r\n * @param verbose defines whether to log detailed information during the build process (false by default)\r\n * @returns a promise that resolves to the built particle system set\r\n */\r\n public async buildAsync(scene: Scene, verbose = false): Promise<ParticleSystemSet> {\r\n return await new Promise<ParticleSystemSet>((resolve) => {\r\n const output = new ParticleSystemSet();\r\n\r\n // Initialize all blocks\r\n for (const block of this._systemBlocks) {\r\n this._initializeBlock(block);\r\n }\r\n\r\n // Build the blocks\r\n for (const block of this.systemBlocks) {\r\n const state = new NodeParticleBuildState();\r\n state.buildId = this._buildId++;\r\n state.scene = scene;\r\n state.verbose = verbose;\r\n\r\n const system = block.createSystem(state);\r\n system._source = this;\r\n system._blockReference = block._internalId;\r\n\r\n // Errors\r\n state.emitErrors();\r\n\r\n output.systems.push(system);\r\n }\r\n\r\n this.onBuildObservable.notifyObservers(this);\r\n\r\n resolve(output);\r\n });\r\n }\r\n\r\n /**\r\n * Clear the current node particle set\r\n */\r\n public clear() {\r\n this.attachedBlocks.length = 0;\r\n this._systemBlocks.length = 0;\r\n }\r\n\r\n /**\r\n * Clear the current set and restore it to a default state\r\n */\r\n public setToDefault() {\r\n this.clear();\r\n\r\n this.editorData = null;\r\n\r\n // Main system\r\n const system = new SystemBlock(\"Particle system\");\r\n\r\n // Update position\r\n const updatePositionBlock = new UpdatePositionBlock(\"Update position\");\r\n updatePositionBlock.output.connectTo(system.particle);\r\n\r\n // Contextual inputs\r\n const positionBlock = new ParticleInputBlock(\"Position\");\r\n positionBlock.contextualValue = NodeParticleContextualSources.Position;\r\n const directionBlock = new ParticleInputBlock(\"Scaled direction\");\r\n directionBlock.contextualValue = NodeParticleContextualSources.ScaledDirection;\r\n\r\n // Add\r\n const addBlock = new ParticleMathBlock(\"Add\");\r\n addBlock.operation = ParticleMathBlockOperations.Add;\r\n positionBlock.output.connectTo(addBlock.left);\r\n directionBlock.output.connectTo(addBlock.right);\r\n addBlock.output.connectTo(updatePositionBlock.position);\r\n\r\n // Create particle\r\n const createParticleBlock = new CreateParticleBlock(\"Create particle\");\r\n\r\n // Shape\r\n const emitterShape = new BoxShapeBlock(\"Box shape\");\r\n createParticleBlock.particle.connectTo(emitterShape.particle);\r\n emitterShape.output.connectTo(updatePositionBlock.particle);\r\n\r\n // Texture\r\n const textureBlock = new ParticleTextureSourceBlock(\"Texture\");\r\n textureBlock.texture.connectTo(system.texture);\r\n textureBlock.url = \"https://assets.babylonjs.com/textures/flare.png\";\r\n\r\n this._systemBlocks.push(system);\r\n }\r\n\r\n /**\r\n * Remove a block from the current system set\r\n * @param block defines the block to remove\r\n */\r\n public removeBlock(block: NodeParticleBlock) {\r\n const attachedBlockIndex = this.attachedBlocks.indexOf(block);\r\n if (attachedBlockIndex > -1) {\r\n this.attachedBlocks.splice(attachedBlockIndex, 1);\r\n }\r\n\r\n if (block.isSystem) {\r\n const index = this._systemBlocks.indexOf(block as SystemBlock);\r\n if (index > -1) {\r\n this._systemBlocks.splice(index, 1);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current graph and load a new one from a serialization object\r\n * @param source defines the JSON representation of the particle set\r\n * @param merge defines whether or not the source must be merged or replace the current content\r\n */\r\n public parseSerializedObject(source: any, merge = false) {\r\n if (!merge) {\r\n this.clear();\r\n }\r\n\r\n const map: { [key: number]: NodeParticleBlock } = {};\r\n\r\n // Create blocks\r\n for (const parsedBlock of source.blocks) {\r\n const blockType = GetClass(parsedBlock.customType);\r\n if (blockType) {\r\n const block: NodeParticleBlock = new blockType();\r\n block._deserialize(parsedBlock);\r\n map[parsedBlock.id] = block;\r\n\r\n this.attachedBlocks.push(block);\r\n\r\n if (block.isSystem) {\r\n this._systemBlocks.push(block as SystemBlock);\r\n }\r\n }\r\n }\r\n\r\n // Reconnect teleportation\r\n for (const block of this.attachedBlocks) {\r\n if (block.isTeleportOut) {\r\n const teleportOut = block as ParticleTeleportOutBlock;\r\n const id = teleportOut._tempEntryPointUniqueId;\r\n if (id) {\r\n const source = map[id] as ParticleTeleportInBlock;\r\n if (source) {\r\n source.attachToEndpoint(teleportOut);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Connections - Starts with input blocks only (except if in \"merge\" mode where we scan all blocks)\r\n for (let blockIndex = 0; blockIndex < source.blocks.length; blockIndex++) {\r\n const parsedBlock = source.blocks[blockIndex];\r\n const block = map[parsedBlock.id];\r\n\r\n if (!block) {\r\n continue;\r\n }\r\n\r\n if (block.inputs.length && parsedBlock.inputs.some((i: any) => i.targetConnectionName) && !merge) {\r\n continue;\r\n }\r\n this._restoreConnections(block, source, map);\r\n }\r\n\r\n // UI related info\r\n if (source.locations || (source.editorData && source.editorData.locations)) {\r\n const locations: {\r\n blockId: number;\r\n x: number;\r\n y: number;\r\n isCollapsed: boolean;\r\n }[] = source.locations || source.editorData.locations;\r\n\r\n for (const location of locations) {\r\n if (map[location.blockId]) {\r\n location.blockId = map[location.blockId].uniqueId;\r\n }\r\n }\r\n\r\n if (merge && this.editorData && this.editorData.locations) {\r\n locations.concat(this.editorData.locations);\r\n }\r\n\r\n if (source.locations) {\r\n this.editorData = {\r\n locations: locations,\r\n };\r\n } else {\r\n this.editorData = source.editorData;\r\n this.editorData.locations = locations;\r\n }\r\n\r\n const blockMap: { [key: number]: number } = {};\r\n\r\n for (const key in map) {\r\n blockMap[key] = map[key].uniqueId;\r\n }\r\n\r\n this.editorData.map = blockMap;\r\n }\r\n\r\n this.comment = source.comment;\r\n }\r\n\r\n private _restoreConnections(block: NodeParticleBlock, source: any, map: { [key: number]: NodeParticleBlock }) {\r\n for (const outputPoint of block.outputs) {\r\n for (const candidate of source.blocks) {\r\n const target = map[candidate.id];\r\n\r\n if (!target) {\r\n continue;\r\n }\r\n\r\n for (const input of candidate.inputs) {\r\n if (map[input.targetBlockId] === block && input.targetConnectionName === outputPoint.name) {\r\n const inputPoint = target.getInputByName(input.inputName);\r\n if (!inputPoint || inputPoint.isConnected) {\r\n continue;\r\n }\r\n\r\n outputPoint.connectTo(inputPoint, true);\r\n this._restoreConnections(target, source, map);\r\n continue;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Serializes this node particle set in a JSON representation\r\n * @param selectedBlocks defines the list of blocks to save (if null the whole node particle set will be saved)\r\n * @returns the serialized particle system set object\r\n */\r\n public serialize(selectedBlocks?: NodeParticleBlock[]): any {\r\n const serializationObject = selectedBlocks ? {} : SerializationHelper.Serialize(this);\r\n serializationObject.editorData = JSON.parse(JSON.stringify(this.editorData)); // Copy\r\n\r\n let blocks: NodeParticleBlock[] = [];\r\n\r\n if (selectedBlocks) {\r\n blocks = selectedBlocks;\r\n } else {\r\n serializationObject.customType = \"BABYLON.NodeParticleSystemSet\";\r\n }\r\n\r\n // Blocks\r\n serializationObject.blocks = [];\r\n\r\n for (const block of blocks) {\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n\r\n if (!selectedBlocks) {\r\n for (const block of this.attachedBlocks) {\r\n if (blocks.indexOf(block) !== -1) {\r\n continue;\r\n }\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current particle system set.\r\n * @param name defines the name to use for the new particle system set\r\n * @returns the cloned particle system set\r\n */\r\n public clone(name: string): NodeParticleSystemSet {\r\n const serializationObject = this.serialize();\r\n\r\n const clone = SerializationHelper.Clone(() => new NodeParticleSystemSet(name), this);\r\n clone.name = name;\r\n clone.snippetId = this.snippetId;\r\n\r\n clone.parseSerializedObject(serializationObject);\r\n clone._buildId = this._buildId;\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Disposes the resources\r\n */\r\n public dispose(): void {\r\n for (const block of this.attachedBlocks) {\r\n block.dispose();\r\n }\r\n\r\n this.attachedBlocks.length = 0;\r\n this.onBuildObservable.clear();\r\n }\r\n\r\n /**\r\n * Creates a new node particle set set to default basic configuration\r\n * @param name defines the name of the particle set\r\n * @returns a new NodeParticleSystemSet\r\n */\r\n public static CreateDefault(name: string) {\r\n const nodeParticleSet = new NodeParticleSystemSet(name);\r\n\r\n nodeParticleSet.setToDefault();\r\n\r\n return nodeParticleSet;\r\n }\r\n\r\n /**\r\n * Creates a node particle set from parsed data\r\n * @param source defines the JSON representation of the particle set\r\n * @returns a new node particle set\r\n */\r\n public static Parse(source: any): NodeParticleSystemSet {\r\n const nodeParticleSet = SerializationHelper.Parse(() => new NodeParticleSystemSet(source.name), source, null);\r\n\r\n nodeParticleSet.parseSerializedObject(source);\r\n\r\n return nodeParticleSet;\r\n }\r\n\r\n /**\r\n * Creates a node particle set from a snippet saved in a remote file\r\n * @param name defines the name of the node particle set to create\r\n * @param url defines the url to load from\r\n * @param nodeParticleSet defines a node particle set to update (instead of creating a new one)\r\n * @returns a promise that will resolve to the new node particle set\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public static ParseFromFileAsync(name: string, url: string, nodeParticleSet?: NodeParticleSystemSet): Promise<NodeParticleSystemSet> {\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const serializationObject = JSON.parse(request.responseText);\r\n if (!nodeParticleSet) {\r\n nodeParticleSet = SerializationHelper.Parse(() => new NodeParticleSystemSet(name), serializationObject, null);\r\n }\r\n\r\n nodeParticleSet.parseSerializedObject(serializationObject);\r\n\r\n resolve(nodeParticleSet);\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the node particle system set\");\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", url);\r\n request.send();\r\n });\r\n }\r\n\r\n /**\r\n * Creates a node particle set from a snippet saved by the node particle editor\r\n * @param snippetId defines the snippet to load\r\n * @param nodeParticleSet defines a node particle set to update (instead of creating a new one)\r\n * @returns a promise that will resolve to the new node particle set\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public static ParseFromSnippetAsync(snippetId: string, nodeParticleSet?: NodeParticleSystemSet): Promise<NodeParticleSystemSet> {\r\n if (snippetId === \"_BLANK\") {\r\n return Promise.resolve(NodeParticleSystemSet.CreateDefault(\"blank\"));\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n const serializationObject = JSON.parse(snippet.nodeParticle);\r\n\r\n if (!nodeParticleSet) {\r\n nodeParticleSet = SerializationHelper.Parse(() => new NodeParticleSystemSet(snippetId), serializationObject, null);\r\n }\r\n\r\n nodeParticleSet.parseSerializedObject(serializationObject);\r\n nodeParticleSet.snippetId = snippetId;\r\n\r\n try {\r\n resolve(nodeParticleSet);\r\n } catch (err) {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(err);\r\n }\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the snippet \" + snippetId);\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", this.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\r\n request.send();\r\n });\r\n }\r\n}\r\n"]}
|