SdfAssetPathAttributeModel
- class omni.kit.property.usd.SdfAssetPathAttributeModel(stage: Stage, attribute_paths: List[Path], self_refresh: bool, metadata: dict, **kwargs)
Bases:
UsdAttributeModel
A value model for monitoring USD asset path attributes.
This model is specifically designed to handle the Sdf.AssetPath attribute type in USD, providing additional functionality to resolve and validate asset paths.
- Parameters
stage (
Usd.Stage
) – The USD stage associated with the attribute.attribute_paths (List[
Sdf.Path
]) – A list of Sdf.Path objects representing the attribute paths to monitor.self_refresh (bool) – Indicates whether the model should refresh itself when the attribute value changes.
metadata (dict) – Additional metadata that may be needed for the model.
- Keyword Arguments
treat_array_entry_as_comp (bool) – If True, treat array entries as individual components. Default is False.
Methods
__init__
(stage, attribute_paths, ...)Constructor for SdfAssetPathAttributeModel.
Gets the resolved path of the asset.
get_value_as_string
([elide_big_array])Gets the string representation of the asset path value.
Checks if the model is currently in an editing state.
Determines if the stored asset path is valid.
set_value
(value[, comp, resolved_path])Sets the value of the asset path.
Attributes
- __init__(stage: Stage, attribute_paths: List[Path], self_refresh: bool, metadata: dict, **kwargs)
Constructor for SdfAssetPathAttributeModel.
- get_resolved_path()
Gets the resolved path of the asset.
- Returns
The resolved asset path.
- Return type
str
- get_value_as_string(elide_big_array=True) str
Gets the string representation of the asset path value.
- Parameters
elide_big_array (bool) – If True, large arrays will be shortened in the representation.
- Returns
The string representation of the asset path value.
- Return type
str
- is_editing() bool
Checks if the model is currently in an editing state.
- Returns
True if editing, False otherwise.
- Return type
bool
- is_valid_path() bool
Determines if the stored asset path is valid.
- Returns
True if the path is valid, False otherwise.
- Return type
bool
- set_value(value, comp: int = -1, resolved_path: str = '')
Sets the value of the asset path.
- Parameters
value (str) – The new value for the asset path.
comp (int) – Component index when dealing with array attributes.
resolved_path (str) – The resolved path corresponding to the value.