SdfAssetPathArrayAttributeSingleEntryModel#
- class omni.kit.property.usd.SdfAssetPathArrayAttributeSingleEntryModel(
- stage: Stage,
- attribute_paths: List[Path],
- index: int,
- self_refresh: bool,
- metadata: dict,
Bases:
SdfAssetPathAttributeModelA model for a single entry in an array of SdfAssetPath attributes.
This model represents an individual asset path entry within a larger array of SdfAssetPath attributes. It provides functionality to get and set the value of the asset path, as well as to check the validity of the path and retrieve the resolved path.
- Parameters:
stage (
Usd.Stage) – The stage where the attribute is located.attribute_paths (List[
Sdf.Path]) – The paths to the attributes within the USD stage.index (int) – The index of the entry in the array this model represents.
self_refresh (bool) – Indicates whether the model should self-refresh.
metadata (dict) – A dictionary containing metadata for the attribute.
Methods
__init__(stage, attribute_paths, index, ...)Initializes the SdfAssetPathArrayAttributeSingleEntryModel.
Gets the resolved filesystem path for the asset at the current index.
Gets the value of the asset path at the current index.
get_value_as_string([elide_big_array])Gets the value of the asset path at the current index as a string.
Checks if the asset path at the current index is a valid path.
set_value(value[, comp, resolved_path])Sets the value of the asset path at the current index.
Attributes
Gets the index of the array entry this model represents.
- __init__(
- stage: Stage,
- attribute_paths: List[Path],
- index: int,
- self_refresh: bool,
- metadata: dict,
Initializes the SdfAssetPathArrayAttributeSingleEntryModel.
- Parameters:
stage (
Usd.Stage) – The USD stage associated with the model.attribute_paths (List[
Sdf.Path]) – The attribute paths the model is tracking.index (int) – The index this model represents in the attribute array.
self_refresh (bool) – Whether the model should self-refresh on changes.
metadata (dict) – Additional metadata for the model.
- get_resolved_path()#
Gets the resolved filesystem path for the asset at the current index.
- Returns:
The resolved filesystem path.
- Return type:
str
- get_value()#
Gets the value of the asset path at the current index.
- Returns:
The asset path value.
- Return type:
Any
- get_value_as_string(
- elide_big_array=True,
Gets the value of the asset path at the current index as a string.
- Parameters:
elide_big_array (bool) – Whether to elide large arrays for display.
- Returns:
The asset path as a string.
- Return type:
str
- is_valid_path() bool#
Checks if the asset path at the current index is a valid path.
- 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 at the current index.
- Parameters:
value (str) – The new asset path value.
comp (int) – The component index for vector types.
resolved_path (str) – The resolved filesystem path.
- property index#
Gets the index of the array entry this model represents.
- Returns:
The index of the array entry.
- Return type:
int