Gizmo Manager and Billboard/Animations

I’ve noticed some behavior with the GizmoManager that isn’t a bug, but I’m trying to find some way around it.

If I have a mesh with billboardMode set to anything besides none, or a mesh with an animation on it, like a simple animation done in the render loop, as soon as I attached the Gizmo to the mesh then those animations and behaviors stop. I understand that, because at that point we have to let the Gizmo manager do its thing. But when the GizmoManager gets attached to something else or leaves that mesh, it would be neat if the animation I was putting on the mesh from the render loop could resume automatically, as well as the billboard mode it had before the gizmo manager was placed on it.

Any ideas around how I could achieve this?

Cc @Cedric

Billboard mode should be preserved. For animation, I don’t know why it stops. I don’t remember code explicitly stopping animation before editing. It might be implicit.

Do you have a PG I can test?

Hi @Cedric , here’s a simple PG where I put an animation on a mesh in the renderloop. When you click on the spinning one and the gizmo manager comes on, the animation stops. It also doesn’t resume if you click another mesh!

Babylon.js Playground (babylonjs.com)

Ho ! I get it! gizmos use rotationQuaternion. Once you bind the mesh with the gizmo, rotation is not used anymore but rotationQuaternion is.

When animating with quaternion:

Babylon.js Playground (babylonjs.com)

3 Likes

@gabrieljbaker was it what you were looking for ? I would think so but rather ask before closing blindly :slight_smile:

Hi @sebavan :slight_smile: thanks for checking. This did work for rotation however I’m still struggling to get billboard mode to “stick” when a gizmo comes on then off a mesh. I’m going to poke around just a bit more tonight on this and will report back!

2 Likes

This is all good now @sebavan and @Cedric , thanks again!

You will see the outcome of this in the next Frame release where we have a cool “spin” feature that lets users add a simple spin animation to various assets. Simple but slick. :grin:

I think my lingering issue with the billboard mode has to do with code on our side so I’m going to poke at that and if I identify something concrete I’ll raise it in a separate post!

3 Likes