repo: janusweb action: commit revision: path_from: revision_from: ad89210c43e41f81ded547b881e6b584809dd2e5: path_to: revision_to:
commit ad89210c43e41f81ded547b881e6b584809dd2e5 Author: James BaicoianuDate: Tue Sep 3 10:02:03 2024 -0700 Allow highlighter to work directly with THREE.js Object3Ds diff --git a/scripts/elements/outliner.js b/scripts/elements/outliner.js
--- a/scripts/elements/outliner.js
+++ b/scripts/elements/outliner.js
@@ -74,14 +74,25 @@ elation.require(['janusweb.janusbase'], function() {
return;
}
let objmeshes = [], skinnedmeshes = [];
- object.traverseObjects(n => {
- if (n instanceof THREE.Mesh && n.material !== this.outlinematerial) {
- if (n.isSkinnedMesh)
- skinnedmeshes.push(n);
- else
- objmeshes.push(n);
- }
- });
+ if (object instanceof THREE.Object3D) {
+ object.traverse(n => {
+ if (n instanceof THREE.Mesh && n.material !== this.outlinematerial) {
+ if (n.isSkinnedMesh)
+ skinnedmeshes.push(n);
+ else
+ objmeshes.push(n);
+ }
+ });
+ } else {
+ object.traverseObjects(n => {
+ if (n instanceof THREE.Mesh && n.material !== this.outlinematerial) {
+ if (n.isSkinnedMesh)
+ skinnedmeshes.push(n);
+ else
+ objmeshes.push(n);
+ }
+ });
+ }
// Create and update regular Meshes
let meshIdx = 0;
for (; meshIdx < objmeshes.length; meshIdx++) {
-----END OF PAGE-----