question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

Is there any reason why Object3D.traverseAncestors is not called on this, unlike Object3D.traverse ?

See original GitHub issue

I expected Object3D.traverseAncestors to behave like Object3D.traverse in this regard. Has it been done like this intentionally for some reason ?

If you want I can add callback( this ); here : https://github.com/mrdoob/three.js/blob/6400f2c9b6ee58e01c005a66f00c7cd1113752aa/src/core/Object3D.js#L494

Although it could potentially break a lot of things for such a trivial benefitā€¦

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Mugen87commented, Jun 1, 2020

@felixmariotto Iā€™ve made the experience that other users were confused by traverseAncestors(), too šŸ˜… . They thought the method just changes the direction of the traversal but apart from that behaves identical.

1reaction
felixmariottocommented, Jun 1, 2020

Yes is does make sense according to the semantic of ā€œancestorsā€.

This sentence actually meant that I agree that the current behaviour does make sense according the semantic of ā€œancestorsā€.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Object3D#traverse ā€“ three.js docs
Like traverse, but the callback will only be executed for visible objects. Descendants of invisible objects are not traversed.
Read more >
abort object3d.traverse in three.js - Stack Overflow
The processing basically continues until your callback returns true , at which point it triggers a cascade back up the traverse recursionĀ ...
Read more >
Loop over all objects in a threejs scene with the Object3d ...
The way this works is I just call the traverse method off of the scene object, or any object based off the object3d...
Read more >
Three.js Cleanup
For Object3D, if they aren't referenced they'll be garbage collected so there's no reason to free them. Just remove them from the scene....
Read more >
aframe-vatiste-toolkit Documentation and Reference
Object3D as a glb file in a single function call. There's even a PhysX-based physics ... Object3D.traverse to find the first object where...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found