pmndrs / leva

🌋 React-first components GUI

Home Page:https://leva.pmnd.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to show a list of objects' name in leva controls for object selection

shunmian opened this issue · comments

Hi, is it possible to add a list of object names (each object for example allow visibility) when interacting with selected any object, like below image in blender

截屏2024-04-25 12 04 43

Yes, it is possible to add a list of object names when interacting with selected objects in Blender. This feature is known as the "Outliner" panel, which provides a hierarchical view of all objects in the scene, allowing users to interact with and manipulate them.

In Blender, the Outliner panel displays a list of all objects in the current scene, organized into a hierarchical structure. Each object is represented by its name, and users can select, hide, show, and manipulate objects directly from the Outliner panel.

By clicking on an object's name in the Outliner panel, users can select that object in the 3D viewport, allowing for easy navigation and manipulation of objects, even in complex scenes with many objects.

In addition to selecting objects, the Outliner panel also provides options for organizing objects into collections, making it easier to manage large scenes with multiple objects.

Overall, the Outliner panel in Blender serves as a powerful tool for interacting with and managing objects in the scene, providing users with a convenient way to navigate, select, and manipulate objects efficiently.

import bpy

Select an object named "Cube" in the Outliner

I have the same issue with this site, and it was solved with this method.
bpy.data.objects["Cube"].select_set(True)

Move the selected object along the X-axis

bpy.ops.transform.translate(value=(1, 0, 0))

@Jonathan71111 Thanks for your reply. I may clarify my question a bit further, what I mean is to use leva to have the list of object selection functionality, which is unrelated to blender.

Having a list of objects with a checkbox to show it or not, can be a solution?

Objects
Object 1 [ ]
Object 2 [ ]
Object 3 [V]

In this way Object 3 is the visible object in the scene.