studio icon indicating copy to clipboard operation
studio copied to clipboard

[New3D] Set "selected_id" global variable when selecting a marker

Open jhurliman opened this issue 3 years ago • 2 comments

User-Facing Changes

  • 3D (Beta) panel sets a global variable named selected_id when selecting a marker in the 3D scene

Description

This also wires the map of global variables into Renderer instances, which is not currently used but could be used in the future to make object selection propagate across all 3d panels or expose variables to 3d panel scene extensions.

jhurliman avatar Jul 26 '22 23:07 jhurliman

@amacneil After talking through some nuances with @jhurliman on the "selected object" feature, we decided to go with selected_id variable for now. This allows us to replicate the main behavior of: select an object in the scene and use that with message path syntax queries. We decided that a larger scope "selected object" variable or built-in feature should be a follow-on since thats a larger scope that isn't something old3d did.

The other gotcha we discovered that led us to this conclusion is that the variables are saved to the layout. Without additional care on filtering the selected object you could easily end up with a layout that balloons to 8MB in size if you happen to select a grid or other large message object.

defunctzombie avatar Jul 27 '22 15:07 defunctzombie

Feedback:

  • No need to implement support for changing the selected variable ID (wait and see if anyone asks for it)
  • Set $selected_id to null after I deselect an item (so that it doesn't cause message path syntax errors in my layout)
  • Update Node Playground examples from id to selected_id

amacneil avatar Jul 27 '22 21:07 amacneil