From cf8707ef28a51cee581cc737418330f41a67f7e9 Mon Sep 17 00:00:00 2001 From: 0b5vr <0b5vr@0b5vr.com> Date: Tue, 23 Jul 2024 21:53:20 +0900 Subject: [PATCH] fix: expose addNodeMaterial and createNodeMaterialFromType (#1122) * fix: expose addNodeMaterial and createNodeMaterialFromType these functions are now exposed - See: https://github.com/mrdoob/three.js/blob/a00f79b32274975d5bd5c0f3d83ac8c31efec64d/src/nodes/materials/Materials.js#L3 - See: https://github.com/mrdoob/three.js/blob/a00f79b32274975d5bd5c0f3d83ac8c31efec64d/src/nodes/Nodes.js#L200 * refactor: npm run format * Update --------- Co-authored-by: Nathan Bierema --- types/three/src/nodes/materials/Materials.d.ts | 2 +- types/three/src/nodes/materials/NodeMaterial.d.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/types/three/src/nodes/materials/Materials.d.ts b/types/three/src/nodes/materials/Materials.d.ts index 2ec7a4b22..9d668a8a1 100644 --- a/types/three/src/nodes/materials/Materials.d.ts +++ b/types/three/src/nodes/materials/Materials.d.ts @@ -8,7 +8,7 @@ export { default as MeshPhysicalNodeMaterial } from "./MeshPhysicalNodeMaterial. export { default as MeshSSSPhysicalNodeMaterial } from "./MeshSSSNodeMaterial.js"; export { default as MeshStandardNodeMaterial } from "./MeshStandardNodeMaterial.js"; export { default as MeshToonNodeMaterial } from "./MeshToonNodeMaterial.js"; -export { default as NodeMaterial } from "./NodeMaterial.js"; +export { addNodeMaterial, createNodeMaterialFromType, default as NodeMaterial } from "./NodeMaterial.js"; export { default as PointsNodeMaterial } from "./PointsNodeMaterial.js"; export { default as ShadowNodeMaterial } from "./ShadowNodeMaterial.js"; export { default as SpriteNodeMaterial } from "./SpriteNodeMaterial.js"; diff --git a/types/three/src/nodes/materials/NodeMaterial.d.ts b/types/three/src/nodes/materials/NodeMaterial.d.ts index bbd4651d0..8df7ea1ba 100644 --- a/types/three/src/nodes/materials/NodeMaterial.d.ts +++ b/types/three/src/nodes/materials/NodeMaterial.d.ts @@ -118,3 +118,6 @@ export default class NodeMaterial extends Material { static fromMaterial(material: NodeMaterial): NodeMaterial; static fromMaterial(material: Material): NodeMaterial; } + +export function addNodeMaterial(type: string, nodeMaterial: typeof NodeMaterial): void; +export function createNodeMaterialFromType(type: string): NodeMaterial;