API

  • SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.

  • SPDX-License-Identifier: Apache-2.0

  • Licensed under the Apache License, Version 2.0 (the “License”);

  • you may not use this file except in compliance with the License.

  • You may obtain a copy of the License at

  • https://www.apache.org/licenses/LICENSE-2.0

  • Unless required by applicable law or agreed to in writing, software

  • distributed under the License is distributed on an “AS IS” BASIS,

  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

  • See the License for the specific language governing permissions and

  • limitations under the License.

class omni.flux.commands.AttributeDef

Bases: TypedDict

name: str
op: pxr.UsdGeom.XformOp
precision: pxr.UsdGeom.Precision
value: Optional[Any]
class omni.flux.commands.RemoveOverrideCommand(prim_path: str, layer: pxr.Sdf.Path, context_name: str, stage: Optional[pxr.Usd.Stage] = None, attribute: Optional[pxr.Usd.Attribute] = None, check_up_to_prim: Optional[str] = None)

Bases: omni.kit.commands.command.Command

Will remove override for a given attribute and remove any empty overrides on the prim or its children. If no attribute is given, then only empty overrides will be removed. Command.

Parameters
  • prim_path (str) – Prim path.

  • layer (Sdf.Path) – Layer to check for overrides

  • context_name (str) – Usd context name to run the command on.

  • stage (Usd.Stage) – Stage to operate. Optional.

  • attribute (Usd.Attribute) – Attribute to remove. Optional

  • check_up_to_prim (str) – Prim to stop check. Optional

__init__(prim_path: str, layer: pxr.Sdf.Path, context_name: str, stage: Optional[pxr.Usd.Stage] = None, attribute: Optional[pxr.Usd.Attribute] = None, check_up_to_prim: Optional[str] = None)
do()
undo()
class omni.flux.commands.SetDefaultPrimCommand(prim_path: str, context_name: Optional[str] = None, stage: Optional[pxr.Usd.Stage] = None)

Bases: omni.kit.commands.command.Command

Sets a prim to be the default prim

Parameters

prim_path (str) – Path of the prim to be set as the default prim.

__init__(prim_path: str, context_name: Optional[str] = None, stage: Optional[pxr.Usd.Stage] = None)
do()
undo()
class omni.flux.commands.SetFluxXFormPrimCommand(prim_path: str, attribute_defs: list[omni.flux.commands.custom_commands.AttributeDef], context_name: str, stage: Optional[pxr.Usd.Stage] = None)

Bases: omni.kit.commands.command.Command

Set xforms on a prim undoable Command.

Parameters
  • prim_path (str) – Prim path.

  • attribute_defs (AttributeDef) – Desired attributes

  • context_name (str) – Usd context name to run the command on.

  • stage (Usd.Stage) – Stage to operate. Optional.

__init__(prim_path: str, attribute_defs: list[omni.flux.commands.custom_commands.AttributeDef], context_name: str, stage: Optional[pxr.Usd.Stage] = None)
do()
undo()
class omni.flux.commands.UsdEditTargetUndo(edit_target: pxr.Usd.EditTarget)

Bases: omni.kit.usd_undo.layer_undo.UsdLayerUndo

A class for managing undo operations on a USD edit target.

This class provides methods to reserve and undo changes made to a USD layer through an edit target.

Parameters

edit_target – Usd.EditTarget The edit target to be managed for undo operations.

__init__(edit_target: pxr.Usd.EditTarget)

Initializes a UsdEditTargetUndo instance with the given edit target.

Parameters

edit_target (Usd.EditTarget) – The edit target to be managed for undo operations.

reserve(path: pxr.Sdf.Path, info=None)

Reserves the specified path and info for undo, mapped to the edit target’s namespace.

Parameters
  • path (Sdf.Path) – The path to be reserved.

  • info (str, optional) – The info key to be reserved. If None, the entire spec is reserved.