ChangeFabricPropertyCommand#
- class omni.fabric.commands.scripts.ChangeFabricPropertyCommand(
- prop_path: str,
- value: Any,
- prev: Any,
- timecode=Usd.TimeCode.Default(),
- type_to_create_if_not_exist: ValueTypeNames | None = None,
- usd_context_name: str | UsdContext | Stage | Stage = '',
- is_custom: bool = False,
Bases:
Command
Change prim property undoable Command.
- Parameters:
prop_path (str) – Prim property path.
value (Any) – Value to change to.
prev (Any) – Value to undo to.
timecode (usdrt.Usd.TimeCode) – The timecode to set property value to.
type_to_create_if_not_exist (usdrt.Sdf.ValueTypeName) – If not None AND property does not already exist, a new property will be created with given type and value.
usd_context_name (Union[str, Usd.Stage]) – 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.
is_custom (bool) – If the property is created, specifiy if it is a ‘custom’ property (not part of the Schema).
Methods
__init__
(prop_path, value, prev[, timecode, ...])Create a command to change prim property.
do
()Executes the command to change the specified Fabric property to a new value.
undo
()Undoes the property change, reverting the property value to its previous state.
- __init__(
- prop_path: str,
- value: Any,
- prev: Any,
- timecode=Usd.TimeCode.Default(),
- type_to_create_if_not_exist: ValueTypeNames | None = None,
- usd_context_name: str | UsdContext | Stage | Stage = '',
- is_custom: bool = False,
Create a command to change prim property.
- do()#
Executes the command to change the specified Fabric property to a new value.
This method updates the property value and can create a new property if it does not exist and a type is specified.
- undo()#
Undoes the property change, reverting the property value to its previous state.
If the property was created during the execution of the `do` method, this method will remove the property.