TfTokenAttributeModel
- class omni.kit.property.usd.TfTokenAttributeModel(stage: Stage, attribute_paths: List[Path], self_refresh: bool, metadata: dict)
Bases:
AbstractItemModel
,UsdBase
A model specialized in managing USD attributes represented as tokens.
This model allows for interaction with USD attributes that are token-based, providing functionality for updating, editing, and retrieving token values. It integrates with USD stages and attribute paths to facilitate the management of token attributes, including handling self-refresh behavior and metadata processing.
- Parameters
stage (
Usd.Stage
) – The USD stage where the attributes are located.attribute_paths (List[
Sdf.Path
]) – A list of paths to the token attributes within the USD stage.self_refresh (bool) – Indicates whether the model should automatically refresh its value when changes are detected.
metadata (dict) – A dictionary containing metadata related to the attribute.
Methods
__init__
(stage, attribute_paths, ...)Constructor for TfTokenAttributeModel.
begin_edit
(item)Begins an edit operation on the given item.
clean
()Cleans up the model, releasing resources if necessary.
end_edit
(item)Ends an edit operation on the given item.
get_item_children
(item)Retrieves the children of a given item.
get_item_value_model
(item, column_id)Gets the value model for the specified item and column.
Gets the token value of the current index.
is_allowed_token
(token)Checks if the provided token is allowed.
Attributes
- __init__(stage: Stage, attribute_paths: List[Path], self_refresh: bool, metadata: dict)
Constructor for TfTokenAttributeModel.
- begin_edit(item)
Begins an edit operation on the given item.
- Parameters
item – The item to begin the edit on.
- clean()
Cleans up the model, releasing resources if necessary.
- end_edit(item)
Ends an edit operation on the given item.
- Parameters
item – The item to end the edit on.
- get_item_children(item)
Retrieves the children of a given item.
- Parameters
item – The item to retrieve the children for.
- get_item_value_model(item, column_id)
Gets the value model for the specified item and column.
- Parameters
item – The item to get the value model for.
column_id – The column id related to the value model.
- get_value_as_token()
Gets the token value of the current index.
- is_allowed_token(token)
Checks if the provided token is allowed.
- Parameters
token – The token to check for allowance.