UsdShadeBaseWidget
- class omni.kit.property.material.scripts.widgets.usdshade.base_widget.UsdShadeBaseWidget(schema: SchemaBase, title: str, schema_ignore: Optional[List[SchemaBase]] = None)
Bases:
UsdPropertiesWidget
A base class for creating widgets for USD Shade elements.
This class provides a foundation for deriving custom widgets that interact with USD Shading prims, such as shaders and materials. It handles common functionalities like managing USD schema objects, setting up white mode exceptions, and responding to MDL module loads. It also facilitates the customization of the widget’s UI, including property ordering and group collapsing.
- Parameters
schema (
Usd.SchemaBase
) – The USD schema this widget targets.title (str) – The top level group name in the UI.
schema_ignore (Optional[List[
Usd.SchemaBase
]]) – Optional list of USD schema types ignored by this widget.
Methods
__init__
(schema, title[, schema_ignore])Initializes the UsdShadeBaseWidget.
clean
()Cleans up resources and unsubscribes from events before the widget is destroyed.
get_additional_kwargs
(ui_prop)Generates additional keyword arguments for the UI properties.
on_new_payload
(payload)Handles a new payload for the widget.
Attributes
Path to material adapter setting.
Identifier for white mode exception input.
Path to white mode exceptions setting.
Flag for testing/debugging the UI layout.
Flag to print metadata for debugging.
Order to display UI groups.
- __init__(schema: SchemaBase, title: str, schema_ignore: Optional[List[SchemaBase]] = None)
Initializes the UsdShadeBaseWidget.
This method initializes the widget with a USD schema and various settings.
- clean() None
Cleans up resources and unsubscribes from events before the widget is destroyed.
- get_additional_kwargs(ui_prop: UsdPropertyUiEntry) Tuple[Optional[dict], Optional[dict]]
Generates additional keyword arguments for the UI properties.
- Parameters
ui_prop (
UsdPropertyUiEntry
) – The UI property for which to generate the kwargs.
- on_new_payload(payload: PrimSelectionPayload) bool
Handles a new payload for the widget.
- Parameters
payload (
PrimSelectionPayload
) – The new payload to be handled by the widget.- Returns
Whether the payload can be represented by this widget.
- Return type
bool
- MATERIAL_ADAPTER_SETTING_PATH = '/ext/omni.kit.property.material/enableAdapter'
Path to material adapter setting.
- Type
str
- MATERIAL_WHITE_MODE_EXCEPTION_INPUT = 'inputs:excludeFromWhiteMode'
Identifier for white mode exception input.
- Type
str
- MATERIAL_WHITE_MODE_EXCEPTION_LIST_SETTING_PATH = '/persistent/app/rendering/whiteModeExceptions'
Path to white mode exceptions setting.
- Type
str
- PRINT_LAYOUT = False
Flag for testing/debugging the UI layout.
- Type
bool
- PRINT_LAYOUT_METADATA = False
Flag to print metadata for debugging.
- Type
bool
- UI_ORDER = ['Description', 'inputs', 'outputs', 'info', 'Material Flags', 'ui']
Order to display UI groups.
- Type
List[str]