ComputeNodeWidget#
- class omni.graph.ui.ComputeNodeWidget(title='OmniGraph Node', collapsed=False)#
Bases:
UsdPropertiesWidgetCreates and registers a widget in the Property Window to display Compute Node contents
Methods
__init__([title, collapsed])Constructor.
add_template_path(file_path)Makes a path from the file_path parameter and adds it to templates paths.
apply_default_layout(props)Performs standard preparation of an OmniGraph node's properties for display in the Property Window: - remove unwanted props (e.g. hidden) - organize into display groups ("Relationships", "Inputs", etc) - prettify prop names (strip "inputs:" prefix, apply UI name, etc) - reorder props (e.g. move relationships to the start of the list).
build_property_item(stage, ui_prop, prim_paths)Override of base - intercepts all attribute widget building
bundle_elements_layout_fn(**kwargs)display_bundles_content()get_additional_kwargs(ui_attr)Override this function if you want to supply additional arguments when building the label or ui widget.
get_bundles()get_instance()get_template_path(template_name)Deterimine the full path to the node template if it exists
get_widget_prim()list_diff(list_a, list_b)load_template(props)Find a template for this node and apply it to our properties
move_elements_to_beginning(elements_list, ...)on_bundles_update(event)on_new_payload(payload)See PropertyWidget.on_new_payload
on_shutdown()on_stage_update(event)rebuild_window()reset()See PropertyWidget.reset
set_bundle_models_values()width_changed_subscribe()Attributes
ATTRIB_LIST_INDEXBUNDLE_INDEXpayload- __init__(title='OmniGraph Node', collapsed=False)#
Constructor.
- Parameters:
title (str) – title of the widget.
collapsed (bool) – whether the collapsable frame should be collapsed for this widget.
multi_edit (bool) – whether multi-editing is supported.
enable_adapter (bool) – use stage_adapters
maintain_property_order (bool) – _customize_props_layout returns a list of properties to display on the widget.
- add_template_path(file_path)#
Makes a path from the file_path parameter and adds it to templates paths.
So if there is a same kind of structure:
/templates/template_<ModuleName>.<NameOfComputeNodeType>.py <my_extension>.py
then template path can be added by this line in the <my_extension>.py:
omni.graph.ui.ComputeNodeWidget.get_instance().add_template_path(__file__)
example of template filename:
template_omni.particle.system.core.Emitter.py
- apply_default_layout(
- props: list[UsdPropertyUiEntry],
Performs standard preparation of an OmniGraph node’s properties for display in the Property Window: - remove unwanted props (e.g. hidden) - organize into display groups (“Relationships”, “Inputs”, etc) - prettify prop names (strip “inputs:” prefix, apply UI name, etc) - reorder props (e.g. move relationships to the start of the list)
- Parameters:
node (props - List of property UI entries for the attributes of the) – of the list will be undefined after the call and should not be used afterward.
- Returns:
The modified list of property UI entries.
- build_property_item(
- stage,
- ui_prop: UsdPropertyUiEntry,
- prim_paths: list[Path],
Override of base - intercepts all attribute widget building
- get_additional_kwargs(
- ui_attr: UsdAttributeUiEntry,
Override this function if you want to supply additional arguments when building the label or ui widget.
- get_template_path(
- template_name: str,
Deterimine the full path to the node template if it exists
- load_template(
- props: list[UsdPropertyUiEntry],
Find a template for this node and apply it to our properties
- on_new_payload(payload: list[Path]) bool#
See PropertyWidget.on_new_payload
- reset()#
See PropertyWidget.reset