The gizmo uses the latest cameras in inspector


In the inspector when we want to display a gizmo, it does not work correctly when there are several cameras.
In fact, it takes the last camera and the scene displays the first camera well. so we never see the gizmo on the camera[0]
Wouldn’t it be possible to define the active camera for the inspector’s gizmos? An options in :{activeCamera: camera[0]});

Afterwards, yes we can modify the order of the cameras in activeCameras, but my cameras are already in an order that suits me. Changing the order would break everything. The ideal would be to be able to choose the camera that the gizmo of the inspector uses. On my scene, the camera{0] is used.
Besides, the scene uses the first active camera, it would be logical for the inspector to do the same.

Did I miss something otherwise, an option that I would not have seen?

That should not be the case. If you pick a camera and select a move gizmo it should appear on that camera

cc @Cedric

I can’t choose only one camera when we have several :

scene.activeCameras = [camera0, camera1, camera2, cameragui];
here it is cameragui which is taken into account for the gizmo of the inspector, but for the scene it is indeed camera0

This does nothing :
scene.activeCamera = scene.activeCameras[0];

What I would like is for the gizmos to take into account the first camera (camera[0]) and not the last (camera[4]) Or maybe an additional option in show(activveCamera: cameras[0])

Hope you are well. I sort of remember you had (a base of) a PG for this including the gizmo, correct?
But I can’t find it just now? Would you mind posting it here so we can have a closer look. Sry, I’m such a lazy person, I don’t feel like adding the gizmo to the scene? No, in truth, if I recall correctly you also had a number of viewports and some specific behavior of the camera depending on context (or is it another project?)

Edit: Sry in advance, created some ‘shit’ in this PG before finding what I was looking for. In truth, I’m not a specialist of gizmos :wink: But I think what you are looking for is ’ UtilityLayerRenderer
Quite simple in fact, once you know where to look :smiley: Line 47 in this ‘dirty’ PG (again apologies for that). Hope this helps anyways and have a great day :sunglasses:

Edit1: Of course it works with the gizmo manager as well, you just need to instruct on the utility layer to not use the default rendering

Salut Mawa,

I may have expressed myself badly. I’m talking about the inspector’s gizmo. You don’t need to add one.
The Gizmo inspector’s does not work with several cameras. it takes into account the last camera only.

use the gizmo available in the inspector, but we cannot define which camera the inspector uses. The scene takes camera[0] but the inspector takes the last active camera and not the first.

Here is a picture of the Gizmos I’m talking about.
2022-06-10 16_06_35-Greenshot

Indeed. I completely misunderstood this. My apologies. :pleading_face:
Now that you explain it, actually you are right and I noticed this before.
I could deal without it but I can understand that depending on project it can be annoying.
Though I have no idea what sort of effort it would require to implement/fix this.

May be you should edit the category of your post which is not really a question, in my opinion.
Rather a ‘bug’ or ‘feature request’?

Yes it’s true, I hesitated to post in bug, I thought maybe there was something I had missed.
I can’t move my post. Maybe someone on the team can do it.

@Cedric were you able to take a look at this?
thanks in advance

no, it’s still on my todo list.

@sebavan when setting in PG code : scene.activeCamera = camera0;, the activeCamera is still the last one in the activeCameras list. why?

activeCameras is used when in multi camera mode and will normally superseed activeCamera.

But to “simplify” the process I think that during the render phase, in scene, the current activeCamera is swap in a foreach loop by one of the activeCameras.

I’ve created a new issue to keep track of it: The gizmo uses the latest cameras in inspector · Issue #12650 · BabylonJS/Babylon.js · GitHub


Following some breaking changes introduced in the previous PR, I pushed this fix: Fix Camera Order Back Compat by sebavan · Pull Request #13162 · BabylonJS/Babylon.js · GitHub

It should help specifying the Camera you want for gizmo with this: as some setup like choosing one of the middle camera would never be possible otherwise.

Please note, the playground will only work after the next nightly.

1 Like

There still seems to be a minor issue. As seen in the playground, the light gizmo stays invisible unless you dispose all cameras except camera0. T


I tried to add some cameras in a playground and the lightgizmo was visible (when enabled) in each of them. do you have some steps to repro?

  2. click the visibility icon of the light object as I have pointed in the first screen shot
  3. the light mesh doesn’t appear
  4. dispose all cameras except camera0
  5. the light mesh appears as seen in the second screenshot
1 Like

looks like a bug. I’m adding to my todo list.

Sorry for the delay