LayerMetaModel

class omni.kit.property.layer.layer_property_models.LayerMetaModel(layer_item: <module 'weakref' from '/root/.cache/packman/python/3.10.5-1-linux-x86_64/lib/python3.10/weakref.py'>, meta_type: ~omni.kit.property.layer.types.LayerMetaType)

Bases: AbstractValueModel

A model for representing and editing metadata of a USD layer item.

This model allows for the storage and manipulation of different types of metadata associated with a layer, such as comments, documentation, start and end times, timecodes per second, and more. It provides functionality to retrieve the current metadata value as a string and to set a new value for the metadata. The model also handles the beginning and ending of metadata editing sessions.

Parameters
  • layer_item (weakref) – A weak reference to the layer item associated with this metadata model.

  • meta_type (LayerMetaType) – The type of metadata this model represents.

Methods

__init__(layer_item, meta_type)

Initializes a LayerMetaModel instance.

begin_edit()

Prepares the model for editing.

end_edit()

Finalizes the editing process and applies changes.

get_usd_token_name()

Retrieves the USD token name for the current metadata type.

get_value_as_string()

Returns the string representation of the current metadata value.

on_value_changed()

Updates the model's value based on the latest changes.

set_value(value)

Sets a new metadata value.

Attributes

__init__(layer_item: <module 'weakref' from '/root/.cache/packman/python/3.10.5-1-linux-x86_64/lib/python3.10/weakref.py'>, meta_type: ~omni.kit.property.layer.types.LayerMetaType)

Initializes a LayerMetaModel instance.

begin_edit()

Prepares the model for editing.

end_edit()

Finalizes the editing process and applies changes.

get_usd_token_name()

Retrieves the USD token name for the current metadata type.

Returns

The USD token name.

Return type

str

get_value_as_string()

Returns the string representation of the current metadata value.

Returns

The current metadata value as a string.

Return type

str

on_value_changed()

Updates the model’s value based on the latest changes.

set_value(value)

Sets a new metadata value.

Parameters

value (str) – The new value for the metadata.