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
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: XformOp#
- precision: Precision#
- value: Any | None#
- class omni.flux.commands.CreateOrInsertSublayerCommand(
- layer_identifier: str,
- sublayer_position: int,
- new_layer_path: str,
- transfer_root_content: bool,
- create_or_insert: bool,
- layer_name: str = '',
- usd_context: str | UsdContext = '',
Bases:
Command
Creates or inserts a sublayer.
- __init__(
- layer_identifier: str,
- sublayer_position: int,
- new_layer_path: str,
- transfer_root_content: bool,
- create_or_insert: bool,
- layer_name: str = '',
- usd_context: str | UsdContext = '',
- Parameters:
layer_identifier (str) – The identifier of layer to create sublayer. It should be found by Sdf.Find.
sublayer_position (int) – Sublayer position that the new sublayer is created before. If position_before == -1, it will create layer at the end of sublayer list. If position_before >= total_number_of_sublayers, it will create layer at the end of sublayer list.
new_layer_path (str) – Absolute path of new layer. If it’s empty, it will create anonymous layer if create_or_insert == True. If create_or_insert == False and it’s empty, it will fail to insert layer.
transfer_root_content (bool) – True if we should move the root contents to the new layer.
create_or_insert (bool) – If it’s true, it will create layer from this path. It’s insert, otherwise.
layer_name (str, optional) – If it’s to create anonymous layer (new_layer_path is empty), this name is used.
usd_context (Union[str, omni.usd.UsdContext]) – Usd context name or instance. It uses default context if it’s empty.
- do()#
- undo()#
- class omni.flux.commands.RemoveOverrideCommand(
- prim_path: str,
- layer: Path,
- context_name: str,
- stage: Stage | None = None,
- attribute: Attribute | None = None,
- check_up_to_prim: str | None = None,
Bases:
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: Path,
- context_name: str,
- stage: Stage | None = None,
- attribute: Attribute | None = None,
- check_up_to_prim: str | None = None,
- do()#
- undo()#
- class omni.flux.commands.SetDefaultPrimCommand(
- prim_path: str,
- context_name: str | None = None,
- stage: Stage | None = None,
Bases:
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: str | None = None,
- stage: Stage | None = None,
- do()#
- undo()#
- class omni.flux.commands.SetFluxXFormPrimCommand(
- prim_path: str,
- attribute_defs: list[AttributeDef],
- context_name: str,
- stage: Stage | None = None,
Bases:
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[AttributeDef],
- context_name: str,
- stage: Stage | None = None,
- do()#
- undo()#
- class omni.flux.commands.SetVisibilitySelectedPrimsCommand(
- selected_paths: list[str],
- value: bool,
- context_name: str = '',
Bases:
Command
Sets the visibility of the selected primitives.
- __init__(
- selected_paths: list[str],
- value: bool,
- context_name: str = '',
- Parameters:
selected_paths (list[str]) – A list of prim paths to set the visibility.
value (bool) – The visibility value to set.
context_name (str) – The context name to get the stage from.
- do()#
- undo()#