GfVecAttributeModel#

class omni.kit.property.usd.GfVecAttributeModel(
stage: Stage,
attribute_paths: List[Path],
comp_count: int,
tf_type: Type,
self_refresh: bool,
metadata: dict,
**kwargs,
)#

Bases: AbstractItemModel, UsdBase

A model for representing and manipulating GfVec typed attributes in USD.

This model handles vector attributes with a specified number of components and a given type from the Gf library. It provides functionality to interact with the attribute’s value, including getting and setting the vector components.

Parameters:
  • stage (Usd.Stage) – The USD stage containing the attribute.

  • attribute_paths (List[Sdf.Path]) – A list of attribute paths to be managed by the model.

  • comp_count (int) – The number of components in the vector.

  • tf_type (Tf.Type) – The type of the vector from the Gf library.

  • self_refresh (bool) – Whether the model should refresh itself automatically.

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

Keyword Arguments:
  • change_on_edit_end (bool) – Whether to apply changes only when editing is finished.

  • treat_array_entry_as_comp (bool) – Treat array entries as components of the vector.

Methods

__init__(stage, attribute_paths, comp_count, ...)

Initializer for GfVecAttributeModel.

begin_edit([item])

Begins an edit operation on the given item.

clean()

Cleans up the model removing any stored data.

construct_vector_from_item()

end_edit([item])

Ends an edit operation on the given item.

get_item_children(item)

Returns the child items of the given item.

get_item_value_model(item, column_id)

Retrieves the value model for the given item and column.

set_value(value[, comp])

Sets the value of the attribute.

Attributes

__init__(
stage: Stage,
attribute_paths: List[Path],
comp_count: int,
tf_type: Type,
self_refresh: bool,
metadata: dict,
**kwargs,
)#

Initializer for GfVecAttributeModel.

begin_edit(item=None)#

Begins an edit operation on the given item.

Parameters:

item – The item to begin editing.

clean()#

Cleans up the model removing any stored data.

end_edit(item=None)#

Ends an edit operation on the given item.

Parameters:

item – The item to end editing.

get_item_children(item)#

Returns the child items of the given item.

Parameters:

item – The item whose children to retrieve.

get_item_value_model(item, column_id)#

Retrieves the value model for the given item and column.

Parameters:
  • item – The item for which to retrieve the model.

  • column_id – The ID of the column.

set_value(value, comp: int = -1) bool#

Sets the value of the attribute. Can set value for a specific component.

Parameters:
  • value (Any) – The new value to set.

  • comp (int) – The component index to set the value for.