@babylonjs/core 9.4.0 → 9.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cameras/Inputs/freeCameraTouchInput.js +5 -3
- package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraVirtualJoystickInput.js +11 -7
- package/Cameras/Inputs/freeCameraVirtualJoystickInput.js.map +1 -1
- package/Cameras/arcRotateCamera.js +2 -1
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.js +1 -0
- package/Cameras/camera.js.map +1 -1
- package/Cameras/followCamera.js +1 -1
- package/Cameras/followCamera.js.map +1 -1
- package/Collisions/gpuPicker.d.ts +12 -0
- package/Collisions/gpuPicker.js +51 -0
- package/Collisions/gpuPicker.js.map +1 -1
- package/Culling/ray.core.js +46 -2
- package/Culling/ray.core.js.map +1 -1
- package/Engines/Native/nativeHelpers.js +26 -0
- package/Engines/Native/nativeHelpers.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +26 -0
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +52 -0
- package/Engines/constants.js +52 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.d.ts +13 -0
- package/Engines/thinEngine.js +52 -0
- package/Engines/thinEngine.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +10 -3
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js +36 -3
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -1
- package/FlowGraph/flowGraphEventBlock.d.ts +13 -0
- package/FlowGraph/flowGraphEventBlock.js +21 -2
- package/FlowGraph/flowGraphEventBlock.js.map +1 -1
- package/FrameGraph/frameGraphTextureManager.js +26 -0
- package/FrameGraph/frameGraphTextureManager.js.map +1 -1
- package/Layers/layer.js +5 -1
- package/Layers/layer.js.map +1 -1
- package/LensFlares/lensFlareSystem.js +1 -0
- package/LensFlares/lensFlareSystem.js.map +1 -1
- package/Lights/Clustered/clusteredLightContainer.js +11 -1
- package/Lights/Clustered/clusteredLightContainer.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +14 -0
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.d.ts +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.js +6 -3
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.d.ts +2 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +10 -3
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.d.ts +2 -1
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.js +10 -4
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.js.map +1 -1
- package/Materials/PBR/openpbrMaterial.d.ts +11 -0
- package/Materials/PBR/openpbrMaterial.js +59 -12
- package/Materials/PBR/openpbrMaterial.js.map +1 -1
- package/Materials/Textures/Loaders/ktxTextureLoader.js +26 -0
- package/Materials/Textures/Loaders/ktxTextureLoader.js.map +1 -1
- package/Materials/Textures/envCubeTexture.js +33 -15
- package/Materials/Textures/envCubeTexture.js.map +1 -1
- package/Materials/material.d.ts +16 -1
- package/Materials/material.js +16 -1
- package/Materials/material.js.map +1 -1
- package/Materials/standardMaterial.js +4 -2
- package/Materials/standardMaterial.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +16 -18
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.d.ts +24 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.js +93 -18
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.js.map +1 -1
- package/Meshes/abstractMesh.js +1 -0
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/mesh.js +3 -0
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/transformNode.d.ts +6 -0
- package/Meshes/transformNode.js +6 -0
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/brdfTextureTools.d.ts +12 -0
- package/Misc/brdfTextureTools.js +22 -0
- package/Misc/brdfTextureTools.js.map +1 -1
- package/Misc/depthReducer.js +1 -1
- package/Misc/depthReducer.js.map +1 -1
- package/Misc/snapshotRenderingHelper.d.ts +7 -1
- package/Misc/snapshotRenderingHelper.js +7 -1
- package/Misc/snapshotRenderingHelper.js.map +1 -1
- package/Misc/textureTools.js +26 -0
- package/Misc/textureTools.js.map +1 -1
- package/Misc/tools.js +1 -1
- package/Misc/tools.js.map +1 -1
- package/Particles/Node/Blocks/Update/updateFlowMapBlock.js +17 -10
- package/Particles/Node/Blocks/Update/updateFlowMapBlock.js.map +1 -1
- package/Particles/Node/Blocks/Update/updateNoiseBlock.js +14 -0
- package/Particles/Node/Blocks/Update/updateNoiseBlock.js.map +1 -1
- package/Particles/Node/Blocks/particleSourceTextureBlock.js +114 -12
- package/Particles/Node/Blocks/particleSourceTextureBlock.js.map +1 -1
- package/Particles/Node/nodeParticleBuildState.d.ts +11 -0
- package/Particles/Node/nodeParticleBuildState.js +15 -0
- package/Particles/Node/nodeParticleBuildState.js.map +1 -1
- package/Particles/Node/nodeParticleSystemSet.js +23 -22
- package/Particles/Node/nodeParticleSystemSet.js.map +1 -1
- package/Particles/gpuParticleSystem.js +1 -0
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.js +1 -0
- package/Particles/thinParticleSystem.js.map +1 -1
- package/PostProcesses/postProcessManager.d.ts +2 -0
- package/PostProcesses/postProcessManager.js +14 -8
- package/PostProcesses/postProcessManager.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js +12 -9
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js.map +1 -1
- package/Rendering/depthRendererSceneComponent.js +6 -6
- package/Rendering/depthRendererSceneComponent.js.map +1 -1
- package/Rendering/iblCdfGeneratorSceneComponent.d.ts +6 -0
- package/Rendering/iblCdfGeneratorSceneComponent.js +16 -0
- package/Rendering/iblCdfGeneratorSceneComponent.js.map +1 -1
- package/Rendering/prePassRenderer.d.ts +4 -1
- package/Rendering/prePassRenderer.js +31 -9
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js +1 -1
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrBackgroundTransmission.js +1 -1
- package/Shaders/ShadersInclude/openpbrBackgroundTransmission.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrDirectLighting.js +18 -10
- package/Shaders/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js +36 -14
- package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrIblFunctions.js +8 -5
- package/Shaders/ShadersInclude/openpbrIblFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBRDFFunctions.js +10 -6
- package/Shaders/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
- package/Shaders/openpbr.fragment.js +14 -15
- package/Shaders/openpbr.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js +19 -11
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrDirectLightingInit.js +3 -3
- package/ShadersWGSL/ShadersInclude/openpbrDirectLightingInit.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js +36 -14
- package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js +5 -3
- package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js +5 -6
- package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
- package/ShadersWGSL/openpbr.fragment.js +16 -17
- package/ShadersWGSL/openpbr.fragment.js.map +1 -1
- package/Sprites/spriteManager.js +1 -0
- package/Sprites/spriteManager.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +16 -0
- package/scene.js +13 -0
- package/scene.js.map +1 -1
|
@@ -35,13 +35,20 @@ export class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {
|
|
|
35
35
|
// returning true here to continue the propagation of the pointer event to the rest of the blocks
|
|
36
36
|
return true;
|
|
37
37
|
}
|
|
38
|
-
// check if the mesh is the picked mesh or a descendant
|
|
39
38
|
const mesh = this._getReferencedMesh(context);
|
|
40
|
-
|
|
39
|
+
const pickedMesh = pickedInfo.pickInfo?.pickedMesh;
|
|
40
|
+
// When no target mesh is configured, fire for any picked mesh.
|
|
41
|
+
// When a target is configured, require an exact match or descendant match.
|
|
42
|
+
// Match by reference first, then by descendant, then by stable name/id as a
|
|
43
|
+
// fallback for scene reloads where the object reference changes but the mesh
|
|
44
|
+
// identity (name) is preserved (uniqueId increments monotonically and is NOT
|
|
45
|
+
// stable across reloads).
|
|
46
|
+
const meshMatches = !mesh ? !!pickedMesh : !!(pickedMesh && (pickedMesh === mesh || _IsDescendantOf(pickedMesh, mesh) || pickedMesh.name === mesh.name));
|
|
47
|
+
if (meshMatches && pickedMesh) {
|
|
41
48
|
this.pointerId.setValue(pickedInfo.event.pointerId, context);
|
|
42
49
|
this.pickOrigin.setValue(pickedInfo.pickInfo.ray?.origin, context);
|
|
43
50
|
this.pickedPoint.setValue(pickedInfo.pickInfo.pickedPoint, context);
|
|
44
|
-
this.pickedMesh.setValue(
|
|
51
|
+
this.pickedMesh.setValue(pickedMesh, context);
|
|
45
52
|
this._execute(context);
|
|
46
53
|
// stop the propagation if the configuration says so
|
|
47
54
|
return !this.config?.stopPropagation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphMeshPickEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAoB,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGpF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAiBjG;;GAEG;AACH,MAAM,OAAO,2BAA4B,SAAQ,mBAAmB;IAoChE;IACI;;OAEG;IACa,MAAkD;QAElE,KAAK,CAAC,MAAM,CAAC,CAAC;QAFE,WAAM,GAAN,MAAM,CAA4C;QATtE;;WAEG;QACsB,SAAI,gDAAmD;QAS5E,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;QAC3E,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;QACzE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QACtE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;QACrE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,iBAAiB,CAAC,aAAa,EAAE,WAAW,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;IACzG,CAAC;IAEM,kBAAkB,CAAC,OAAyB;QAC/C,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAEe,aAAa,CAAC,OAAyB,EAAE,UAAuB;QAC5E,uBAAuB;QACvB,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACvD,IAAI,WAAW,KAAK,UAAU,CAAC,IAAI,EAAE,CAAC;YAClC,iGAAiG;YACjG,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,
|
|
1
|
+
{"version":3,"file":"flowGraphMeshPickEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAoB,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGpF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAiBjG;;G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CAAC;IAED;;OAEG;IACa,oBAAoB,CAAC,QAA0B;QAC3D,QAAQ;IACZ,CAAC;IAED;;OAEG;IACa,mBAAmB,CAAC,QAA0B;QAC1D,QAAQ;IACZ,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,6EAAyC;IAC7C,CAAC;CACJ;AACD,aAAa,wEAAoC,2BAA2B,CAAC,CAAC","sourcesContent":["import { type AbstractMesh } from \"../../../Meshes/abstractMesh\";\r\nimport { FlowGraphEventBlock } from \"../../flowGraphEventBlock\";\r\nimport { type PointerInfo, PointerEventTypes } from \"../../../Events/pointerEvents\";\r\nimport { type FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { type IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { _IsDescendantOf } from \"../../utils\";\r\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\r\nimport { type FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\r\nimport { RichTypeAny, RichTypeNumber, RichTypeVector3 } from \"core/FlowGraph/flowGraphRichTypes\";\r\nimport { type Vector3 } from \"core/Maths/math.vector\";\r\nimport { FlowGraphEventType } from \"core/FlowGraph/flowGraphEventType\";\r\n/**\r\n * Configuration for the mesh pick event block.\r\n */\r\nexport interface IFlowGraphMeshPickEventBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * Should this mesh block propagation of the event.\r\n */\r\n stopPropagation?: boolean;\r\n\r\n /**\r\n * The mesh to listen to. Can also be set by the asset input.\r\n */\r\n targetMesh?: AbstractMesh;\r\n}\r\n/**\r\n * A block that activates when a mesh is picked.\r\n */\r\nexport class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {\r\n /**\r\n * Input connection: The mesh to listen to.\r\n */\r\n public readonly asset: FlowGraphDataConnection<AbstractMesh>;\r\n\r\n /**\r\n * Output connection: The picked point.\r\n */\r\n public readonly pickedPoint: FlowGraphDataConnection<Vector3>;\r\n\r\n /**\r\n * Output connection: The picked origin.\r\n */\r\n public readonly pickOrigin: FlowGraphDataConnection<Vector3>;\r\n\r\n /**\r\n * Output connection: The pointer id.\r\n */\r\n public readonly pointerId: FlowGraphDataConnection<number>;\r\n\r\n /**\r\n * Output connection: The picked mesh. Possibly NOT the same as the asset (could be a descendant).\r\n */\r\n public readonly pickedMesh: FlowGraphDataConnection<AbstractMesh>;\r\n\r\n /**\r\n * Input connection: The type of the pointer event.\r\n */\r\n public readonly pointerType: FlowGraphDataConnection<PointerEventTypes>;\r\n\r\n /**\r\n * the type of the event this block reacts to\r\n */\r\n public override readonly type: FlowGraphEventType = FlowGraphEventType.MeshPick;\r\n\r\n public constructor(\r\n /**\r\n * the configuration of the block\r\n */\r\n public override config?: IFlowGraphMeshPickEventBlockConfiguration\r\n ) {\r\n super(config);\r\n this.asset = this.registerDataInput(\"asset\", RichTypeAny, config?.targetMesh);\r\n this.pickedPoint = this.registerDataOutput(\"pickedPoint\", RichTypeVector3);\r\n this.pickOrigin = this.registerDataOutput(\"pickOrigin\", RichTypeVector3);\r\n this.pointerId = this.registerDataOutput(\"pointerId\", RichTypeNumber);\r\n this.pickedMesh = this.registerDataOutput(\"pickedMesh\", RichTypeAny);\r\n this.pointerType = this.registerDataInput(\"pointerType\", RichTypeAny, PointerEventTypes.POINTERPICK);\r\n }\r\n\r\n public _getReferencedMesh(context: FlowGraphContext): AbstractMesh {\r\n return this.asset.getValue(context);\r\n }\r\n\r\n public override _executeEvent(context: FlowGraphContext, pickedInfo: PointerInfo): boolean {\r\n // get the pointer type\r\n const pointerType = this.pointerType.getValue(context);\r\n if (pointerType !== pickedInfo.type) {\r\n // returning true here to continue the propagation of the pointer event to the rest of the blocks\r\n return true;\r\n }\r\n const mesh = this._getReferencedMesh(context);\r\n const pickedMesh = pickedInfo.pickInfo?.pickedMesh;\r\n // When no target mesh is configured, fire for any picked mesh.\r\n // When a target is configured, require an exact match or descendant match.\r\n // Match by reference first, then by descendant, then by stable name/id as a\r\n // fallback for scene reloads where the object reference changes but the mesh\r\n // identity (name) is preserved (uniqueId increments monotonically and is NOT\r\n // stable across reloads).\r\n const meshMatches = !mesh ? !!pickedMesh : !!(pickedMesh && (pickedMesh === mesh || _IsDescendantOf(pickedMesh, mesh) || pickedMesh.name === mesh.name));\r\n if (meshMatches && pickedMesh) {\r\n this.pointerId.setValue((pickedInfo.event as PointerEvent).pointerId, context);\r\n this.pickOrigin.setValue(pickedInfo.pickInfo!.ray?.origin!, context);\r\n this.pickedPoint.setValue(pickedInfo.pickInfo!.pickedPoint!, context);\r\n this.pickedMesh.setValue(pickedMesh, context);\r\n this._execute(context);\r\n // stop the propagation if the configuration says so\r\n return !this.config?.stopPropagation;\r\n } else {\r\n // reset the outputs\r\n this.pointerId.resetToDefaultValue(context);\r\n this.pickOrigin.resetToDefaultValue(context);\r\n this.pickedPoint.resetToDefaultValue(context);\r\n this.pickedMesh.resetToDefaultValue(context);\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _preparePendingTasks(_context: FlowGraphContext): void {\r\n // no-op\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _cancelPendingTasks(_context: FlowGraphContext): void {\r\n // no-op\r\n }\r\n\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName(): string {\r\n return FlowGraphBlockNames.MeshPickEvent;\r\n }\r\n}\r\nRegisterClass(FlowGraphBlockNames.MeshPickEvent, FlowGraphMeshPickEventBlock);\r\n"]}
|
|
@@ -45,20 +45,53 @@ export class FlowGraphConsoleLogBlock extends FlowGraphExecutionBlockWithOutSign
|
|
|
45
45
|
getClassName() {
|
|
46
46
|
return "FlowGraphConsoleLogBlock" /* FlowGraphBlockNames.ConsoleLog */;
|
|
47
47
|
}
|
|
48
|
+
_serializeValue(value) {
|
|
49
|
+
if (value === null || value === undefined) {
|
|
50
|
+
return String(value);
|
|
51
|
+
}
|
|
52
|
+
if (typeof value === "object") {
|
|
53
|
+
// Prefer the object's own toString() (e.g. Vector3 → "{X:1 Y:2 Z:3}").
|
|
54
|
+
// Only fall back to JSON.stringify when toString() is the unhelpful default.
|
|
55
|
+
const str = value.toString();
|
|
56
|
+
if (str === "[object Object]") {
|
|
57
|
+
try {
|
|
58
|
+
return JSON.stringify(value);
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return str;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return str;
|
|
65
|
+
}
|
|
66
|
+
return String(value);
|
|
67
|
+
}
|
|
48
68
|
_getMessageValue(context) {
|
|
49
69
|
if (this.config?.messageTemplate) {
|
|
50
70
|
let template = this.config.messageTemplate;
|
|
51
71
|
const matches = this._getTemplateMatches(template);
|
|
72
|
+
// If the message input is an object, use its keys as the primary
|
|
73
|
+
// source for template placeholders, falling back to named data inputs.
|
|
74
|
+
const messageValue = this.message.getValue(context);
|
|
75
|
+
const messageObj = messageValue !== null && messageValue !== undefined && typeof messageValue === "object" ? messageValue : null;
|
|
52
76
|
for (const match of matches) {
|
|
53
|
-
|
|
77
|
+
let value;
|
|
78
|
+
if (messageObj !== null && match in messageObj) {
|
|
79
|
+
value = messageObj[match];
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
value = this.getDataInput(match)?.getValue(context);
|
|
83
|
+
}
|
|
54
84
|
if (value !== undefined) {
|
|
55
|
-
//
|
|
56
|
-
|
|
85
|
+
// Escape regex metacharacters in the placeholder name before building the pattern.
|
|
86
|
+
const escapedMatch = match.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
87
|
+
template = template.replace(new RegExp(`\\{${escapedMatch}\\}`, "g"), this._serializeValue(value));
|
|
57
88
|
}
|
|
58
89
|
}
|
|
59
90
|
return template;
|
|
60
91
|
}
|
|
61
92
|
else {
|
|
93
|
+
// No template — pass the raw value directly so Logger receives the original
|
|
94
|
+
// object (e.g. Vector3) rather than a stringified representation.
|
|
62
95
|
return this.message.getValue(context);
|
|
63
96
|
}
|
|
64
97
|
}
|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,MAAM,CAAC,MAAM,YAAY,KAAK,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;gBACvG,CAAC;YACL,CAAC;YACD,OAAO,QAAQ,CAAC;QACpB,CAAC;aAAM,CAAC;YACJ,4EAA4E;YAC5E,kEAAkE;YAClE,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC1C,CAAC;IACL,CAAC;IAEO,mBAAmB,CAAC,QAAgB;QACxC,MAAM,KAAK,GAAG,cAAc,CAAC;QAC7B,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,IAAI,KAAK,CAAC;QACV,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YAC7C,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AAED,aAAa,kEAAiC,wBAAwB,CAAC,CAAC","sourcesContent":["import { type FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { type FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../flowGraphExecutionBlockWithOutSignal\";\r\nimport { RichTypeAny, RichTypeString } from \"../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { type IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { Logger } from \"core/Misc/logger\";\r\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\r\n\r\n/**\r\n * Configuration for the console log block.\r\n */\r\nexport interface IFlowGraphConsoleLogBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * An optional message template to use for the log message.\r\n * If provided, the template can hold placeholders for the message value.\r\n * For example, if the template is \"The message is: \\{data\\}\", a new data input called \"data\" will be created.\r\n * The value of the message input will be used to replace the placeholder in the template.\r\n */\r\n messageTemplate?: string;\r\n}\r\n\r\n/**\r\n * Block that logs a message to the console.\r\n */\r\nexport class FlowGraphConsoleLogBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The message to log.\r\n * Will be ignored if a message template is provided.\r\n */\r\n public readonly message: FlowGraphDataConnection<any>;\r\n\r\n /**\r\n * Input connection: The log type.\r\n */\r\n public readonly logType: FlowGraphDataConnection<\"log\" | \"warn\" | \"error\">;\r\n\r\n /**\r\n * Creates a new console log block.\r\n * @param config optional configuration\r\n */\r\n public constructor(config?: IFlowGraphConsoleLogBlockConfiguration) {\r\n super(config);\r\n this.message = this.registerDataInput(\"message\", RichTypeAny);\r\n this.logType = this.registerDataInput(\"logType\", RichTypeString, \"log\") as FlowGraphDataConnection<\"log\" | \"warn\" | \"error\">;\r\n if (config?.messageTemplate) {\r\n const matches = this._getTemplateMatches(config.messageTemplate);\r\n for (const match of matches) {\r\n this.registerDataInput(match, RichTypeAny);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _execute(context: FlowGraphContext): void {\r\n const typeValue = this.logType.getValue(context);\r\n const messageValue = this._getMessageValue(context);\r\n if (typeValue === \"warn\") {\r\n Logger.Warn(messageValue);\r\n } else if (typeValue === \"error\") {\r\n Logger.Error(messageValue);\r\n } else {\r\n Logger.Log(messageValue);\r\n }\r\n // activate the output flow block\r\n this.out._activateSignal(context);\r\n }\r\n\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName(): string {\r\n return FlowGraphBlockNames.ConsoleLog;\r\n }\r\n\r\n private _serializeValue(value: any): string {\r\n if (value === null || value === undefined) {\r\n return String(value);\r\n }\r\n if (typeof value === \"object\") {\r\n // Prefer the object's own toString() (e.g. Vector3 → \"{X:1 Y:2 Z:3}\").\r\n // Only fall back to JSON.stringify when toString() is the unhelpful default.\r\n const str = value.toString();\r\n if (str === \"[object Object]\") {\r\n try {\r\n return JSON.stringify(value);\r\n } catch {\r\n return str;\r\n }\r\n }\r\n return str;\r\n }\r\n return String(value);\r\n }\r\n\r\n private _getMessageValue(context: FlowGraphContext): string {\r\n if (this.config?.messageTemplate) {\r\n let template: string = this.config.messageTemplate;\r\n const matches = this._getTemplateMatches(template);\r\n // If the message input is an object, use its keys as the primary\r\n // source for template placeholders, falling back to named data inputs.\r\n const messageValue = this.message.getValue(context);\r\n const messageObj = messageValue !== null && messageValue !== undefined && typeof messageValue === \"object\" ? messageValue : null;\r\n for (const match of matches) {\r\n let value: any;\r\n if (messageObj !== null && match in messageObj) {\r\n value = messageObj[match];\r\n } else {\r\n value = this.getDataInput(match)?.getValue(context);\r\n }\r\n if (value !== undefined) {\r\n // Escape regex metacharacters in the placeholder name before building the pattern.\r\n const escapedMatch = match.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\r\n template = template.replace(new RegExp(`\\\\{${escapedMatch}\\\\}`, \"g\"), this._serializeValue(value));\r\n }\r\n }\r\n return template;\r\n } else {\r\n // No template — pass the raw value directly so Logger receives the original\r\n // object (e.g. Vector3) rather than a stringified representation.\r\n return this.message.getValue(context);\r\n }\r\n }\r\n\r\n private _getTemplateMatches(template: string): string[] {\r\n const regex = /\\{([^}]+)\\}/g;\r\n const matches: string[] = [];\r\n let match;\r\n while ((match = regex.exec(template)) !== null) {\r\n matches.push(match[1]);\r\n }\r\n return matches;\r\n }\r\n}\r\n\r\nRegisterClass(FlowGraphBlockNames.ConsoleLog, FlowGraphConsoleLogBlock);\r\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FlowGraphAsyncExecutionBlock } from "./flowGraphAsyncExecutionBlock.js";
|
|
2
|
+
import { type IFlowGraphBlockConfiguration } from "./flowGraphBlock.js";
|
|
2
3
|
import { type FlowGraphContext } from "./flowGraphContext.js";
|
|
3
4
|
import { FlowGraphEventType } from "./flowGraphEventType.js";
|
|
4
5
|
/**
|
|
@@ -11,6 +12,18 @@ export declare abstract class FlowGraphEventBlock extends FlowGraphAsyncExecutio
|
|
|
11
12
|
* For example, scene start should have a negative priority because it should be initialized last.
|
|
12
13
|
*/
|
|
13
14
|
initPriority: number;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new event block.
|
|
17
|
+
* @param config optional configuration
|
|
18
|
+
*/
|
|
19
|
+
constructor(config?: IFlowGraphBlockConfiguration);
|
|
20
|
+
/**
|
|
21
|
+
* Deserializes from an object.
|
|
22
|
+
* Filters out the legacy "in" signal input that existed before event blocks
|
|
23
|
+
* stopped exposing it, so old serialized graphs load without error.
|
|
24
|
+
* @param serializationObject the object to deserialize from
|
|
25
|
+
*/
|
|
26
|
+
deserialize(serializationObject: any): void;
|
|
14
27
|
/**
|
|
15
28
|
* The type of the event
|
|
16
29
|
*/
|
|
@@ -4,8 +4,12 @@ import { FlowGraphAsyncExecutionBlock } from "./flowGraphAsyncExecutionBlock.js"
|
|
|
4
4
|
* its output signal when the event is triggered.
|
|
5
5
|
*/
|
|
6
6
|
export class FlowGraphEventBlock extends FlowGraphAsyncExecutionBlock {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Creates a new event block.
|
|
9
|
+
* @param config optional configuration
|
|
10
|
+
*/
|
|
11
|
+
constructor(config) {
|
|
12
|
+
super(config);
|
|
9
13
|
/**
|
|
10
14
|
* the priority of initialization of this block.
|
|
11
15
|
* For example, scene start should have a negative priority because it should be initialized last.
|
|
@@ -15,6 +19,21 @@ export class FlowGraphEventBlock extends FlowGraphAsyncExecutionBlock {
|
|
|
15
19
|
* The type of the event
|
|
16
20
|
*/
|
|
17
21
|
this.type = "NoTrigger" /* FlowGraphEventType.NoTrigger */;
|
|
22
|
+
// Event blocks are driven by scene events, not by an incoming signal.
|
|
23
|
+
// Remove the inherited `in` port so it is not shown in the editor UI
|
|
24
|
+
// and cannot be accidentally wired.
|
|
25
|
+
this._unregisterSignalInput("in");
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Deserializes from an object.
|
|
29
|
+
* Filters out the legacy "in" signal input that existed before event blocks
|
|
30
|
+
* stopped exposing it, so old serialized graphs load without error.
|
|
31
|
+
* @param serializationObject the object to deserialize from
|
|
32
|
+
*/
|
|
33
|
+
deserialize(serializationObject) {
|
|
34
|
+
const filtered = { ...serializationObject };
|
|
35
|
+
filtered.signalInputs = (serializationObject.signalInputs ?? []).filter((s) => s.name !== "in");
|
|
36
|
+
super.deserialize(filtered);
|
|
18
37
|
}
|
|
19
38
|
/**
|
|
20
39
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphEventBlock.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphEventBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"flowGraphEventBlock.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphEventBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAK9E;;;GAGG;AACH,MAAM,OAAgB,mBAAoB,SAAQ,4BAA4B;IAO1E;;;OAGG;IACH,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAXlB;;;WAGG;QACI,iBAAY,GAAW,CAAC,CAAC;QA0BhC;;WAEG;QACa,SAAI,kDAAoD;QArBpE,sEAAsE;QACtE,qEAAqE;QACrE,oCAAoC;QACpC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAED;;;;;OAKG;IACa,WAAW,CAAC,mBAAwB;QAChD,MAAM,QAAQ,GAAG,EAAE,GAAG,mBAAmB,EAAE,CAAC;QAC5C,QAAQ,CAAC,YAAY,GAAG,CAAC,mBAAmB,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;QACrG,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAMD;;OAEG;IACI,QAAQ,CAAC,OAAyB;QACrC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACjC,iEAAiE;QACjE,2DAA2D;QAC3D,8DAA8D;QAC9D,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED;;;;;;;;OAQG;IACa,kBAAkB,CAAC,OAAyB;QACxD,IAAI,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC;YAC7D,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;YAClC,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QACnC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC/B,mEAAmE;QACnE,mDAAmD;QACnD,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;CASJ","sourcesContent":["import { FlowGraphAsyncExecutionBlock } from \"./flowGraphAsyncExecutionBlock\";\r\nimport { type IFlowGraphBlockConfiguration } from \"./flowGraphBlock\";\r\nimport { type FlowGraphContext } from \"./flowGraphContext\";\r\nimport { FlowGraphEventType } from \"./flowGraphEventType\";\r\n\r\n/**\r\n * A type of block that listens to an event observable and activates\r\n * its output signal when the event is triggered.\r\n */\r\nexport abstract class FlowGraphEventBlock extends FlowGraphAsyncExecutionBlock {\r\n /**\r\n * the priority of initialization of this block.\r\n * For example, scene start should have a negative priority because it should be initialized last.\r\n */\r\n public initPriority: number = 0;\r\n\r\n /**\r\n * Creates a new event block.\r\n * @param config optional configuration\r\n */\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n // Event blocks are driven by scene events, not by an incoming signal.\r\n // Remove the inherited `in` port so it is not shown in the editor UI\r\n // and cannot be accidentally wired.\r\n this._unregisterSignalInput(\"in\");\r\n }\r\n\r\n /**\r\n * Deserializes from an object.\r\n * Filters out the legacy \"in\" signal input that existed before event blocks\r\n * stopped exposing it, so old serialized graphs load without error.\r\n * @param serializationObject the object to deserialize from\r\n */\r\n public override deserialize(serializationObject: any) {\r\n const filtered = { ...serializationObject };\r\n filtered.signalInputs = (serializationObject.signalInputs ?? []).filter((s: any) => s.name !== \"in\");\r\n super.deserialize(filtered);\r\n }\r\n\r\n /**\r\n * The type of the event\r\n */\r\n public readonly type: FlowGraphEventType = FlowGraphEventType.NoTrigger;\r\n /**\r\n * @internal\r\n */\r\n public _execute(context: FlowGraphContext): void {\r\n context._notifyExecuteNode(this);\r\n // Fire both signals: KHR_interactivity graphs connect to `done`,\r\n // while editor-authored graphs typically connect to `out`.\r\n // Both must fire so that either wiring style works correctly.\r\n this.done._activateSignal(context);\r\n this.out._activateSignal(context);\r\n }\r\n\r\n /**\r\n * @internal\r\n * Override _startPendingTasks so that event blocks do NOT fire the\r\n * `out` signal at graph-start time. The base FlowGraphAsyncExecutionBlock\r\n * fires `out` immediately in _startPendingTasks (useful for async blocks\r\n * like PlayAnimation that start a task and let sync flow continue).\r\n * Event blocks should only fire their output signals when the actual\r\n * event occurs, which is handled by _execute.\r\n */\r\n public override _startPendingTasks(context: FlowGraphContext): void {\r\n if (context._getExecutionVariable(this, \"_initialized\", false)) {\r\n this._cancelPendingTasks(context);\r\n this._resetAfterCanceled(context);\r\n }\r\n this._preparePendingTasks(context);\r\n context._addPendingBlock(this);\r\n // Do NOT fire out._activateSignal — event blocks fire both out and\r\n // done in _execute when the actual event triggers.\r\n context._setExecutionVariable(this, \"_initialized\", true);\r\n }\r\n\r\n /**\r\n * Execute the event. This function should be called by the flow graph when the event is triggered.\r\n * @param context the context in which the event is executed\r\n * @param payload the payload of the event\r\n * @returns a boolean indicating if the event should stop propagation. if false, the event will stop propagating.\r\n */\r\n public abstract _executeEvent(context: FlowGraphContext, payload: any): boolean;\r\n}\r\n"]}
|
|
@@ -913,6 +913,32 @@ export class FrameGraphTextureManager {
|
|
|
913
913
|
return { width: 4, height: 4, length: 8 };
|
|
914
914
|
case 37808:
|
|
915
915
|
return { width: 4, height: 4, length: 16 };
|
|
916
|
+
case 37809:
|
|
917
|
+
return { width: 5, height: 4, length: 16 };
|
|
918
|
+
case 37810:
|
|
919
|
+
return { width: 5, height: 5, length: 16 };
|
|
920
|
+
case 37811:
|
|
921
|
+
return { width: 6, height: 5, length: 16 };
|
|
922
|
+
case 37812:
|
|
923
|
+
return { width: 6, height: 6, length: 16 };
|
|
924
|
+
case 37813:
|
|
925
|
+
return { width: 8, height: 5, length: 16 };
|
|
926
|
+
case 37814:
|
|
927
|
+
return { width: 8, height: 6, length: 16 };
|
|
928
|
+
case 37815:
|
|
929
|
+
return { width: 8, height: 8, length: 16 };
|
|
930
|
+
case 37816:
|
|
931
|
+
return { width: 10, height: 5, length: 16 };
|
|
932
|
+
case 37817:
|
|
933
|
+
return { width: 10, height: 6, length: 16 };
|
|
934
|
+
case 37818:
|
|
935
|
+
return { width: 10, height: 8, length: 16 };
|
|
936
|
+
case 37819:
|
|
937
|
+
return { width: 10, height: 10, length: 16 };
|
|
938
|
+
case 37820:
|
|
939
|
+
return { width: 12, height: 10, length: 16 };
|
|
940
|
+
case 37821:
|
|
941
|
+
return { width: 12, height: 12, length: 16 };
|
|
916
942
|
case 36196:
|
|
917
943
|
case 37492:
|
|
918
944
|
return { width: 4, height: 4, length: 8 };
|