three-zoo 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/miscellaneous/SceneResolver.js +28 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export { StandardToLambertConverter } from "./materialConverters/StandardToLambe
|
|
|
19
19
|
export { StandardToPhongConverter } from "./materialConverters/StandardToPhongConverter";
|
|
20
20
|
export { StandardToPhysicalConverter } from "./materialConverters/StandardToPhysicalConverter";
|
|
21
21
|
export { StandardToToonConverter } from "./materialConverters/StandardToToonConverter";
|
|
22
|
+
export { SceneResolver } from "./miscellaneous/SceneResolver";
|
|
22
23
|
export { SceneSorter } from "./miscellaneous/SceneSorter";
|
|
23
24
|
export { SceneTraversal } from "./miscellaneous/SceneTraversal";
|
|
24
25
|
export { SkinnedMeshBaker } from "./miscellaneous/SkinnedMeshBaker";
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ export { StandardToLambertConverter } from './materialConverters/StandardToLambe
|
|
|
19
19
|
export { StandardToPhongConverter } from './materialConverters/StandardToPhongConverter.js';
|
|
20
20
|
export { StandardToPhysicalConverter } from './materialConverters/StandardToPhysicalConverter.js';
|
|
21
21
|
export { StandardToToonConverter } from './materialConverters/StandardToToonConverter.js';
|
|
22
|
+
export { SceneResolver } from './miscellaneous/SceneResolver.js';
|
|
22
23
|
export { SceneSorter } from './miscellaneous/SceneSorter.js';
|
|
23
24
|
export { SceneTraversal } from './miscellaneous/SceneTraversal.js';
|
|
24
25
|
export { SkinnedMeshBaker } from './miscellaneous/SkinnedMeshBaker.js';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Object3D, Mesh, Material } from 'three';
|
|
2
|
+
import { SceneTraversal } from './SceneTraversal.js';
|
|
3
|
+
|
|
4
|
+
class SceneResolver {
|
|
5
|
+
static resolveObject3DByName(scene, name) {
|
|
6
|
+
const result = SceneTraversal.getObjectByName(scene, name);
|
|
7
|
+
if (result instanceof Object3D) {
|
|
8
|
+
return result;
|
|
9
|
+
}
|
|
10
|
+
throw new Error(`Object3D with name "${name}" not found.`);
|
|
11
|
+
}
|
|
12
|
+
static resolveMeshByName(scene, name) {
|
|
13
|
+
const result = SceneTraversal.getObjectByName(scene, name);
|
|
14
|
+
if (result instanceof Mesh) {
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
throw new Error(`Mesh with name "${name}" not found.`);
|
|
18
|
+
}
|
|
19
|
+
static resolveMaterialByName(scene, name) {
|
|
20
|
+
const result = SceneTraversal.getMaterialByName(scene, name);
|
|
21
|
+
if (result instanceof Material) {
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
throw new Error(`Material with name "${name}" not found.`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { SceneResolver };
|