Attach gizmo to GLB without breaking the hierarchy / resizing / repositioning

Hi all -
Just wondering how to attach gizmo to a mesh within a loaded glb, without it popping the mesh out of its hierarchy in order to add the bounding box - which seems to reposition and resize the mesh. Do i need to reparent or something back to the hierarchy? Or save the size/position in advance and then re-apply? What’s the technique? (or am i just doing it wrong)?


Actually scratch this post! There must have been something odd happening with the model i’d used. Like an extraneous animation loop it seems. I’d exported from PixCap and it seems to be adding stuff that I didn’t notice. Stay cool and carry on.


I have this issue, too. And I’m not in control of whatever is in the model files.

Some kind of fix or workaround would be appreciated.

Ive just been experimenting with not setting the bounding box - which seems a lot cleaner b/c it doesn’t create the “box” container and doesn’t move the object out of its hierarchy. Is there any compelling reason to run this?

let boundingBox = BABYLON.BoundingBoxGizmo.MakeNotPickableAndWrapInBoundingBox(myMesh);

Ok, well, with enough editing Chrome eventually crashed (white “on snap” screen). So, maybe there are perf. issues. No idea how to measure the perf. issues though. I had 60fps right up until the crash. Wonder if there’s another place I can see memory filling up?

cc @Cedric about the gizmo but reading the post I am having issues to understand exactly which part we are trying to solve now @bigrig ? and which repro to use ?

I’m all good. My issue fixed with exporting from blender instead of pixcap.

But think @852Kerfunkle is having issues b/c he can’t modify his source Glbs… so suffers from the fact that MakeNotPickableAndWrapInBoundingBox pops the object out of its hierarchy and loses pos/rot/scaling seemingly as a result (?).

1 Like

Yes, I think that is what was happening. I’ve since cobbled together my own bounding box gizmo of sorts (it’s not nearly as nice, though) and moved on to other things.

I’ll have a look again at some point, but the behaviour was pretty much exactly what your playground showed.