ChangePropertyCommand

class omni.usd.commands.ChangePropertyCommand(prop_path: str, value: Any, prev: Any, timecode=Usd.TimeCode.Default(), type_to_create_if_not_exist: Optional[ValueTypeNames] = None, target_layer: Optional[Layer] = None, usd_context_name: Union[str, UsdContext, Stage] = '', is_custom: bool = False, variability: Variability = Sdf.VariabilityVarying)

Bases: Command

Change property value.

By default, this command changes the value of the property when it exists. If the property doesn’t exist, type_to_create_if_not_exist must be given to explicitly tell this command to create a new property with the new type and value.

Methods

__init__(prop_path, value, prev[, timecode, ...])

Constructor.

do()

undo()

Attributes

overriden_notification

__init__(prop_path: str, value: Any, prev: Any, timecode=Usd.TimeCode.Default(), type_to_create_if_not_exist: Optional[ValueTypeNames] = None, target_layer: Optional[Layer] = None, usd_context_name: Union[str, UsdContext, Stage] = '', is_custom: bool = False, variability: Variability = Sdf.VariabilityVarying)

Constructor.

Parameters
  • prop_path (str) – Prim property path.

  • value (Any) – Value to change to. If it’s None, current attribute value is cleared.

  • prev (Any) – Value to undo to.

  • timecode (Usd.TimeCode, optional) – The timecode to set property value to. Default is Usd.TimeCode.Default().

  • type_to_create_if_not_exist (Sdf.ValueTypeName) – If not None and property doesn’t exist, a new property will be created with given type and value. Default is None.

  • target_layer (sdf.Layer, optional) – Target layer to write value to. Leave to None to use the current edit target.

  • usd_context_name (Union[str, omni.usd.UsdContext, Usd.Stage], optional) – Union that could be: * Name of the usd context to work on. Leave to “” to use default USD context. * Instance of UsdContext. * Or stage instance. Default is None, which means the default UsdContext is used.

  • is_custom (bool, optional) – If the property is created, specifiy if it is a ‘custom’ property (not part of the Schema). Default is False.

  • variability (Sdf.Variability, optional) – If the property is created, specify the variability. Default is Sdf.VariabilityVarying.