Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Selection by prim type for Composer UI #8

Open
chunghob opened this issue Aug 16, 2023 · 0 comments
Open

Add Selection by prim type for Composer UI #8

chunghob opened this issue Aug 16, 2023 · 0 comments
Labels
new request Request a new code sample

Comments

@chunghob
Copy link

chunghob commented Aug 16, 2023

Sync with @mati-nvidia about adding more ways to get prim selection by type to for better discoverability.

import omni.usd

stage = omni.usd.get_context().get_stage()
selection = omni.usd.get_context().get_selection()

prim_paths = []
for prim in stage.Traverse():
    # Change string to desired type i.e. Xform, Mesh, Scope, etc
    if prim.GetTypeName() == "Material":
        prim_path = prim.GetPath()
        prim_paths.append(str(prim_path))

print(prim_paths)
selection.set_selected_prim_paths(prim_paths, True)
@mati-nvidia mati-nvidia added the new request Request a new code sample label Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new request Request a new code sample
Projects
None yet
Development

No branches or pull requests

2 participants