UsdShadeCustomModelsBuilder

class omni.kit.property.material.scripts.widgets.usdshade.models.builder.UsdShadeCustomModelsBuilder

Bases: object

A class responsible for constructing custom models for USD shading properties.

This class includes methods that build custom UI components based on the shading attributes and metadata provided. These methods are used to generate UI elements like call expressions, matrices, outputs, and checkboxes that correspond to various USD shading property types. Each method is a class method, ensuring that direct instantiation of the class is not required to utilize the functionality.

Methods

call_expression_builder(stage, attr_name, ...)

Builds and returns a CallExpressionModel for the given attribute.

checkbox_builder(stage, attr_name, metadata, ...)

Builds and returns a boolean property widget.

matrix_builder(stage, attr_name, metadata, ...)

Builds and returns a model for matrix attributes.

outputs_builder(stage, attr_name, metadata, ...)

For outputs create a string field with no value that is locked for editing.

__init__()
classmethod call_expression_builder(stage, attr_name, metadata, type_name, prim_paths: List[Path], additional_label_kwargs=None, additional_widget_kwargs=None)

Builds and returns a CallExpressionModel for the given attribute.

Parameters
  • stage – The stage to which the model belongs.

  • attr_name (str) – The name of the attribute for which the model is created.

  • metadata (dict) – Metadata associated with the attribute.

  • type_name (str) – The type name of the attribute.

  • prim_paths (List[Sdf.Path]) – List of paths to the primitives containing the attribute.

  • additional_label_kwargs (Optional[dict]) – Additional kwargs for the label creation.

  • additional_widget_kwargs (Optional[dict]) – Additional kwargs for the widget creation.

Returns

The created CallExpressionModel instance.

Return type

CallExpressionModel

classmethod checkbox_builder(stage, attr_name, metadata, type_name, prim_paths: List[Path], additional_label_kwargs=None, additional_widget_kwargs=None)

Builds and returns a boolean property widget.

Parameters
  • stage – The stage to which the model belongs.

  • attr_name (str) – The name of the attribute for which the model is created.

  • metadata (dict) – Metadata associated with the attribute.

  • type_name (str) – The type name of the attribute.

  • prim_paths (List[Sdf.Path]) – List of paths to the primitives containing the attribute.

  • additional_label_kwargs (Optional[dict]) – Additional kwargs for label creation.

  • additional_widget_kwargs (Optional[dict]) – Additional kwargs for widget creation.

classmethod matrix_builder(stage, attr_name, metadata, type_name, prim_paths: List[Path], additional_label_kwargs=None, additional_widget_kwargs=None)

Builds and returns a model for matrix attributes.

Parameters
  • stage – The stage to which the model belongs.

  • attr_name (str) – The name of the attribute for which the model is created.

  • metadata (dict) – Metadata associated with the attribute.

  • type_name (str) – The type name of the attribute.

  • prim_paths (List[Sdf.Path]) – List of paths to the primitives containing the attribute.

  • additional_label_kwargs (Optional[dict]) – Additional kwargs for label creation.

  • additional_widget_kwargs (Optional[dict]) – Additional kwargs for widget creation.

Returns

The created matrix attribute model.

classmethod outputs_builder(stage, attr_name, metadata, type_name, prim_paths: List[Path], additional_label_kwargs=None, additional_widget_kwargs=None)

For outputs create a string field with no value that is locked for editing.

Parameters
  • stage – The stage to which the model belongs.

  • attr_name (str) – The name of the attribute for which the model is created.

  • metadata (dict) – Metadata associated with the attribute.

  • type_name (str) – The type name of the attribute.

  • prim_paths (List[Sdf.Path]) – List of paths to the primitives containing the attribute.

  • additional_label_kwargs (Optional[dict]) – Additional kwargs for label creation.

  • additional_widget_kwargs (Optional[dict]) – Additional kwargs for widget creation.

Returns

The created UsdShadeOutputModel instance.

Return type

UsdShadeOutputModel