Python Usage Examples
Use the extension instance interface
from omni.kit.widget.layers import get_instance()
layer_instance = get_instance()
# set current focused layer
layer_instance.set_current_focused_layer_item(some_layer_path)
def on_layer_selection_changed(self, item):
layer_item = layer_instance.get_current_focused_layer_item()
if layer_item:
# do something on layer selection changed
pass
# subscribe layer item select change in layer widget
layer_instance.add_layer_selection_changed_fn(on_layer_selection_changed)
# remve the subscribe function
layer_instance.remove_layer_selection_changed_fn(on_layer_selection_changed)