file_path
stringlengths 21
207
| content
stringlengths 5
1.02M
| size
int64 5
1.02M
| lang
stringclasses 9
values | avg_line_length
float64 1.33
100
| max_line_length
int64 4
993
| alphanum_fraction
float64 0.27
0.93
|
---|---|---|---|---|---|---|
omniverse-code/kit/exts/omni.kit.test_suite.stage_window/omni/kit/test_suite/stage_window/tests/drag_drop_usd_stage_item.py | ## Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
##
## NVIDIA CORPORATION and its licensors retain all intellectual property
## and proprietary rights in and to this software, related documentation
## and any modifications thereto. Any use, reproduction, disclosure or
## distribution of this software and related documentation without an express
## license agreement from NVIDIA CORPORATION is strictly prohibited.
##
import omni.kit.test
import os
import carb
import omni.usd
import omni.kit.app
from omni.kit.test.async_unittest import AsyncTestCase
from omni.kit import ui_test
from omni.kit.test_suite.helpers import open_stage, get_test_data_path, wait_stage_loading, arrange_windows
from omni.kit.window.content_browser.test_helper import ContentBrowserTestHelper
class DragDropUsdStageItem(AsyncTestCase):
# Before running each test
async def setUp(self):
carb.settings.get_settings().set("/persistent/app/stage/dragDropImport", "reference")
await arrange_windows("Stage", 512)
await open_stage(get_test_data_path(__name__, "bound_shapes.usda"))
# After running each test
async def tearDown(self):
await wait_stage_loading()
carb.settings.get_settings().set("/persistent/app/stage/dragDropImport", "reference")
async def test_l1_drag_drop_usd_stage_item_reference(self):
usd_context = omni.usd.get_context()
stage = usd_context.get_stage()
await wait_stage_loading()
# set dragDropImport
carb.settings.get_settings().set("/persistent/app/stage/dragDropImport", "reference")
# drag/drop
async with ContentBrowserTestHelper() as content_browser_helper:
await content_browser_helper.toggle_grid_view_async(show_grid_view=False)
await ui_test.human_delay(50)
usd_path = get_test_data_path(__name__, f"shapes/basic_sphere.usda").replace("\\", "/")
stage_window = ui_test.find("Stage//Frame/**/ScrollingFrame/TreeView[*].visible==True")
drag_target = stage_window.position + ui_test.Vec2(stage_window.size.x / 2, stage_window.size.y - 32)
await content_browser_helper.drag_and_drop_tree_view(usd_path, drag_target=drag_target)
await wait_stage_loading()
# verify
prim = stage.GetPrimAtPath("/World/basic_sphere")
payloads = omni.usd.get_composed_payloads_from_prim(prim)
references = omni.usd.get_composed_references_from_prim(prim)
self.assertEqual(payloads, [])
self.assertEqual(len(references), 1)
for (ref, layer) in references:
absolute_path = layer.ComputeAbsolutePath(ref.assetPath)
self.assertEqual(os.path.normpath(absolute_path).lower(), os.path.normpath(usd_path).lower())
async def test_l1_drag_drop_usd_stage_item_payload(self):
usd_context = omni.usd.get_context()
stage = usd_context.get_stage()
await wait_stage_loading()
# set dragDropImport
carb.settings.get_settings().set("/persistent/app/stage/dragDropImport", "payload")
# drag/drop
async with ContentBrowserTestHelper() as content_browser_helper:
await content_browser_helper.toggle_grid_view_async(show_grid_view=False)
await ui_test.human_delay(50)
usd_path = get_test_data_path(__name__, f"shapes/basic_cone.usda").replace("\\", "/")
stage_window = ui_test.find("Stage//Frame/**/ScrollingFrame/TreeView[*].visible==True")
drag_target = stage_window.position + ui_test.Vec2(stage_window.size.x / 2, stage_window.size.y - 32)
await content_browser_helper.drag_and_drop_tree_view(usd_path, drag_target=drag_target)
await wait_stage_loading()
# verify
prim = stage.GetPrimAtPath("/World/basic_cone")
payloads = omni.usd.get_composed_payloads_from_prim(prim)
references = omni.usd.get_composed_references_from_prim(prim)
self.assertEqual(references, [])
self.assertEqual(len(payloads), 1)
for (ref, layer) in payloads:
absolute_path = layer.ComputeAbsolutePath(ref.assetPath)
self.assertEqual(os.path.normpath(absolute_path).lower(), os.path.normpath(usd_path).lower())
| 4,277 | Python | 47.067415 | 113 | 0.680851 |
omniverse-code/kit/exts/omni.kit.test_suite.stage_window/omni/kit/test_suite/stage_window/tests/drag_drop_material_stage_item.py | ## Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
##
## NVIDIA CORPORATION and its licensors retain all intellectual property
## and proprietary rights in and to this software, related documentation
## and any modifications thereto. Any use, reproduction, disclosure or
## distribution of this software and related documentation without an express
## license agreement from NVIDIA CORPORATION is strictly prohibited.
##
import omni.kit.test
import omni.usd
import omni.kit.app
from omni.kit.test.async_unittest import AsyncTestCase
from omni.kit import ui_test
from pxr import Sdf, UsdShade
from omni.kit.test_suite.helpers import (
open_stage,
get_test_data_path,
select_prims,
wait_stage_loading,
delete_prim_path_children,
arrange_windows
)
from omni.kit.material.library.test_helper import MaterialLibraryTestHelper
from omni.kit.window.content_browser.test_helper import ContentBrowserTestHelper
class DragDropMaterialStageItem(AsyncTestCase):
# Before running each test
async def setUp(self):
await arrange_windows()
await open_stage(get_test_data_path(__name__, "bound_shapes.usda"))
# After running each test
async def tearDown(self):
await wait_stage_loading()
def _verify_material(self, stage, mtl_name, to_select):
# verify material created
prim_paths = [p.GetPrimPath().pathString for p in stage.Traverse()]
self.assertTrue(f"/World/Looks/{mtl_name}" in prim_paths)
self.assertTrue(f"/World/Looks/{mtl_name}/Shader" in prim_paths)
# verify bound material
if to_select:
for prim_path in to_select:
prim = stage.GetPrimAtPath(prim_path)
bound_material, _ = UsdShade.MaterialBindingAPI(prim).ComputeBoundMaterial()
self.assertTrue(bound_material.GetPrim().IsValid() == True)
self.assertTrue(bound_material.GetPrim().GetPrimPath().pathString == f"/World/Looks/{mtl_name}")
async def test_l1_drag_drop_material_stage_item(self):
usd_context = omni.usd.get_context()
stage = usd_context.get_stage()
to_select = "/World/Cone"
await wait_stage_loading()
# focus windows
await ui_test.find("Stage").focus()
await ui_test.find("Content").focus()
# select prims
await select_prims([to_select])
await ui_test.human_delay()
# drag to bottom of stage window
# NOTE: Material binding is done on dropped item
treeview_widget = ui_test.find("Stage//Frame/**/ScrollingFrame/TreeView[*].visible==True")
drag_target = treeview_widget.find(f"**/StringField[*].model.path=='{to_select}'").center
# Add offsets to ensure the drop is not between stage items
drag_target.y += 10
content_browser_helper = ContentBrowserTestHelper()
material_test_helper = MaterialLibraryTestHelper()
mdl_list = await omni.kit.material.library.get_mdl_list_async()
for mtl_name, mdl_path, submenu in mdl_list:
# delete any materials in looks
await delete_prim_path_children("/World/Looks")
# drag/drop
await content_browser_helper.drag_and_drop_tree_view(mdl_path, drag_target=drag_target)
# use create material dialog
await material_test_helper.handle_create_material_dialog(mdl_path, mtl_name)
# wait for material to load & UI to refresh
await wait_stage_loading()
# verify
self._verify_material(stage, mtl_name, [to_select])
| 3,653 | Python | 38.290322 | 116 | 0.6611 |
omniverse-code/kit/exts/omni.kit.test_suite.stage_window/docs/CHANGELOG.md | # Changelog
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [1.0.4] - 2022-11-10
- Create/Materials changed to Create/Material
## [1.0.3] - 2022-08-03
### Changes
- Added external drag/drop audio file tests
## [1.0.2] - 2022-07-25
### Changes
- Refactored unittests to make use of content_browser test helpers
## [1.0.1] - 2022-07-01
### Changes
- Updated calls to material handlers in unittests
## [1.0.0] - 2022-02-09
### Changes
- Created
| 484 | Markdown | 20.086956 | 80 | 0.67562 |
omniverse-code/kit/exts/omni.kit.test_suite.stage_window/docs/README.md | # omni.kit.test_suite.stage_window
## omni.kit.test_suite.stage_window
Test Suite
| 86 | Markdown | 9.874999 | 35 | 0.732558 |
omniverse-code/kit/exts/omni.kit.test_suite.stage_window/docs/index.rst | omni.kit.test_suite.stage_window
################################
stage window tests
.. toctree::
:maxdepth: 1
CHANGELOG
| 130 | reStructuredText | 12.099999 | 32 | 0.523077 |
omniverse-code/kit/exts/omni.kit.livestream.webrtc/PACKAGE-LICENSES/omni.kit.livestream.webrtc-LICENSE.md | Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
NVIDIA CORPORATION and its licensors retain all intellectual property
and proprietary rights in and to this software, related documentation
and any modifications thereto. Any use, reproduction, disclosure or
distribution of this software and related documentation without an express
license agreement from NVIDIA CORPORATION is strictly prohibited. | 412 | Markdown | 57.999992 | 74 | 0.839806 |
omniverse-code/kit/exts/omni.kit.livestream.webrtc/config/extension.toml | [package]
version = "0.1.0"
title = "Livestream WebRTC Backend"
category = "Rendering"
[[python.module]]
name = "omni.kit.livestream.webrtc"
[dependencies]
"omni.kit.livestream.core" = {}
"omni.kit.streamsdk.plugins" = {}
[[native.plugin]]
path = "${omni.kit.streamsdk.plugins}/bin/carb.livestream-rtc.plugin"
[settings]
app.livestream.port = 49100
app.livestream.proto = "websocket"
app.livestream.ipversion = "ipv4"
[[test]]
parallelizable = false
unreliable = true # OM-36759
waiver = "Validation of end-to-end workflow covered via the productized, User-facing omni.kit.livestream.webrtc extension." # OM-48092
| 619 | TOML | 23.799999 | 134 | 0.736672 |
omniverse-code/kit/exts/omni.kit.livestream.webrtc/omni/kit/livestream/webrtc/__init__.py | from .scripts.extension import *
| 33 | Python | 15.999992 | 32 | 0.787879 |
omniverse-code/kit/exts/omni.kit.livestream.webrtc/omni/kit/livestream/webrtc/scripts/extension.py | import omni.ext
import omni.kit.livestream.bind
class Extension(omni.ext.IExt):
def __init__(self):
pass
def on_startup(self):
self._kit_livestream = omni.kit.livestream.bind.acquire_livestream_interface()
self._kit_livestream.startup()
def on_shutdown(self):
self._kit_livestream.shutdown()
self._kit_livestream = None
| 376 | Python | 22.562499 | 86 | 0.656915 |
omniverse-code/kit/exts/omni.mtlx/omni/mtlx/extension.py | import omni.ext
import os
from pathlib import Path
# path to set to the environment variable `PXR_MTLX_STDLIB_SEARCH_PATHS` while usd is initialized
# i.e., called by omni.usd.config
def get_mtlx_stdlib_search_path() -> str:
# compute the real path without symlinks in order to get it working with usdmtlx
current_dir = os.path.dirname(__file__)
mtlx_libraries_dir = os.path.join(current_dir, '..', '..', 'libraries')
mtlx_libraries_dir = os.path.realpath(mtlx_libraries_dir)
return str(Path(mtlx_libraries_dir).resolve())
class MtlxExtension(omni.ext.IExt):
def on_startup(self):
pass
def on_shutdown(self):
pass | 670 | Python | 32.549998 | 97 | 0.68806 |
omniverse-code/kit/exts/omni.mtlx/omni/mtlx/__init__.py | from .extension import * | 24 | Python | 23.999976 | 24 | 0.791667 |
omniverse-code/kit/exts/omni.mtlx/omni/mtlx/tests/__init__.py | from .setup import *
from .render import *
| 43 | Python | 13.666662 | 21 | 0.72093 |
omniverse-code/kit/exts/omni.mtlx/omni/mtlx/tests/setup.py | import omni.kit.test
import omni.mtlx
import os
import carb
class SetupTest(omni.kit.test.AsyncTestCase):
def test_verify_mtlx_search_path(self):
path:str = omni.mtlx.get_mtlx_stdlib_search_path()
# check the library folder that contains all mtlx standard library modules
exists = os.path.isdir(path)
if not exists:
carb.log_info(f"MaterialX Standard Library Search Path is not existing: {path}")
self.assertTrue(exists)
carb.log_info(f"MaterialX Standard Library Search Path found: {path}")
# test some important libraries as secondary check
self.assertTrue(os.path.exists(os.path.join(path, "bxdf", "standard_surface.mtlx")))
self.assertTrue(os.path.exists(os.path.join(path, "pbrlib", "genmdl", "pbrlib_genmdl_impl.mtlx")))
| 834 | Python | 40.749998 | 106 | 0.677458 |
omniverse-code/kit/exts/omni.mtlx/omni/mtlx/tests/render.py | #!/usr/bin/env python3
import omni.kit.commands
import omni.kit.test
import omni.usd
from omni.rtx.tests import RtxTest, testSettings, postLoadTestSettings
from omni.rtx.tests.test_common import wait_for_update
from omni.kit.test_helpers_gfx.compare_utils import ComparisonMetric
import carb
from pathlib import Path
import os
EXTENSION_DIR = Path(omni.kit.app.get_app().get_extension_manager().get_extension_path_by_module(__name__))
TESTS_DIR = EXTENSION_DIR.joinpath('data', 'tests')
USD_DIR = TESTS_DIR.joinpath('usd')
GOLDEN_IMAGES_DIR = TESTS_DIR.joinpath('golden')
OUTPUTS_DIR = Path(omni.kit.test.get_test_output_path())
# This class is auto-discoverable by omni.kit.test
class MtlxRenderTest(RtxTest):
WINDOW_SIZE = (1280, 768)
THRESHOLD = 5e-5
# common settings used for all renderers
async def setUp(self):
await super().setUp()
self.set_settings(testSettings)
# Overridden with custom paths
async def capture_and_compare(self,
renderer: str,
img_subdir: Path = "",
test_name=None,
threshold=THRESHOLD,
metric: ComparisonMetric = ComparisonMetric.MEAN_ERROR_SQUARED):
golden_img_dir = GOLDEN_IMAGES_DIR.joinpath(img_subdir)
output_img_dir = OUTPUTS_DIR.joinpath(img_subdir)
golden_img_name = f"{test_name}_{renderer}.png"
return await self._capture_and_compare(golden_img_name, threshold, output_img_dir, golden_img_dir, metric)
# Open the scene, overridden with custom paths
async def open_usd(self, usdSubpath: Path):
path = USD_DIR.joinpath(usdSubpath)
# This settings should be set before stage opening/creation
self.set_settings(testSettings)
# Actually open the stage
self.ctx.open_stage(str(path))
await omni.kit.app.get_app().next_update_async()
# Settings that should override settings that was set on stage opening/creation
self.set_settings(postLoadTestSettings)
# Close the scene
def close_usd(self):
self.ctx.close_stage()
# do string replacements and save a new file
def prepare_temp_file(self, srcFilename, destFilename, replacementMap):
with open(srcFilename, 'r') as srcFile, \
open(destFilename, 'w') as destFile:
src = srcFile.read()
for key, value in replacementMap.items():
src = src.replace(key, value)
destFile.write(src)
# base test script
async def run_image_test(self, usd_file: str, test_name: str = None):
# load the scene
if usd_file:
await self.open_usd(usd_file)
# wait for rendering and capture
await wait_for_update(wait_frames=128+10)
# golden image path need the renderer
settings = carb.settings.get_settings()
renderer:str = settings.get("/renderer/active")
await self.capture_and_compare(renderer = renderer, test_name = test_name)
# close the scene to also test clean-up
# self.close_usd() # getting `[Error] [omni.usd] Stage opening or closing already in progress!!`
await wait_for_update()
# ==============================================================================================
# The tests
# ==============================================================================================
# StandardSurface presets that ship with the MaterialX SDK
# ----------------------------------------------------------------------------------------------
async def test_standardsurface_composition(self):
await self.run_image_test('StandardSurface/Composition.usda', 'mtlx_standardsurface_composition')
# A selection of the materials published by AMD on https://matlib.gpuopen.com
# ----------------------------------------------------------------------------------------------
async def test_amd_composition(self):
await self.run_image_test('AMD/Composition.usda', 'mtlx_amd_composition')
# Open Chess Set as released by the USD Work Group
# ----------------------------------------------------------------------------------------------
async def test_open_chess_set(self):
await self.run_image_test('OpenChessSet/chess_set_light_camera.usda', 'mtlx_open_chess_set')
# MaterialX tests published in the USD workgroup on https://github.com/usd-wg/assets
# Added a single root prim to each test scene and recomposed them into one test case.
# ----------------------------------------------------------------------------------------------
async def test_usd_wg_assets_composition(self):
try:
# replace the token by an absolute file path in order to test absolute paths
sceneDir = USD_DIR.joinpath('usd-wg-assets')
tempSceneFile = sceneDir.joinpath('basicTextured_flatten.usda')
self.prepare_temp_file(
srcFilename = sceneDir.joinpath('basicTextured_flatten_template.usda'),
destFilename = tempSceneFile,
replacementMap = {"${USD_DIR}":f"{sceneDir}"})
tempMtlxFile = sceneDir.joinpath('standard_surface_brass_tiled_absolute_paths.mtlx')
self.prepare_temp_file(
srcFilename = sceneDir.joinpath('standard_surface_brass_tiled_absolute_paths_template.mtlx'),
destFilename = tempMtlxFile,
replacementMap = {"${USD_DIR}":f"{sceneDir}"})
# run the test
await self.run_image_test('usd-wg-assets/Composition.usda', 'mtlx_usd-wg-assets_composition')
finally:
# remove the temp files
if tempSceneFile.exists():
tempSceneFile.unlink()
if tempMtlxFile.exists():
tempMtlxFile.unlink()
| 5,928 | Python | 44.259542 | 114 | 0.579622 |
omniverse-code/kit/exts/omni.mtlx/docs/index.rst | omni.mtlx
################################
.. toctree::
:maxdepth: 1
CHANGELOG
| 88 | reStructuredText | 8.888888 | 32 | 0.375 |
omniverse-code/kit/exts/omni.kit.test_suite.helpers/omni/kit/test_suite/helpers/helpers.py | import os
import carb
from pkgutil import iter_modules
import omni.usd
import omni.kit.app
from typing import List
from pxr import Usd
from functools import lru_cache
from pathlib import Path
from omni.kit import ui_test
from omni.kit.ui_test import Vec2
from omni.kit.ui_test import WidgetRef
@lru_cache()
def get_test_data_path(module: str, subpath: str = "") -> str:
if not subpath:
ext_path = omni.kit.app.get_app().get_extension_manager().get_extension_path_by_module(module)
return str(Path(ext_path) / "data" / "tests")
return str(Path(get_test_data_path(module)) / subpath)
async def wait():
await omni.kit.app.get_app().next_update_async()
await omni.kit.app.get_app().next_update_async()
async def wait_stage_loading(usd_context=omni.usd.get_context()):
while True:
_, files_loaded, total_files = usd_context.get_stage_loading_status()
if files_loaded or total_files:
await omni.kit.app.get_app().next_update_async()
continue
break
await wait()
async def open_stage(path: str, usd_context=omni.usd.get_context()):
await usd_context.open_stage_async(path)
await wait_stage_loading(usd_context)
async def select_prims(paths, usd_context=omni.usd.get_context()):
usd_context.get_selection().set_selected_prim_paths(paths, True)
await wait()
# wait for any marterials to load
await wait_stage_loading()
def get_prims(stage, exclude_list=[]):
prims = []
for p in stage.Traverse(Usd.TraverseInstanceProxies(Usd.PrimIsActive and Usd.PrimIsDefined and Usd.PrimIsLoaded)):
if p not in exclude_list:
prims.append(p)
return prims
async def wait_for_window(window_name: str):
MAX_WAIT = 100
# Find active window
for _ in range(MAX_WAIT):
window_root = ui_test.find(f"{window_name}")
if window_root and window_root.widget.visible:
await ui_test.human_delay()
break
await ui_test.human_delay(1)
if not window_root:
raise Exception("Can't find window {window_name}, wait time exceeded.")
async def handle_assign_material_dialog(index, strength_index=0):
carb.log_warn("WARNING: 'handle_assign_material_dialog' is being DEPRECATED. Please use the function of the same name from 'omni.kit.material.library.test_helper.MaterialLibraryTestHelper'")
from pxr import Sdf
# handle assign dialog
prims = omni.usd.get_context().get_selection().get_selected_prim_paths()
if len(prims) == 1:
shape = Sdf.Path(prims[0]).name
window_name = f"Bind material to {shape}###context_menu_bind"
else:
window_name = f"Bind material to {len(prims)} selected models###context_menu_bind"
await wait_for_window(window_name)
# open listbox
widget = ui_test.find(f"{window_name}//Frame/**/Button[*].identifier=='combo_open_button'")
await ui_test.emulate_mouse_move_and_click(widget.center, human_delay_speed=4)
# select material item on listbox
await wait_for_window("MaterialPropertyPopupWindow")
widget = ui_test.find(f"MaterialPropertyPopupWindow//Frame/**/TreeView[*]")
# FIXME - can't use widget.click as open combobox has no readable size and clicks goto stage window
item_name = widget.model.get_item_children(None)[index].name_model.as_string if index else "None"
await ui_test.find(f"MaterialPropertyPopupWindow//Frame/**/Label[*].text=='{item_name}'").click(human_delay_speed=4)
# select strength item on listbox
widget = ui_test.find(f"{window_name}//Frame/**/ComboBox[*]")
if widget:
widget.model.set_value(strength_index)
# click ok
widget = ui_test.find(f"{window_name}//Frame/**/Button[*].identifier=='assign_material_ok_button'")
await ui_test.emulate_mouse_move_and_click(widget.center, human_delay_speed=4)
# wait for materials to load
await ui_test.human_delay()
await wait_stage_loading()
async def handle_create_material_dialog(mdl_path: str, mtl_name: str):
carb.log_warn("WARNING: 'handle_create_material_dialog' is being DEPRECATED. Please use the function of the same name from 'omni.kit.material.library.test_helper.MaterialLibraryTestHelper'")
subid_list = []
def have_subids(id_list):
nonlocal subid_list
subid_list = id_list
await omni.kit.material.library.get_subidentifier_from_mdl(mdl_file=mdl_path, on_complete_fn=have_subids)
if len(subid_list)> 1:
# material has subid and dialog is shown
await wait_for_window("Create Material")
create_widget = ui_test.find("Create Material//Frame/**/Button[*].identifier=='create_material_ok_button'")
subid_widget = ui_test.find("Create Material//Frame/**/ComboBox[*].identifier=='create_material_subid_combo'")
subid_list = subid_widget.model.get_item_list()
subid_index = 0
for index, subid in enumerate(subid_list):
if subid.name == mtl_name:
subid_index = index
subid_widget.model.set_current_index(subid_index)
await ui_test.human_delay()
create_widget.widget.call_clicked_fn()
await ui_test.human_delay(4)
await wait_stage_loading()
async def delete_prim_path_children(prim_path: str):
stage = omni.usd.get_context().get_stage()
root_prim = stage.GetPrimAtPath(prim_path)
purge_list = []
for prim in Usd.PrimRange(root_prim):
if prim.GetPath().pathString != root_prim.GetPath().pathString:
purge_list.append(prim)
for prim in purge_list:
stage.RemovePrim(prim.GetPath())
# wait for refresh after deleting prims
await ui_test.human_delay()
async def build_sdf_asset_frame_dictonary():
widget_table = {}
for frame in ui_test.find_all("Property//Frame/**/CollapsableFrame[*]"):
if frame.widget.title != "Raw USD Properties":
for widget in frame.find_all("Property//Frame/**/StringField[*].identifier!=''"):
if widget.widget.identifier.startswith('sdf_asset_'):
if not frame.widget.title in widget_table:
widget_table[frame.widget.title] = {}
if not widget.widget.identifier in widget_table[frame.widget.title]:
widget_table[frame.widget.title][widget.widget.identifier] = 0
widget_table[frame.widget.title][widget.widget.identifier] += 1
return widget_table
def push_window_height(cls, window_name, new_height=None):
window = ui_test.find(window_name)
if window:
if not hasattr(cls, "_original_window_height"):
cls._original_window_height = {}
cls._original_window_height[window_name] = window.widget.height
if new_height is not None:
window.widget.height = new_height
def pop_window_height(cls, window_name):
window = ui_test.find(window_name)
if window:
if hasattr(cls, "_original_window_height"):
window.widget.height = cls._original_window_height[window_name]
del cls._original_window_height[window_name]
async def handle_multiple_descendents_dialog(stage, prim_path: str, target_prim: str):
root_prim = stage.GetPrimAtPath(prim_path)
if not root_prim:
return
descendents = omni.usd.get_prim_descendents(root_prim)
# skip if only root_prim
if descendents == [root_prim]:
return
await ui_test.human_delay(10)
await wait_for_window("Target prim has multiple descendents")
await ui_test.human_delay(10)
# need to select target_prim in combo_widget
combo_widget = ui_test.find("Target prim has multiple descendents//Frame/**/ComboBox[*].identifier=='multi_descendents_combo'")
combo_list = combo_widget.model.get_item_children(None)
combo_index = 0
for index, item in enumerate(combo_list):
if item.prim.GetPrimPath().pathString == target_prim:
combo_index = index
combo_widget.model.set_current_index(combo_index)
await ui_test.human_delay()
ok_widget = ui_test.find("Target prim has multiple descendents//Frame/**/Button[*].identifier=='multi_descendents_ok_button'")
await ok_widget.click()
await wait_stage_loading()
async def arrange_windows(topleft_window="Stage", topleft_height=421.0, topleft_width=436.0, hide_viewport=False):
from omni.kit.viewport.utility import get_active_viewport_window
viewport_window = get_active_viewport_window()
# omni.ui & legacy viewport synch
await wait()
if viewport_window:
vp_width = int(1436 - topleft_width)
viewport_window.position_x = 0
viewport_window.position_y = 0
viewport_window.width = vp_width
viewport_window.height = 425
viewport_window.visible = (not hide_viewport)
# # XXX: force the legacy API
# if hasattr(viewport_window, 'legacy_window'):
# legacy_window = viewport_window.legacy_window
# legacy_window.set_window_pos(0, 0)
# legacy_window.set_window_size(vp_width, 425)
# viewport.show_hide_window(not hide_viewport)
import omni.ui as ui
content_window = ui.Workspace.get_window("Content")
if content_window:
content_window.position_x = 0.0
content_window.position_y = 448.0
content_window.width = 1436.0 - topleft_width
content_window.height = 421.0
await ui_test.human_delay()
stage_window = ui.Workspace.get_window("Stage")
if stage_window:
stage_window.position_x = 1436.0 - topleft_width
stage_window.position_y = 0.0
stage_window.width = topleft_width
stage_window.height = topleft_height
await ui_test.human_delay()
layer_window = ui.Workspace.get_window("Layer")
if layer_window:
layer_window.position_x = 1436.0 - topleft_width
layer_window.position_y = 0.0
layer_window.width = topleft_width
layer_window.height = topleft_height
await ui_test.human_delay()
tl_window = ui.Workspace.get_window(topleft_window)
if tl_window:
tl_window.focus()
property_window = ui.Workspace.get_window("Property")
if property_window:
property_window.position_x = 1436.0 - topleft_width
property_window.position_y = topleft_height + 27.0
property_window.width = topleft_width
property_window.height = 846.0 - topleft_height
await ui_test.human_delay()
# Wait for the layout to complete
await wait()
return viewport_window
| 10,555 | Python | 37.246377 | 194 | 0.665656 |
omniverse-code/kit/exts/omni.kit.test_suite.helpers/omni/kit/test_suite/helpers/__init__.py | from .helpers import *
| 23 | Python | 10.999995 | 22 | 0.73913 |
omniverse-code/kit/exts/omni.kit.test_suite.helpers/omni/kit/test_suite/helpers/test_populators.py | """Support for utility classes that populate a list of tests from various locations"""
| 87 | Python | 42.999979 | 86 | 0.781609 |
omniverse-code/kit/exts/omni.kit.test_suite.helpers/docs/index.rst | omni.kit.test_suite.helpers
###########################
test suite helpers
.. toctree::
:maxdepth: 1
CHANGELOG
| 120 | reStructuredText | 11.099999 | 27 | 0.533333 |
omniverse-code/kit/exts/omni.kit.window.file_importer/PACKAGE-LICENSES/omni.kit.window.file_importer-LICENSE.md | Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
NVIDIA CORPORATION and its licensors retain all intellectual property
and proprietary rights in and to this software, related documentation
and any modifications thereto. Any use, reproduction, disclosure or
distribution of this software and related documentation without an express
license agreement from NVIDIA CORPORATION is strictly prohibited. | 412 | Markdown | 57.999992 | 74 | 0.839806 |
omniverse-code/kit/exts/omni.kit.window.file_importer/scripts/demo_file_importer.py | # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
import os
import asyncio
import omni.ui as ui
import omni.usd as usd
from typing import List
from omni.kit.window.file_importer import get_file_importer, ImportOptionsDelegate
# BEGIN-DOC-import_options
class MyImportOptionsDelegate(ImportOptionsDelegate):
def __init__(self):
super().__init__(build_fn=self._build_ui_impl, destroy_fn=self._destroy_impl)
self._widget = None
def _build_ui_impl(self):
self._widget = ui.Frame()
with self._widget:
with ui.VStack():
with ui.HStack(height=24, spacing=2, style={"background_color": 0xFF23211F}):
ui.Label("Prim Path", width=0)
ui.StringField().model = ui.SimpleStringModel()
ui.Spacer(height=8)
def _destroy_impl(self, _):
if self._widget:
self._widget.destroy()
self._widget = None
# END-DOC-import_options
# BEGIN-DOC-tagging_options
class MyTaggingOptionsDelegate(ImportOptionsDelegate):
def __init__(self):
super().__init__(
build_fn=self._build_ui_impl,
filename_changed_fn=self._filename_changed_impl,
selection_changed_fn=self._selection_changed_impl,
destroy_fn=self._destroy_impl
)
self._widget = None
def _build_ui_impl(self, file_type: str=''):
self._widget = ui.Frame()
with self._widget:
with ui.VStack():
ui.Button(f"Tags for {file_type or 'unknown'} type", height=24)
def _filename_changed_impl(self, filename: str):
if filename:
_, ext = os.path.splitext(filename)
self._build_ui_impl(file_type=ext)
def _selection_changed_impl(self, selections: List[str]):
if len(selections) == 1:
_, ext = os.path.splitext(selections[0])
self._build_ui_impl(file_type=ext)
def _destroy_impl(self, _):
if self._widget:
self._widget.destroy()
self._widget = None
# END-DOC-tagging_options
class DemoFileImporterDialog:
"""
Example that demonstrates how to invoke the file importer dialog.
"""
def __init__(self):
self._app_window: ui.Window = None
self._import_options: ImportOptionsDelegate = None
self._tagging_options: ImportOptionsDelegate = None
self.build_ui()
def build_ui(self):
""" """
window_flags = ui.WINDOW_FLAGS_NO_SCROLLBAR
self._app_window = ui.Window("File Importer", width=1000, height=500, flags=window_flags)
with self._app_window.frame:
with ui.VStack(spacing=10):
with ui.HStack(height=30):
ui.Spacer()
button = ui.Button(text="Import File", width=120)
button.set_clicked_fn(self._show_dialog)
ui.Spacer()
asyncio.ensure_future(self._dock_window("File Importer", ui.DockPosition.TOP))
def _show_dialog(self):
# BEGIN-DOC-get_instance
# Get the singleton extension.
file_importer = get_file_importer()
if not file_importer:
return
# END-DOC-get_instance
# BEGIN-DOC-show_window
file_importer.show_window(
title="Import File",
import_handler=self.import_handler,
#filename_url="omniverse://ov-rc/NVIDIA/Samples/Marbles/Marbles_Assets.usd",
)
# END-DOC-show_window
# BEGIN-DOC-add_tagging_options
self._tagging_options = MyTaggingOptionsDelegate()
file_importer.add_import_options_frame("Tagging Options", self._tagging_options)
# END-DOC-add_tagging_options
# BEGIN-DOC-add_import_options
self._import_options = MyImportOptionsDelegate()
file_importer.add_import_options_frame("Import Options", self._import_options)
# END-DOC-add_import_options
def _hide_dialog(self):
# Get the File Importer extension.
file_importer = get_file_importer()
if file_importer:
file_importer.hide()
# BEGIN-DOC-import_handler
def import_handler(self, filename: str, dirname: str, selections: List[str] = []):
# NOTE: Get user inputs from self._import_options, if needed.
print(f"> Import '{filename}' from '{dirname}' or selected files '{selections}'")
# END-DOC-import_handler
async def _dock_window(self, window_title: str, position: ui.DockPosition, ratio: float = 1.0):
frames = 3
while frames > 0:
if ui.Workspace.get_window(window_title):
break
frames = frames - 1
await omni.kit.app.get_app().next_update_async()
window = ui.Workspace.get_window(window_title)
dockspace = ui.Workspace.get_window("DockSpace")
if window and dockspace:
window.dock_in(dockspace, position, ratio=ratio)
window.dock_tab_bar_visible = False
def destroy(self):
if self._app_window:
self._app_window.destroy()
self._app_window = None
if __name__ == "__main__":
view = DemoFileImporterDialog()
| 5,583 | Python | 34.119497 | 99 | 0.615081 |
omniverse-code/kit/exts/omni.kit.window.file_importer/config/extension.toml | [package]
title = "File Importer"
version = "1.0.10"
category = "core"
feature = true
description = "A dialog for importing files"
authors = ["NVIDIA"]
slackids = ["UQY4RMR3N"]
repository = ""
keywords = ["kit", "ui"]
readme = "docs/README.md"
changelog = "docs/CHANGELOG.md"
preview_image = "data/preview.png"
icon = "data/icon.png"
[dependencies]
"omni.ui" = {}
"omni.usd" = {}
"omni.kit.window.filepicker" = {}
[[python.module]]
name = "omni.kit.window.file_importer"
[settings]
exts."omni.kit.window.file_importer".appSettings = "/persistent/app/file_importer"
[[python.scriptFolder]]
path = "scripts"
[[test]]
dependencies = [
"omni.kit.renderer.core"
]
[documentation]
pages = [
"docs/Overview.md",
"docs/CHANGELOG.md",
]
| 747 | TOML | 17.7 | 82 | 0.672021 |
omniverse-code/kit/exts/omni.kit.window.file_importer/omni/kit/window/file_importer/extension.py | # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
import os
import asyncio
import omni.ext
import carb.settings
import carb.windowing
import omni.appwindow
from typing import List, Tuple, Callable, Dict
from functools import partial
from carb import log_warn, events
from omni.kit.window.filepicker import FilePickerDialog, UI_READY_EVENT
from omni.kit.widget.filebrowser import FileBrowserItem
from . import ImportOptionsDelegate
g_singleton = None
WINDOW_NAME = "File Importer"
# BEGIN-DOC-file_postfix_options
DEFAULT_FILE_POSTFIX_OPTIONS = [
None,
"anim",
"cache",
"curveanim",
"geo",
"material",
"project",
"seq",
"skel",
"skelanim",
]
# END-DOC-file_postfix_options
# BEGIN-DOC-file_extension_types
DEFAULT_FILE_EXTENSION_TYPES = [
# this intentionally restricts the extension listing to native USD file types
# rather than all supported Sdf File Formats. See OM-76297 for details.
("*.usd, *.usda, *.usdc, *.usdz", "USD Files"),
("*.*", "All files"),
]
# END-DOC-file_extension_types
# cache usd file exts since it is costly
_usd_file_exts = None
def _get_usd_file_exts():
global _usd_file_exts
if _usd_file_exts is None:
# the Code bellow is taking ~100ms, so it needs to be delayed to the latest moment possible
default_usd_file_exts = ["usd", "usda", "usdc", "usdz"]
try:
import omni.usd
usd_file_exts = omni.usd.readable_usd_file_exts()
except Exception:
try:
import pxr.Sdf
usd_file_exts = pxr.Sdf.FileFormat.FindAllFileFormatExtensions()
except Exception:
usd_file_exts = default_usd_file_exts
_usd_file_exts = [(f"*.{ext_str}", f"{ext_str.upper()} Files") for ext_str in usd_file_exts]
return _usd_file_exts
def on_filter_item(filter_fn: Callable[[str], bool], dialog: FilePickerDialog, item: FileBrowserItem, show_only_folders: bool = True) -> bool:
if item and not item.is_folder:
# OM-96626: Add show_only_folders option to file importer
if show_only_folders:
return False
if filter_fn:
return filter_fn(item.path or '', dialog.get_file_postfix(), dialog.get_file_extension())
return True
def on_import(import_fn: Callable[[str, str, List[str]], None], dialog: FilePickerDialog, filename: str, dirname: str, hide_window_on_import: bool = True):
_save_default_settings({'directory': dirname})
selections = dialog.get_current_selections() or []
if hide_window_on_import:
dialog.hide()
if import_fn:
import_fn(filename, dirname, selections=selections)
# BEGIN-DOC-file_filter_handler
def default_filter_handler(filename: str, filter_postfix: str, filter_ext: str) -> bool:
if not filename:
return True
# Show only files whose names end with: *<postfix>.<ext>
if filter_ext:
# split comma separated string into a list:
filter_exts = filter_ext.split(",") if isinstance(filter_ext, str) else filter_ext
filter_exts = [x.replace(" ", "") for x in filter_exts]
filter_exts = [x for x in filter_exts if x]
# check if the file extension matches anything in the list:
if not (
"*.*" in filter_exts or
any(filename.endswith(f.replace("*", "")) for f in filter_exts)
):
# match failed:
return False
if filter_postfix:
# strip extension and check postfix:
filename = os.path.splitext(filename)[0]
return filename.endswith(filter_postfix)
return True
# END-DOC-file_filter_handler
def _save_default_settings(default_settings: Dict):
settings = carb.settings.get_settings()
default_settings_path = settings.get_as_string("/exts/omni.kit.window.file_importer/appSettings")
settings.set_string(f"{default_settings_path}/directory", default_settings['directory'] or "")
# Any class derived from `omni.ext.IExt` in top level module (defined in `python.modules` of `extension.toml`) will be
# instantiated when extension gets enabled and `on_startup(ext_id)` will be called. Later when extension gets disabled
# on_shutdown() is called.
class FileImporterExtension(omni.ext.IExt):
"""A Standardized file import dialog."""
def __init__(self):
super().__init__()
self._dialog = None
self._title = None
self._ui_ready = False
self._ui_ready_event_sub = None
def on_startup(self, ext_id):
# Save away this instance as singleton for the editor window
global g_singleton
g_singleton = self
# Listen for filepicker events
self._destroy_task = None
event_stream = omni.kit.app.get_app().get_message_bus_event_stream()
self._ui_ready_event_sub = event_stream.create_subscription_to_pop_by_type(UI_READY_EVENT, self._on_ui_ready)
def show_window(self,
title: str = None,
width: int = 1080,
height: int = 450,
show_only_collections: List[str] = None,
show_only_folders: bool = False,
file_postfix_options: List[str] = None,
file_extension_types: List[Tuple[str, str]] = None,
file_filter_handler:Callable[[str], bool] = None,
import_button_label: str = "Import",
import_handler: Callable[[str, str, List[str]], None] = None,
filename_url: str = None,
file_postfix: str = None,
file_extension: str = None,
hide_window_on_import: bool = True,
focus_filename_input: bool = True,
):
"""
Displays the import dialog with the specified settings.
Keyword Args:
title (str): The name of the dialog
width (int): Width of the window (Default=1250)
height (int): Height of the window (Default=450)
show_only_collections (List[str]): Which of these collections, ["bookmarks", "omniverse", "my-computer"] to display.
show_only_folders (bool): Show only folders in the list view.
file_postfix_options (List[str]): A list of filename postfix options. Nvidia defaults.
file_extension_types (List[Tuple[str, str]]): A list of filename extension options. Each list
element is a (extension name, description) pair, e.g. (".usd", "USD format"). Nvidia defaults.
file_filter_handler (Callable): The filter handler that is called to decide whether or not to display a file.
Function signature is filter_handler(menu_option: int, filename: str) -> bool
import_button_label (str): Label for the import button (Default="Import")
import_handler (Callable): The callback to handle the import. Function signature is
import_handler(filename: str, dirname: str, selections: List[str]) -> None
filename_url (str): Url of the file to import, if any.
file_postfix (str): Sets selected postfix to this value if specified.
file_extension (str): Sets selected extension to this value if specified.
hide_window_on_import (bool): Whether the dialog hides on apply; if False, it means that whether to hide the
dialog should be decided by import handler.
"""
if self._dialog:
self.destroy_dialog()
# Load saved settings as defaults
default_settings = self._load_default_settings()
filename = None
directory = default_settings.get('directory')
settings = carb.settings.get_settings()
enable_timestamp = settings.get_as_bool("exts/omni.kit.window.file_importer/enable_timestamp")
if filename_url:
directory, filename = os.path.split(filename_url)
# OM-96962: Delay usd extension computation so it doesn't take up load time
file_extension_types = file_extension_types or DEFAULT_FILE_EXTENSION_TYPES + _get_usd_file_exts()
file_filter_handler = file_filter_handler or default_filter_handler
self._title = title or WINDOW_NAME
self._dialog = FilePickerDialog(
self._title,
width=width,
height=height,
splitter_offset=260,
enable_file_bar=True,
enable_filename_input=True,
enable_checkpoints=True,
enable_timestamp=enable_timestamp,
show_detail_view=True,
show_only_collections=show_only_collections or [],
file_postfix_options=file_postfix_options,
file_extension_options=file_extension_types,
filename_changed_handler=self._on_filename_changed,
apply_button_label=import_button_label,
current_directory=directory,
current_filename=filename,
current_file_postfix=file_postfix,
current_file_extension=file_extension,
focus_filename_input=focus_filename_input, # OM-91056: file exporter should focus filename input field
)
self._dialog.set_item_filter_fn(partial(on_filter_item, file_filter_handler, self._dialog, show_only_folders=show_only_folders))
self._dialog.set_click_apply_handler(
partial(on_import, import_handler, self._dialog, hide_window_on_import=hide_window_on_import))
self._dialog.set_visibility_changed_listener(self._visibility_changed_fn)
# OM-96626: Add show_only_folders option to file importer
self._dialog._widget.file_bar.enable_apply_button(enable=show_only_folders)
self._dialog.show()
def _visibility_changed_fn(self, visible):
async def destroy_dialog_async():
# wait one frame, this is due to the one frame defer
# in Window::_moveToMainOSWindow()
await omni.kit.app.get_app().next_update_async()
if self._dialog:
self._dialog.destroy()
self._dialog = None
self._destroy_task = None
if not visible:
# Destroy the window, since we are creating new window in show_window
if not self._destroy_task or self._destroy_task.done():
self._destroy_task = asyncio.ensure_future(destroy_dialog_async())
def _load_default_settings(self) -> dict:
settings = carb.settings.get_settings()
default_settings_path = settings.get_as_string("/exts/omni.kit.window.file_importer/appSettings")
default_settings = {}
default_settings['directory'] = settings.get_as_string(f"{default_settings_path}/directory")
return default_settings
def _on_filename_changed(self, filename, show_only_folders=False):
# OM-78341: Disable apply button if no file is selected, if we are not showing only folders
if self._dialog and not show_only_folders:
self._dialog._widget.file_bar.enable_apply_button(enable=bool(filename))
def _on_ui_ready(self, event: events.IEvent):
try:
payload = event.payload.get_dict()
title = payload.get('title', None)
except Exception:
return
if event.type == UI_READY_EVENT and title == self._title:
self._ui_ready = True
@property
def is_ui_ready(self) -> bool:
return self._ui_ready
@property
def is_window_visible(self) -> bool:
if self._dialog and self._dialog._window:
return self._dialog._window.visible
return False
def hide_window(self):
"""Hides and destroys the dialog window."""
self.destroy_dialog()
def add_import_options_frame(self, name: str, delegate: ImportOptionsDelegate):
"""
Adds a set of import options to the dialog. Should be called after show_window.
Args:
name (str): Title of the options box.
delegate (ImportOptionsDelegate): Subclasses specified delegate and overrides the
_build_ui_impl method to provide a custom widget for getting user input.
"""
if self._dialog:
self._dialog.add_detail_frame_from_controller(name, delegate)
def click_apply(self, filename_url: str = None, postfix: str = None, extension: str = None):
"""Helper function to progammatically execute the apply callback. Useful in unittests"""
if self._dialog:
if filename_url:
dirname, filename = os.path.split(filename_url)
self._dialog.set_current_directory(dirname)
self._dialog.set_filename(filename)
if postfix:
self._dialog.set_file_postfix(postfix)
if extension:
self._dialog.self_file_extension(extension)
self._dialog._widget._file_bar._on_apply()
def click_cancel(self, cancel_handler: Callable[[str, str], None] = None):
"""Helper function to progammatically execute the cancel callback. Useful in unittests"""
if cancel_handler:
self._dialog._widget._file_bar._click_cancel_handler = cancel_handler
self._dialog._widget._file_bar._on_cancel()
async def select_items_async(self, url: str, filenames: List[str] = []) -> List[FileBrowserItem]:
"""Helper function to programatically select multiple items in filepicker. Useful in unittests."""
if self._dialog:
return await self._dialog._widget.api.select_items_async(url, filenames=filenames)
return []
def detach_from_main_window(self):
"""Detach the current file importer dialog from main window."""
if self._dialog:
self._dialog._window.move_to_new_os_window()
def destroy_dialog(self):
# handles the case for detached window
if self._dialog:
if self._dialog._window:
window = self._dialog._window.app_window.get_window()
if window is not omni.appwindow.get_default_app_window().get_window():
carb.windowing.acquire_windowing_interface().hide_window(window)
self._dialog.set_item_filter_fn(None)
self._dialog.set_click_apply_handler(None)
self._dialog.set_visibility_changed_listener(None)
self._dialog.destroy()
self._dialog = None
self._ui_ready = False
if self._destroy_task:
self._destroy_task.cancel()
self._destroy_task = None
def on_shutdown(self):
self.destroy_dialog()
self._ui_ready_event_sub = None
global g_singleton
g_singleton = None
def get_instance():
return g_singleton
| 14,984 | Python | 40.054794 | 155 | 0.638348 |
omniverse-code/kit/exts/omni.kit.window.file_importer/omni/kit/window/file_importer/__init__.py | # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
"""A standardized dialog for importing files"""
__all__ = ['FileImporterExtension', 'get_file_importer']
from carb import log_warn
from omni.kit.window.filepicker import DetailFrameController as ImportOptionsDelegate
from .extension import FileImporterExtension, get_instance
def get_file_importer() -> FileImporterExtension:
"""Returns the singleton file_importer extension instance"""
instance = get_instance()
if instance is None:
log_warn("File importer extension is no longer alive.")
return instance | 965 | Python | 42.909089 | 85 | 0.780311 |
omniverse-code/kit/exts/omni.kit.window.file_importer/omni/kit/window/file_importer/test_helper.py | ## Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
##
## NVIDIA CORPORATION and its licensors retain all intellectual property
## and proprietary rights in and to this software, related documentation
## and any modifications thereto. Any use, reproduction, disclosure or
## distribution of this software and related documentation without an express
## license agreement from NVIDIA CORPORATION is strictly prohibited.
##
import asyncio
import omni.kit.app
import omni.kit.ui_test as ui_test
from typing import List, Dict, Callable
from omni.kit.widget.filebrowser import FileBrowserItem, LISTVIEW_PANE, TREEVIEW_PANE
from .extension import get_instance
class FileImporterTestHelper:
"""Test helper for the file import dialog"""
# NOTE Since the file dialog is a singleton, use an async lock to ensure mutex access in unit tests.
# During run-time, this is not a issue because the dialog is effectively modal.
__async_lock = asyncio.Lock()
async def __aenter__(self):
await self.__async_lock.acquire()
return self
async def __aexit__(self, *args):
self.__async_lock.release()
async def wait_for_popup(self, timeout_frames: int = 20):
"""Waits for dialog to be ready"""
file_importer = get_instance()
if file_importer:
for _ in range(timeout_frames):
if file_importer.is_ui_ready:
for _ in range(4):
# Wait a few extra frames to settle before returning
await omni.kit.app.get_app().next_update_async()
return
await omni.kit.app.get_app().next_update_async()
raise Exception("Error: The file import window did not open.")
async def click_apply_async(self, filename_url: str = None):
"""Helper function to progammatically execute the apply callback. Useful in unittests"""
file_importer = get_instance()
if file_importer:
file_importer.click_apply(filename_url=filename_url)
await omni.kit.app.get_app().next_update_async()
async def click_cancel_async(self, cancel_handler: Callable[[str, str], None] = None):
"""Helper function to progammatically execute the cancel callback. Useful in unittests"""
file_importer = get_instance()
if file_importer:
file_importer.click_cancel(cancel_handler=cancel_handler)
await omni.kit.app.get_app().next_update_async()
async def select_items_async(self, dir_url: str, names: List[str]) -> List[FileBrowserItem]:
file_importer = get_instance()
selections = []
if file_importer:
selections = await file_importer.select_items_async(dir_url, names)
return selections
async def get_config_menu_settings(self) -> Dict:
"""
Returns settings from the config menu as a dictionary.
Returns:
Dict
"""
import omni.kit.ui_test as ui_test
import omni.ui as ui
file_importer = get_instance()
if file_importer:
widget = file_importer._dialog._widget
config_menu = widget._tool_bar._config_menu
return config_menu.get_values()
return {}
async def set_config_menu_settings(self, settings: Dict):
"""
Writes to settings of the config menu.
"""
import omni.kit.ui_test as ui_test
import omni.ui as ui
file_importer = get_instance()
if file_importer:
widget = file_importer._dialog._widget
config_menu = widget._tool_bar._config_menu
for setting, value in settings.items():
config_menu.set_value(setting, value)
# wait for dialog to update
await ui_test.human_delay(50)
async def get_item_async(self, treeview_identifier: str, name: str, pane: int = LISTVIEW_PANE):
# Return item from the specified pane, handles both tree and grid views
file_importer = get_instance()
if not file_importer:
return
if name:
pane_widget = None
if pane == TREEVIEW_PANE:
pane_widget = ui_test.find_all(f"{file_importer._title}//Frame/**/TreeView[*].identifier=='{treeview_identifier}_folder_view'")
elif file_importer._dialog._widget._view.filebrowser.show_grid_view:
# LISTVIEW selected + showing grid view
pane_widget = ui_test.find_all(f"{file_importer._title}//Frame/**/VGrid[*].identifier=='{treeview_identifier}_grid_view'")
else:
# LISTVIEW selected + showing tree view
pane_widget = ui_test.find_all(f"{file_importer._title}//Frame/**/TreeView[*].identifier=='{treeview_identifier}'")
if pane_widget:
widget = pane_widget[0].find(f"**/Label[*].text=='{name}'")
if widget:
widget.widget.scroll_here(0.5, 0.5)
await ui_test.human_delay(4)
return widget
return None | 5,113 | Python | 40.241935 | 143 | 0.618228 |
omniverse-code/kit/exts/omni.kit.window.file_importer/omni/kit/window/file_importer/tests/__init__.py | ## Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
##
## NVIDIA CORPORATION and its licensors retain all intellectual property
## and proprietary rights in and to this software, related documentation
## and any modifications thereto. Any use, reproduction, disclosure or
## distribution of this software and related documentation without an express
## license agreement from NVIDIA CORPORATION is strictly prohibited.
##
from .test_extension import * | 470 | Python | 51.333328 | 77 | 0.793617 |
omniverse-code/kit/exts/omni.kit.window.file_importer/omni/kit/window/file_importer/tests/test_extension.py | ## Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
##
## NVIDIA CORPORATION and its licensors retain all intellectual property
## and proprietary rights in and to this software, related documentation
## and any modifications thereto. Any use, reproduction, disclosure or
## distribution of this software and related documentation without an express
## license agreement from NVIDIA CORPORATION is strictly prohibited.
##
import os
import omni.kit.test
import asyncio
import omni.kit.ui_test as ui_test
import omni.appwindow
from unittest.mock import Mock, patch, ANY
from carb.settings import ISettings
from omni.kit.window.filepicker import FilePickerDialog
from omni.kit.test_suite.helpers import get_test_data_path
from .. import get_file_importer
from ..extension import FileImporterExtension
from ..test_helper import FileImporterTestHelper
class TestFileImporter(omni.kit.test.AsyncTestCase):
"""
Testing omni.kit.window.file_importer extension. NOTE that since the dialog is a singleton, we use an async
lock to ensure that only one test runs at a time. In practice, this is not a issue because only one extension
is accessing the dialog at any given time.
"""
__lock = asyncio.Lock()
async def setUp(self):
self._settings_path = "my_settings"
self._test_settings = {
"/exts/omni.kit.window.file_importer/appSettings": self._settings_path,
f"{self._settings_path}/directory": "C:/temp/folder",
}
async def tearDown(self):
pass
def _mock_settings_get_string_impl(self, name: str) -> str:
return self._test_settings.get(name)
def _mock_settings_set_string_impl(self, name: str, value: str):
self._test_settings[name] = value
async def test_show_window_destroys_previous(self):
"""Testing show_window destroys previously allocated dialog"""
async with self.__lock:
under_test = get_file_importer()
with patch.object(FilePickerDialog, "destroy", autospec=True) as mock_destroy_dialog,\
patch("carb.windowing.IWindowing.hide_window"):
under_test.show_window(title="first")
under_test.show_window(title="second")
mock_destroy_dialog.assert_called()
dialog = mock_destroy_dialog.call_args[0][0]
self.assertEqual(str(dialog._window), "first")
async def test_hide_window_destroys_it(self):
"""Testing that hiding the window destroys it"""
async with self.__lock:
under_test = get_file_importer()
with patch.object(FilePickerDialog, "destroy", autospec=True) as mock_destroy_dialog:
under_test.show_window(title="test")
under_test._dialog.hide()
# Dialog is destroyed after a couple frames
await omni.kit.app.get_app().next_update_async()
await omni.kit.app.get_app().next_update_async()
mock_destroy_dialog.assert_called()
dialog = mock_destroy_dialog.call_args[0][0]
self.assertEqual(str(dialog._window), "test")
async def test_hide_window_destroys_detached_window(self):
"""Testing that hiding the window destroys detached window."""
async with self.__lock:
under_test = get_file_importer()
with patch.object(FilePickerDialog, "destroy", autospec=True) as mock_destroy_dialog:
under_test.show_window(title="test_detached")
await omni.kit.app.get_app().next_update_async()
under_test.detach_from_main_window()
main_window = omni.appwindow.get_default_app_window().get_window()
self.assertFalse(main_window is under_test._dialog._window.app_window.get_window())
under_test.hide_window()
# Dialog is destroyed after a couple frames
await omni.kit.app.get_app().next_update_async()
await omni.kit.app.get_app().next_update_async()
mock_destroy_dialog.assert_called()
dialog = mock_destroy_dialog.call_args[0][0]
self.assertEqual(str(dialog._window), "test_detached")
async def test_load_default_settings(self):
"""Testing that dialog applies saved settings"""
async with self.__lock:
under_test = get_file_importer()
with patch('omni.kit.window.file_importer.extension.FilePickerDialog') as mock_dialog,\
patch.object(ISettings, "get_as_string", side_effect=self._mock_settings_get_string_impl):
under_test.show_window(title="test_dialog")
# Retrieve keyword args for the constructor (first call), and confirm called with expected values
constructor_kwargs = mock_dialog.call_args_list[0][1]
self.assertEqual(constructor_kwargs['current_directory'], self._test_settings[f"{self._settings_path}/directory"])
async def test_override_default_settings(self):
"""Testing that user values override default settings"""
async with self.__lock:
test_url = "Omniverse://ov-test/my-folder/my-file.usd"
under_test = get_file_importer()
with patch('omni.kit.window.file_importer.extension.FilePickerDialog') as mock_dialog,\
patch.object(ISettings, "get_as_string", side_effect=self._mock_settings_get_string_impl),\
patch("carb.windowing.IWindowing.hide_window"):
under_test.show_window(title="test_dialog", filename_url=test_url)
# Retrieve keyword args for the constructor (first call), and confirm called with expected values
constructor_kwargs = mock_dialog.call_args_list[0][1]
dirname, filename = os.path.split(test_url)
self.assertEqual(constructor_kwargs['current_directory'], dirname)
self.assertEqual(constructor_kwargs['current_filename'], filename)
async def test_save_settings_on_import(self):
"""Testing that settings are saved on import"""
from ..extension import on_import
my_settings = {
'filename': "my-file.anim.usd",
'directory': "Omniverse://ov-test/my-folder",
}
mock_dialog = Mock()
with patch.object(ISettings, "get_as_string", side_effect=self._mock_settings_get_string_impl),\
patch.object(ISettings, "set_string", side_effect=self._mock_settings_set_string_impl):
on_import(None, mock_dialog, my_settings['filename'], my_settings['directory'])
# Retrieve keyword args for the constructor (first call), and confirm called with expected values
self.assertEqual(my_settings['directory'], self._test_settings[f"{self._settings_path}/directory"])
async def test_show_only_folders(self):
"""Testing show only folders option."""
mock_handler = Mock()
async with self.__lock:
under_test = get_file_importer()
test_path = get_test_data_path(__name__).replace("\\", '/')
async with FileImporterTestHelper() as helper:
with patch("carb.windowing.IWindowing.hide_window"):
# under normal circumstance, files will be shown and could be selected.
under_test.show_window(title="test", filename_url=test_path + "/")
await ui_test.human_delay(10)
item = await helper.get_item_async(None, "dummy.usd")
self.assertIsNotNone(item)
# apply button should be disabled
self.assertFalse(under_test._dialog._widget.file_bar._apply_button.enabled)
await helper.click_cancel_async()
# if shown with show_only_folders, files will not be shown
under_test.show_window(title="test", show_only_folders=True, import_handler=mock_handler)
await ui_test.human_delay(10)
item = await helper.get_item_async(None, "dummy.usd")
self.assertIsNone(item)
# try selecting a folder
selections = await under_test.select_items_async(test_path, filenames=['folder'])
self.assertEqual(len(selections), 1)
selected = selections[0]
# apply button should not be disabled
self.assertTrue(under_test._dialog._widget.file_bar._apply_button.enabled)
await ui_test.human_delay()
await helper.click_apply_async()
mock_handler.assert_called_once_with('', selected.path + "/", selections=[selected.path])
async def test_cancel_handler(self):
"""Testing cancel handler."""
mock_handler = Mock()
async with self.__lock:
under_test = get_file_importer()
async with FileImporterTestHelper() as helper:
under_test.show_window("test_cancel_handler")
await helper.wait_for_popup()
await omni.kit.app.get_app().next_update_async()
await omni.kit.app.get_app().next_update_async()
await helper.click_cancel_async(cancel_handler=mock_handler)
await omni.kit.app.get_app().next_update_async()
await omni.kit.app.get_app().next_update_async()
mock_handler.assert_called_once()
class TestFileFilterHandler(omni.kit.test.AsyncTestCase):
async def setUp(self):
ext_type = {
'usd': "*.usd",
'usda': "*.usda",
'usdc': "*.usdc",
'usdz': "*.usdz",
'multiusd': "*.usd, *.usda, *.usdc, *.usdz",
'all': "*.*",
'bad_formatting_type': "*.usd, .usda, *.usdc,*.usdz, , ,"
}
self.test_filenames = [
("test.anim.usd", "anim", ext_type['all'], True),
("test.anim.usd", "anim", ext_type['usd'], True),
("test.anim.usdz", "anim", ext_type['usdz'], True),
("test.anim.usdc", "anim", ext_type['usdz'], False),
("test.anim.usda", None, ext_type['usda'], True),
("test.material.", None, ext_type['usda'], False),
("test.materials.usd", "material", ext_type['usd'], False),
("test.material.", None, ext_type['all'], True),
("test.material.", "anim", ext_type['all'], False),
("test.material.", "material", ext_type['all'], True),
]
for t in ["multiusd", 'bad_formatting_type']:
self.test_filenames.extend([
("test.anim.usd", "anim", ext_type[t], True),
("test.anim.usdz", "anim", ext_type[t], True),
("test.anim.usdc", "anim", ext_type[t], True),
("test.anim.usda", None, ext_type[t], True),
("test.anim.bbb", None, ext_type[t], False),
("test.material.", None, ext_type[t], False),
("test.anim.usdc", "cache", ext_type[t], False),
("test.anim.usdc", None, ext_type[t], True),
])
async def tearDown(self):
pass
async def test_file_filter_handler(self):
"""Testing default file filter handler"""
from ..extension import default_filter_handler
for test_filename in self.test_filenames:
filename, postfix, ext, expected = test_filename
result = default_filter_handler(filename, postfix, ext)
self.assertEqual(result, expected)
| 11,636 | Python | 48.519149 | 126 | 0.601152 |
omniverse-code/kit/exts/omni.kit.window.file_importer/docs/CHANGELOG.md | # Changelog
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [1.0.10] - 2023-01-11
### Changed
- Added `get_config_menu_settings` & `set_config_menu_settings`
## [1.0.9] - 2022-12-20
### Changed
- Improve the file extension filter.
## [1.0.8] - 2022-11-08
### Added
- Updated the docs.
## [1.0.7] - 2022-10-13
### Added
- Added `select_items_async` to file_importer ext and test helper.
## [1.0.6] - 2022-07-07
### Added
- Added test helper function that waits for UI to be ready.
## [1.0.5] - 2022-06-15
### Added
- Adds test helper.
## [1.0.4] - 2022-04-06
### Added
- Disable unittests from loading at startup.
## [1.0.3] - 2022-03-17
### Added
- Selected file extension defaults to USD type.
## [1.0.2] - 2022-02-09
### Added
- Adds click_apply and click_cancel functions.
## [1.0.1] - 2022-02-03
### Added
- Adds postfix and extension options.
## [1.0.0] - 2021-11-16
### Added
- Initial add.
| 945 | Markdown | 18.708333 | 80 | 0.635979 |
omniverse-code/kit/exts/omni.kit.window.file_importer/docs/README.md | # Kit File Importer Extension [omni.kit.window.file_importer]
The File Importer extension
| 91 | Markdown | 21.999995 | 61 | 0.802198 |
omniverse-code/kit/exts/omni.kit.window.file_importer/docs/index.rst | omni.kit.window.file_importer
#############################
.. toctree::
:maxdepth: 1
CHANGELOG
.. automodule:: omni.kit.window.file_importer
:platform: Windows-x86_64, Linux-x86_64
:members:
:show-inheritance:
:undoc-members:
:imported-members:
| 275 | reStructuredText | 17.399999 | 45 | 0.596364 |
omniverse-code/kit/exts/omni.kit.window.file_importer/docs/Overview.md | # Overview
The file_importer extension provides a standardized dialog for importing files. It is a wrapper around the {obj}`FilePickerDialog`,
but with reasonable defaults for common settings, so it's a higher-level entry point to that interface.
Nevertheless, users will still have the ability to customize some parts but we've boiled them down to just the essential ones.
Why you should use this extension:
* Present a consistent file import experience across the app.
* Customize only the essential parts while inheriting sensible defaults elsewhere.
* Reduce boilerplate code.
* Inherit future improvements.
* Checkpoints fully supported if available on the server.
```{image} ../../../../source/extensions/omni.kit.window.file_importer/data/preview.png
---
align: center
---
```
## Quickstart
You can pop-up a dialog in just 2 steps. First, retrieve the extension.
```{literalinclude} ../../../../source/extensions/omni.kit.window.file_importer/scripts/demo_file_importer.py
---
language: python
start-after: BEGIN-DOC-get_instance
end-before: END-DOC-get_instance
dedent: 8
---
```
Then, invoke its show_window method.
```{literalinclude} ../../../../source/extensions/omni.kit.window.file_importer/scripts/demo_file_importer.py
---
language: python
start-after: BEGIN-DOC-show_window
end-before: END-DOC-show_window
dedent: 8
---
```
Note that the extension is a singleton, meaning there's only one instance of it throughout the app. Basically, we are assuming that you'd
never open more than one instance of the dialog at any one time. The advantage is that we can channel any development through this
single extension and all users will inherit the same changes.
## Customizing the Dialog
You can customize these parts of the dialog.
* Title - The title of the dialog.
* Collections - Which of these collections, ["bookmarks", "omniverse", "my-computer"] to display.
* Filename Url - Url of the file to import.
* Postfix options - Show only files of these content types.
* Extension options - Show only files with these filename extensions.
* Import label - Label for the import button.
* Import handler - User provided callback to handle the import process.
Note that these settings are applied when you show the window. Therefore, each time it's displayed, the dialog can be tailored to
the use case.
## Filter files by type
The user has the option to filter what files get shown in the list view.
One challenge of working in Omniverse is that everything is a USD file. An expected use case is to show only files of a
particular content type. To facilitate this workflow, we suggest adding a postfix to the filename, e.g. "file.animation.usd".
The file bar contains a dropdown that lists the default postfix labels, so you can filter by these. You have the option to
override this list.
```{literalinclude} ../../../../source/extensions/omni.kit.window.file_importer/omni/kit/window/file_importer/extension.py
---
language: python
start-after: BEGIN-DOC-file_postfix_options
end-before: END-DOC-file_postfix_options
dedent: 0
---
```
You can also filter by filename extension. By default, we provide the option to show only USD files.
```{literalinclude} ../../../../source/extensions/omni.kit.window.file_importer/omni/kit/window/file_importer/extension.py
---
language: python
start-after: BEGIN-DOC-file_extension_types
end-before: END-DOC-file_extension_types
dedent: 0
---
```
If you override either of the lists above, then you'll also need to provide a filter handler. The handler is called to decide whether
or not to display a given file. The default handler is shown below as an example.
```{literalinclude} ../../../../source/extensions/omni.kit.window.file_importer/omni/kit/window/file_importer/extension.py
---
language: python
start-after: BEGIN-DOC-file_filter_handler
end-before: END-DOC-file_filter_handler
dedent: 0
---
```
## Import options
A common need is to provide user options for the import process. You create the widget for accepting those inputs,
then add it to the details pane of the dialog. Do this by subclassing from {obj}`ImportOptionsDelegate`
and overriding the methods, {meth}`ImportOptionsDelegate._build_ui_impl` and (optionally) {meth}`ImportOptionsDelegate._destroy_impl`.
```{literalinclude} ../../../../source/extensions/omni.kit.window.file_importer/scripts/demo_file_importer.py
---
language: python
start-after: BEGIN-DOC-import_options
end-before: END-DOC-import_options
dedent: 0
---
```
Then provide the controller to the file picker for display.
```{literalinclude} ../../../../source/extensions/omni.kit.window.file_importer/scripts/demo_file_importer.py
---
language: python
start-after: BEGIN-DOC-add_import_options
end-before: END-DOC-add_import_options
dedent: 8
---
```
## Import handler
Provide a handler for when the Import button is clicked. The handler should expect a list of :attr:`selections` made from the UI.
```{literalinclude} ../../../../source/extensions/omni.kit.window.file_importer/scripts/demo_file_importer.py
---
language: python
start-after: BEGIN-DOC-import_handler
end-before: END-DOC-import_handler
dedent: 4
---
```
## Demo app
A complete demo, that includes the code snippets above, is included with this extension at "scripts/demo_file_importer.py".
| 5,291 | Markdown | 35 | 139 | 0.756379 |
omniverse-code/kit/exts/omni.kit.window.console/PACKAGE-LICENSES/omni.kit.window.console-LICENSE.md | Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
NVIDIA CORPORATION and its licensors retain all intellectual property
and proprietary rights in and to this software, related documentation
and any modifications thereto. Any use, reproduction, disclosure or
distribution of this software and related documentation without an express
license agreement from NVIDIA CORPORATION is strictly prohibited. | 412 | Markdown | 57.999992 | 74 | 0.839806 |
omniverse-code/kit/exts/omni.kit.window.console/config/extension.toml | [package]
version = "0.2.3"
category = "Internal"
[dependencies]
"omni.ui" = {}
"omni.usd" = {}
"omni.kit.menu.utils" = {}
[[native.library]]
path = "bin/${lib_prefix}omni.kit.window.console.plugin${lib_ext}"
[settings.exts."omni.kit.window.console"]
# Commands to execute on startup:
startupCommands = []
logFilter.verbose = false
logFilter.info = false
logFilter.warning = true
logFilter.error = true
logFilter.fatal = true
# Show input field to input commands
enableInput = true
[[python.module]]
name = "omni.kit.window.console"
[[test]]
args = [
"--/app/window/dpiScaleOverride=1.0",
"--/app/window/scaleToMonitor=false",
"--no-window"
]
dependencies = [
"omni.kit.renderer.capture",
"omni.kit.mainwindow",
]
| 741 | TOML | 18.025641 | 66 | 0.681511 |
omniverse-code/kit/exts/omni.kit.window.console/omni/kit/window/console/__init__.py | from ._console import *
from .scripts import * | 47 | Python | 14.999995 | 23 | 0.723404 |
omniverse-code/kit/exts/omni.kit.window.console/omni/kit/window/console/scripts/console_window.py | # Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ["ConsoleWindow"]
import omni.kit
import omni.ui as ui
from .._console import ConsoleWidget
class ConsoleWindow(ui.Window):
"""The Console window"""
def __init__(self):
self._title = "Console"
super().__init__(
self._title,
width=1000,
height=600,
dockPreference=ui.DockPreference.LEFT_BOTTOM,
raster_policy=ui.RasterPolicy.NEVER
)
# Dock it to the same space where Content is docked, make it the second tab and the active tab.
self.deferred_dock_in("Content", ui.DockPolicy.CURRENT_WINDOW_IS_ACTIVE)
self.dock_order = 1
self.set_visibility_changed_fn(self._visibility_changed_fn)
with self.frame:
self._console_widget = ConsoleWidget()
def _visibility_changed_fn(self, visible):
if self._visiblity_changed_listener:
self._visiblity_changed_listener(visible)
def set_visibility_changed_listener(self, listener):
self._visiblity_changed_listener = listener
def destroy(self):
"""
Called by extension before destroying this object. It doesn't happen automatically.
Without this hot reloading doesn't work.
"""
if self._console_widget:
self._console_widget.destroy()
self._console_widget = None
self._visiblity_changed_listener = None
super().destroy()
| 1,868 | Python | 32.374999 | 103 | 0.663812 |
omniverse-code/kit/exts/omni.kit.window.console/omni/kit/window/console/scripts/__init__.py | from .console_extension import ConsoleExtension | 47 | Python | 46.999953 | 47 | 0.893617 |
omniverse-code/kit/exts/omni.kit.window.console/omni/kit/window/console/scripts/console_extension.py | # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ["ConsoleExtension"]
import asyncio
import omni.ext
import omni.kit.ui
import omni.ui as ui
from omni.kit.menu.utils import MenuItemDescription
from .console_window import ConsoleWindow
class ConsoleExtension(omni.ext.IExt):
"""The entry point for Console Window"""
WINDOW_NAME = "Console"
MENU_GROUP = "Window"
def on_startup(self):
self._window = None
ui.Workspace.set_show_window_fn(ConsoleExtension.WINDOW_NAME, self.show_window)
self._menu = [MenuItemDescription(
name=ConsoleExtension.WINDOW_NAME,
ticked=True, # menu item is ticked
ticked_fn=self._is_visible, # gets called when the menu needs to get the state of the ticked menu
onclick_fn=self._toggle_window
)]
omni.kit.menu.utils.add_menu_items(self._menu, name=ConsoleExtension.MENU_GROUP)
ui.Workspace.show_window(ConsoleExtension.WINDOW_NAME)
def on_shutdown(self):
omni.kit.menu.utils.remove_menu_items(self._menu, name=ConsoleExtension.MENU_GROUP)
self._menu = None
if self._window:
self._window.destroy()
self._window = None
ui.Workspace.set_show_window_fn(ConsoleExtension.WINDOW_NAME, None)
def _set_menu(self, value):
"""Set the menu to create this window on and off"""
# this only tags test menu to update when menu is opening, so it
# doesn't matter that is called before window has been destroyed
omni.kit.menu.utils.refresh_menu_items(ConsoleExtension.MENU_GROUP)
async def _destroy_window_async(self):
# wait one frame, this is due to the one frame defer
# in Window::_moveToMainOSWindow()
await omni.kit.app.get_app().next_update_async()
if self._window:
self._window.destroy()
self._window = None
def _visiblity_changed_fn(self, visible):
self._set_menu(visible)
if not visible:
# Destroy the window, since we are creating new window
# in show_window
asyncio.ensure_future(self._destroy_window_async())
def show_window(self, value):
if value:
self._window = ConsoleWindow()
self._window.set_visibility_changed_listener(self._visiblity_changed_fn)
elif self._window:
self._window.visible = False
def _is_visible(self) -> bool:
return False if self._window is None else self._window.visible
def _toggle_window(self):
if self._is_visible():
self.show_window(False)
else:
self.show_window(True)
| 3,079 | Python | 34.813953 | 109 | 0.657681 |
omniverse-code/kit/exts/omni.kit.window.console/omni/kit/window/console/tests/__init__.py | from .console_tests import *
| 29 | Python | 13.999993 | 28 | 0.758621 |
omniverse-code/kit/exts/omni.kit.window.console/omni/kit/window/console/tests/console_tests.py | ## Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
##
## NVIDIA CORPORATION and its licensors retain all intellectual property
## and proprietary rights in and to this software, related documentation
## and any modifications thereto. Any use, reproduction, disclosure or
## distribution of this software and related documentation without an express
## license agreement from NVIDIA CORPORATION is strictly prohibited.
##
import omni.kit.test
from omni.ui.tests.test_base import OmniUiTest
from omni.kit.window.console import ConsoleWidget
from pathlib import Path
import omni.kit.app
import omni.kit.ui_test as ui_test
class TestConsoleWindow(OmniUiTest):
# Before running each test
async def setUp(self):
await super().setUp()
extension_path = omni.kit.app.get_app().get_extension_manager().get_extension_path_by_module(__name__)
self._golden_img_dir = Path(extension_path).joinpath("data").joinpath("tests").absolute()
# After running each test
async def tearDown(self):
await super().tearDown()
async def test_console(self):
window = await self.create_test_window(1000, 600)
with window.frame:
console_widget = ConsoleWidget()
console_widget.exec_command("clear")
console_window = ui_test.find("Console")
console_window._widget._console_widget.exec_command("clear")
for i in range(5):
await omni.kit.app.get_app().next_update_async()
await self.finalize_test(golden_img_dir=self._golden_img_dir, golden_img_name="test_console.png", use_log=False)
console_widget.visible =False
console_widget.destroy()
console_window._widget.visible =False
console_window._widget.destroy()
| 1,768 | Python | 36.638297 | 120 | 0.701357 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Sdf/__init__.py | #
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
from pxr import Tf
Tf.PreparePythonModule()
del Tf
def Find(layerFileName, scenePath=None):
'''Find(layerFileName, scenePath) -> object
layerFileName: string
scenePath: Path
If given a single string argument, returns the menv layer with
the given filename. If given two arguments (a string and a Path), finds
the menv layer with the given filename and returns the scene object
within it at the given path.'''
layer = Layer.Find(layerFileName)
if (scenePath is None): return layer
return layer.GetObjectAtPath(scenePath)
# Test utilities
def _PathElemsToPrefixes(absolute, elements):
if absolute:
string = "/"
else:
string = ""
lastElemWasDotDot = False
didFirst = False
for elem in elements:
if elem == Path.parentPathElement:
# dotdot
if didFirst:
string = string + "/"
else:
didFirst = True
string = string + elem
lastElemWasDotDot = True
elif elem[0] == ".":
# property
if lastElemWasDotDot:
string = string + "/"
string = string + elem
lastElemWasDotDot = False
elif elem[0] == "[":
# rel attr or sub-attr indices, don't care which
string = string + elem
lastElemWasDotDot = False
else:
if didFirst:
string = string + "/"
else:
didFirst = True
string = string + elem
lastElemWasDotDot = False
if not string:
return []
path = Path(string)
return path.GetPrefixes()
| 2,722 | Python | 31.807229 | 74 | 0.646583 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Sdf/__DOC.py | def Execute(result):
result["AssetPath"].__doc__ = """
Contains an asset path and an optional resolved path. Asset paths may
contain non-control UTF-8 encoded characters. Specifically,
U+0000\\.\\.U+001F (C0 controls), U+007F (delete), and
U+0080\\.\\.U+009F (C1 controls) are disallowed. Attempts to construct
asset paths with such characters will issue a TfError and produce the
default-constructed empty asset path.
"""
result["AssetPath"].__init__.func_doc = """__init__()
Construct an empty asset path.
----------------------------------------------------------------------
__init__(path)
Construct an asset path with ``path`` and no associated resolved path.
If the passed ``path`` is not valid UTF-8 or contains C0 or C1 control
characters, raise a TfError and return the default-constructed empty
asset path.
Parameters
----------
path : str
----------------------------------------------------------------------
__init__(path, resolvedPath)
Construct an asset path with ``path`` and an associated
``resolvedPath`` .
If either the passed \path or ``resolvedPath`` are not valid UTF-8 or
either contain C0 or C1 control characters, raise a TfError and return
the default-constructed empty asset path.
Parameters
----------
path : str
resolvedPath : str
"""
result["AttributeSpec"].__doc__ = """
A subclass of SdfPropertySpec that holds typed data.
Attributes are typed data containers that can optionally hold any and
all of the following:
- A single default value.
- An array of knot values describing how the value varies over
time.
- A dictionary of posed values, indexed by name.
The values contained in an attribute must all be of the same type. In
the Python API the ``typeName`` property holds the attribute type. In
the C++ API, you can get the attribute type using the GetTypeName()
method. In addition, all values, including all knot values, must be
the same shape. For information on shapes, see the VtShape class
reference in the C++ documentation.
"""
result["AttributeSpec"].HasColorSpace.func_doc = """HasColorSpace() -> bool
Returns true if this attribute has a colorSpace value authored.
"""
result["AttributeSpec"].ClearColorSpace.func_doc = """ClearColorSpace() -> None
Clears the colorSpace metadata value set on this attribute.
"""
result["BatchNamespaceEdit"].__doc__ = """
A description of an arbitrarily complex namespace edit.
A ``SdfBatchNamespaceEdit`` object describes zero or more namespace
edits. Various types providing a namespace will allow the edits to be
applied in a single operation and also allow testing if this will
work.
Clients are encouraged to group several edits into one object because
that may allow more efficient processing of the edits. If, for
example, you need to reparent several prims it may be faster to add
all of the reparents to a single ``SdfBatchNamespaceEdit`` and apply
them at once than to apply each separately.
Objects that allow applying edits are free to apply the edits in any
way and any order they see fit but they should guarantee that the
resulting namespace will be as if each edit was applied one at a time
in the order they were added.
Note that the above rule permits skipping edits that have no effect or
generate a non-final state. For example, if renaming A to B then to C
we could just rename A to C. This means notices may be elided.
However, implementations must not elide notices that contain
information about any edit that clients must be able to know but
otherwise cannot determine.
"""
result["BatchNamespaceEdit"].__init__.func_doc = """__init__()
Create an empty sequence of edits.
----------------------------------------------------------------------
__init__(arg1)
Parameters
----------
arg1 : BatchNamespaceEdit
----------------------------------------------------------------------
__init__(arg1)
Parameters
----------
arg1 : list[SdfNamespaceEdit]
"""
result["BatchNamespaceEdit"].Add.func_doc = """Add(edit) -> None
Add a namespace edit.
Parameters
----------
edit : NamespaceEdit
----------------------------------------------------------------------
Add(currentPath, newPath, index) -> None
Add a namespace edit.
Parameters
----------
currentPath : NamespaceEdit.Path
newPath : NamespaceEdit.Path
index : NamespaceEdit.Index
"""
result["BatchNamespaceEdit"].Process.func_doc = """Process(processedEdits, hasObjectAtPath, canEdit, details, fixBackpointers) -> bool
Validate the edits and generate a possibly more efficient edit
sequence.
Edits are treated as if they were performed one at time in sequence,
therefore each edit occurs in the namespace resulting from all
previous edits.
Editing the descendants of the object in each edit is implied. If an
object is removed then the new path will be empty. If an object is
removed after being otherwise edited, the other edits will be
processed and included in ``processedEdits`` followed by the removal.
This allows clients to fixup references to point to the object's final
location prior to removal.
This function needs help to determine if edits are allowed. The
callbacks provide that help. ``hasObjectAtPath`` returns ``true`` iff
there's an object at the given path. This path will be in the original
namespace not any intermediate or final namespace. ``canEdit`` returns
``true`` iff the object at the current path can be namespace edited to
the new path, ignoring whether an object already exists at the new
path. Both paths are in the original namespace. If it returns
``false`` it should set the string to the reason why the edit isn't
allowed. It should not write either path to the string.
If ``hasObjectAtPath`` is invalid then this assumes objects exist
where they should and don't exist where they shouldn't. Use this with
care. If ``canEdit`` in invalid then it's assumed all edits are valid.
If ``fixBackpointers`` is ``true`` then target/connection paths are
expected to be in the intermediate namespace resulting from all
previous edits. If ``false`` and any current or new path contains a
target or connection path that has been edited then this will generate
an error.
This method returns ``true`` if the edits are allowed and sets
``processedEdits`` to a new edit sequence at least as efficient as the
input sequence. If not allowed it returns ``false`` and appends
reasons why not to ``details`` .
Parameters
----------
processedEdits : list[SdfNamespaceEdit]
hasObjectAtPath : HasObjectAtPath
canEdit : CanEdit
details : list[SdfNamespaceEditDetail]
fixBackpointers : bool
"""
result["ChangeBlock"].__doc__ = """
**DANGER DANGER DANGER**
Please make sure you have read and fully understand the issues below
before using a changeblock! They are very easy to use in an unsafe way
that could make the system crash or corrupt data. If you have any
questions, please contact the USD team, who would be happy to help!
SdfChangeBlock provides a way to group a round of related changes to
scene description in order to process them more efficiently.
Normally, Sdf sends notification immediately as changes are made so
that downstream representations like UsdStage can update accordingly.
However, sometimes it can be advantageous to group a series of Sdf
changes into a batch so that they can be processed more efficiently,
with a single round of change processing. An example might be when
setting many avar values on a model at the same time.
Opening a changeblock tells Sdf to delay sending notification about
changes until the outermost changeblock is exited. Until then, Sdf
internally queues up the notification it needs to send.
It is *not* safe to use Usd or other downstream API while a
changeblock is open!! This is because those derived representations
will not have had a chance to update while the changeblock is open.
Not only will their view of the world be stale, it could be unsafe to
even make queries from, since they may be holding onto expired handles
to Sdf objects that no longer exist. If you need to make a bunch of
changes to scene description, the best approach is to build a list of
necessary changes that can be performed directly via the Sdf API, then
submit those all inside a changeblock without talking to any
downstream modules. For example, this is how many mutators in Usd
that operate on more than one field or Spec work.
"""
result["ChangeBlock"].__init__.func_doc = """__init__()
"""
result["CleanupEnabler"].__doc__ = """
An RAII class which, when an instance is alive, enables scheduling of
automatic cleanup of SdfLayers.
Any affected specs which no longer contribute to the scene will be
removed when the last SdfCleanupEnabler instance goes out of scope.
Note that for this purpose, SdfPropertySpecs are removed if they have
only required fields (see SdfPropertySpecs::HasOnlyRequiredFields),
but only if the property spec itself was affected by an edit that left
it with only required fields. This will have the effect of
uninstantiating on-demand attributes. For example, if its parent prim
was affected by an edit that left it otherwise inert, it will not be
removed if it contains an SdfPropertySpec with only required fields,
but if the property spec itself is edited leaving it with only
required fields, it will be removed, potentially uninstantiating it if
it's an on-demand property.
SdfCleanupEnablers are accessible in both C++ and Python.
/// SdfCleanupEnabler can be used in the following manner:
.. code-block:: text
{
SdfCleanupEnabler enabler;
// Perform any action that might otherwise leave inert specs around,
// such as removing info from properties or prims, or removing name
// children. i.e:
primSpec->ClearInfo(SdfFieldKeys->Default);
// When enabler goes out of scope on the next line, primSpec will
// be removed if it has been left as an empty over.
}
"""
result["CleanupEnabler"].__init__.func_doc = """__init__()
"""
result["FastUpdateList"].__doc__ = """"""
result["FileFormat"].__doc__ = """
Base class for file format implementations.
"""
result["FileFormat"].GetFileExtensions.func_doc = """GetFileExtensions() -> list[str]
Returns a list of extensions that this format supports.
"""
result["FileFormat"].IsSupportedExtension.func_doc = """IsSupportedExtension(extension) -> bool
Returns true if ``extension`` matches one of the extensions returned
by GetFileExtensions.
Parameters
----------
extension : str
"""
result["FileFormat"].IsPackage.func_doc = """IsPackage() -> bool
Returns true if this file format is a package containing other assets.
"""
result["FileFormat"].CanRead.func_doc = """CanRead(file) -> bool
Returns true if ``file`` can be read by this format.
Parameters
----------
file : str
"""
result["FileFormat"].GetFileExtension.func_doc = """**classmethod** GetFileExtension(s) -> str
Returns the file extension for path or file name ``s`` , without the
leading dot character.
Parameters
----------
s : str
"""
result["FileFormat"].FindAllFileFormatExtensions.func_doc = """**classmethod** FindAllFileFormatExtensions() -> set[str]
Returns a set containing the extension(s) corresponding to all
registered file formats.
"""
result["FileFormat"].FindById.func_doc = """**classmethod** FindById(formatId) -> FileFormat
Returns the file format instance with the specified ``formatId``
identifier.
If a format with a matching identifier is not found, this returns a
null file format pointer.
Parameters
----------
formatId : str
"""
result["FileFormat"].FindByExtension.func_doc = """**classmethod** FindByExtension(path, target) -> FileFormat
Returns the file format instance that supports the extension for
``path`` .
If a format with a matching extension is not found, this returns a
null file format pointer.
An extension may be handled by multiple file formats, but each with a
different target. In such cases, if no ``target`` is specified, the
file format that is registered as the primary plugin will be returned.
Otherwise, the file format whose target matches ``target`` will be
returned.
Parameters
----------
path : str
target : str
----------------------------------------------------------------------
FindByExtension(path, args) -> FileFormat
Returns a file format instance that supports the extension for
``path`` and whose target matches one of those specified by the given
``args`` .
If the ``args`` specify no target, then the file format that is
registered as the primary plugin will be returned. If a format with a
matching extension is not found, this returns a null file format
pointer.
Parameters
----------
path : str
args : FileFormatArguments
"""
result["Layer"].__doc__ = """
A scene description container that can combine with other such
containers to form simple component assets, and successively larger
aggregates. The contents of an SdfLayer adhere to the SdfData data
model. A layer can be ephemeral, or be an asset accessed and
serialized through the ArAsset and ArResolver interfaces.
The SdfLayer class provides a consistent API for accesing and
serializing scene description, using any data store provided by Ar
plugins. Sdf itself provides a UTF-8 text format for layers identified
by the".sdf"identifier extension, but via the SdfFileFormat
abstraction, allows downstream modules and plugins to adapt arbitrary
data formats to the SdfData/SdfLayer model.
The FindOrOpen() method returns a new SdfLayer object with scene
description from any supported asset format. Once read, a layer
remembers which asset it was read from. The Save() method saves the
layer back out to the original asset. You can use the Export() method
to write the layer to a different location. You can use the
GetIdentifier() method to get the layer's Id or GetRealPath() to get
the resolved, full URI.
Layers can have a timeCode range (startTimeCode and endTimeCode). This
range represents the suggested playback range, but has no impact on
the extent of the animation data that may be stored in the layer. The
metadatum"timeCodesPerSecond"is used to annotate how the time ordinate
for samples contained in the file scales to seconds. For example, if
timeCodesPerSecond is 24, then a sample at time ordinate 24 should be
viewed exactly one second after the sample at time ordinate 0.
"""
result["Layer"].GetFileFormat.func_doc = """GetFileFormat() -> FileFormat
Returns the file format used by this layer.
"""
result["Layer"].GetFileFormatArguments.func_doc = """GetFileFormatArguments() -> FileFormatArguments
Returns the file format-specific arguments used during the
construction of this layer.
"""
result["Layer"].StreamsData.func_doc = """StreamsData() -> bool
Returns true if this layer streams data from its serialized data store
on demand, false otherwise.
Layers with streaming data are treated differently to avoid pulling in
data unnecessarily. For example, reloading a streaming layer will not
perform fine-grained change notification, since doing so would require
the full contents of the layer to be loaded.
"""
result["Layer"].IsDetached.func_doc = """IsDetached() -> bool
Returns true if this layer is detached from its serialized data store,
false otherwise.
Detached layers are isolated from external changes to their serialized
data.
"""
result["Layer"].TransferContent.func_doc = """TransferContent(layer) -> None
Copies the content of the given layer into this layer.
Source layer is unmodified.
Parameters
----------
layer : Layer
"""
result["Layer"].CreateNew.func_doc = """**classmethod** CreateNew(identifier, args) -> Layer
Creates a new empty layer with the given identifier.
Additional arguments may be supplied via the ``args`` parameter. These
arguments may control behavior specific to the layer's file format.
Parameters
----------
identifier : str
args : FileFormatArguments
----------------------------------------------------------------------
CreateNew(fileFormat, identifier, args) -> Layer
Creates a new empty layer with the given identifier for a given file
format class.
This function has the same behavior as the other CreateNew function,
but uses the explicitly-specified ``fileFormat`` instead of attempting
to discern the format from ``identifier`` .
Parameters
----------
fileFormat : FileFormat
identifier : str
args : FileFormatArguments
"""
result["Layer"].New.func_doc = """**classmethod** New(fileFormat, identifier, args) -> Layer
Creates a new empty layer with the given identifier for a given file
format class.
The new layer will not be dirty and will not be saved.
Additional arguments may be supplied via the ``args`` parameter. These
arguments may control behavior specific to the layer's file format.
Parameters
----------
fileFormat : FileFormat
identifier : str
args : FileFormatArguments
"""
result["Layer"].FindOrOpen.func_doc = """**classmethod** FindOrOpen(identifier, args) -> Layer
Return an existing layer with the given ``identifier`` and ``args`` ,
or else load it.
If the layer can't be found or loaded, an error is posted and a null
layer is returned.
Arguments in ``args`` will override any arguments specified in
``identifier`` .
Parameters
----------
identifier : str
args : FileFormatArguments
"""
result["Layer"].FindOrOpenRelativeToLayer.func_doc = """**classmethod** FindOrOpenRelativeToLayer(anchor, identifier, args) -> Layer
Return an existing layer with the given ``identifier`` and ``args`` ,
or else load it.
The given ``identifier`` will be resolved relative to the ``anchor``
layer. If the layer can't be found or loaded, an error is posted and a
null layer is returned.
If the ``anchor`` layer is invalid, issues a coding error and returns
a null handle.
Arguments in ``args`` will override any arguments specified in
``identifier`` .
Parameters
----------
anchor : Layer
identifier : str
args : FileFormatArguments
"""
result["Layer"].OpenAsAnonymous.func_doc = """**classmethod** OpenAsAnonymous(layerPath, metadataOnly, tag) -> Layer
Load the given layer from disk as a new anonymous layer.
If the layer can't be found or loaded, an error is posted and a null
layer is returned.
The anonymous layer does not retain any knowledge of the backing file
on the filesystem.
``metadataOnly`` is a flag that asks for only the layer metadata to be
read in, which can be much faster if that is all that is required.
Note that this is just a hint: some FileFormat readers may disregard
this flag and still fully populate the layer contents.
An optional ``tag`` may be specified. See CreateAnonymous for details.
Parameters
----------
layerPath : str
metadataOnly : bool
tag : str
"""
result["Layer"].CreateAnonymous.func_doc = """**classmethod** CreateAnonymous(tag, args) -> Layer
Creates a new *anonymous* layer with an optional ``tag`` .
An anonymous layer is a layer with a system assigned identifier, that
cannot be saved to disk via Save() . Anonymous layers have an
identifier, but no real path or other asset information fields.
Anonymous layers may be tagged, which can be done to aid debugging
subsystems that make use of anonymous layers. The tag becomes the
display name of an anonymous layer, and is also included in the
generated identifier. Untagged anonymous layers have an empty display
name.
Additional arguments may be supplied via the ``args`` parameter. These
arguments may control behavior specific to the layer's file format.
Parameters
----------
tag : str
args : FileFormatArguments
----------------------------------------------------------------------
CreateAnonymous(tag, format, args) -> Layer
Create an anonymous layer with a specific ``format`` .
Parameters
----------
tag : str
format : FileFormat
args : FileFormatArguments
"""
result["Layer"].IsAnonymousLayerIdentifier.func_doc = """**classmethod** IsAnonymousLayerIdentifier(identifier) -> bool
Returns true if the ``identifier`` is an anonymous layer unique
identifier.
Parameters
----------
identifier : str
"""
result["Layer"].GetDisplayNameFromIdentifier.func_doc = """**classmethod** GetDisplayNameFromIdentifier(identifier) -> str
Returns the display name for the given ``identifier`` , using the same
rules as GetDisplayName.
Parameters
----------
identifier : str
"""
result["Layer"].Save.func_doc = """Save(force) -> bool
Returns ``true`` if successful, ``false`` if an error occurred.
Returns ``false`` if the layer has no remembered file name or the
layer type cannot be saved. The layer will not be overwritten if the
file exists and the layer is not dirty unless ``force`` is true.
Parameters
----------
force : bool
"""
result["Layer"].Export.func_doc = """Export(filename, comment, args) -> bool
Exports this layer to a file.
Returns ``true`` if successful, ``false`` if an error occurred.
If ``comment`` is not empty, the layer gets exported with the given
comment. Additional arguments may be supplied via the ``args``
parameter. These arguments may control behavior specific to the
exported layer's file format.
Note that the file name or comment of the original layer is not
updated. This only saves a copy of the layer to the given filename.
Subsequent calls to Save() will still save the layer to it's
previously remembered file name.
Parameters
----------
filename : str
comment : str
args : FileFormatArguments
"""
result["Layer"].ImportFromString.func_doc = """ImportFromString(string) -> bool
Reads this layer from the given string.
Returns ``true`` if successful, otherwise returns ``false`` .
Parameters
----------
string : str
"""
result["Layer"].Clear.func_doc = """Clear() -> None
Clears the layer of all content.
This restores the layer to a state as if it had just been created with
CreateNew() . This operation is Undo-able.
The fileName and whether journaling is enabled are not affected by
this method.
"""
result["Layer"].Reload.func_doc = """Reload(force) -> bool
Reloads the layer from its persistent representation.
This restores the layer to a state as if it had just been created with
FindOrOpen() . This operation is Undo-able.
The fileName and whether journaling is enabled are not affected by
this method.
When called with force = false (the default), Reload attempts to avoid
reloading layers that have not changed on disk. It does so by
comparing the file's modification time (mtime) to when the file was
loaded. If the layer has unsaved modifications, this mechanism is not
used, and the layer is reloaded from disk. If the layer has any
external asset dependencies their modification state will also be
consulted when determining if the layer needs to be reloaded.
Passing true to the ``force`` parameter overrides this behavior,
forcing the layer to be reloaded from disk regardless of whether it
has changed.
Parameters
----------
force : bool
"""
result["Layer"].Import.func_doc = """Import(layerPath) -> bool
Imports the content of the given layer path, replacing the content of
the current layer.
Note: If the layer path is the same as the current layer's real path,
no action is taken (and a warning occurs). For this case use Reload()
.
Parameters
----------
layerPath : str
"""
result["Layer"].ReloadLayers.func_doc = """**classmethod** ReloadLayers(layers, force) -> bool
Reloads the specified layers.
Returns ``false`` if one or more layers failed to reload.
See ``Reload()`` for a description of the ``force`` flag.
Parameters
----------
layers : set[Layer]
force : bool
"""
result["Layer"].UpdateExternalReference.func_doc = """UpdateExternalReference(oldAssetPath, newAssetPath) -> bool
Deprecated
Use UpdateCompositionAssetDependency instead.
Parameters
----------
oldAssetPath : str
newAssetPath : str
"""
result["Layer"].GetCompositionAssetDependencies.func_doc = """GetCompositionAssetDependencies() -> set[str]
Return paths of all assets this layer depends on due to composition
fields.
This includes the paths of all layers referred to by reference,
payload, and sublayer fields in this layer. This function only returns
direct composition dependencies of this layer, i.e. it does not
recurse to find composition dependencies from its dependent layer
assets.
"""
result["Layer"].UpdateCompositionAssetDependency.func_doc = """UpdateCompositionAssetDependency(oldAssetPath, newAssetPath) -> bool
Updates the asset path of a composation dependency in this layer.
If ``newAssetPath`` is supplied, the update works as"rename", updating
any occurrence of ``oldAssetPath`` to ``newAssetPath`` in all
reference, payload, and sublayer fields.
If ``newAssetPath`` is not given, this update behaves as a"delete",
removing all occurrences of ``oldAssetPath`` from all reference,
payload, and sublayer fields.
Parameters
----------
oldAssetPath : str
newAssetPath : str
"""
result["Layer"].GetExternalAssetDependencies.func_doc = """GetExternalAssetDependencies() -> set[str]
Returns a set of resolved paths to all external asset dependencies the
layer needs to generate its contents.
These are additional asset dependencies that are determined by the
layer's file format and will be consulted during Reload() when
determining if the layer needs to be reloaded. This specifically does
not include dependencies related to composition, i.e. this will not
include assets from references, payloads, and sublayers.
"""
result["Layer"].UpdateAssetInfo.func_doc = """UpdateAssetInfo() -> None
Update layer asset information.
Calling this method re-resolves the layer identifier, which updates
asset information such as the layer's resolved path and other asset
info. This may be used to update the layer after external changes to
the underlying asset system.
"""
result["Layer"].GetDisplayName.func_doc = """GetDisplayName() -> str
Returns the layer's display name.
The display name is the base filename of the identifier.
"""
result["Layer"].GetAssetName.func_doc = """GetAssetName() -> str
Returns the asset name associated with this layer.
"""
result["Layer"].GetAssetInfo.func_doc = """GetAssetInfo() -> VtValue
Returns resolve information from the last time the layer identifier
was resolved.
"""
result["Layer"].ComputeAbsolutePath.func_doc = """ComputeAbsolutePath(assetPath) -> str
Returns the path to the asset specified by ``assetPath`` using this
layer to anchor the path if necessary.
Returns ``assetPath`` if it's empty or an anonymous layer identifier.
This method can be used on asset paths that are authored in this layer
to create new asset paths that can be copied to other layers. These
new asset paths should refer to the same assets as the original asset
paths. For example, if the underlying ArResolver is filesystem-based
and ``assetPath`` is a relative filesystem path, this method might
return the absolute filesystem path using this layer's location as the
anchor.
The returned path should in general not be assumed to be an absolute
filesystem path or any other specific form. It is"absolute"in that it
should resolve to the same asset regardless of what layer it's
authored in.
Parameters
----------
assetPath : str
"""
result["Layer"].SplitIdentifier.func_doc = """**classmethod** SplitIdentifier(identifier, layerPath, arguments) -> bool
Splits the given layer identifier into its constituent layer path and
arguments.
Parameters
----------
identifier : str
layerPath : str
arguments : FileFormatArguments
"""
result["Layer"].CreateIdentifier.func_doc = """**classmethod** CreateIdentifier(layerPath, arguments) -> str
Joins the given layer path and arguments into an identifier.
Parameters
----------
layerPath : str
arguments : FileFormatArguments
"""
result["Layer"].Traverse.func_doc = """Traverse(path, func) -> None
Parameters
----------
path : Path
func : TraversalFunction
"""
result["Layer"].HasColorConfiguration.func_doc = """HasColorConfiguration() -> bool
Returns true if color configuration metadata is set in this layer.
GetColorConfiguration() , SetColorConfiguration()
"""
result["Layer"].ClearColorConfiguration.func_doc = """ClearColorConfiguration() -> None
Clears the color configuration metadata authored in this layer.
HasColorConfiguration() , SetColorConfiguration()
"""
result["Layer"].HasColorManagementSystem.func_doc = """HasColorManagementSystem() -> bool
Returns true if colorManagementSystem metadata is set in this layer.
GetColorManagementSystem() , SetColorManagementSystem()
"""
result["Layer"].ClearColorManagementSystem.func_doc = """ClearColorManagementSystem() -> None
Clears the'colorManagementSystem'metadata authored in this layer.
HascolorManagementSystem(), SetColorManagementSystem()
"""
result["Layer"].ClearDefaultPrim.func_doc = """ClearDefaultPrim() -> None
Clear the default prim metadata for this layer.
See GetDefaultPrim() and SetDefaultPrim() .
"""
result["Layer"].HasDefaultPrim.func_doc = """HasDefaultPrim() -> bool
Return true if the default prim metadata is set in this layer.
See GetDefaultPrim() and SetDefaultPrim() .
"""
result["Layer"].HasStartTimeCode.func_doc = """HasStartTimeCode() -> bool
Returns true if the layer has a startTimeCode opinion.
"""
result["Layer"].ClearStartTimeCode.func_doc = """ClearStartTimeCode() -> None
Clear the startTimeCode opinion.
"""
result["Layer"].HasEndTimeCode.func_doc = """HasEndTimeCode() -> bool
Returns true if the layer has an endTimeCode opinion.
"""
result["Layer"].ClearEndTimeCode.func_doc = """ClearEndTimeCode() -> None
Clear the endTimeCode opinion.
"""
result["Layer"].HasTimeCodesPerSecond.func_doc = """HasTimeCodesPerSecond() -> bool
Returns true if the layer has a timeCodesPerSecond opinion.
"""
result["Layer"].ClearTimeCodesPerSecond.func_doc = """ClearTimeCodesPerSecond() -> None
Clear the timeCodesPerSecond opinion.
"""
result["Layer"].HasFramesPerSecond.func_doc = """HasFramesPerSecond() -> bool
Returns true if the layer has a frames per second opinion.
"""
result["Layer"].ClearFramesPerSecond.func_doc = """ClearFramesPerSecond() -> None
Clear the framesPerSecond opinion.
"""
result["Layer"].HasFramePrecision.func_doc = """HasFramePrecision() -> bool
Returns true if the layer has a frames precision opinion.
"""
result["Layer"].ClearFramePrecision.func_doc = """ClearFramePrecision() -> None
Clear the framePrecision opinion.
"""
result["Layer"].HasOwner.func_doc = """HasOwner() -> bool
Returns true if the layer has an owner opinion.
"""
result["Layer"].ClearOwner.func_doc = """ClearOwner() -> None
Clear the owner opinion.
"""
result["Layer"].HasSessionOwner.func_doc = """HasSessionOwner() -> bool
Returns true if the layer has a session owner opinion.
"""
result["Layer"].ClearSessionOwner.func_doc = """ClearSessionOwner() -> None
"""
result["Layer"].HasCustomLayerData.func_doc = """HasCustomLayerData() -> bool
Returns true if CustomLayerData is authored on the layer.
"""
result["Layer"].ClearCustomLayerData.func_doc = """ClearCustomLayerData() -> None
Clears out the CustomLayerData dictionary associated with this layer.
"""
result["Layer"].ScheduleRemoveIfInert.func_doc = """ScheduleRemoveIfInert(spec) -> None
Cause ``spec`` to be removed if it no longer affects the scene when
the last change block is closed, or now if there are no change blocks.
Parameters
----------
spec : Spec
"""
result["Layer"].RemoveInertSceneDescription.func_doc = """RemoveInertSceneDescription() -> None
Removes all scene description in this layer that does not affect the
scene.
This method walks the layer namespace hierarchy and removes any prims
and that are not contributing any opinions.
"""
result["Layer"].ApplyRootPrimOrder.func_doc = """ApplyRootPrimOrder(vec) -> None
Reorders the given list of prim names according to the reorder
rootPrims statement for this layer.
This routine employs the standard list editing operations for ordered
items in a ListEditor.
Parameters
----------
vec : list[str]
"""
result["Layer"].SetDetachedLayerRules.func_doc = """**classmethod** SetDetachedLayerRules(mask) -> None
Sets the rules specifying detached layers.
Newly-created or opened layers whose identifiers are included in
``rules`` will be opened as detached layers. Existing layers that are
now included or no longer included will be reloaded. Any unsaved
modifications to those layers will be lost.
This function is not thread-safe. It may not be run concurrently with
any other functions that open, close, or read from any layers.
The detached layer rules are initially set to exclude all layers. This
may be overridden by setting the environment variables
SDF_LAYER_INCLUDE_DETACHED and SDF_LAYER_EXCLUDE_DETACHED to specify
the initial set of include and exclude patterns in the rules. These
variables can be set to a comma-delimited list of patterns.
SDF_LAYER_INCLUDE_DETACHED may also be set to"\\*"to include all
layers. Note that these environment variables only set the initial
state of the detached layer rules; these values may be overwritten by
subsequent calls to this function.
See SdfLayer::DetachedLayerRules::IsIncluded for details on how the
rules are applied to layer identifiers.
Parameters
----------
mask : DetachedLayerRules
"""
result["Layer"].GetDetachedLayerRules.func_doc = """**classmethod** GetDetachedLayerRules() -> DetachedLayerRules
Returns the current rules for the detached layer set.
"""
result["Layer"].IsIncludedByDetachedLayerRules.func_doc = """**classmethod** IsIncludedByDetachedLayerRules(identifier) -> bool
Returns whether the given layer identifier is included in the current
rules for the detached layer set.
This is equivalent to GetDetachedLayerRules() .IsIncluded(identifier).
Parameters
----------
identifier : str
"""
result["Layer"].IsMuted.func_doc = """**classmethod** IsMuted() -> bool
Returns ``true`` if the current layer is muted.
----------------------------------------------------------------------
IsMuted(path) -> bool
Returns ``true`` if the specified layer path is muted.
Parameters
----------
path : str
"""
result["Layer"].SetMuted.func_doc = """SetMuted(muted) -> None
Mutes the current layer if ``muted`` is ``true`` , and unmutes it
otherwise.
Parameters
----------
muted : bool
"""
result["Layer"].AddToMutedLayers.func_doc = """**classmethod** AddToMutedLayers(mutedPath) -> None
Add the specified path to the muted layers set.
Parameters
----------
mutedPath : str
"""
result["Layer"].RemoveFromMutedLayers.func_doc = """**classmethod** RemoveFromMutedLayers(mutedPath) -> None
Remove the specified path from the muted layers set.
Parameters
----------
mutedPath : str
"""
result["Layer"].GetObjectAtPath.func_doc = """GetObjectAtPath(path) -> Spec
Returns the object at the given ``path`` .
There is no distinction between an absolute and relative path at the
SdLayer level.
Returns ``None`` if there is no object at ``path`` .
Parameters
----------
path : Path
"""
result["Layer"].GetPrimAtPath.func_doc = """GetPrimAtPath(path) -> PrimSpec
Returns the prim at the given ``path`` .
Returns ``None`` if there is no prim at ``path`` . This is simply a
more specifically typed version of ``GetObjectAtPath()`` .
Parameters
----------
path : Path
"""
result["Layer"].GetPropertyAtPath.func_doc = """GetPropertyAtPath(path) -> PropertySpec
Returns a property at the given ``path`` .
Returns ``None`` if there is no property at ``path`` . This is simply
a more specifically typed version of ``GetObjectAtPath()`` .
Parameters
----------
path : Path
"""
result["Layer"].GetAttributeAtPath.func_doc = """GetAttributeAtPath(path) -> AttributeSpec
Returns an attribute at the given ``path`` .
Returns ``None`` if there is no attribute at ``path`` . This is simply
a more specifically typed version of ``GetObjectAtPath()`` .
Parameters
----------
path : Path
"""
result["Layer"].GetRelationshipAtPath.func_doc = """GetRelationshipAtPath(path) -> RelationshipSpec
Returns a relationship at the given ``path`` .
Returns ``None`` if there is no relationship at ``path`` . This is
simply a more specifically typed version of ``GetObjectAtPath()`` .
Parameters
----------
path : Path
"""
result["Layer"].SetPermissionToEdit.func_doc = """SetPermissionToEdit(allow) -> None
Sets permission to edit.
Parameters
----------
allow : bool
"""
result["Layer"].SetPermissionToSave.func_doc = """SetPermissionToSave(allow) -> None
Sets permission to save.
Parameters
----------
allow : bool
"""
result["Layer"].CanApply.func_doc = """CanApply(arg1, details) -> NamespaceEditDetail.Result
Check if a batch of namespace edits will succeed.
This returns ``SdfNamespaceEditDetail::Okay`` if they will succeed as
a batch, ``SdfNamespaceEditDetail::Unbatched`` if the edits will
succeed but will be applied unbatched, and
``SdfNamespaceEditDetail::Error`` if they will not succeed. No edits
will be performed in any case.
If ``details`` is not ``None`` and the method does not return ``Okay``
then details about the problems will be appended to ``details`` . A
problem may cause the method to return early, so ``details`` may not
list every problem.
Note that Sdf does not track backpointers so it's unable to fix up
targets/connections to namespace edited objects. Clients must fix
those to prevent them from falling off. In addition, this method will
report failure if any relational attribute with a target to a
namespace edited object is subsequently edited (in the same batch).
Clients should perform edits on relational attributes first.
Clients may wish to report unbatch details to the user to confirm that
the edits should be applied unbatched. This will give the user a
chance to correct any problems that cause batching to fail and try
again.
Parameters
----------
arg1 : BatchNamespaceEdit
details : list[SdfNamespaceEditDetail]
"""
result["Layer"].Apply.func_doc = """Apply(arg1) -> bool
Performs a batch of namespace edits.
Returns ``true`` on success and ``false`` on failure. On failure, no
namespace edits will have occurred.
Parameters
----------
arg1 : BatchNamespaceEdit
"""
result["Layer"].ListAllTimeSamples.func_doc = """ListAllTimeSamples() -> set[float]
"""
result["Layer"].ListTimeSamplesForPath.func_doc = """ListTimeSamplesForPath(path) -> set[float]
Parameters
----------
path : Path
"""
result["Layer"].GetBracketingTimeSamples.func_doc = """GetBracketingTimeSamples(time, tLower, tUpper) -> bool
Parameters
----------
time : float
tLower : float
tUpper : float
"""
result["Layer"].GetNumTimeSamplesForPath.func_doc = """GetNumTimeSamplesForPath(path) -> int
Parameters
----------
path : Path
"""
result["Layer"].GetBracketingTimeSamplesForPath.func_doc = """GetBracketingTimeSamplesForPath(path, time, tLower, tUpper) -> bool
Parameters
----------
path : Path
time : float
tLower : float
tUpper : float
"""
result["Layer"].QueryTimeSample.func_doc = """QueryTimeSample(path, time, value) -> bool
Parameters
----------
path : Path
time : float
value : VtValue
----------------------------------------------------------------------
QueryTimeSample(path, time, value) -> bool
Parameters
----------
path : Path
time : float
value : SdfAbstractDataValue
----------------------------------------------------------------------
QueryTimeSample(path, time, data) -> bool
Parameters
----------
path : Path
time : float
data : T
"""
result["Layer"].SetTimeSample.func_doc = """SetTimeSample(path, time, value) -> None
Parameters
----------
path : Path
time : float
value : VtValue
----------------------------------------------------------------------
SetTimeSample(path, time, value) -> None
Parameters
----------
path : Path
time : float
value : SdfAbstractDataConstValue
----------------------------------------------------------------------
SetTimeSample(path, time, value) -> None
Parameters
----------
path : Path
time : float
value : T
"""
result["Layer"].EraseTimeSample.func_doc = """EraseTimeSample(path, time) -> None
Parameters
----------
path : Path
time : float
"""
result["LayerOffset"].__doc__ = """
Represents a time offset and scale between layers.
The SdfLayerOffset class is an affine transform, providing both a
scale and a translate. It supports vector algebra semantics for
composing SdfLayerOffsets together via multiplication. The
SdfLayerOffset class is unitless: it does not refer to seconds or
frames.
For example, suppose layer A uses layer B, with an offset of X: when
bringing animation from B into A, you first apply the scale of X, and
then the offset. Suppose you have a scale of 2 and an offset of 24:
first multiply B's frame numbers by 2, and then add 24. The animation
from B as seen in A will take twice as long and start 24 frames later.
Offsets are typically used in either sublayers or prim references. For
more information, see the SetSubLayerOffset() method of the SdfLayer
class (the subLayerOffsets property in Python), as well as the
SetReference() and GetReferenceLayerOffset() methods (the latter is
the referenceLayerOffset property in Python) of the SdfPrimSpec class.
"""
result["LayerOffset"].__init__.func_doc = """__init__(offset, scale)
Constructs a new SdfLayerOffset instance.
Parameters
----------
offset : float
scale : float
"""
result["LayerOffset"].IsIdentity.func_doc = """IsIdentity() -> bool
Returns ``true`` if this is an identity transformation, with an offset
of 0.0 and a scale of 1.0.
"""
result["LayerOffset"].GetInverse.func_doc = """GetInverse() -> LayerOffset
Gets the inverse offset, which performs the opposite transformation.
"""
result["LayerTree"].__doc__ = """
A SdfLayerTree is an immutable tree structure representing a sublayer
stack and its recursive structure.
Layers can have sublayers, which can in turn have sublayers of their
own. Clients that want to represent that hierarchical structure in
memory can build a SdfLayerTree for that purpose.
We use TfRefPtr<SdfLayerTree> as handles to LayerTrees, as a simple
way to pass them around as immutable trees without worrying about
lifetime.
"""
result["LayerTree"].__init__.func_doc = """__init__(layer, childTrees, cumulativeOffset)
Parameters
----------
layer : Layer
childTrees : list[SdfLayerTreeHandle]
cumulativeOffset : LayerOffset
"""
result["NamespaceEdit"].__doc__ = """
A single namespace edit. It supports renaming, reparenting,
reparenting with a rename, reordering, and removal.
"""
result["NamespaceEdit"].__init__.func_doc = """__init__()
The default edit maps the empty path to the empty path.
----------------------------------------------------------------------
__init__(currentPath_, newPath_, index_)
The fully general edit.
Parameters
----------
currentPath_ : Path
newPath_ : Path
index_ : Index
"""
result["NamespaceEdit"].Remove.func_doc = """**classmethod** Remove(currentPath) -> This
Returns a namespace edit that removes the object at ``currentPath`` .
Parameters
----------
currentPath : Path
"""
result["NamespaceEdit"].Rename.func_doc = """**classmethod** Rename(currentPath, name) -> This
Returns a namespace edit that renames the prim or property at
``currentPath`` to ``name`` .
Parameters
----------
currentPath : Path
name : str
"""
result["NamespaceEdit"].Reorder.func_doc = """**classmethod** Reorder(currentPath, index) -> This
Returns a namespace edit to reorder the prim or property at
``currentPath`` to index ``index`` .
Parameters
----------
currentPath : Path
index : Index
"""
result["NamespaceEdit"].Reparent.func_doc = """**classmethod** Reparent(currentPath, newParentPath, index) -> This
Returns a namespace edit to reparent the prim or property at
``currentPath`` to be under ``newParentPath`` at index ``index`` .
Parameters
----------
currentPath : Path
newParentPath : Path
index : Index
"""
result["NamespaceEdit"].ReparentAndRename.func_doc = """**classmethod** ReparentAndRename(currentPath, newParentPath, name, index) -> This
Returns a namespace edit to reparent the prim or property at
``currentPath`` to be under ``newParentPath`` at index ``index`` with
the name ``name`` .
Parameters
----------
currentPath : Path
newParentPath : Path
name : str
index : Index
"""
result["NamespaceEditDetail"].__doc__ = """
Detailed information about a namespace edit.
"""
result["NamespaceEditDetail"].Result.__doc__ = """
Validity of an edit.
"""
result["NamespaceEditDetail"].__init__.func_doc = """__init__()
----------------------------------------------------------------------
__init__(arg1, edit, reason)
Parameters
----------
arg1 : Result
edit : NamespaceEdit
reason : str
"""
result["Notice"].__doc__ = """
Wrapper class for Sdf notices.
"""
result["Path"].__doc__ = """
A path value used to locate objects in layers or scenegraphs.
Overview
========
SdfPath is used in several ways:
- As a storage key for addressing and accessing values held in a
SdfLayer
- As a namespace identity for scenegraph objects
- As a way to refer to other scenegraph objects through relative
paths
The paths represented by an SdfPath class may be either relative or
absolute. Relative paths are relative to the prim object that contains
them (that is, if an SdfRelationshipSpec target is relative, it is
relative to the SdfPrimSpec object that owns the SdfRelationshipSpec
object).
SdfPath objects can be readily created from and converted back to
strings, but as SdfPath objects, they have behaviors that make it easy
and efficient to work with them. The SdfPath class provides a full
range of methods for manipulating scene paths by appending a namespace
child, appending a relationship target, getting the parent path, and
so on. Since the SdfPath class uses a node-based representation
internally, you should use the editing functions rather than
converting to and from strings if possible.
Path Syntax
===========
Like a filesystem path, an SdfPath is conceptually just a sequence of
path components. Unlike a filesystem path, each component has a type,
and the type is indicated by the syntax.
Two separators are used between parts of a path. A slash ("/")
following an identifier is used to introduce a namespace child. A
period (".") following an identifier is used to introduce a property.
A property may also have several non-sequential colons (':') in its
name to provide a rudimentary namespace within properties but may not
end or begin with a colon.
A leading slash in the string representation of an SdfPath object
indicates an absolute path. Two adjacent periods indicate the parent
namespace.
Brackets ("["and"]") are used to indicate relationship target paths
for relational attributes.
The first part in a path is assumed to be a namespace child unless it
is preceded by a period. That means:
- ``/Foo`` is an absolute path specifying the root prim Foo.
- ``/Foo/Bar`` is an absolute path specifying namespace child Bar
of root prim Foo.
- ``/Foo/Bar.baz`` is an absolute path specifying property ``baz``
of namespace child Bar of root prim Foo.
- ``Foo`` is a relative path specifying namespace child Foo of the
current prim.
- ``Foo/Bar`` is a relative path specifying namespace child Bar of
namespace child Foo of the current prim.
- ``Foo/Bar.baz`` is a relative path specifying property ``baz`` of
namespace child Bar of namespace child Foo of the current prim.
- ``.foo`` is a relative path specifying the property ``foo`` of
the current prim.
- ``/Foo.bar[/Foo.baz].attrib`` is a relational attribute path. The
relationship ``/Foo.bar`` has a target ``/Foo.baz`` . There is a
relational attribute ``attrib`` on that relationship->target pair.
A Note on Thread-Safety
=======================
SdfPath is strongly thread-safe, in the sense that zero additional
synchronization is required between threads creating or using SdfPath
values. Just like TfToken, SdfPath values are immutable. Internally,
SdfPath uses a global prefix tree to efficiently share representations
of paths, and provide fast equality/hashing operations, but
modifications to this table are internally synchronized. Consequently,
as with TfToken, for best performance it is important to minimize the
number of values created (since it requires synchronized access to
this table) or copied (since it requires atomic ref-counting
operations).
"""
result["Path"].__init__.func_doc = """__init__()
Constructs the default, empty path.
----------------------------------------------------------------------
__init__(path)
Creates a path from the given string.
If the given string is not a well-formed path, this will raise a Tf
error. Note that passing an empty std::string() will also raise an
error; the correct way to get the empty path is SdfPath() .
Internal dot-dots will be resolved by removing the first dot-dot, the
element preceding it, and repeating until no internal dot-dots remain.
Note that most often new paths are expected to be created by asking
existing paths to return modified versions of themselves.
Parameters
----------
path : str
----------------------------------------------------------------------
__init__(primNode)
Parameters
----------
primNode : Sdf_PathPrimNode
----------------------------------------------------------------------
__init__(primPart, propPart)
Parameters
----------
primPart : Sdf_PathPrimNode
propPart : Sdf_PathPropNode
----------------------------------------------------------------------
__init__(primPart, propPart)
Parameters
----------
primPart : Sdf_PathNode
propPart : Sdf_PathNode
"""
result["Path"].IsAbsolutePath.func_doc = """IsAbsolutePath() -> bool
Returns whether the path is absolute.
"""
result["Path"].IsAbsoluteRootPath.func_doc = """IsAbsoluteRootPath() -> bool
Return true if this path is the AbsoluteRootPath() .
"""
result["Path"].IsPrimPath.func_doc = """IsPrimPath() -> bool
Returns whether the path identifies a prim.
"""
result["Path"].IsAbsoluteRootOrPrimPath.func_doc = """IsAbsoluteRootOrPrimPath() -> bool
Returns whether the path identifies a prim or the absolute root.
"""
result["Path"].IsRootPrimPath.func_doc = """IsRootPrimPath() -> bool
Returns whether the path identifies a root prim.
the path must be absolute and have a single element (for example
``/foo`` ).
"""
result["Path"].IsPropertyPath.func_doc = """IsPropertyPath() -> bool
Returns whether the path identifies a property.
A relational attribute is considered to be a property, so this method
will return true for relational attributes as well as properties of
prims.
"""
result["Path"].IsPrimPropertyPath.func_doc = """IsPrimPropertyPath() -> bool
Returns whether the path identifies a prim's property.
A relational attribute is not a prim property.
"""
result["Path"].IsNamespacedPropertyPath.func_doc = """IsNamespacedPropertyPath() -> bool
Returns whether the path identifies a namespaced property.
A namespaced property has colon embedded in its name.
"""
result["Path"].IsPrimVariantSelectionPath.func_doc = """IsPrimVariantSelectionPath() -> bool
Returns whether the path identifies a variant selection for a prim.
"""
result["Path"].ContainsPrimVariantSelection.func_doc = """ContainsPrimVariantSelection() -> bool
Returns whether the path or any of its parent paths identifies a
variant selection for a prim.
"""
result["Path"].ContainsPropertyElements.func_doc = """ContainsPropertyElements() -> bool
Return true if this path contains any property elements, false
otherwise.
A false return indicates a prim-like path, specifically a root path, a
prim path, or a prim variant selection path. A true return indicates a
property-like path: a prim property path, a target path, a relational
attribute path, etc.
"""
result["Path"].ContainsTargetPath.func_doc = """ContainsTargetPath() -> bool
Return true if this path is or has a prefix that's a target path or a
mapper path.
"""
result["Path"].IsRelationalAttributePath.func_doc = """IsRelationalAttributePath() -> bool
Returns whether the path identifies a relational attribute.
If this is true, IsPropertyPath() will also be true.
"""
result["Path"].IsTargetPath.func_doc = """IsTargetPath() -> bool
Returns whether the path identifies a relationship or connection
target.
"""
result["Path"].IsMapperPath.func_doc = """IsMapperPath() -> bool
Returns whether the path identifies a connection mapper.
"""
result["Path"].IsMapperArgPath.func_doc = """IsMapperArgPath() -> bool
Returns whether the path identifies a connection mapper arg.
"""
result["Path"].IsExpressionPath.func_doc = """IsExpressionPath() -> bool
Returns whether the path identifies a connection expression.
"""
result["Path"].GetAncestorsRange.func_doc = """GetAncestorsRange() -> SdfPathAncestorsRange
Return a range for iterating over the ancestors of this path.
The range provides iteration over the prefixes of a path, ordered from
longest to shortest (the opposite of the order of the prefixes
returned by GetPrefixes).
"""
result["Path"].ReplaceName.func_doc = """ReplaceName(newName) -> Path
Return a copy of this path with its final component changed to
*newName*.
This path must be a prim or property path.
This method is shorthand for path.GetParentPath().AppendChild(newName)
for prim paths, path.GetParentPath().AppendProperty(newName) for prim
property paths, and
path.GetParentPath().AppendRelationalAttribute(newName) for relational
attribute paths.
Note that only the final path component is ever changed. If the name
of the final path component appears elsewhere in the path, it will not
be modified.
Some examples:
ReplaceName('/chars/MeridaGroup','AngusGroup')
\\->'/chars/AngusGroup'ReplaceName('/Merida.tx','ty')
\\->'/Merida.ty'ReplaceName('/Merida.tx[targ].tx','ty')
\\->'/Merida.tx[targ].ty'
Parameters
----------
newName : str
"""
result["Path"].GetAllTargetPathsRecursively.func_doc = """GetAllTargetPathsRecursively(result) -> None
Returns all the relationship target or connection target paths
contained in this path, and recursively all the target paths contained
in those target paths in reverse depth-first order.
For example, given the
path:'/A/B.a[/C/D.a[/E/F.a]].a[/A/B.a[/C/D.a]]'this method
produces:'/A/B.a[/C/D.a]','/C/D.a','/C/D.a[/E/F.a]','/E/F.a'
Parameters
----------
result : list[SdfPath]
"""
result["Path"].GetVariantSelection.func_doc = """GetVariantSelection() -> tuple[str, str]
Returns the variant selection for this path, if this is a variant
selection path.
Returns a pair of empty strings if this path is not a variant
selection path.
"""
result["Path"].HasPrefix.func_doc = """HasPrefix(prefix) -> bool
Return true if both this path and *prefix* are not the empty path and
this path has *prefix* as a prefix.
Return false otherwise.
Parameters
----------
prefix : Path
"""
result["Path"].GetParentPath.func_doc = """GetParentPath() -> Path
Return the path that identifies this path's namespace parent.
For a prim path (like'/foo/bar'), return the prim's parent's path
('/foo'). For a prim property path (like'/foo/bar.property'), return
the prim's path ('/foo/bar'). For a target path
(like'/foo/bar.property[/target]') return the property path
('/foo/bar.property'). For a mapper path
(like'/foo/bar.property.mapper[/target]') return the property path
('/foo/bar.property). For a relational attribute path
(like'/foo/bar.property[/target].relAttr') return the relationship
target's path ('/foo/bar.property[/target]'). For a prim variant
selection path (like'/foo/bar{var=sel}') return the prim path
('/foo/bar'). For a root prim path (like'/rootPrim'), return
AbsoluteRootPath() ('/'). For a single element relative prim path
(like'relativePrim'), return ReflexiveRelativePath() ('.'). For
ReflexiveRelativePath() , return the relative parent path ('\\.\\.').
Note that the parent path of a relative parent path ('\\.\\.') is a
relative grandparent path ('\\.\\./\\.\\.'). Use caution writing loops
that walk to parent paths since relative paths have infinitely many
ancestors. To more safely traverse ancestor paths, consider iterating
over an SdfPathAncestorsRange instead, as returend by
GetAncestorsRange() .
"""
result["Path"].GetPrimPath.func_doc = """GetPrimPath() -> Path
Creates a path by stripping all relational attributes, targets,
properties, and variant selections from the leafmost prim path,
leaving the nearest path for which *IsPrimPath()* returns true.
See *GetPrimOrPrimVariantSelectionPath* also.
If the path is already a prim path, the same path is returned.
"""
result["Path"].GetPrimOrPrimVariantSelectionPath.func_doc = """GetPrimOrPrimVariantSelectionPath() -> Path
Creates a path by stripping all relational attributes, targets, and
properties, leaving the nearest path for which
*IsPrimOrPrimVariantSelectionPath()* returns true.
See *GetPrimPath* also.
If the path is already a prim or a prim variant selection path, the
same path is returned.
"""
result["Path"].GetAbsoluteRootOrPrimPath.func_doc = """GetAbsoluteRootOrPrimPath() -> Path
Creates a path by stripping all properties and relational attributes
from this path, leaving the path to the containing prim.
If the path is already a prim or absolute root path, the same path is
returned.
"""
result["Path"].StripAllVariantSelections.func_doc = """StripAllVariantSelections() -> Path
Create a path by stripping all variant selections from all components
of this path, leaving a path with no embedded variant selections.
"""
result["Path"].AppendPath.func_doc = """AppendPath(newSuffix) -> Path
Creates a path by appending a given relative path to this path.
If the newSuffix is a prim path, then this path must be a prim path or
a root path.
If the newSuffix is a prim property path, then this path must be a
prim path or the ReflexiveRelativePath.
Parameters
----------
newSuffix : Path
"""
result["Path"].AppendChild.func_doc = """AppendChild(childName) -> Path
Creates a path by appending an element for ``childName`` to this path.
This path must be a prim path, the AbsoluteRootPath or the
ReflexiveRelativePath.
Parameters
----------
childName : str
"""
result["Path"].AppendProperty.func_doc = """AppendProperty(propName) -> Path
Creates a path by appending an element for ``propName`` to this path.
This path must be a prim path or the ReflexiveRelativePath.
Parameters
----------
propName : str
"""
result["Path"].AppendVariantSelection.func_doc = """AppendVariantSelection(variantSet, variant) -> Path
Creates a path by appending an element for ``variantSet`` and
``variant`` to this path.
This path must be a prim path.
Parameters
----------
variantSet : str
variant : str
"""
result["Path"].AppendTarget.func_doc = """AppendTarget(targetPath) -> Path
Creates a path by appending an element for ``targetPath`` .
This path must be a prim property or relational attribute path.
Parameters
----------
targetPath : Path
"""
result["Path"].AppendRelationalAttribute.func_doc = """AppendRelationalAttribute(attrName) -> Path
Creates a path by appending an element for ``attrName`` to this path.
This path must be a target path.
Parameters
----------
attrName : str
"""
result["Path"].ReplaceTargetPath.func_doc = """ReplaceTargetPath(newTargetPath) -> Path
Replaces the relational attribute's target path.
The path must be a relational attribute path.
Parameters
----------
newTargetPath : Path
"""
result["Path"].AppendMapper.func_doc = """AppendMapper(targetPath) -> Path
Creates a path by appending a mapper element for ``targetPath`` .
This path must be a prim property or relational attribute path.
Parameters
----------
targetPath : Path
"""
result["Path"].AppendMapperArg.func_doc = """AppendMapperArg(argName) -> Path
Creates a path by appending an element for ``argName`` .
This path must be a mapper path.
Parameters
----------
argName : str
"""
result["Path"].AppendExpression.func_doc = """AppendExpression() -> Path
Creates a path by appending an expression element.
This path must be a prim property or relational attribute path.
"""
result["Path"].AppendElementString.func_doc = """AppendElementString(element) -> Path
Creates a path by extracting and appending an element from the given
ascii element encoding.
Attempting to append a root or empty path (or malformed path) or
attempting to append *to* the EmptyPath will raise an error and return
the EmptyPath.
May also fail and return EmptyPath if this path's type cannot possess
a child of the type encoded in ``element`` .
Parameters
----------
element : str
"""
result["Path"].ReplacePrefix.func_doc = """ReplacePrefix(oldPrefix, newPrefix, fixTargetPaths) -> Path
Returns a path with all occurrences of the prefix path ``oldPrefix``
replaced with the prefix path ``newPrefix`` .
If fixTargetPaths is true, any embedded target paths will also have
their paths replaced. This is the default.
If this is not a target, relational attribute or mapper path this will
do zero or one path prefix replacements, if not the number of
replacements can be greater than one.
Parameters
----------
oldPrefix : Path
newPrefix : Path
fixTargetPaths : bool
"""
result["Path"].GetCommonPrefix.func_doc = """GetCommonPrefix(path) -> Path
Returns a path with maximal length that is a prefix path of both this
path and ``path`` .
Parameters
----------
path : Path
"""
result["Path"].RemoveCommonSuffix.func_doc = """RemoveCommonSuffix(otherPath, stopAtRootPrim) -> tuple[Path, Path]
Find and remove the longest common suffix from two paths.
Returns this path and ``otherPath`` with the longest common suffix
removed (first and second, respectively). If the two paths have no
common suffix then the paths are returned as-is. If the paths are
equal then this returns empty paths for relative paths and absolute
roots for absolute paths. The paths need not be the same length.
If ``stopAtRootPrim`` is ``true`` then neither returned path will be
the root path. That, in turn, means that some common suffixes will not
be removed. For example, if ``stopAtRootPrim`` is ``true`` then the
paths /A/B and /B will be returned as is. Were it ``false`` then the
result would be /A and /. Similarly paths /A/B/C and /B/C would return
/A/B and /B if ``stopAtRootPrim`` is ``true`` but /A and / if it's
``false`` .
Parameters
----------
otherPath : Path
stopAtRootPrim : bool
"""
result["Path"].MakeAbsolutePath.func_doc = """MakeAbsolutePath(anchor) -> Path
Returns the absolute form of this path using ``anchor`` as the
relative basis.
``anchor`` must be an absolute prim path.
If this path is a relative path, resolve it using ``anchor`` as the
relative basis.
If this path is already an absolute path, just return a copy.
Parameters
----------
anchor : Path
"""
result["Path"].MakeRelativePath.func_doc = """MakeRelativePath(anchor) -> Path
Returns the relative form of this path using ``anchor`` as the
relative basis.
``anchor`` must be an absolute prim path.
If this path is an absolute path, return the corresponding relative
path that is relative to the absolute path given by ``anchor`` .
If this path is a relative path, return the optimal relative path to
the absolute path given by ``anchor`` . (The optimal relative path
from a given prim path is the relative path with the least leading
dot-dots.
Parameters
----------
anchor : Path
"""
result["Path"].IsValidIdentifier.func_doc = """**classmethod** IsValidIdentifier(name) -> bool
Returns whether ``name`` is a legal identifier for any path component.
Parameters
----------
name : str
"""
result["Path"].IsValidNamespacedIdentifier.func_doc = """**classmethod** IsValidNamespacedIdentifier(name) -> bool
Returns whether ``name`` is a legal namespaced identifier.
This returns ``true`` if IsValidIdentifier() does.
Parameters
----------
name : str
"""
result["Path"].TokenizeIdentifier.func_doc = """**classmethod** TokenizeIdentifier(name) -> list[str]
Tokenizes ``name`` by the namespace delimiter.
Returns the empty vector if ``name`` is not a valid namespaced
identifier.
Parameters
----------
name : str
"""
result["Path"].JoinIdentifier.func_doc = """**classmethod** JoinIdentifier(names) -> str
Join ``names`` into a single identifier using the namespace delimiter.
Any empty strings present in ``names`` are ignored when joining.
Parameters
----------
names : list[str]
----------------------------------------------------------------------
JoinIdentifier(names) -> str
Join ``names`` into a single identifier using the namespace delimiter.
Any empty strings present in ``names`` are ignored when joining.
Parameters
----------
names : list[TfToken]
----------------------------------------------------------------------
JoinIdentifier(lhs, rhs) -> str
Join ``lhs`` and ``rhs`` into a single identifier using the namespace
delimiter.
Returns ``lhs`` if ``rhs`` is empty and vice verse. Returns an empty
string if both ``lhs`` and ``rhs`` are empty.
Parameters
----------
lhs : str
rhs : str
----------------------------------------------------------------------
JoinIdentifier(lhs, rhs) -> str
Join ``lhs`` and ``rhs`` into a single identifier using the namespace
delimiter.
Returns ``lhs`` if ``rhs`` is empty and vice verse. Returns an empty
string if both ``lhs`` and ``rhs`` are empty.
Parameters
----------
lhs : str
rhs : str
"""
result["Path"].StripNamespace.func_doc = """**classmethod** StripNamespace(name) -> str
Returns ``name`` stripped of any namespaces.
This does not check the validity of the name; it just attempts to
remove anything that looks like a namespace.
Parameters
----------
name : str
----------------------------------------------------------------------
StripNamespace(name) -> str
Returns ``name`` stripped of any namespaces.
This does not check the validity of the name; it just attempts to
remove anything that looks like a namespace.
Parameters
----------
name : str
"""
result["Path"].StripPrefixNamespace.func_doc = """**classmethod** StripPrefixNamespace(name, matchNamespace) -> tuple[str, bool]
Returns ( ``name`` , ``true`` ) where ``name`` is stripped of the
prefix specified by ``matchNamespace`` if ``name`` indeed starts with
``matchNamespace`` .
Returns ( ``name`` , ``false`` ) otherwise, with ``name`` unmodified.
This function deals with both the case where ``matchNamespace``
contains the trailing namespace delimiter':'or not.
Parameters
----------
name : str
matchNamespace : str
"""
result["Path"].IsValidPathString.func_doc = """**classmethod** IsValidPathString(pathString, errMsg) -> bool
Return true if ``pathString`` is a valid path string, meaning that
passing the string to the *SdfPath* constructor will result in a
valid, non-empty SdfPath.
Otherwise, return false and if ``errMsg`` is not None, set the
pointed-to string to the parse error.
Parameters
----------
pathString : str
errMsg : str
"""
result["Path"].GetConciseRelativePaths.func_doc = """**classmethod** GetConciseRelativePaths(paths) -> list[SdfPath]
Given some vector of paths, get a vector of concise unambiguous
relative paths.
GetConciseRelativePaths requires a vector of absolute paths. It finds
a set of relative paths such that each relative path is unique.
Parameters
----------
paths : list[SdfPath]
"""
result["Path"].RemoveDescendentPaths.func_doc = """**classmethod** RemoveDescendentPaths(paths) -> None
Remove all elements of *paths* that are prefixed by other elements in
*paths*.
As a side-effect, the result is left in sorted order.
Parameters
----------
paths : list[SdfPath]
"""
result["Path"].RemoveAncestorPaths.func_doc = """**classmethod** RemoveAncestorPaths(paths) -> None
Remove all elements of *paths* that prefix other elements in *paths*.
As a side-effect, the result is left in sorted order.
Parameters
----------
paths : list[SdfPath]
"""
result["Payload"].__doc__ = """
Represents a payload and all its meta data.
A payload represents a prim reference to an external layer. A payload
is similar to a prim reference (see SdfReference) with the major
difference that payloads are explicitly loaded by the user.
Unloaded payloads represent a boundary that lazy composition and
system behaviors will not traverse across, providing a user-visible
way to manage the working set of the scene.
"""
result["Payload"].__init__.func_doc = """__init__(assetPath, primPath, layerOffset)
Create a payload.
See SdfAssetPath for what characters are valid in ``assetPath`` . If
``assetPath`` contains invalid characters, issue an error and set this
payload's asset path to the empty asset path.
Parameters
----------
assetPath : str
primPath : Path
layerOffset : LayerOffset
"""
result["PrimSpec"].__doc__ = """
Represents a prim description in an SdfLayer object.
Every SdfPrimSpec object is defined in a layer. It is identified by
its path (SdfPath class) in the namespace hierarchy of its layer.
SdfPrimSpecs can be created using the New() method as children of
either the containing SdfLayer itself (for"root level"prims), or as
children of other SdfPrimSpec objects to extend a hierarchy. The
helper function SdfCreatePrimInLayer() can be used to quickly create a
hierarchy of primSpecs.
SdfPrimSpec objects have properties of two general types: attributes
(containing values) and relationships (different types of connections
to other prims and attributes). Attributes are represented by the
SdfAttributeSpec class and relationships by the SdfRelationshipSpec
class. Each prim has its own namespace of properties. Properties are
stored and accessed by their name.
SdfPrimSpec objects have a typeName, permission restriction, and they
reference and inherit prim paths. Permission restrictions control
which other layers may refer to, or express opinions about a prim. See
the SdfPermission class for more information.
- Insert doc about references and inherits here.
- Should have validate\\.\\.\\. methods for name, children,
properties
"""
result["PrimSpec"].CanSetName.func_doc = """CanSetName(newName, whyNot) -> bool
Returns true if setting the prim spec's name to ``newName`` will
succeed.
Returns false if it won't, and sets ``whyNot`` with a string
describing why not.
Parameters
----------
newName : str
whyNot : str
"""
result["PrimSpec"].ApplyNameChildrenOrder.func_doc = """ApplyNameChildrenOrder(vec) -> None
Reorders the given list of child names according to the reorder
nameChildren statement for this prim.
This routine employs the standard list editing operation for ordered
items in a ListEditor.
Parameters
----------
vec : list[str]
"""
result["PrimSpec"].RemoveProperty.func_doc = """RemoveProperty(property) -> None
Removes the property.
Parameters
----------
property : PropertySpec
"""
result["PrimSpec"].ApplyPropertyOrder.func_doc = """ApplyPropertyOrder(vec) -> None
Reorders the given list of property names according to the reorder
properties statement for this prim.
This routine employs the standard list editing operation for ordered
items in a ListEditor.
Parameters
----------
vec : list[str]
"""
result["PrimSpec"].GetPrimAtPath.func_doc = """GetPrimAtPath(path) -> PrimSpec
Returns a prim given its ``path`` .
Returns invalid handle if there is no prim at ``path`` . This is
simply a more specifically typed version of GetObjectAtPath.
Parameters
----------
path : Path
"""
result["PrimSpec"].GetPropertyAtPath.func_doc = """GetPropertyAtPath(path) -> PropertySpec
Returns a property given its ``path`` .
Returns invalid handle if there is no property at ``path`` . This is
simply a more specifically typed version of GetObjectAtPath.
Parameters
----------
path : Path
"""
result["PrimSpec"].GetAttributeAtPath.func_doc = """GetAttributeAtPath(path) -> AttributeSpec
Returns an attribute given its ``path`` .
Returns invalid handle if there is no attribute at ``path`` . This is
simply a more specifically typed version of GetObjectAtPath.
Parameters
----------
path : Path
"""
result["PrimSpec"].GetRelationshipAtPath.func_doc = """GetRelationshipAtPath(path) -> RelationshipSpec
Returns a relationship given its ``path`` .
Returns invalid handle if there is no relationship at ``path`` . This
is simply a more specifically typed version of GetObjectAtPath.
Parameters
----------
path : Path
"""
result["PrimSpec"].HasActive.func_doc = """HasActive() -> bool
Returns true if this prim spec has an opinion about active.
"""
result["PrimSpec"].ClearActive.func_doc = """ClearActive() -> None
Removes the active opinion in this prim spec if there is one.
"""
result["PrimSpec"].HasKind.func_doc = """HasKind() -> bool
Returns true if this prim spec has an opinion about kind.
"""
result["PrimSpec"].ClearKind.func_doc = """ClearKind() -> None
Remove the kind opinion from this prim spec if there is one.
"""
result["PrimSpec"].HasInstanceable.func_doc = """HasInstanceable() -> bool
Returns true if this prim spec has a value authored for its
instanceable flag, false otherwise.
"""
result["PrimSpec"].ClearInstanceable.func_doc = """ClearInstanceable() -> None
Clears the value for the prim's instanceable flag.
"""
result["PrimSpec"].GetVariantNames.func_doc = """GetVariantNames(name) -> list[str]
Returns list of variant names for the given variant set.
Parameters
----------
name : str
"""
result["PrimSpec"].BlockVariantSelection.func_doc = """BlockVariantSelection(variantSetName) -> None
Blocks the variant selected for the given variant set by setting the
variant selection to empty.
Parameters
----------
variantSetName : str
"""
result["PropertySpec"].__doc__ = """
Base class for SdfAttributeSpec and SdfRelationshipSpec.
Scene Spec Attributes (SdfAttributeSpec) and Relationships
(SdfRelationshipSpec) are the basic properties that make up Scene Spec
Prims (SdfPrimSpec). They share many qualities and can sometimes be
treated uniformly. The common qualities are provided by this base
class.
NOTE: Do not use Python reserved words and keywords as attribute
names. This will cause attribute resolution to fail.
"""
result["PropertySpec"].HasDefaultValue.func_doc = """HasDefaultValue() -> bool
Returns true if a default value is set for this attribute.
"""
result["PropertySpec"].ClearDefaultValue.func_doc = """ClearDefaultValue() -> None
Clear the attribute's default value.
"""
result["PseudoRootSpec"].__doc__ = """"""
result["Reference"].__doc__ = """
Represents a reference and all its meta data.
A reference is expressed on a prim in a given layer and it identifies
a prim in a layer stack. All opinions in the namespace hierarchy under
the referenced prim will be composed with the opinions in the
namespace hierarchy under the referencing prim.
The asset path specifies the layer stack being referenced. If this
asset path is non-empty, this reference is considered
an'external'reference to the layer stack rooted at the specified
layer. If this is empty, this reference is considered
an'internal'reference to the layer stack containing (but not
necessarily rooted at) the layer where the reference is authored.
The prim path specifies the prim in the referenced layer stack from
which opinions will be composed. If this prim path is empty, it will
be considered a reference to the default prim specified in the root
layer of the referenced layer stack see SdfLayer::GetDefaultPrim.
The meta data for a reference is its layer offset and custom data. The
layer offset is an affine transformation applied to all anim splines
in the referenced prim's namespace hierarchy, see SdfLayerOffset for
details. Custom data is for use by plugins or other non-tools supplied
extensions that need to be able to store data associated with
references.
"""
result["Reference"].__init__.func_doc = """__init__(assetPath, primPath, layerOffset, customData)
Creates a reference with all its meta data.
The default reference is an internal reference to the default prim.
See SdfAssetPath for what characters are valid in ``assetPath`` . If
``assetPath`` contains invalid characters, issue an error and set this
reference's asset path to the empty asset path.
Parameters
----------
assetPath : str
primPath : Path
layerOffset : LayerOffset
customData : VtDictionary
"""
result["Reference"].IsInternal.func_doc = """IsInternal() -> bool
Returns ``true`` in the case of an internal reference.
An internal reference is a reference with an empty asset path.
"""
result["RelationshipSpec"].__doc__ = """
A property that contains a reference to one or more SdfPrimSpec
instances.
A relationship may refer to one or more target prims or attributes.
All targets of a single relationship are considered to be playing the
same role. Note that ``role`` does not imply that the target prims or
attributes are of the same ``type`` .
Relationships may be annotated with relational attributes. Relational
attributes are named SdfAttributeSpec objects containing values that
describe the relationship. For example, point weights are commonly
expressed as relational attributes.
"""
result["RelationshipSpec"].ReplaceTargetPath.func_doc = """ReplaceTargetPath(oldPath, newPath) -> None
Updates the specified target path.
Replaces the path given by ``oldPath`` with the one specified by
``newPath`` . Relational attributes are updated if necessary.
Parameters
----------
oldPath : Path
newPath : Path
"""
result["RelationshipSpec"].RemoveTargetPath.func_doc = """RemoveTargetPath(path, preserveTargetOrder) -> None
Removes the specified target path.
Removes the given target path and any relational attributes for the
given target path. If ``preserveTargetOrder`` is ``true`` , Erase() is
called on the list editor instead of RemoveItemEdits(). This preserves
the ordered items list.
Parameters
----------
path : Path
preserveTargetOrder : bool
"""
result["Spec"].__doc__ = """
Base class for all Sdf spec classes.
"""
result["Spec"].ListInfoKeys.func_doc = """ListInfoKeys() -> list[str]
Returns the full list of info keys currently set on this object.
This does not include fields that represent names of children.
"""
result["Spec"].GetMetaDataInfoKeys.func_doc = """GetMetaDataInfoKeys() -> list[str]
Returns the list of metadata info keys for this object.
This is not the complete list of keys, it is only those that should be
considered to be metadata by inspectors or other presentation UI.
This is interim API which is likely to change. Only editors with an
immediate specific need (like the Inspector) should use this API.
"""
result["Spec"].GetMetaDataDisplayGroup.func_doc = """GetMetaDataDisplayGroup(key) -> str
Returns this metadata key's displayGroup.
Parameters
----------
key : str
"""
result["Spec"].GetInfo.func_doc = """GetInfo(key) -> VtValue
Gets the value for the given metadata key.
This is interim API which is likely to change. Only editors with an
immediate specific need (like the Inspector) should use this API.
Parameters
----------
key : str
"""
result["Spec"].SetInfo.func_doc = """SetInfo(key, value) -> None
Sets the value for the given metadata key.
It is an error to pass a value that is not the correct type for that
given key.
This is interim API which is likely to change. Only editors with an
immediate specific need (like the Inspector) should use this API.
Parameters
----------
key : str
value : VtValue
"""
result["Spec"].SetInfoDictionaryValue.func_doc = """SetInfoDictionaryValue(dictionaryKey, entryKey, value) -> None
Sets the value for ``entryKey`` to ``value`` within the dictionary
with the given metadata key ``dictionaryKey`` .
Parameters
----------
dictionaryKey : str
entryKey : str
value : VtValue
"""
result["TimeCode"].__doc__ = """
Value type that represents a time code. It's equivalent to a double
type value but is used to indicate that this value should be resolved
by any time based value resolution.
"""
result["TimeCode"].__init__.func_doc = """__init__(time)
Construct a time code with the given time.
A default constructed SdfTimeCode has a time of 0.0. A double value
can implicitly cast to SdfTimeCode.
Parameters
----------
time : float
"""
result["TimeCode"].GetValue.func_doc = """GetValue() -> float
Return the time value.
"""
result["UnregisteredValue"].__doc__ = """
Stores a representation of the value for an unregistered metadata
field encountered during text layer parsing.
This provides the ability to serialize this data to a layer, as well
as limited inspection and editing capabilities (e.g., moving this data
to a different spec or field) even when the data type of the value
isn't known.
"""
result["UnregisteredValue"].__init__.func_doc = """__init__()
Wraps an empty VtValue.
----------------------------------------------------------------------
__init__(value)
Wraps a std::string.
Parameters
----------
value : str
----------------------------------------------------------------------
__init__(value)
Wraps a VtDictionary.
Parameters
----------
value : VtDictionary
----------------------------------------------------------------------
__init__(value)
Wraps a SdfUnregisteredValueListOp.
Parameters
----------
value : UnregisteredValueListOp
"""
result["ValueBlock"].__doc__ = """
A special value type that can be used to explicitly author an opinion
for an attribute's default value or time sample value that represents
having no value. Note that this is different from not having a value
authored.
One could author such a value in two ways.
.. code-block:: text
attribute->SetDefaultValue(VtValue(SdfValueBlock());
\\.\\.\\.
layer->SetTimeSample(attribute->GetPath(), 101, VtValue(SdfValueBlock()));
"""
result["ValueTypeName"].__doc__ = """
Represents a value type name, i.e. an attribute's type name. Usually,
a value type name associates a string with a ``TfType`` and an
optional role, along with additional metadata. A schema registers all
known value type names and may register multiple names for the same
TfType and role pair. All name strings for a given pair are
collectively called its aliases.
A value type name may also represent just a name string, without a
``TfType`` , role or other metadata. This is currently used
exclusively to unserialize and re-serialize an attribute's type name
where that name is not known to the schema.
Because value type names can have aliases and those aliases may change
in the future, clients should avoid using the value type name's string
representation except to report human readable messages and when
serializing. Clients can look up a value type name by string using
``SdfSchemaBase::FindType()`` and shouldn't otherwise need the string.
Aliases compare equal, even if registered by different schemas.
"""
result["ValueTypeName"].__init__.func_doc = """__init__()
Constructs an invalid type name.
----------------------------------------------------------------------
__init__(arg1)
Parameters
----------
arg1 : Sdf_ValueTypeImpl
"""
result["VariantSetSpec"].__doc__ = """
Represents a coherent set of alternate representations for part of a
scene.
An SdfPrimSpec object may contain one or more named SdfVariantSetSpec
objects that define variations on the prim.
An SdfVariantSetSpec object contains one or more named SdfVariantSpec
objects. It may also define the name of one of its variants to be used
by default.
When a prim references another prim, the referencing prim may specify
one of the variants from each of the variant sets of the target prim.
The chosen variant from each set (or the default variant from those
sets that the referencing prim does not explicitly specify) is
composited over the target prim, and then the referencing prim is
composited over the result.
"""
result["VariantSetSpec"].RemoveVariant.func_doc = """RemoveVariant(variant) -> None
Removes ``variant`` from the list of variants.
If the variant set does not currently own ``variant`` , no action is
taken.
Parameters
----------
variant : VariantSpec
"""
result["VariantSpec"].__doc__ = """
Represents a single variant in a variant set.
A variant contains a prim. This prim is the root prim of the variant.
SdfVariantSpecs are value objects. This means they are immutable once
created and they are passed by copy-in APIs. To change a variant spec,
you make a new one and replace the existing one.
"""
result["VariantSpec"].GetVariantNames.func_doc = """GetVariantNames(name) -> list[str]
Returns list of variant names for the given variant set.
Parameters
----------
name : str
"""
result["AssetPath"].resolvedPath = property(result["AssetPath"].resolvedPath.fget, result["AssetPath"].resolvedPath.fset, result["AssetPath"].resolvedPath.fdel, """type : str
Return the resolved asset path, if any.
Note that SdfAssetPath carries a resolved path only if its creator
passed one to the constructor. SdfAssetPath never performs resolution
itself.
----------------------------------------------------------------------
type : str
Overload for rvalues, move out the asset path.
""")
result["BatchNamespaceEdit"].edits = property(result["BatchNamespaceEdit"].edits.fget, result["BatchNamespaceEdit"].edits.fset, result["BatchNamespaceEdit"].edits.fdel, """type : list[SdfNamespaceEdit]
Returns the edits.
""")
result["FileFormat"].formatId = property(result["FileFormat"].formatId.fget, result["FileFormat"].formatId.fset, result["FileFormat"].formatId.fdel, """type : str
Returns the format identifier.
""")
result["FileFormat"].target = property(result["FileFormat"].target.fget, result["FileFormat"].target.fset, result["FileFormat"].target.fdel, """type : str
Returns the target for this file format.
""")
result["FileFormat"].fileCookie = property(result["FileFormat"].fileCookie.fget, result["FileFormat"].fileCookie.fset, result["FileFormat"].fileCookie.fdel, """type : str
Returns the cookie to be used when writing files with this format.
""")
result["FileFormat"].primaryFileExtension = property(result["FileFormat"].primaryFileExtension.fget, result["FileFormat"].primaryFileExtension.fset, result["FileFormat"].primaryFileExtension.fdel, """type : str
Returns the primary file extension for this format.
This is the extension that is reported for layers using this file
format.
""")
result["Layer"].empty = property(result["Layer"].empty.fget, result["Layer"].empty.fset, result["Layer"].empty.fdel, """type : bool
Returns whether this layer has no significant data.
""")
result["Layer"].anonymous = property(result["Layer"].anonymous.fget, result["Layer"].anonymous.fset, result["Layer"].anonymous.fdel, """type : bool
Returns true if this layer is an anonymous layer.
""")
result["Layer"].dirty = property(result["Layer"].dirty.fget, result["Layer"].dirty.fset, result["Layer"].dirty.fdel, """type : bool
Returns ``true`` if the layer is dirty, i.e.
has changed from its persistent representation.
""")
result["LayerOffset"].offset = property(result["LayerOffset"].offset.fget, result["LayerOffset"].offset.fset, result["LayerOffset"].offset.fdel, """type : None
Sets the time offset.
----------------------------------------------------------------------
type : float
Returns the time offset.
""")
result["LayerOffset"].scale = property(result["LayerOffset"].scale.fget, result["LayerOffset"].scale.fset, result["LayerOffset"].scale.fdel, """type : None
Sets the time scale factor.
----------------------------------------------------------------------
type : float
Returns the time scale factor.
""")
result["LayerTree"].layer = property(result["LayerTree"].layer.fget, result["LayerTree"].layer.fset, result["LayerTree"].layer.fdel, """type : Layer
Returns the layer handle this tree node represents.
""")
result["LayerTree"].offset = property(result["LayerTree"].offset.fget, result["LayerTree"].offset.fset, result["LayerTree"].offset.fdel, """type : LayerOffset
Returns the cumulative layer offset from the root of the tree.
""")
result["LayerTree"].childTrees = property(result["LayerTree"].childTrees.fget, result["LayerTree"].childTrees.fset, result["LayerTree"].childTrees.fdel, """type : list[SdfLayerTreeHandle]
Returns the children of this tree node.
""")
result["Path"].isEmpty = property(result["Path"].isEmpty.fget, result["Path"].isEmpty.fset, result["Path"].isEmpty.fdel, """type : bool
Returns true if this is the empty path ( SdfPath::EmptyPath() ).
""")
result["Payload"].assetPath = property(result["Payload"].assetPath.fget, result["Payload"].assetPath.fset, result["Payload"].assetPath.fdel, """type : None
Sets a new asset path for the layer the payload uses.
See SdfAssetPath for what characters are valid in ``assetPath`` . If
``assetPath`` contains invalid characters, issue an error and set this
payload's asset path to the empty asset path.
----------------------------------------------------------------------
type : str
Returns the asset path of the layer that the payload uses.
""")
result["Payload"].primPath = property(result["Payload"].primPath.fget, result["Payload"].primPath.fset, result["Payload"].primPath.fdel, """type : None
Sets a new prim path for the prim that the payload uses.
----------------------------------------------------------------------
type : Path
Returns the scene path of the prim for the payload.
""")
result["Payload"].layerOffset = property(result["Payload"].layerOffset.fget, result["Payload"].layerOffset.fset, result["Payload"].layerOffset.fdel, """type : None
Sets a new layer offset.
----------------------------------------------------------------------
type : LayerOffset
Returns the layer offset associated with the payload.
""")
result["Reference"].assetPath = property(result["Reference"].assetPath.fget, result["Reference"].assetPath.fset, result["Reference"].assetPath.fdel, """type : None
Sets the asset path for the root layer of the referenced layer stack.
This may be set to an empty string to specify an internal reference.
See SdfAssetPath for what characters are valid in ``assetPath`` . If
``assetPath`` contains invalid characters, issue an error and set this
reference's asset path to the empty asset path.
----------------------------------------------------------------------
type : str
Returns the asset path to the root layer of the referenced layer
stack.
This will be empty in the case of an internal reference.
""")
result["Reference"].primPath = property(result["Reference"].primPath.fget, result["Reference"].primPath.fset, result["Reference"].primPath.fdel, """type : None
Sets the path of the referenced prim.
This may be set to an empty path to specify a reference to the default
prim in the referenced layer stack.
----------------------------------------------------------------------
type : Path
Returns the path of the referenced prim.
This will be empty if the referenced prim is the default prim
specified in the referenced layer stack.
""")
result["Reference"].layerOffset = property(result["Reference"].layerOffset.fget, result["Reference"].layerOffset.fset, result["Reference"].layerOffset.fdel, """type : None
Sets a new layer offset.
----------------------------------------------------------------------
type : LayerOffset
Returns the layer offset associated with the reference.
""")
result["Reference"].customData = property(result["Reference"].customData.fget, result["Reference"].customData.fset, result["Reference"].customData.fdel, """type : None
Sets the custom data associated with the reference.
----------------------------------------------------------------------
type : None
Sets a custom data entry for the reference.
If *value* is empty, then this removes the given custom data entry.
----------------------------------------------------------------------
type : VtDictionary
Returns the custom data associated with the reference.
""")
result["UnregisteredValue"].value = property(result["UnregisteredValue"].value.fget, result["UnregisteredValue"].value.fset, result["UnregisteredValue"].value.fdel, """type : VtValue
Returns the wrapped VtValue specified in the constructor.
""")
result["ValueTypeName"].type = property(result["ValueTypeName"].type.fget, result["ValueTypeName"].type.fset, result["ValueTypeName"].type.fdel, """type : Type
Returns the ``TfType`` of the type.
""")
result["ValueTypeName"].role = property(result["ValueTypeName"].role.fget, result["ValueTypeName"].role.fset, result["ValueTypeName"].role.fdel, """type : str
Returns the type's role.
""")
result["ValueTypeName"].defaultValue = property(result["ValueTypeName"].defaultValue.fget, result["ValueTypeName"].defaultValue.fset, result["ValueTypeName"].defaultValue.fdel, """type : VtValue
Returns the default value for the type.
""")
result["ValueTypeName"].defaultUnit = property(result["ValueTypeName"].defaultUnit.fget, result["ValueTypeName"].defaultUnit.fset, result["ValueTypeName"].defaultUnit.fdel, """type : Enum
Returns the default unit enum for the type.
""")
result["ValueTypeName"].scalarType = property(result["ValueTypeName"].scalarType.fget, result["ValueTypeName"].scalarType.fset, result["ValueTypeName"].scalarType.fdel, """type : ValueTypeName
Returns the scalar version of this type name if it's an array type
name, otherwise returns this type name.
If there is no scalar type name then this returns the invalid type
name.
""")
result["ValueTypeName"].arrayType = property(result["ValueTypeName"].arrayType.fget, result["ValueTypeName"].arrayType.fset, result["ValueTypeName"].arrayType.fdel, """type : ValueTypeName
Returns the array version of this type name if it's an scalar type
name, otherwise returns this type name.
If there is no array type name then this returns the invalid type
name.
""")
result["ValueTypeName"].isScalar = property(result["ValueTypeName"].isScalar.fget, result["ValueTypeName"].isScalar.fset, result["ValueTypeName"].isScalar.fdel, """type : bool
Returns ``true`` iff this type is a scalar.
The invalid type is considered neither scalar nor array.
""")
result["ValueTypeName"].isArray = property(result["ValueTypeName"].isArray.fget, result["ValueTypeName"].isArray.fset, result["ValueTypeName"].isArray.fdel, """type : bool
Returns ``true`` iff this type is an array.
The invalid type is considered neither scalar nor array.
""")
result["VariantSpec"].variantSets = property(result["VariantSpec"].variantSets.fget, result["VariantSpec"].variantSets.fset, result["VariantSpec"].variantSets.fdel, """type : SdfVariantSetsProxy
Returns the nested variant sets.
The result maps variant set names to variant sets. Variant sets may be
removed through the proxy.
""") | 95,823 | Python | 22.654406 | 213 | 0.711291 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Sdf/__init__.pyi | from __future__ import annotations
import pxr.Sdf._sdf
import typing
import Boost.Python
import pxr.Sdf
import pxr.Tf
__all__ = [
"AngularUnit",
"AngularUnitDegrees",
"AngularUnitRadians",
"AssetPath",
"AssetPathArray",
"AttributeSpec",
"AuthoringError",
"AuthoringErrorUnrecognizedFields",
"AuthoringErrorUnrecognizedSpecType",
"BatchNamespaceEdit",
"Cat",
"ChangeBlock",
"ChildrenView_Sdf_AttributeChildPolicy_SdfAttributeViewPredicate",
"ChildrenView_Sdf_AttributeChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfAttributeSpec___",
"ChildrenView_Sdf_PrimChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfPrimSpec___",
"ChildrenView_Sdf_PropertyChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfPropertySpec___",
"ChildrenView_Sdf_RelationshipChildPolicy_SdfRelationshipViewPredicate",
"ChildrenView_Sdf_VariantChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfVariantSpec___",
"ChildrenView_Sdf_VariantSetChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfVariantSetSpec___",
"CleanupEnabler",
"ComputeAssetPathRelativeToLayer",
"ConvertToValidMetadataDictionary",
"ConvertUnit",
"CopySpec",
"CreatePrimInLayer",
"CreateVariantInLayer",
"DefaultUnit",
"DimensionlessUnit",
"DimensionlessUnitDefault",
"DimensionlessUnitPercent",
"Equal",
"FastUpdateList",
"FileFormat",
"GetNameForUnit",
"GetTypeForValueTypeName",
"GetUnitFromName",
"GetValueTypeNameForValue",
"Int64ListOp",
"IntListOp",
"JustCreatePrimAttributeInLayer",
"JustCreatePrimInLayer",
"Layer",
"LayerOffset",
"LayerTree",
"LengthUnit",
"LengthUnitCentimeter",
"LengthUnitDecimeter",
"LengthUnitFoot",
"LengthUnitInch",
"LengthUnitKilometer",
"LengthUnitMeter",
"LengthUnitMile",
"LengthUnitMillimeter",
"LengthUnitYard",
"ListEditorProxy_SdfNameKeyPolicy",
"ListEditorProxy_SdfPathKeyPolicy",
"ListEditorProxy_SdfPayloadTypePolicy",
"ListEditorProxy_SdfReferenceTypePolicy",
"ListOpType",
"ListOpTypeAdded",
"ListOpTypeAppended",
"ListOpTypeDeleted",
"ListOpTypeExplicit",
"ListOpTypeOrdered",
"ListOpTypePrepended",
"ListProxy_SdfNameKeyPolicy",
"ListProxy_SdfNameTokenKeyPolicy",
"ListProxy_SdfPathKeyPolicy",
"ListProxy_SdfPayloadTypePolicy",
"ListProxy_SdfReferenceTypePolicy",
"ListProxy_SdfSubLayerTypePolicy",
"MapEditProxy_VtDictionary",
"MapEditProxy_map_SdfPath_SdfPath_less_SdfPath__allocator_pair_SdfPath_const__SdfPath_____",
"MapEditProxy_map_string_string_less_string__allocator_pair_stringconst__string_____",
"NamespaceEdit",
"NamespaceEditDetail",
"NotEqual",
"Notice",
"Path",
"PathArray",
"PathListOp",
"Payload",
"PayloadListOp",
"Permission",
"PermissionPrivate",
"PermissionPublic",
"PrimSpec",
"PropertySpec",
"PseudoRootSpec",
"Reference",
"ReferenceListOp",
"RelationshipSpec",
"Spec",
"SpecType",
"SpecTypeAttribute",
"SpecTypeConnection",
"SpecTypeExpression",
"SpecTypeMapper",
"SpecTypeMapperArg",
"SpecTypePrim",
"SpecTypePseudoRoot",
"SpecTypeRelationship",
"SpecTypeRelationshipTarget",
"SpecTypeUnknown",
"SpecTypeVariant",
"SpecTypeVariantSet",
"Specifier",
"SpecifierClass",
"SpecifierDef",
"SpecifierOver",
"StringListOp",
"TimeCode",
"TimeCodeArray",
"TokenListOp",
"UInt64ListOp",
"UIntListOp",
"UnitCategory",
"UnregisteredValue",
"UnregisteredValueListOp",
"ValueBlock",
"ValueHasValidType",
"ValueRoleNames",
"ValueTypeName",
"ValueTypeNames",
"Variability",
"VariabilityUniform",
"VariabilityVarying",
"VariantSetSpec",
"VariantSpec"
]
class AngularUnit(pxr.Tf.Tf_PyEnumWrapper, pxr.Tf.Enum, Boost.Python.instance):
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = ''
allValues: tuple # value = (Sdf.AngularUnitDegrees, Sdf.AngularUnitRadians)
pass
class AssetPath(Boost.Python.instance):
"""
Contains an asset path and an optional resolved path. Asset paths may
contain non-control UTF-8 encoded characters. Specifically,
U+0000\.\.U+001F (C0 controls), U+007F (delete), and
U+0080\.\.U+009F (C1 controls) are disallowed. Attempts to construct
asset paths with such characters will issue a TfError and produce the
default-constructed empty asset path.
"""
@property
def path(self) -> None:
"""
:type: None
"""
@property
def resolvedPath(self) -> None:
"""
type : str
Return the resolved asset path, if any.
Note that SdfAssetPath carries a resolved path only if its creator
passed one to the constructor. SdfAssetPath never performs resolution
itself.
----------------------------------------------------------------------
type : str
Overload for rvalues, move out the asset path.
:type: None
"""
__instance_size__ = 80
pass
class AssetPathArray(Boost.Python.instance):
"""
An array of type SdfAssetPath.
"""
_isVtArray = True
pass
class AttributeSpec(PropertySpec, Spec, Boost.Python.instance):
"""
A subclass of SdfPropertySpec that holds typed data.
Attributes are typed data containers that can optionally hold any and
all of the following:
- A single default value.
- An array of knot values describing how the value varies over
time.
- A dictionary of posed values, indexed by name.
The values contained in an attribute must all be of the same type. In
the Python API the ``typeName`` property holds the attribute type. In
the C++ API, you can get the attribute type using the GetTypeName()
method. In addition, all values, including all knot values, must be
the same shape. For information on shapes, see the VtShape class
reference in the C++ documentation.
"""
@staticmethod
def ClearColorSpace() -> None:
"""
ClearColorSpace() -> None
Clears the colorSpace metadata value set on this attribute.
"""
@staticmethod
def HasColorSpace() -> bool:
"""
HasColorSpace() -> bool
Returns true if this attribute has a colorSpace value authored.
"""
@property
def allowedTokens(self) -> None:
"""
The allowed value tokens for this property
:type: None
"""
@property
def colorSpace(self) -> None:
"""
The color-space in which the attribute value is authored.
:type: None
"""
@property
def connectionPathList(self) -> None:
"""
A PathListEditor for the attribute's connection paths.
The list of the connection paths for this attribute may be modified with this PathListEditor.
A PathListEditor may express a list either as an explicit value or as a set of list editing operations. See GdListEditor for more information.
:type: None
"""
@property
def displayUnit(self) -> None:
"""
The display unit for this attribute.
:type: None
"""
@property
def expired(self) -> None:
"""
:type: None
"""
@property
def roleName(self) -> None:
"""
The roleName for this attribute's typeName.
:type: None
"""
@property
def typeName(self) -> None:
"""
The typename of this attribute.
:type: None
"""
@property
def valueType(self) -> None:
"""
The value type of this attribute.
:type: None
"""
ConnectionPathsKey = 'connectionPaths'
DefaultValueKey = 'default'
DisplayUnitKey = 'displayUnit'
pass
class AuthoringError(pxr.Tf.Tf_PyEnumWrapper, pxr.Tf.Enum, Boost.Python.instance):
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = ''
allValues: tuple # value = (Sdf.AuthoringErrorUnrecognizedFields, Sdf.AuthoringErrorUnrecognizedSpecType)
pass
class BatchNamespaceEdit(Boost.Python.instance):
"""
A description of an arbitrarily complex namespace edit.
A ``SdfBatchNamespaceEdit`` object describes zero or more namespace
edits. Various types providing a namespace will allow the edits to be
applied in a single operation and also allow testing if this will
work.
Clients are encouraged to group several edits into one object because
that may allow more efficient processing of the edits. If, for
example, you need to reparent several prims it may be faster to add
all of the reparents to a single ``SdfBatchNamespaceEdit`` and apply
them at once than to apply each separately.
Objects that allow applying edits are free to apply the edits in any
way and any order they see fit but they should guarantee that the
resulting namespace will be as if each edit was applied one at a time
in the order they were added.
Note that the above rule permits skipping edits that have no effect or
generate a non-final state. For example, if renaming A to B then to C
we could just rename A to C. This means notices may be elided.
However, implementations must not elide notices that contain
information about any edit that clients must be able to know but
otherwise cannot determine.
"""
@staticmethod
@typing.overload
def Add(edit) -> None:
"""
Add(edit) -> None
Add a namespace edit.
Parameters
----------
edit : NamespaceEdit
----------------------------------------------------------------------
Add a namespace edit.
Parameters
----------
currentPath : NamespaceEdit.Path
newPath : NamespaceEdit.Path
index : NamespaceEdit.Index
"""
@staticmethod
@typing.overload
def Add(currentPath, newPath, index) -> None: ...
@staticmethod
def Process(processedEdits, hasObjectAtPath, canEdit, details, fixBackpointers) -> bool:
"""
Process(processedEdits, hasObjectAtPath, canEdit, details, fixBackpointers) -> bool
Validate the edits and generate a possibly more efficient edit
sequence.
Edits are treated as if they were performed one at time in sequence,
therefore each edit occurs in the namespace resulting from all
previous edits.
Editing the descendants of the object in each edit is implied. If an
object is removed then the new path will be empty. If an object is
removed after being otherwise edited, the other edits will be
processed and included in ``processedEdits`` followed by the removal.
This allows clients to fixup references to point to the object's final
location prior to removal.
This function needs help to determine if edits are allowed. The
callbacks provide that help. ``hasObjectAtPath`` returns ``true`` iff
there's an object at the given path. This path will be in the original
namespace not any intermediate or final namespace. ``canEdit`` returns
``true`` iff the object at the current path can be namespace edited to
the new path, ignoring whether an object already exists at the new
path. Both paths are in the original namespace. If it returns
``false`` it should set the string to the reason why the edit isn't
allowed. It should not write either path to the string.
If ``hasObjectAtPath`` is invalid then this assumes objects exist
where they should and don't exist where they shouldn't. Use this with
care. If ``canEdit`` in invalid then it's assumed all edits are valid.
If ``fixBackpointers`` is ``true`` then target/connection paths are
expected to be in the intermediate namespace resulting from all
previous edits. If ``false`` and any current or new path contains a
target or connection path that has been edited then this will generate
an error.
This method returns ``true`` if the edits are allowed and sets
``processedEdits`` to a new edit sequence at least as efficient as the
input sequence. If not allowed it returns ``false`` and appends
reasons why not to ``details`` .
Parameters
----------
processedEdits : list[SdfNamespaceEdit]
hasObjectAtPath : HasObjectAtPath
canEdit : CanEdit
details : list[SdfNamespaceEditDetail]
fixBackpointers : bool
"""
@property
def edits(self) -> None:
"""
type : list[SdfNamespaceEdit]
Returns the edits.
:type: None
"""
pass
class ChangeBlock(Boost.Python.instance):
"""
**DANGER DANGER DANGER**
Please make sure you have read and fully understand the issues below
before using a changeblock! They are very easy to use in an unsafe way
that could make the system crash or corrupt data. If you have any
questions, please contact the USD team, who would be happy to help!
SdfChangeBlock provides a way to group a round of related changes to
scene description in order to process them more efficiently.
Normally, Sdf sends notification immediately as changes are made so
that downstream representations like UsdStage can update accordingly.
However, sometimes it can be advantageous to group a series of Sdf
changes into a batch so that they can be processed more efficiently,
with a single round of change processing. An example might be when
setting many avar values on a model at the same time.
Opening a changeblock tells Sdf to delay sending notification about
changes until the outermost changeblock is exited. Until then, Sdf
internally queues up the notification it needs to send.
It is *not* safe to use Usd or other downstream API while a
changeblock is open!! This is because those derived representations
will not have had a chance to update while the changeblock is open.
Not only will their view of the world be stale, it could be unsafe to
even make queries from, since they may be holding onto expired handles
to Sdf objects that no longer exist. If you need to make a bunch of
changes to scene description, the best approach is to build a list of
necessary changes that can be performed directly via the Sdf API, then
submit those all inside a changeblock without talking to any
downstream modules. For example, this is how many mutators in Usd
that operate on more than one field or Spec work.
"""
__instance_size__ = 32
pass
class ChildrenView_Sdf_AttributeChildPolicy_SdfAttributeViewPredicate(Boost.Python.instance):
class ChildrenView_Sdf_AttributeChildPolicy_SdfAttributeViewPredicate_Iterator(Boost.Python.instance):
pass
class ChildrenView_Sdf_AttributeChildPolicy_SdfAttributeViewPredicate_KeyIterator(Boost.Python.instance):
pass
class ChildrenView_Sdf_AttributeChildPolicy_SdfAttributeViewPredicate_ValueIterator(Boost.Python.instance):
pass
@staticmethod
def get(*args, **kwargs) -> None: ...
@staticmethod
def index(*args, **kwargs) -> None: ...
@staticmethod
def items(*args, **kwargs) -> None: ...
@staticmethod
def keys(*args, **kwargs) -> None: ...
@staticmethod
def values(*args, **kwargs) -> None: ...
pass
class ChildrenView_Sdf_AttributeChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfAttributeSpec___(Boost.Python.instance):
class ChildrenView_Sdf_AttributeChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfAttributeSpec____Iterator(Boost.Python.instance):
pass
class ChildrenView_Sdf_AttributeChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfAttributeSpec____KeyIterator(Boost.Python.instance):
pass
class ChildrenView_Sdf_AttributeChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfAttributeSpec____ValueIterator(Boost.Python.instance):
pass
@staticmethod
def get(*args, **kwargs) -> None: ...
@staticmethod
def index(*args, **kwargs) -> None: ...
@staticmethod
def items(*args, **kwargs) -> None: ...
@staticmethod
def keys(*args, **kwargs) -> None: ...
@staticmethod
def values(*args, **kwargs) -> None: ...
pass
class ChildrenView_Sdf_PrimChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfPrimSpec___(Boost.Python.instance):
class ChildrenView_Sdf_PrimChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfPrimSpec____Iterator(Boost.Python.instance):
pass
class ChildrenView_Sdf_PrimChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfPrimSpec____KeyIterator(Boost.Python.instance):
pass
class ChildrenView_Sdf_PrimChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfPrimSpec____ValueIterator(Boost.Python.instance):
pass
@staticmethod
def get(*args, **kwargs) -> None: ...
@staticmethod
def index(*args, **kwargs) -> None: ...
@staticmethod
def items(*args, **kwargs) -> None: ...
@staticmethod
def keys(*args, **kwargs) -> None: ...
@staticmethod
def values(*args, **kwargs) -> None: ...
pass
class ChildrenView_Sdf_PropertyChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfPropertySpec___(Boost.Python.instance):
class ChildrenView_Sdf_PropertyChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfPropertySpec____Iterator(Boost.Python.instance):
pass
class ChildrenView_Sdf_PropertyChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfPropertySpec____KeyIterator(Boost.Python.instance):
pass
class ChildrenView_Sdf_PropertyChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfPropertySpec____ValueIterator(Boost.Python.instance):
pass
@staticmethod
def get(*args, **kwargs) -> None: ...
@staticmethod
def index(*args, **kwargs) -> None: ...
@staticmethod
def items(*args, **kwargs) -> None: ...
@staticmethod
def keys(*args, **kwargs) -> None: ...
@staticmethod
def values(*args, **kwargs) -> None: ...
pass
class ChildrenView_Sdf_RelationshipChildPolicy_SdfRelationshipViewPredicate(Boost.Python.instance):
class ChildrenView_Sdf_RelationshipChildPolicy_SdfRelationshipViewPredicate_Iterator(Boost.Python.instance):
pass
class ChildrenView_Sdf_RelationshipChildPolicy_SdfRelationshipViewPredicate_KeyIterator(Boost.Python.instance):
pass
class ChildrenView_Sdf_RelationshipChildPolicy_SdfRelationshipViewPredicate_ValueIterator(Boost.Python.instance):
pass
@staticmethod
def get(*args, **kwargs) -> None: ...
@staticmethod
def index(*args, **kwargs) -> None: ...
@staticmethod
def items(*args, **kwargs) -> None: ...
@staticmethod
def keys(*args, **kwargs) -> None: ...
@staticmethod
def values(*args, **kwargs) -> None: ...
pass
class ChildrenView_Sdf_VariantChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfVariantSpec___(Boost.Python.instance):
class ChildrenView_Sdf_VariantChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfVariantSpec____Iterator(Boost.Python.instance):
pass
class ChildrenView_Sdf_VariantChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfVariantSpec____KeyIterator(Boost.Python.instance):
pass
class ChildrenView_Sdf_VariantChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfVariantSpec____ValueIterator(Boost.Python.instance):
pass
@staticmethod
def get(*args, **kwargs) -> None: ...
@staticmethod
def index(*args, **kwargs) -> None: ...
@staticmethod
def items(*args, **kwargs) -> None: ...
@staticmethod
def keys(*args, **kwargs) -> None: ...
@staticmethod
def values(*args, **kwargs) -> None: ...
pass
class ChildrenView_Sdf_VariantSetChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfVariantSetSpec___(Boost.Python.instance):
class ChildrenView_Sdf_VariantSetChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfVariantSetSpec____Iterator(Boost.Python.instance):
pass
class ChildrenView_Sdf_VariantSetChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfVariantSetSpec____KeyIterator(Boost.Python.instance):
pass
class ChildrenView_Sdf_VariantSetChildPolicy_SdfChildrenViewTrivialPredicate_SdfHandle_SdfVariantSetSpec____ValueIterator(Boost.Python.instance):
pass
@staticmethod
def get(*args, **kwargs) -> None: ...
@staticmethod
def index(*args, **kwargs) -> None: ...
@staticmethod
def items(*args, **kwargs) -> None: ...
@staticmethod
def keys(*args, **kwargs) -> None: ...
@staticmethod
def values(*args, **kwargs) -> None: ...
pass
class CleanupEnabler(Boost.Python.instance):
"""
An RAII class which, when an instance is alive, enables scheduling of
automatic cleanup of SdfLayers.
Any affected specs which no longer contribute to the scene will be
removed when the last SdfCleanupEnabler instance goes out of scope.
Note that for this purpose, SdfPropertySpecs are removed if they have
only required fields (see SdfPropertySpecs::HasOnlyRequiredFields),
but only if the property spec itself was affected by an edit that left
it with only required fields. This will have the effect of
uninstantiating on-demand attributes. For example, if its parent prim
was affected by an edit that left it otherwise inert, it will not be
removed if it contains an SdfPropertySpec with only required fields,
but if the property spec itself is edited leaving it with only
required fields, it will be removed, potentially uninstantiating it if
it's an on-demand property.
SdfCleanupEnablers are accessible in both C++ and Python.
/// SdfCleanupEnabler can be used in the following manner:
.. code-block:: text
{
SdfCleanupEnabler enabler;
// Perform any action that might otherwise leave inert specs around,
// such as removing info from properties or prims, or removing name
// children. i.e:
primSpec->ClearInfo(SdfFieldKeys->Default);
// When enabler goes out of scope on the next line, primSpec will
// be removed if it has been left as an empty over.
}
"""
__instance_size__ = 24
pass
class DimensionlessUnit(pxr.Tf.Tf_PyEnumWrapper, pxr.Tf.Enum, Boost.Python.instance):
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = ''
allValues: tuple # value = (Sdf.DimensionlessUnitPercent, Sdf.DimensionlessUnitDefault)
pass
class FastUpdateList(Boost.Python.instance):
class FastUpdate(Boost.Python.instance):
@property
def path(self) -> None:
"""
:type: None
"""
@property
def value(self) -> None:
"""
:type: None
"""
pass
@property
def fastUpdates(self) -> None:
"""
:type: None
"""
@property
def hasCompositionDependents(self) -> None:
"""
:type: None
"""
pass
class FileFormat(Boost.Python.instance):
"""
Base class for file format implementations.
"""
class Tokens(Boost.Python.instance):
TargetArg = 'target'
pass
@staticmethod
def CanRead(file) -> bool:
"""
CanRead(file) -> bool
Returns true if ``file`` can be read by this format.
Parameters
----------
file : str
"""
@staticmethod
def FindAllFileFormatExtensions(*args, **kwargs) -> None:
"""
**classmethod** FindAllFileFormatExtensions() -> set[str]
Returns a set containing the extension(s) corresponding to all
registered file formats.
"""
@staticmethod
def FindByExtension(path, args) -> FileFormat:
"""
**classmethod** FindByExtension(path, target) -> FileFormat
Returns the file format instance that supports the extension for
``path`` .
If a format with a matching extension is not found, this returns a
null file format pointer.
An extension may be handled by multiple file formats, but each with a
different target. In such cases, if no ``target`` is specified, the
file format that is registered as the primary plugin will be returned.
Otherwise, the file format whose target matches ``target`` will be
returned.
Parameters
----------
path : str
target : str
----------------------------------------------------------------------
Returns a file format instance that supports the extension for
``path`` and whose target matches one of those specified by the given
``args`` .
If the ``args`` specify no target, then the file format that is
registered as the primary plugin will be returned. If a format with a
matching extension is not found, this returns a null file format
pointer.
Parameters
----------
path : str
args : FileFormatArguments
"""
@staticmethod
def FindById(*args, **kwargs) -> None:
"""
**classmethod** FindById(formatId) -> FileFormat
Returns the file format instance with the specified ``formatId``
identifier.
If a format with a matching identifier is not found, this returns a
null file format pointer.
Parameters
----------
formatId : str
"""
@staticmethod
def GetFileExtension(*args, **kwargs) -> None:
"""
**classmethod** GetFileExtension(s) -> str
Returns the file extension for path or file name ``s`` , without the
leading dot character.
Parameters
----------
s : str
"""
@staticmethod
def GetFileExtensions() -> list[str]:
"""
GetFileExtensions() -> list[str]
Returns a list of extensions that this format supports.
"""
@staticmethod
def IsPackage() -> bool:
"""
IsPackage() -> bool
Returns true if this file format is a package containing other assets.
"""
@staticmethod
def IsSupportedExtension(extension) -> bool:
"""
IsSupportedExtension(extension) -> bool
Returns true if ``extension`` matches one of the extensions returned
by GetFileExtensions.
Parameters
----------
extension : str
"""
@property
def expired(self) -> None:
"""
True if this object has expired, False otherwise.
:type: None
"""
@property
def fileCookie(self) -> None:
"""
type : str
Returns the cookie to be used when writing files with this format.
:type: None
"""
@property
def formatId(self) -> None:
"""
type : str
Returns the format identifier.
:type: None
"""
@property
def primaryFileExtension(self) -> None:
"""
type : str
Returns the primary file extension for this format.
This is the extension that is reported for layers using this file
format.
:type: None
"""
@property
def target(self) -> None:
"""
type : str
Returns the target for this file format.
:type: None
"""
pass
class Int64ListOp(Boost.Python.instance):
@staticmethod
def ApplyOperations(*args, **kwargs) -> None: ...
@staticmethod
def Clear(*args, **kwargs) -> None: ...
@staticmethod
def ClearAndMakeExplicit(*args, **kwargs) -> None: ...
@staticmethod
def Create(*args, **kwargs) -> None: ...
@staticmethod
def CreateExplicit(*args, **kwargs) -> None: ...
@staticmethod
def GetAddedOrExplicitItems(*args, **kwargs) -> None: ...
@staticmethod
def HasItem(*args, **kwargs) -> None: ...
@property
def addedItems(self) -> None:
"""
:type: None
"""
@property
def appendedItems(self) -> None:
"""
:type: None
"""
@property
def deletedItems(self) -> None:
"""
:type: None
"""
@property
def explicitItems(self) -> None:
"""
:type: None
"""
@property
def isExplicit(self) -> None:
"""
:type: None
"""
@property
def orderedItems(self) -> None:
"""
:type: None
"""
@property
def prependedItems(self) -> None:
"""
:type: None
"""
__instance_size__ = 168
pass
class IntListOp(Boost.Python.instance):
@staticmethod
def ApplyOperations(*args, **kwargs) -> None: ...
@staticmethod
def Clear(*args, **kwargs) -> None: ...
@staticmethod
def ClearAndMakeExplicit(*args, **kwargs) -> None: ...
@staticmethod
def Create(*args, **kwargs) -> None: ...
@staticmethod
def CreateExplicit(*args, **kwargs) -> None: ...
@staticmethod
def GetAddedOrExplicitItems(*args, **kwargs) -> None: ...
@staticmethod
def HasItem(*args, **kwargs) -> None: ...
@property
def addedItems(self) -> None:
"""
:type: None
"""
@property
def appendedItems(self) -> None:
"""
:type: None
"""
@property
def deletedItems(self) -> None:
"""
:type: None
"""
@property
def explicitItems(self) -> None:
"""
:type: None
"""
@property
def isExplicit(self) -> None:
"""
:type: None
"""
@property
def orderedItems(self) -> None:
"""
:type: None
"""
@property
def prependedItems(self) -> None:
"""
:type: None
"""
__instance_size__ = 168
pass
class Layer(Boost.Python.instance):
"""
A scene description container that can combine with other such
containers to form simple component assets, and successively larger
aggregates. The contents of an SdfLayer adhere to the SdfData data
model. A layer can be ephemeral, or be an asset accessed and
serialized through the ArAsset and ArResolver interfaces.
The SdfLayer class provides a consistent API for accesing and
serializing scene description, using any data store provided by Ar
plugins. Sdf itself provides a UTF-8 text format for layers identified
by the".sdf"identifier extension, but via the SdfFileFormat
abstraction, allows downstream modules and plugins to adapt arbitrary
data formats to the SdfData/SdfLayer model.
The FindOrOpen() method returns a new SdfLayer object with scene
description from any supported asset format. Once read, a layer
remembers which asset it was read from. The Save() method saves the
layer back out to the original asset. You can use the Export() method
to write the layer to a different location. You can use the
GetIdentifier() method to get the layer's Id or GetRealPath() to get
the resolved, full URI.
Layers can have a timeCode range (startTimeCode and endTimeCode). This
range represents the suggested playback range, but has no impact on
the extent of the animation data that may be stored in the layer. The
metadatum"timeCodesPerSecond"is used to annotate how the time ordinate
for samples contained in the file scales to seconds. For example, if
timeCodesPerSecond is 24, then a sample at time ordinate 24 should be
viewed exactly one second after the sample at time ordinate 0.
"""
class DetachedLayerRules(Boost.Python.instance):
@staticmethod
def Exclude(*args, **kwargs) -> None: ...
@staticmethod
def GetExcluded(*args, **kwargs) -> None: ...
@staticmethod
def GetIncluded(*args, **kwargs) -> None: ...
@staticmethod
def Include(*args, **kwargs) -> None: ...
@staticmethod
def IncludeAll(*args, **kwargs) -> None: ...
@staticmethod
def IncludedAll(*args, **kwargs) -> None: ...
@staticmethod
def IsIncluded(*args, **kwargs) -> None: ...
__instance_size__ = 72
pass
@staticmethod
def AddToMutedLayers(*args, **kwargs) -> None:
"""
**classmethod** AddToMutedLayers(mutedPath) -> None
Add the specified path to the muted layers set.
Parameters
----------
mutedPath : str
"""
@staticmethod
def Apply(arg1) -> bool:
"""
Apply(arg1) -> bool
Performs a batch of namespace edits.
Returns ``true`` on success and ``false`` on failure. On failure, no
namespace edits will have occurred.
Parameters
----------
arg1 : BatchNamespaceEdit
"""
@staticmethod
def ApplyRootPrimOrder(vec) -> None:
"""
ApplyRootPrimOrder(vec) -> None
Reorders the given list of prim names according to the reorder
rootPrims statement for this layer.
This routine employs the standard list editing operations for ordered
items in a ListEditor.
Parameters
----------
vec : list[str]
"""
@staticmethod
def CanApply(arg1, details) -> NamespaceEditDetail.Result:
"""
CanApply(arg1, details) -> NamespaceEditDetail.Result
Check if a batch of namespace edits will succeed.
This returns ``SdfNamespaceEditDetail::Okay`` if they will succeed as
a batch, ``SdfNamespaceEditDetail::Unbatched`` if the edits will
succeed but will be applied unbatched, and
``SdfNamespaceEditDetail::Error`` if they will not succeed. No edits
will be performed in any case.
If ``details`` is not ``None`` and the method does not return ``Okay``
then details about the problems will be appended to ``details`` . A
problem may cause the method to return early, so ``details`` may not
list every problem.
Note that Sdf does not track backpointers so it's unable to fix up
targets/connections to namespace edited objects. Clients must fix
those to prevent them from falling off. In addition, this method will
report failure if any relational attribute with a target to a
namespace edited object is subsequently edited (in the same batch).
Clients should perform edits on relational attributes first.
Clients may wish to report unbatch details to the user to confirm that
the edits should be applied unbatched. This will give the user a
chance to correct any problems that cause batching to fail and try
again.
Parameters
----------
arg1 : BatchNamespaceEdit
details : list[SdfNamespaceEditDetail]
"""
@staticmethod
def Clear() -> None:
"""
Clear() -> None
Clears the layer of all content.
This restores the layer to a state as if it had just been created with
CreateNew() . This operation is Undo-able.
The fileName and whether journaling is enabled are not affected by
this method.
"""
@staticmethod
def ClearColorConfiguration() -> None:
"""
ClearColorConfiguration() -> None
Clears the color configuration metadata authored in this layer.
"""
@staticmethod
def ClearColorManagementSystem() -> None:
"""
ClearColorManagementSystem() -> None
Clears the'colorManagementSystem'metadata authored in this layer.
"""
@staticmethod
def ClearCustomLayerData() -> None:
"""
ClearCustomLayerData() -> None
Clears out the CustomLayerData dictionary associated with this layer.
"""
@staticmethod
def ClearDefaultPrim() -> None:
"""
ClearDefaultPrim() -> None
Clear the default prim metadata for this layer.
See GetDefaultPrim() and SetDefaultPrim() .
"""
@staticmethod
def ClearEndTimeCode() -> None:
"""
ClearEndTimeCode() -> None
Clear the endTimeCode opinion.
"""
@staticmethod
def ClearFramePrecision() -> None:
"""
ClearFramePrecision() -> None
Clear the framePrecision opinion.
"""
@staticmethod
def ClearFramesPerSecond() -> None:
"""
ClearFramesPerSecond() -> None
Clear the framesPerSecond opinion.
"""
@staticmethod
def ClearOwner() -> None:
"""
ClearOwner() -> None
Clear the owner opinion.
"""
@staticmethod
def ClearSessionOwner() -> None:
"""
ClearSessionOwner() -> None
"""
@staticmethod
def ClearStartTimeCode() -> None:
"""
ClearStartTimeCode() -> None
Clear the startTimeCode opinion.
"""
@staticmethod
def ClearTimeCodesPerSecond() -> None:
"""
ClearTimeCodesPerSecond() -> None
Clear the timeCodesPerSecond opinion.
"""
@staticmethod
def ComputeAbsolutePath(assetPath) -> str:
"""
ComputeAbsolutePath(assetPath) -> str
Returns the path to the asset specified by ``assetPath`` using this
layer to anchor the path if necessary.
Returns ``assetPath`` if it's empty or an anonymous layer identifier.
This method can be used on asset paths that are authored in this layer
to create new asset paths that can be copied to other layers. These
new asset paths should refer to the same assets as the original asset
paths. For example, if the underlying ArResolver is filesystem-based
and ``assetPath`` is a relative filesystem path, this method might
return the absolute filesystem path using this layer's location as the
anchor.
The returned path should in general not be assumed to be an absolute
filesystem path or any other specific form. It is"absolute"in that it
should resolve to the same asset regardless of what layer it's
authored in.
Parameters
----------
assetPath : str
"""
@staticmethod
def CreateAnonymous(tag, format, args) -> Layer:
"""
**classmethod** CreateAnonymous(tag, args) -> Layer
Creates a new *anonymous* layer with an optional ``tag`` .
An anonymous layer is a layer with a system assigned identifier, that
cannot be saved to disk via Save() . Anonymous layers have an
identifier, but no real path or other asset information fields.
Anonymous layers may be tagged, which can be done to aid debugging
subsystems that make use of anonymous layers. The tag becomes the
display name of an anonymous layer, and is also included in the
generated identifier. Untagged anonymous layers have an empty display
name.
Additional arguments may be supplied via the ``args`` parameter. These
arguments may control behavior specific to the layer's file format.
Parameters
----------
tag : str
args : FileFormatArguments
----------------------------------------------------------------------
Create an anonymous layer with a specific ``format`` .
Parameters
----------
tag : str
format : FileFormat
args : FileFormatArguments
"""
@staticmethod
def CreateIdentifier(*args, **kwargs) -> None:
"""
**classmethod** CreateIdentifier(layerPath, arguments) -> str
Joins the given layer path and arguments into an identifier.
Parameters
----------
layerPath : str
arguments : FileFormatArguments
"""
@staticmethod
def CreateNew(fileFormat, identifier, args) -> Layer:
"""
**classmethod** CreateNew(identifier, args) -> Layer
Creates a new empty layer with the given identifier.
Additional arguments may be supplied via the ``args`` parameter. These
arguments may control behavior specific to the layer's file format.
Parameters
----------
identifier : str
args : FileFormatArguments
----------------------------------------------------------------------
Creates a new empty layer with the given identifier for a given file
format class.
This function has the same behavior as the other CreateNew function,
but uses the explicitly-specified ``fileFormat`` instead of attempting
to discern the format from ``identifier`` .
Parameters
----------
fileFormat : FileFormat
identifier : str
args : FileFormatArguments
"""
@staticmethod
def DumpLayerInfo(*args, **kwargs) -> None:
"""
Debug helper to examine content of the current layer registry and
the asset/real path of all layers in the registry.
"""
@staticmethod
def EraseTimeSample(path, time) -> None:
"""
EraseTimeSample(path, time) -> None
Parameters
----------
path : Path
time : float
"""
@staticmethod
def Export(filename, comment, args) -> bool:
"""
Export(filename, comment, args) -> bool
Exports this layer to a file.
Returns ``true`` if successful, ``false`` if an error occurred.
If ``comment`` is not empty, the layer gets exported with the given
comment. Additional arguments may be supplied via the ``args``
parameter. These arguments may control behavior specific to the
exported layer's file format.
Note that the file name or comment of the original layer is not
updated. This only saves a copy of the layer to the given filename.
Subsequent calls to Save() will still save the layer to it's
previously remembered file name.
Parameters
----------
filename : str
comment : str
args : FileFormatArguments
"""
@staticmethod
def ExportToString(*args, **kwargs) -> None:
"""
Returns the string representation of the layer.
"""
@staticmethod
def Find(filename) -> LayerPtr:
"""
filename : string
Returns the open layer with the given filename, or None. Note that this is a static class method.
"""
@staticmethod
def FindOrOpen(*args, **kwargs) -> None:
"""
**classmethod** FindOrOpen(identifier, args) -> Layer
Return an existing layer with the given ``identifier`` and ``args`` ,
or else load it.
If the layer can't be found or loaded, an error is posted and a null
layer is returned.
Arguments in ``args`` will override any arguments specified in
``identifier`` .
Parameters
----------
identifier : str
args : FileFormatArguments
"""
@staticmethod
def FindOrOpenRelativeToLayer(*args, **kwargs) -> None:
"""
**classmethod** FindOrOpenRelativeToLayer(anchor, identifier, args) -> Layer
Return an existing layer with the given ``identifier`` and ``args`` ,
or else load it.
The given ``identifier`` will be resolved relative to the ``anchor``
layer. If the layer can't be found or loaded, an error is posted and a
null layer is returned.
If the ``anchor`` layer is invalid, issues a coding error and returns
a null handle.
Arguments in ``args`` will override any arguments specified in
``identifier`` .
Parameters
----------
anchor : Layer
identifier : str
args : FileFormatArguments
"""
@staticmethod
def FindRelativeToLayer(*args, **kwargs) -> None:
"""
Returns the open layer with the given filename, or None. If the filename is a relative path then it's found relative to the given layer. Note that this is a static class method.
"""
@staticmethod
def GetAssetInfo() -> VtValue:
"""
GetAssetInfo() -> VtValue
Returns resolve information from the last time the layer identifier
was resolved.
"""
@staticmethod
def GetAssetName() -> str:
"""
GetAssetName() -> str
Returns the asset name associated with this layer.
"""
@staticmethod
def GetAttributeAtPath(path) -> AttributeSpec:
"""
GetAttributeAtPath(path) -> AttributeSpec
Returns an attribute at the given ``path`` .
Returns ``None`` if there is no attribute at ``path`` . This is simply
a more specifically typed version of ``GetObjectAtPath()`` .
Parameters
----------
path : Path
"""
@staticmethod
def GetBracketingTimeSamples(time, tLower, tUpper) -> bool:
"""
GetBracketingTimeSamples(time, tLower, tUpper) -> bool
Parameters
----------
time : float
tLower : float
tUpper : float
"""
@staticmethod
def GetBracketingTimeSamplesForPath(path, time, tLower, tUpper) -> bool:
"""
GetBracketingTimeSamplesForPath(path, time, tLower, tUpper) -> bool
Parameters
----------
path : Path
time : float
tLower : float
tUpper : float
"""
@staticmethod
def GetCompositionAssetDependencies() -> set[str]:
"""
GetCompositionAssetDependencies() -> set[str]
Return paths of all assets this layer depends on due to composition
fields.
This includes the paths of all layers referred to by reference,
payload, and sublayer fields in this layer. This function only returns
direct composition dependencies of this layer, i.e. it does not
recurse to find composition dependencies from its dependent layer
assets.
"""
@staticmethod
def GetDetachedLayerRules(*args, **kwargs) -> None:
"""
**classmethod** GetDetachedLayerRules() -> DetachedLayerRules
Returns the current rules for the detached layer set.
"""
@staticmethod
def GetDisplayName() -> str:
"""
GetDisplayName() -> str
Returns the layer's display name.
The display name is the base filename of the identifier.
"""
@staticmethod
def GetDisplayNameFromIdentifier(*args, **kwargs) -> None:
"""
**classmethod** GetDisplayNameFromIdentifier(identifier) -> str
Returns the display name for the given ``identifier`` , using the same
rules as GetDisplayName.
Parameters
----------
identifier : str
"""
@staticmethod
def GetExternalAssetDependencies() -> set[str]:
"""
GetExternalAssetDependencies() -> set[str]
Returns a set of resolved paths to all external asset dependencies the
layer needs to generate its contents.
These are additional asset dependencies that are determined by the
layer's file format and will be consulted during Reload() when
determining if the layer needs to be reloaded. This specifically does
not include dependencies related to composition, i.e. this will not
include assets from references, payloads, and sublayers.
"""
@staticmethod
def GetExternalReferences(*args, **kwargs) -> None:
"""
Return a list of asset paths for
this layer.
"""
@staticmethod
def GetFileFormat() -> FileFormat:
"""
GetFileFormat() -> FileFormat
Returns the file format used by this layer.
"""
@staticmethod
def GetFileFormatArguments() -> FileFormatArguments:
"""
GetFileFormatArguments() -> FileFormatArguments
Returns the file format-specific arguments used during the
construction of this layer.
"""
@staticmethod
def GetLoadedLayers(*args, **kwargs) -> None:
"""
Return list of loaded layers.
"""
@staticmethod
def GetMutedLayers(*args, **kwargs) -> None:
"""
Return list of muted layers.
"""
@staticmethod
def GetNumTimeSamplesForPath(path) -> int:
"""
GetNumTimeSamplesForPath(path) -> int
Parameters
----------
path : Path
"""
@staticmethod
def GetObjectAtPath(path) -> Spec:
"""
GetObjectAtPath(path) -> Spec
Returns the object at the given ``path`` .
There is no distinction between an absolute and relative path at the
SdLayer level.
Returns ``None`` if there is no object at ``path`` .
Parameters
----------
path : Path
"""
@staticmethod
def GetPrimAtPath(path) -> PrimSpec:
"""
GetPrimAtPath(path) -> PrimSpec
Returns the prim at the given ``path`` .
Returns ``None`` if there is no prim at ``path`` . This is simply a
more specifically typed version of ``GetObjectAtPath()`` .
Parameters
----------
path : Path
"""
@staticmethod
def GetPropertyAtPath(path) -> PropertySpec:
"""
GetPropertyAtPath(path) -> PropertySpec
Returns a property at the given ``path`` .
Returns ``None`` if there is no property at ``path`` . This is simply
a more specifically typed version of ``GetObjectAtPath()`` .
Parameters
----------
path : Path
"""
@staticmethod
def GetRelationshipAtPath(path) -> RelationshipSpec:
"""
GetRelationshipAtPath(path) -> RelationshipSpec
Returns a relationship at the given ``path`` .
Returns ``None`` if there is no relationship at ``path`` . This is
simply a more specifically typed version of ``GetObjectAtPath()`` .
Parameters
----------
path : Path
"""
@staticmethod
def HasColorConfiguration() -> bool:
"""
HasColorConfiguration() -> bool
Returns true if color configuration metadata is set in this layer.
"""
@staticmethod
def HasColorManagementSystem() -> bool:
"""
HasColorManagementSystem() -> bool
Returns true if colorManagementSystem metadata is set in this layer.
"""
@staticmethod
def HasCustomLayerData() -> bool:
"""
HasCustomLayerData() -> bool
Returns true if CustomLayerData is authored on the layer.
"""
@staticmethod
def HasDefaultPrim() -> bool:
"""
HasDefaultPrim() -> bool
Return true if the default prim metadata is set in this layer.
See GetDefaultPrim() and SetDefaultPrim() .
"""
@staticmethod
def HasEndTimeCode() -> bool:
"""
HasEndTimeCode() -> bool
Returns true if the layer has an endTimeCode opinion.
"""
@staticmethod
def HasFramePrecision() -> bool:
"""
HasFramePrecision() -> bool
Returns true if the layer has a frames precision opinion.
"""
@staticmethod
def HasFramesPerSecond() -> bool:
"""
HasFramesPerSecond() -> bool
Returns true if the layer has a frames per second opinion.
"""
@staticmethod
def HasOwner() -> bool:
"""
HasOwner() -> bool
Returns true if the layer has an owner opinion.
"""
@staticmethod
def HasSessionOwner() -> bool:
"""
HasSessionOwner() -> bool
Returns true if the layer has a session owner opinion.
"""
@staticmethod
def HasStartTimeCode() -> bool:
"""
HasStartTimeCode() -> bool
Returns true if the layer has a startTimeCode opinion.
"""
@staticmethod
def HasTimeCodesPerSecond() -> bool:
"""
HasTimeCodesPerSecond() -> bool
Returns true if the layer has a timeCodesPerSecond opinion.
"""
@staticmethod
def Import(layerPath) -> bool:
"""
Import(layerPath) -> bool
Imports the content of the given layer path, replacing the content of
the current layer.
Note: If the layer path is the same as the current layer's real path,
no action is taken (and a warning occurs). For this case use Reload()
.
Parameters
----------
layerPath : str
"""
@staticmethod
def ImportFromString(string) -> bool:
"""
ImportFromString(string) -> bool
Reads this layer from the given string.
Returns ``true`` if successful, otherwise returns ``false`` .
Parameters
----------
string : str
"""
@staticmethod
def IsAnonymousLayerIdentifier(*args, **kwargs) -> None:
"""
**classmethod** IsAnonymousLayerIdentifier(identifier) -> bool
Returns true if the ``identifier`` is an anonymous layer unique
identifier.
Parameters
----------
identifier : str
"""
@staticmethod
def IsDetached() -> bool:
"""
IsDetached() -> bool
Returns true if this layer is detached from its serialized data store,
false otherwise.
Detached layers are isolated from external changes to their serialized
data.
"""
@staticmethod
def IsIncludedByDetachedLayerRules(*args, **kwargs) -> None:
"""
**classmethod** IsIncludedByDetachedLayerRules(identifier) -> bool
Returns whether the given layer identifier is included in the current
rules for the detached layer set.
This is equivalent to GetDetachedLayerRules() .IsIncluded(identifier).
Parameters
----------
identifier : str
"""
@staticmethod
def IsMuted(path) -> bool:
"""
**classmethod** IsMuted() -> bool
Returns ``true`` if the current layer is muted.
----------------------------------------------------------------------
Returns ``true`` if the specified layer path is muted.
Parameters
----------
path : str
"""
@staticmethod
def ListAllTimeSamples() -> set[float]:
"""
ListAllTimeSamples() -> set[float]
"""
@staticmethod
def ListTimeSamplesForPath(path) -> set[float]:
"""
ListTimeSamplesForPath(path) -> set[float]
Parameters
----------
path : Path
"""
@staticmethod
def New(*args, **kwargs) -> None:
"""
**classmethod** New(fileFormat, identifier, args) -> Layer
Creates a new empty layer with the given identifier for a given file
format class.
The new layer will not be dirty and will not be saved.
Additional arguments may be supplied via the ``args`` parameter. These
arguments may control behavior specific to the layer's file format.
Parameters
----------
fileFormat : FileFormat
identifier : str
args : FileFormatArguments
"""
@staticmethod
def OpenAsAnonymous(*args, **kwargs) -> None:
"""
**classmethod** OpenAsAnonymous(layerPath, metadataOnly, tag) -> Layer
Load the given layer from disk as a new anonymous layer.
If the layer can't be found or loaded, an error is posted and a null
layer is returned.
The anonymous layer does not retain any knowledge of the backing file
on the filesystem.
``metadataOnly`` is a flag that asks for only the layer metadata to be
read in, which can be much faster if that is all that is required.
Note that this is just a hint: some FileFormat readers may disregard
this flag and still fully populate the layer contents.
An optional ``tag`` may be specified. See CreateAnonymous for details.
Parameters
----------
layerPath : str
metadataOnly : bool
tag : str
"""
@staticmethod
@typing.overload
def QueryTimeSample(path, time, value) -> bool:
"""
QueryTimeSample(path, time, value) -> bool
Parameters
----------
path : Path
time : float
value : VtValue
----------------------------------------------------------------------
Parameters
----------
path : Path
time : float
value : SdfAbstractDataValue
----------------------------------------------------------------------
Parameters
----------
path : Path
time : float
data : T
"""
@staticmethod
@typing.overload
def QueryTimeSample(path, time, data) -> bool: ...
@staticmethod
def Reload(force) -> bool:
"""
Reload(force) -> bool
Reloads the layer from its persistent representation.
This restores the layer to a state as if it had just been created with
FindOrOpen() . This operation is Undo-able.
The fileName and whether journaling is enabled are not affected by
this method.
When called with force = false (the default), Reload attempts to avoid
reloading layers that have not changed on disk. It does so by
comparing the file's modification time (mtime) to when the file was
loaded. If the layer has unsaved modifications, this mechanism is not
used, and the layer is reloaded from disk. If the layer has any
external asset dependencies their modification state will also be
consulted when determining if the layer needs to be reloaded.
Passing true to the ``force`` parameter overrides this behavior,
forcing the layer to be reloaded from disk regardless of whether it
has changed.
Parameters
----------
force : bool
"""
@staticmethod
def ReloadLayers(*args, **kwargs) -> None:
"""
**classmethod** ReloadLayers(layers, force) -> bool
Reloads the specified layers.
Returns ``false`` if one or more layers failed to reload.
See ``Reload()`` for a description of the ``force`` flag.
Parameters
----------
layers : set[Layer]
force : bool
"""
@staticmethod
def RemoveFromMutedLayers(*args, **kwargs) -> None:
"""
**classmethod** RemoveFromMutedLayers(mutedPath) -> None
Remove the specified path from the muted layers set.
Parameters
----------
mutedPath : str
"""
@staticmethod
def RemoveInertSceneDescription() -> None:
"""
RemoveInertSceneDescription() -> None
Removes all scene description in this layer that does not affect the
scene.
This method walks the layer namespace hierarchy and removes any prims
and that are not contributing any opinions.
"""
@staticmethod
def Save(force) -> bool:
"""
Save(force) -> bool
Returns ``true`` if successful, ``false`` if an error occurred.
Returns ``false`` if the layer has no remembered file name or the
layer type cannot be saved. The layer will not be overwritten if the
file exists and the layer is not dirty unless ``force`` is true.
Parameters
----------
force : bool
"""
@staticmethod
def ScheduleRemoveIfInert(spec) -> None:
"""
ScheduleRemoveIfInert(spec) -> None
Cause ``spec`` to be removed if it no longer affects the scene when
the last change block is closed, or now if there are no change blocks.
Parameters
----------
spec : Spec
"""
@staticmethod
def SetDetachedLayerRules(*args, **kwargs) -> None:
"""
**classmethod** SetDetachedLayerRules(mask) -> None
Sets the rules specifying detached layers.
Newly-created or opened layers whose identifiers are included in
``rules`` will be opened as detached layers. Existing layers that are
now included or no longer included will be reloaded. Any unsaved
modifications to those layers will be lost.
This function is not thread-safe. It may not be run concurrently with
any other functions that open, close, or read from any layers.
The detached layer rules are initially set to exclude all layers. This
may be overridden by setting the environment variables
SDF_LAYER_INCLUDE_DETACHED and SDF_LAYER_EXCLUDE_DETACHED to specify
the initial set of include and exclude patterns in the rules. These
variables can be set to a comma-delimited list of patterns.
SDF_LAYER_INCLUDE_DETACHED may also be set to"\*"to include all
layers. Note that these environment variables only set the initial
state of the detached layer rules; these values may be overwritten by
subsequent calls to this function.
See SdfLayer::DetachedLayerRules::IsIncluded for details on how the
rules are applied to layer identifiers.
Parameters
----------
mask : DetachedLayerRules
"""
@staticmethod
def SetMuted(muted) -> None:
"""
SetMuted(muted) -> None
Mutes the current layer if ``muted`` is ``true`` , and unmutes it
otherwise.
Parameters
----------
muted : bool
"""
@staticmethod
def SetPermissionToEdit(allow) -> None:
"""
SetPermissionToEdit(allow) -> None
Sets permission to edit.
Parameters
----------
allow : bool
"""
@staticmethod
def SetPermissionToSave(allow) -> None:
"""
SetPermissionToSave(allow) -> None
Sets permission to save.
Parameters
----------
allow : bool
"""
@staticmethod
def SetTimeSample(path, time, value) -> None:
"""
SetTimeSample(path, time, value) -> None
Parameters
----------
path : Path
time : float
value : VtValue
----------------------------------------------------------------------
Parameters
----------
path : Path
time : float
value : SdfAbstractDataConstValue
----------------------------------------------------------------------
Parameters
----------
path : Path
time : float
value : T
"""
@staticmethod
def SplitIdentifier(*args, **kwargs) -> None:
"""
**classmethod** SplitIdentifier(identifier, layerPath, arguments) -> bool
Splits the given layer identifier into its constituent layer path and
arguments.
Parameters
----------
identifier : str
layerPath : str
arguments : FileFormatArguments
"""
@staticmethod
def StreamsData() -> bool:
"""
StreamsData() -> bool
Returns true if this layer streams data from its serialized data store
on demand, false otherwise.
Layers with streaming data are treated differently to avoid pulling in
data unnecessarily. For example, reloading a streaming layer will not
perform fine-grained change notification, since doing so would require
the full contents of the layer to be loaded.
"""
@staticmethod
def TransferContent(layer) -> None:
"""
TransferContent(layer) -> None
Copies the content of the given layer into this layer.
Source layer is unmodified.
Parameters
----------
layer : Layer
"""
@staticmethod
def Traverse(path, func) -> None:
"""
Traverse(path, func) -> None
Parameters
----------
path : Path
func : TraversalFunction
"""
@staticmethod
def UpdateAssetInfo() -> None:
"""
UpdateAssetInfo() -> None
Update layer asset information.
Calling this method re-resolves the layer identifier, which updates
asset information such as the layer's resolved path and other asset
info. This may be used to update the layer after external changes to
the underlying asset system.
"""
@staticmethod
def UpdateCompositionAssetDependency(oldAssetPath, newAssetPath) -> bool:
"""
UpdateCompositionAssetDependency(oldAssetPath, newAssetPath) -> bool
Updates the asset path of a composation dependency in this layer.
If ``newAssetPath`` is supplied, the update works as"rename", updating
any occurrence of ``oldAssetPath`` to ``newAssetPath`` in all
reference, payload, and sublayer fields.
If ``newAssetPath`` is not given, this update behaves as a"delete",
removing all occurrences of ``oldAssetPath`` from all reference,
payload, and sublayer fields.
Parameters
----------
oldAssetPath : str
newAssetPath : str
"""
@staticmethod
def UpdateExternalReference(oldAssetPath, newAssetPath) -> bool:
"""
UpdateExternalReference(oldAssetPath, newAssetPath) -> bool
Deprecated
Use UpdateCompositionAssetDependency instead.
Parameters
----------
oldAssetPath : str
newAssetPath : str
"""
@staticmethod
def _WriteDataFile(*args, **kwargs) -> None: ...
@property
def anonymous(self) -> None:
"""
type : bool
Returns true if this layer is an anonymous layer.
:type: None
"""
@property
def colorConfiguration(self) -> None:
"""
The color configuration asset-path of this layer.
:type: None
"""
@property
def colorManagementSystem(self) -> None:
"""
The name of the color management system used to interpret the colorConfiguration asset.
:type: None
"""
@property
def comment(self) -> None:
"""
The layer's comment string.
:type: None
"""
@property
def customLayerData(self) -> None:
"""
The customLayerData dictionary associated with this layer.
:type: None
"""
@property
def defaultPrim(self) -> None:
"""
The layer's default reference target token.
:type: None
"""
@property
def dirty(self) -> None:
"""
type : bool
Returns ``true`` if the layer is dirty, i.e.
has changed from its persistent representation.
:type: None
"""
@property
def documentation(self) -> None:
"""
The layer's documentation string.
:type: None
"""
@property
def empty(self) -> None:
"""
type : bool
Returns whether this layer has no significant data.
:type: None
"""
@property
def endTimeCode(self) -> None:
"""
The end timeCode of this layer.
The end timeCode of a layer is not a hard limit, but is
more of a hint. A layer's time-varying content is not limited to
the timeCode range of the layer.
:type: None
"""
@property
def expired(self) -> None:
"""
True if this object has expired, False otherwise.
:type: None
"""
@property
def externalReferences(self) -> None:
"""
Return unique list of asset paths of external references for
given layer.
:type: None
"""
@property
def fileExtension(self) -> None:
"""
The layer's file extension.
:type: None
"""
@property
def framePrecision(self) -> None:
"""
The number of digits of precision used in times in this layer.
:type: None
"""
@property
def framesPerSecond(self) -> None:
"""
The frames per second used in this layer.
:type: None
"""
@property
def hasOwnedSubLayers(self) -> None:
"""
Whether this layer's sub layers are expected to have owners.
:type: None
"""
@property
def identifier(self) -> None:
"""
The layer's identifier.
:type: None
"""
@property
def owner(self) -> None:
"""
The owner of this layer.
:type: None
"""
@property
def permissionToEdit(self) -> None:
"""
Return true if permitted to be edited (modified), false otherwise.
:type: None
"""
@property
def permissionToSave(self) -> None:
"""
Return true if permitted to be saved, false otherwise.
:type: None
"""
@property
def pseudoRoot(self) -> None:
"""
The pseudo-root of the layer.
:type: None
"""
@property
def realPath(self) -> None:
"""
The layer's resolved path.
:type: None
"""
@property
def repositoryPath(self) -> None:
"""
The layer's associated repository path
:type: None
"""
@property
def resolvedPath(self) -> None:
"""
The layer's resolved path.
:type: None
"""
@property
def rootPrimOrder(self) -> None:
"""
Get/set the list of root prim names for this layer's 'reorder rootPrims' statement.
:type: None
"""
@property
def rootPrims(self) -> None:
"""
The root prims of this layer, as an ordered dictionary.
The prims may be accessed by index or by name.
Although this property claims it is read only, you can modify the contents of this dictionary to add, remove, or reorder the contents.
:type: None
"""
@property
def sessionOwner(self) -> None:
"""
The session owner of this layer. Only intended for use with session layers.
:type: None
"""
@property
def startTimeCode(self) -> None:
"""
The start timeCode of this layer.
The start timeCode of a layer is not a hard limit, but is
more of a hint. A layer's time-varying content is not limited to
the timeCode range of the layer.
:type: None
"""
@property
def subLayerOffsets(self) -> None:
"""
The sublayer offsets of this layer, as a list. Although this property is claimed to be read only, you can modify the contents of this list by assigning new layer offsets to specific indices.
:type: None
"""
@property
def subLayerPaths(self) -> None:
"""
The sublayer paths of this layer, as a list. Although this property is claimed to be read only, you can modify the contents of this list.
:type: None
"""
@property
def timeCodesPerSecond(self) -> None:
"""
The timeCodes per second used in this layer.
:type: None
"""
@property
def version(self) -> None:
"""
The layer's version.
:type: None
"""
ColorConfigurationKey = 'colorConfiguration'
ColorManagementSystemKey = 'colorManagementSystem'
CommentKey = 'comment'
DocumentationKey = 'documentation'
EndFrameKey = 'endFrame'
EndTimeCodeKey = 'endTimeCode'
FramePrecisionKey = 'framePrecision'
FramesPerSecondKey = 'framesPerSecond'
HasOwnedSubLayers = 'hasOwnedSubLayers'
OwnerKey = 'owner'
SessionOwnerKey = 'sessionOwner'
StartFrameKey = 'startFrame'
StartTimeCodeKey = 'startTimeCode'
TimeCodesPerSecondKey = 'timeCodesPerSecond'
pass
class LayerOffset(Boost.Python.instance):
"""
Represents a time offset and scale between layers.
The SdfLayerOffset class is an affine transform, providing both a
scale and a translate. It supports vector algebra semantics for
composing SdfLayerOffsets together via multiplication. The
SdfLayerOffset class is unitless: it does not refer to seconds or
frames.
For example, suppose layer A uses layer B, with an offset of X: when
bringing animation from B into A, you first apply the scale of X, and
then the offset. Suppose you have a scale of 2 and an offset of 24:
first multiply B's frame numbers by 2, and then add 24. The animation
from B as seen in A will take twice as long and start 24 frames later.
Offsets are typically used in either sublayers or prim references. For
more information, see the SetSubLayerOffset() method of the SdfLayer
class (the subLayerOffsets property in Python), as well as the
SetReference() and GetReferenceLayerOffset() methods (the latter is
the referenceLayerOffset property in Python) of the SdfPrimSpec class.
"""
@staticmethod
def GetInverse() -> LayerOffset:
"""
GetInverse() -> LayerOffset
Gets the inverse offset, which performs the opposite transformation.
"""
@staticmethod
def IsIdentity() -> bool:
"""
IsIdentity() -> bool
Returns ``true`` if this is an identity transformation, with an offset
of 0.0 and a scale of 1.0.
"""
@property
def offset(self) -> None:
"""
type : None
Sets the time offset.
----------------------------------------------------------------------
type : float
Returns the time offset.
:type: None
"""
@property
def scale(self) -> None:
"""
type : None
Sets the time scale factor.
----------------------------------------------------------------------
type : float
Returns the time scale factor.
:type: None
"""
__instance_size__ = 32
pass
class LayerTree(Boost.Python.instance):
"""
A SdfLayerTree is an immutable tree structure representing a sublayer
stack and its recursive structure.
Layers can have sublayers, which can in turn have sublayers of their
own. Clients that want to represent that hierarchical structure in
memory can build a SdfLayerTree for that purpose.
We use TfRefPtr<SdfLayerTree> as handles to LayerTrees, as a simple
way to pass them around as immutable trees without worrying about
lifetime.
"""
@property
def childTrees(self) -> None:
"""
type : list[SdfLayerTreeHandle]
Returns the children of this tree node.
:type: None
"""
@property
def expired(self) -> None:
"""
True if this object has expired, False otherwise.
:type: None
"""
@property
def layer(self) -> None:
"""
type : Layer
Returns the layer handle this tree node represents.
:type: None
"""
@property
def offset(self) -> None:
"""
type : LayerOffset
Returns the cumulative layer offset from the root of the tree.
:type: None
"""
pass
class LengthUnit(pxr.Tf.Tf_PyEnumWrapper, pxr.Tf.Enum, Boost.Python.instance):
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = ''
allValues: tuple # value = (Sdf.LengthUnitMillimeter, Sdf.LengthUnitCentimeter, Sdf.LengthUnitDecimeter, Sdf.LengthUnitMeter, Sdf.LengthUnitKilometer, Sdf.LengthUnitInch, Sdf.LengthUnitFoot, Sdf.LengthUnitYard, Sdf.LengthUnitMile)
pass
class ListEditorProxy_SdfNameKeyPolicy(Boost.Python.instance):
@staticmethod
def Add(*args, **kwargs) -> None: ...
@staticmethod
def Append(*args, **kwargs) -> None: ...
@staticmethod
def ApplyEditsToList(*args, **kwargs) -> None: ...
@staticmethod
def ClearEdits(*args, **kwargs) -> None: ...
@staticmethod
def ClearEditsAndMakeExplicit(*args, **kwargs) -> None: ...
@staticmethod
def ContainsItemEdit(*args, **kwargs) -> None: ...
@staticmethod
def CopyItems(*args, **kwargs) -> None: ...
@staticmethod
def Erase(*args, **kwargs) -> None: ...
@staticmethod
def GetAddedOrExplicitItems(*args, **kwargs) -> None: ...
@staticmethod
def ModifyItemEdits(*args, **kwargs) -> None: ...
@staticmethod
def Prepend(*args, **kwargs) -> None: ...
@staticmethod
def Remove(*args, **kwargs) -> None: ...
@staticmethod
def RemoveItemEdits(*args, **kwargs) -> None: ...
@staticmethod
def ReplaceItemEdits(*args, **kwargs) -> None: ...
@property
def addedItems(self) -> None:
"""
:type: None
"""
@property
def appendedItems(self) -> None:
"""
:type: None
"""
@property
def deletedItems(self) -> None:
"""
:type: None
"""
@property
def explicitItems(self) -> None:
"""
:type: None
"""
@property
def isExpired(self) -> None:
"""
:type: None
"""
@property
def isExplicit(self) -> None:
"""
:type: None
"""
@property
def isOrderedOnly(self) -> None:
"""
:type: None
"""
@property
def orderedItems(self) -> None:
"""
:type: None
"""
@property
def prependedItems(self) -> None:
"""
:type: None
"""
pass
class ListEditorProxy_SdfPathKeyPolicy(Boost.Python.instance):
@staticmethod
def Add(*args, **kwargs) -> None: ...
@staticmethod
def Append(*args, **kwargs) -> None: ...
@staticmethod
def ApplyEditsToList(*args, **kwargs) -> None: ...
@staticmethod
def ClearEdits(*args, **kwargs) -> None: ...
@staticmethod
def ClearEditsAndMakeExplicit(*args, **kwargs) -> None: ...
@staticmethod
def ContainsItemEdit(*args, **kwargs) -> None: ...
@staticmethod
def CopyItems(*args, **kwargs) -> None: ...
@staticmethod
def Erase(*args, **kwargs) -> None: ...
@staticmethod
def GetAddedOrExplicitItems(*args, **kwargs) -> None: ...
@staticmethod
def ModifyItemEdits(*args, **kwargs) -> None: ...
@staticmethod
def Prepend(*args, **kwargs) -> None: ...
@staticmethod
def Remove(*args, **kwargs) -> None: ...
@staticmethod
def RemoveItemEdits(*args, **kwargs) -> None: ...
@staticmethod
def ReplaceItemEdits(*args, **kwargs) -> None: ...
@property
def addedItems(self) -> None:
"""
:type: None
"""
@property
def appendedItems(self) -> None:
"""
:type: None
"""
@property
def deletedItems(self) -> None:
"""
:type: None
"""
@property
def explicitItems(self) -> None:
"""
:type: None
"""
@property
def isExpired(self) -> None:
"""
:type: None
"""
@property
def isExplicit(self) -> None:
"""
:type: None
"""
@property
def isOrderedOnly(self) -> None:
"""
:type: None
"""
@property
def orderedItems(self) -> None:
"""
:type: None
"""
@property
def prependedItems(self) -> None:
"""
:type: None
"""
pass
class ListEditorProxy_SdfPayloadTypePolicy(Boost.Python.instance):
@staticmethod
def Add(*args, **kwargs) -> None: ...
@staticmethod
def Append(*args, **kwargs) -> None: ...
@staticmethod
def ApplyEditsToList(*args, **kwargs) -> None: ...
@staticmethod
def ClearEdits(*args, **kwargs) -> None: ...
@staticmethod
def ClearEditsAndMakeExplicit(*args, **kwargs) -> None: ...
@staticmethod
def ContainsItemEdit(*args, **kwargs) -> None: ...
@staticmethod
def CopyItems(*args, **kwargs) -> None: ...
@staticmethod
def Erase(*args, **kwargs) -> None: ...
@staticmethod
def GetAddedOrExplicitItems(*args, **kwargs) -> None: ...
@staticmethod
def ModifyItemEdits(*args, **kwargs) -> None: ...
@staticmethod
def Prepend(*args, **kwargs) -> None: ...
@staticmethod
def Remove(*args, **kwargs) -> None: ...
@staticmethod
def RemoveItemEdits(*args, **kwargs) -> None: ...
@staticmethod
def ReplaceItemEdits(*args, **kwargs) -> None: ...
@property
def addedItems(self) -> None:
"""
:type: None
"""
@property
def appendedItems(self) -> None:
"""
:type: None
"""
@property
def deletedItems(self) -> None:
"""
:type: None
"""
@property
def explicitItems(self) -> None:
"""
:type: None
"""
@property
def isExpired(self) -> None:
"""
:type: None
"""
@property
def isExplicit(self) -> None:
"""
:type: None
"""
@property
def isOrderedOnly(self) -> None:
"""
:type: None
"""
@property
def orderedItems(self) -> None:
"""
:type: None
"""
@property
def prependedItems(self) -> None:
"""
:type: None
"""
pass
class ListEditorProxy_SdfReferenceTypePolicy(Boost.Python.instance):
@staticmethod
def Add(*args, **kwargs) -> None: ...
@staticmethod
def Append(*args, **kwargs) -> None: ...
@staticmethod
def ApplyEditsToList(*args, **kwargs) -> None: ...
@staticmethod
def ClearEdits(*args, **kwargs) -> None: ...
@staticmethod
def ClearEditsAndMakeExplicit(*args, **kwargs) -> None: ...
@staticmethod
def ContainsItemEdit(*args, **kwargs) -> None: ...
@staticmethod
def CopyItems(*args, **kwargs) -> None: ...
@staticmethod
def Erase(*args, **kwargs) -> None: ...
@staticmethod
def GetAddedOrExplicitItems(*args, **kwargs) -> None: ...
@staticmethod
def ModifyItemEdits(*args, **kwargs) -> None: ...
@staticmethod
def Prepend(*args, **kwargs) -> None: ...
@staticmethod
def Remove(*args, **kwargs) -> None: ...
@staticmethod
def RemoveItemEdits(*args, **kwargs) -> None: ...
@staticmethod
def ReplaceItemEdits(*args, **kwargs) -> None: ...
@property
def addedItems(self) -> None:
"""
:type: None
"""
@property
def appendedItems(self) -> None:
"""
:type: None
"""
@property
def deletedItems(self) -> None:
"""
:type: None
"""
@property
def explicitItems(self) -> None:
"""
:type: None
"""
@property
def isExpired(self) -> None:
"""
:type: None
"""
@property
def isExplicit(self) -> None:
"""
:type: None
"""
@property
def isOrderedOnly(self) -> None:
"""
:type: None
"""
@property
def orderedItems(self) -> None:
"""
:type: None
"""
@property
def prependedItems(self) -> None:
"""
:type: None
"""
pass
class ListOpType(pxr.Tf.Tf_PyEnumWrapper, pxr.Tf.Enum, Boost.Python.instance):
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = ''
allValues: tuple # value = (Sdf.ListOpTypeExplicit, Sdf.ListOpTypeAdded, Sdf.ListOpTypePrepended, Sdf.ListOpTypeAppended, Sdf.ListOpTypeDeleted, Sdf.ListOpTypeOrdered)
pass
class ListProxy_SdfNameKeyPolicy(Boost.Python.instance):
@staticmethod
def ApplyEditsToList(*args, **kwargs) -> None: ...
@staticmethod
def ApplyList(*args, **kwargs) -> None: ...
@staticmethod
def append(*args, **kwargs) -> None: ...
@staticmethod
def clear(*args, **kwargs) -> None: ...
@staticmethod
def copy(*args, **kwargs) -> None: ...
@staticmethod
def count(*args, **kwargs) -> None: ...
@staticmethod
def index(*args, **kwargs) -> None: ...
@staticmethod
def insert(*args, **kwargs) -> None: ...
@staticmethod
def remove(*args, **kwargs) -> None: ...
@staticmethod
def replace(*args, **kwargs) -> None: ...
@property
def expired(self) -> None:
"""
:type: None
"""
pass
class ListProxy_SdfNameTokenKeyPolicy(Boost.Python.instance):
@staticmethod
def ApplyEditsToList(*args, **kwargs) -> None: ...
@staticmethod
def ApplyList(*args, **kwargs) -> None: ...
@staticmethod
def append(*args, **kwargs) -> None: ...
@staticmethod
def clear(*args, **kwargs) -> None: ...
@staticmethod
def copy(*args, **kwargs) -> None: ...
@staticmethod
def count(*args, **kwargs) -> None: ...
@staticmethod
def index(*args, **kwargs) -> None: ...
@staticmethod
def insert(*args, **kwargs) -> None: ...
@staticmethod
def remove(*args, **kwargs) -> None: ...
@staticmethod
def replace(*args, **kwargs) -> None: ...
@property
def expired(self) -> None:
"""
:type: None
"""
pass
class ListProxy_SdfPathKeyPolicy(Boost.Python.instance):
@staticmethod
def ApplyEditsToList(*args, **kwargs) -> None: ...
@staticmethod
def ApplyList(*args, **kwargs) -> None: ...
@staticmethod
def append(*args, **kwargs) -> None: ...
@staticmethod
def clear(*args, **kwargs) -> None: ...
@staticmethod
def copy(*args, **kwargs) -> None: ...
@staticmethod
def count(*args, **kwargs) -> None: ...
@staticmethod
def index(*args, **kwargs) -> None: ...
@staticmethod
def insert(*args, **kwargs) -> None: ...
@staticmethod
def remove(*args, **kwargs) -> None: ...
@staticmethod
def replace(*args, **kwargs) -> None: ...
@property
def expired(self) -> None:
"""
:type: None
"""
pass
class ListProxy_SdfPayloadTypePolicy(Boost.Python.instance):
@staticmethod
def ApplyEditsToList(*args, **kwargs) -> None: ...
@staticmethod
def ApplyList(*args, **kwargs) -> None: ...
@staticmethod
def append(*args, **kwargs) -> None: ...
@staticmethod
def clear(*args, **kwargs) -> None: ...
@staticmethod
def copy(*args, **kwargs) -> None: ...
@staticmethod
def count(*args, **kwargs) -> None: ...
@staticmethod
def index(*args, **kwargs) -> None: ...
@staticmethod
def insert(*args, **kwargs) -> None: ...
@staticmethod
def remove(*args, **kwargs) -> None: ...
@staticmethod
def replace(*args, **kwargs) -> None: ...
@property
def expired(self) -> None:
"""
:type: None
"""
pass
class ListProxy_SdfReferenceTypePolicy(Boost.Python.instance):
@staticmethod
def ApplyEditsToList(*args, **kwargs) -> None: ...
@staticmethod
def ApplyList(*args, **kwargs) -> None: ...
@staticmethod
def append(*args, **kwargs) -> None: ...
@staticmethod
def clear(*args, **kwargs) -> None: ...
@staticmethod
def copy(*args, **kwargs) -> None: ...
@staticmethod
def count(*args, **kwargs) -> None: ...
@staticmethod
def index(*args, **kwargs) -> None: ...
@staticmethod
def insert(*args, **kwargs) -> None: ...
@staticmethod
def remove(*args, **kwargs) -> None: ...
@staticmethod
def replace(*args, **kwargs) -> None: ...
@property
def expired(self) -> None:
"""
:type: None
"""
pass
class ListProxy_SdfSubLayerTypePolicy(Boost.Python.instance):
@staticmethod
def ApplyEditsToList(*args, **kwargs) -> None: ...
@staticmethod
def ApplyList(*args, **kwargs) -> None: ...
@staticmethod
def append(*args, **kwargs) -> None: ...
@staticmethod
def clear(*args, **kwargs) -> None: ...
@staticmethod
def copy(*args, **kwargs) -> None: ...
@staticmethod
def count(*args, **kwargs) -> None: ...
@staticmethod
def index(*args, **kwargs) -> None: ...
@staticmethod
def insert(*args, **kwargs) -> None: ...
@staticmethod
def remove(*args, **kwargs) -> None: ...
@staticmethod
def replace(*args, **kwargs) -> None: ...
@property
def expired(self) -> None:
"""
:type: None
"""
pass
class MapEditProxy_VtDictionary(Boost.Python.instance):
class MapEditProxy_VtDictionary_Iterator(Boost.Python.instance):
pass
class MapEditProxy_VtDictionary_KeyIterator(Boost.Python.instance):
pass
class MapEditProxy_VtDictionary_ValueIterator(Boost.Python.instance):
pass
@staticmethod
def clear(*args, **kwargs) -> None: ...
@staticmethod
def copy(*args, **kwargs) -> None: ...
@staticmethod
def get(*args, **kwargs) -> None: ...
@staticmethod
def items(*args, **kwargs) -> None: ...
@staticmethod
def keys(*args, **kwargs) -> None: ...
@staticmethod
def pop(*args, **kwargs) -> None: ...
@staticmethod
def popitem(*args, **kwargs) -> None: ...
@staticmethod
def setdefault(*args, **kwargs) -> None: ...
@staticmethod
def update(*args, **kwargs) -> None: ...
@staticmethod
def values(*args, **kwargs) -> None: ...
@property
def expired(self) -> None:
"""
:type: None
"""
__instance_size__ = 32
pass
class MapEditProxy_map_SdfPath_SdfPath_less_SdfPath__allocator_pair_SdfPath_const__SdfPath_____(Boost.Python.instance):
class MapEditProxy_map_SdfPath_SdfPath_less_SdfPath__allocator_pair_SdfPath_const__SdfPath______Iterator(Boost.Python.instance):
pass
class MapEditProxy_map_SdfPath_SdfPath_less_SdfPath__allocator_pair_SdfPath_const__SdfPath______KeyIterator(Boost.Python.instance):
pass
class MapEditProxy_map_SdfPath_SdfPath_less_SdfPath__allocator_pair_SdfPath_const__SdfPath______ValueIterator(Boost.Python.instance):
pass
@staticmethod
def clear(*args, **kwargs) -> None: ...
@staticmethod
def copy(*args, **kwargs) -> None: ...
@staticmethod
def get(*args, **kwargs) -> None: ...
@staticmethod
def items(*args, **kwargs) -> None: ...
@staticmethod
def keys(*args, **kwargs) -> None: ...
@staticmethod
def pop(*args, **kwargs) -> None: ...
@staticmethod
def popitem(*args, **kwargs) -> None: ...
@staticmethod
def setdefault(*args, **kwargs) -> None: ...
@staticmethod
def update(*args, **kwargs) -> None: ...
@staticmethod
def values(*args, **kwargs) -> None: ...
@property
def expired(self) -> None:
"""
:type: None
"""
__instance_size__ = 32
pass
class MapEditProxy_map_string_string_less_string__allocator_pair_stringconst__string_____(Boost.Python.instance):
class MapEditProxy_map_string_string_less_string__allocator_pair_stringconst__string______Iterator(Boost.Python.instance):
pass
class MapEditProxy_map_string_string_less_string__allocator_pair_stringconst__string______KeyIterator(Boost.Python.instance):
pass
class MapEditProxy_map_string_string_less_string__allocator_pair_stringconst__string______ValueIterator(Boost.Python.instance):
pass
@staticmethod
def clear(*args, **kwargs) -> None: ...
@staticmethod
def copy(*args, **kwargs) -> None: ...
@staticmethod
def get(*args, **kwargs) -> None: ...
@staticmethod
def items(*args, **kwargs) -> None: ...
@staticmethod
def keys(*args, **kwargs) -> None: ...
@staticmethod
def pop(*args, **kwargs) -> None: ...
@staticmethod
def popitem(*args, **kwargs) -> None: ...
@staticmethod
def setdefault(*args, **kwargs) -> None: ...
@staticmethod
def update(*args, **kwargs) -> None: ...
@staticmethod
def values(*args, **kwargs) -> None: ...
@property
def expired(self) -> None:
"""
:type: None
"""
__instance_size__ = 32
pass
class NamespaceEdit(Boost.Python.instance):
"""
A single namespace edit. It supports renaming, reparenting,
reparenting with a rename, reordering, and removal.
"""
@staticmethod
def Remove(*args, **kwargs) -> None:
"""
**classmethod** Remove(currentPath) -> This
Returns a namespace edit that removes the object at ``currentPath`` .
Parameters
----------
currentPath : Path
"""
@staticmethod
def Rename(*args, **kwargs) -> None:
"""
**classmethod** Rename(currentPath, name) -> This
Returns a namespace edit that renames the prim or property at
``currentPath`` to ``name`` .
Parameters
----------
currentPath : Path
name : str
"""
@staticmethod
def Reorder(*args, **kwargs) -> None:
"""
**classmethod** Reorder(currentPath, index) -> This
Returns a namespace edit to reorder the prim or property at
``currentPath`` to index ``index`` .
Parameters
----------
currentPath : Path
index : Index
"""
@staticmethod
def Reparent(*args, **kwargs) -> None:
"""
**classmethod** Reparent(currentPath, newParentPath, index) -> This
Returns a namespace edit to reparent the prim or property at
``currentPath`` to be under ``newParentPath`` at index ``index`` .
Parameters
----------
currentPath : Path
newParentPath : Path
index : Index
"""
@staticmethod
def ReparentAndRename(*args, **kwargs) -> None:
"""
**classmethod** ReparentAndRename(currentPath, newParentPath, name, index) -> This
Returns a namespace edit to reparent the prim or property at
``currentPath`` to be under ``newParentPath`` at index ``index`` with
the name ``name`` .
Parameters
----------
currentPath : Path
newParentPath : Path
name : str
index : Index
"""
@property
def currentPath(self) -> None:
"""
:type: None
"""
@property
def index(self) -> None:
"""
:type: None
"""
@property
def newPath(self) -> None:
"""
:type: None
"""
atEnd = -1
same = -2
pass
class NamespaceEditDetail(Boost.Python.instance):
"""
Detailed information about a namespace edit.
"""
class Result(pxr.Tf.Tf_PyEnumWrapper, pxr.Tf.Enum, Boost.Python.instance):
"""
Validity of an edit.
"""
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = 'NamespaceEditDetail'
allValues: tuple # value = (Sdf.NamespaceEditDetail.Error, Sdf.NamespaceEditDetail.Unbatched, Sdf.NamespaceEditDetail.Okay)
pass
@property
def edit(self) -> None:
"""
:type: None
"""
@property
def reason(self) -> None:
"""
:type: None
"""
@property
def result(self) -> None:
"""
:type: None
"""
Error: pxr.Sdf.Result # value = Sdf.NamespaceEditDetail.Error
Okay: pxr.Sdf.Result # value = Sdf.NamespaceEditDetail.Okay
Unbatched: pxr.Sdf.Result # value = Sdf.NamespaceEditDetail.Unbatched
pass
class Notice(Boost.Python.instance):
"""
Wrapper class for Sdf notices.
"""
class Base(pxr.Tf.Notice, Boost.Python.instance):
pass
class LayerDidReloadContent(LayerDidReplaceContent, Base, pxr.Tf.Notice, Boost.Python.instance):
pass
class LayerDidReplaceContent(Base, pxr.Tf.Notice, Boost.Python.instance):
pass
class LayerDirtinessChanged(Base, pxr.Tf.Notice, Boost.Python.instance):
pass
class LayerIdentifierDidChange(Base, pxr.Tf.Notice, Boost.Python.instance):
@property
def newIdentifier(self) -> None:
"""
:type: None
"""
@property
def oldIdentifier(self) -> None:
"""
:type: None
"""
pass
class LayerInfoDidChange(Base, pxr.Tf.Notice, Boost.Python.instance):
@staticmethod
def key(*args, **kwargs) -> None: ...
pass
class LayerMutenessChanged(Base, pxr.Tf.Notice, Boost.Python.instance):
@property
def layerPath(self) -> None:
"""
:type: None
"""
@property
def wasMuted(self) -> None:
"""
:type: None
"""
pass
class LayersDidChange(Base, pxr.Tf.Notice, Boost.Python.instance):
@staticmethod
def GetLayers(*args, **kwargs) -> None: ...
@staticmethod
def GetSerialNumber(*args, **kwargs) -> None: ...
pass
class LayersDidChangeSentPerLayer(Base, pxr.Tf.Notice, Boost.Python.instance):
@staticmethod
def GetLayers(*args, **kwargs) -> None: ...
@staticmethod
def GetSerialNumber(*args, **kwargs) -> None: ...
pass
pass
class Path(Boost.Python.instance):
"""
A path value used to locate objects in layers or scenegraphs.
Overview
========
SdfPath is used in several ways:
- As a storage key for addressing and accessing values held in a
SdfLayer
- As a namespace identity for scenegraph objects
- As a way to refer to other scenegraph objects through relative
paths
The paths represented by an SdfPath class may be either relative or
absolute. Relative paths are relative to the prim object that contains
them (that is, if an SdfRelationshipSpec target is relative, it is
relative to the SdfPrimSpec object that owns the SdfRelationshipSpec
object).
SdfPath objects can be readily created from and converted back to
strings, but as SdfPath objects, they have behaviors that make it easy
and efficient to work with them. The SdfPath class provides a full
range of methods for manipulating scene paths by appending a namespace
child, appending a relationship target, getting the parent path, and
so on. Since the SdfPath class uses a node-based representation
internally, you should use the editing functions rather than
converting to and from strings if possible.
Path Syntax
===========
Like a filesystem path, an SdfPath is conceptually just a sequence of
path components. Unlike a filesystem path, each component has a type,
and the type is indicated by the syntax.
Two separators are used between parts of a path. A slash ("/")
following an identifier is used to introduce a namespace child. A
period (".") following an identifier is used to introduce a property.
A property may also have several non-sequential colons (':') in its
name to provide a rudimentary namespace within properties but may not
end or begin with a colon.
A leading slash in the string representation of an SdfPath object
indicates an absolute path. Two adjacent periods indicate the parent
namespace.
Brackets ("["and"]") are used to indicate relationship target paths
for relational attributes.
The first part in a path is assumed to be a namespace child unless it
is preceded by a period. That means:
- ``/Foo`` is an absolute path specifying the root prim Foo.
- ``/Foo/Bar`` is an absolute path specifying namespace child Bar
of root prim Foo.
- ``/Foo/Bar.baz`` is an absolute path specifying property ``baz``
of namespace child Bar of root prim Foo.
- ``Foo`` is a relative path specifying namespace child Foo of the
current prim.
- ``Foo/Bar`` is a relative path specifying namespace child Bar of
namespace child Foo of the current prim.
- ``Foo/Bar.baz`` is a relative path specifying property ``baz`` of
namespace child Bar of namespace child Foo of the current prim.
- ``.foo`` is a relative path specifying the property ``foo`` of
the current prim.
- ``/Foo.bar[/Foo.baz].attrib`` is a relational attribute path. The
relationship ``/Foo.bar`` has a target ``/Foo.baz`` . There is a
relational attribute ``attrib`` on that relationship->target pair.
A Note on Thread-Safety
=======================
SdfPath is strongly thread-safe, in the sense that zero additional
synchronization is required between threads creating or using SdfPath
values. Just like TfToken, SdfPath values are immutable. Internally,
SdfPath uses a global prefix tree to efficiently share representations
of paths, and provide fast equality/hashing operations, but
modifications to this table are internally synchronized. Consequently,
as with TfToken, for best performance it is important to minimize the
number of values created (since it requires synchronized access to
this table) or copied (since it requires atomic ref-counting
operations).
"""
class AncestorsRange(Boost.Python.instance):
class _iterator(Boost.Python.instance):
pass
@staticmethod
def GetPath(*args, **kwargs) -> None: ...
__instance_size__ = 24
pass
class _IsValidPathStringResult(Boost.Python.instance):
@property
def errorMessage(self) -> None:
"""
:type: None
"""
__instance_size__ = 56
pass
@staticmethod
def AppendChild(childName) -> Path:
"""
AppendChild(childName) -> Path
Creates a path by appending an element for ``childName`` to this path.
This path must be a prim path, the AbsoluteRootPath or the
ReflexiveRelativePath.
Parameters
----------
childName : str
"""
@staticmethod
def AppendElementString(element) -> Path:
"""
AppendElementString(element) -> Path
Creates a path by extracting and appending an element from the given
ascii element encoding.
Attempting to append a root or empty path (or malformed path) or
attempting to append *to* the EmptyPath will raise an error and return
the EmptyPath.
May also fail and return EmptyPath if this path's type cannot possess
a child of the type encoded in ``element`` .
Parameters
----------
element : str
"""
@staticmethod
def AppendExpression() -> Path:
"""
AppendExpression() -> Path
Creates a path by appending an expression element.
This path must be a prim property or relational attribute path.
"""
@staticmethod
def AppendMapper(targetPath) -> Path:
"""
AppendMapper(targetPath) -> Path
Creates a path by appending a mapper element for ``targetPath`` .
This path must be a prim property or relational attribute path.
Parameters
----------
targetPath : Path
"""
@staticmethod
def AppendMapperArg(argName) -> Path:
"""
AppendMapperArg(argName) -> Path
Creates a path by appending an element for ``argName`` .
This path must be a mapper path.
Parameters
----------
argName : str
"""
@staticmethod
def AppendPath(newSuffix) -> Path:
"""
AppendPath(newSuffix) -> Path
Creates a path by appending a given relative path to this path.
If the newSuffix is a prim path, then this path must be a prim path or
a root path.
If the newSuffix is a prim property path, then this path must be a
prim path or the ReflexiveRelativePath.
Parameters
----------
newSuffix : Path
"""
@staticmethod
def AppendProperty(propName) -> Path:
"""
AppendProperty(propName) -> Path
Creates a path by appending an element for ``propName`` to this path.
This path must be a prim path or the ReflexiveRelativePath.
Parameters
----------
propName : str
"""
@staticmethod
def AppendRelationalAttribute(attrName) -> Path:
"""
AppendRelationalAttribute(attrName) -> Path
Creates a path by appending an element for ``attrName`` to this path.
This path must be a target path.
Parameters
----------
attrName : str
"""
@staticmethod
def AppendTarget(targetPath) -> Path:
"""
AppendTarget(targetPath) -> Path
Creates a path by appending an element for ``targetPath`` .
This path must be a prim property or relational attribute path.
Parameters
----------
targetPath : Path
"""
@staticmethod
def AppendVariantSelection(variantSet, variant) -> Path:
"""
AppendVariantSelection(variantSet, variant) -> Path
Creates a path by appending an element for ``variantSet`` and
``variant`` to this path.
This path must be a prim path.
Parameters
----------
variantSet : str
variant : str
"""
@staticmethod
def ContainsPrimVariantSelection() -> bool:
"""
ContainsPrimVariantSelection() -> bool
Returns whether the path or any of its parent paths identifies a
variant selection for a prim.
"""
@staticmethod
def ContainsPropertyElements() -> bool:
"""
ContainsPropertyElements() -> bool
Return true if this path contains any property elements, false
otherwise.
A false return indicates a prim-like path, specifically a root path, a
prim path, or a prim variant selection path. A true return indicates a
property-like path: a prim property path, a target path, a relational
attribute path, etc.
"""
@staticmethod
def ContainsTargetPath() -> bool:
"""
ContainsTargetPath() -> bool
Return true if this path is or has a prefix that's a target path or a
mapper path.
"""
@staticmethod
def FindLongestPrefix(*args, **kwargs) -> None: ...
@staticmethod
def FindLongestStrictPrefix(*args, **kwargs) -> None: ...
@staticmethod
def FindPrefixedRange(*args, **kwargs) -> None: ...
@staticmethod
def GetAbsoluteRootOrPrimPath() -> Path:
"""
GetAbsoluteRootOrPrimPath() -> Path
Creates a path by stripping all properties and relational attributes
from this path, leaving the path to the containing prim.
If the path is already a prim or absolute root path, the same path is
returned.
"""
@staticmethod
def GetAllTargetPathsRecursively(result) -> None:
"""
GetAllTargetPathsRecursively(result) -> None
Returns all the relationship target or connection target paths
contained in this path, and recursively all the target paths contained
in those target paths in reverse depth-first order.
For example, given the
path:'/A/B.a[/C/D.a[/E/F.a]].a[/A/B.a[/C/D.a]]'this method
produces:'/A/B.a[/C/D.a]','/C/D.a','/C/D.a[/E/F.a]','/E/F.a'
Parameters
----------
result : list[SdfPath]
"""
@staticmethod
def GetAncestorsRange() -> SdfPathAncestorsRange:
"""
GetAncestorsRange() -> SdfPathAncestorsRange
Return a range for iterating over the ancestors of this path.
The range provides iteration over the prefixes of a path, ordered from
longest to shortest (the opposite of the order of the prefixes
returned by GetPrefixes).
"""
@staticmethod
def GetCommonPrefix(path) -> Path:
"""
GetCommonPrefix(path) -> Path
Returns a path with maximal length that is a prefix path of both this
path and ``path`` .
Parameters
----------
path : Path
"""
@staticmethod
def GetConciseRelativePaths(*args, **kwargs) -> None:
"""
**classmethod** GetConciseRelativePaths(paths) -> list[SdfPath]
Given some vector of paths, get a vector of concise unambiguous
relative paths.
GetConciseRelativePaths requires a vector of absolute paths. It finds
a set of relative paths such that each relative path is unique.
Parameters
----------
paths : list[SdfPath]
"""
@staticmethod
def GetParentPath() -> Path:
"""
GetParentPath() -> Path
Return the path that identifies this path's namespace parent.
For a prim path (like'/foo/bar'), return the prim's parent's path
('/foo'). For a prim property path (like'/foo/bar.property'), return
the prim's path ('/foo/bar'). For a target path
(like'/foo/bar.property[/target]') return the property path
('/foo/bar.property'). For a mapper path
(like'/foo/bar.property.mapper[/target]') return the property path
('/foo/bar.property). For a relational attribute path
(like'/foo/bar.property[/target].relAttr') return the relationship
target's path ('/foo/bar.property[/target]'). For a prim variant
selection path (like'/foo/bar{var=sel}') return the prim path
('/foo/bar'). For a root prim path (like'/rootPrim'), return
AbsoluteRootPath() ('/'). For a single element relative prim path
(like'relativePrim'), return ReflexiveRelativePath() ('.'). For
ReflexiveRelativePath() , return the relative parent path ('\.\.').
Note that the parent path of a relative parent path ('\.\.') is a
relative grandparent path ('\.\./\.\.'). Use caution writing loops
that walk to parent paths since relative paths have infinitely many
ancestors. To more safely traverse ancestor paths, consider iterating
over an SdfPathAncestorsRange instead, as returend by
GetAncestorsRange() .
"""
@staticmethod
def GetPrefixes(*args, **kwargs) -> None:
"""
Returns the prefix paths of this path.
"""
@staticmethod
def GetPrimOrPrimVariantSelectionPath() -> Path:
"""
GetPrimOrPrimVariantSelectionPath() -> Path
Creates a path by stripping all relational attributes, targets, and
properties, leaving the nearest path for which
*IsPrimOrPrimVariantSelectionPath()* returns true.
See *GetPrimPath* also.
If the path is already a prim or a prim variant selection path, the
same path is returned.
"""
@staticmethod
def GetPrimPath() -> Path:
"""
GetPrimPath() -> Path
Creates a path by stripping all relational attributes, targets,
properties, and variant selections from the leafmost prim path,
leaving the nearest path for which *IsPrimPath()* returns true.
See *GetPrimOrPrimVariantSelectionPath* also.
If the path is already a prim path, the same path is returned.
"""
@staticmethod
def GetVariantSelection() -> tuple[str, str]:
"""
GetVariantSelection() -> tuple[str, str]
Returns the variant selection for this path, if this is a variant
selection path.
Returns a pair of empty strings if this path is not a variant
selection path.
"""
@staticmethod
def HasPrefix(prefix) -> bool:
"""
HasPrefix(prefix) -> bool
Return true if both this path and *prefix* are not the empty path and
this path has *prefix* as a prefix.
Return false otherwise.
Parameters
----------
prefix : Path
"""
@staticmethod
def IsAbsolutePath() -> bool:
"""
IsAbsolutePath() -> bool
Returns whether the path is absolute.
"""
@staticmethod
def IsAbsoluteRootOrPrimPath() -> bool:
"""
IsAbsoluteRootOrPrimPath() -> bool
Returns whether the path identifies a prim or the absolute root.
"""
@staticmethod
def IsAbsoluteRootPath() -> bool:
"""
IsAbsoluteRootPath() -> bool
Return true if this path is the AbsoluteRootPath() .
"""
@staticmethod
def IsExpressionPath() -> bool:
"""
IsExpressionPath() -> bool
Returns whether the path identifies a connection expression.
"""
@staticmethod
def IsMapperArgPath() -> bool:
"""
IsMapperArgPath() -> bool
Returns whether the path identifies a connection mapper arg.
"""
@staticmethod
def IsMapperPath() -> bool:
"""
IsMapperPath() -> bool
Returns whether the path identifies a connection mapper.
"""
@staticmethod
def IsNamespacedPropertyPath() -> bool:
"""
IsNamespacedPropertyPath() -> bool
Returns whether the path identifies a namespaced property.
A namespaced property has colon embedded in its name.
"""
@staticmethod
def IsPrimPath() -> bool:
"""
IsPrimPath() -> bool
Returns whether the path identifies a prim.
"""
@staticmethod
def IsPrimPropertyPath() -> bool:
"""
IsPrimPropertyPath() -> bool
Returns whether the path identifies a prim's property.
A relational attribute is not a prim property.
"""
@staticmethod
def IsPrimVariantSelectionPath() -> bool:
"""
IsPrimVariantSelectionPath() -> bool
Returns whether the path identifies a variant selection for a prim.
"""
@staticmethod
def IsPropertyPath() -> bool:
"""
IsPropertyPath() -> bool
Returns whether the path identifies a property.
A relational attribute is considered to be a property, so this method
will return true for relational attributes as well as properties of
prims.
"""
@staticmethod
def IsRelationalAttributePath() -> bool:
"""
IsRelationalAttributePath() -> bool
Returns whether the path identifies a relational attribute.
If this is true, IsPropertyPath() will also be true.
"""
@staticmethod
def IsRootPrimPath() -> bool:
"""
IsRootPrimPath() -> bool
Returns whether the path identifies a root prim.
the path must be absolute and have a single element (for example
``/foo`` ).
"""
@staticmethod
def IsTargetPath() -> bool:
"""
IsTargetPath() -> bool
Returns whether the path identifies a relationship or connection
target.
"""
@staticmethod
def IsValidIdentifier(*args, **kwargs) -> None:
"""
**classmethod** IsValidIdentifier(name) -> bool
Returns whether ``name`` is a legal identifier for any path component.
Parameters
----------
name : str
"""
@staticmethod
def IsValidNamespacedIdentifier(*args, **kwargs) -> None:
"""
**classmethod** IsValidNamespacedIdentifier(name) -> bool
Returns whether ``name`` is a legal namespaced identifier.
This returns ``true`` if IsValidIdentifier() does.
Parameters
----------
name : str
"""
@staticmethod
def IsValidPathString(*args, **kwargs) -> None:
"""
**classmethod** IsValidPathString(pathString, errMsg) -> bool
Return true if ``pathString`` is a valid path string, meaning that
passing the string to the *SdfPath* constructor will result in a
valid, non-empty SdfPath.
Otherwise, return false and if ``errMsg`` is not None, set the
pointed-to string to the parse error.
Parameters
----------
pathString : str
errMsg : str
"""
@staticmethod
@typing.overload
def JoinIdentifier(names) -> str:
"""
**classmethod** JoinIdentifier(names) -> str
Join ``names`` into a single identifier using the namespace delimiter.
Any empty strings present in ``names`` are ignored when joining.
Parameters
----------
names : list[str]
----------------------------------------------------------------------
Join ``names`` into a single identifier using the namespace delimiter.
Any empty strings present in ``names`` are ignored when joining.
Parameters
----------
names : list[TfToken]
----------------------------------------------------------------------
Join ``lhs`` and ``rhs`` into a single identifier using the namespace
delimiter.
Returns ``lhs`` if ``rhs`` is empty and vice verse. Returns an empty
string if both ``lhs`` and ``rhs`` are empty.
Parameters
----------
lhs : str
rhs : str
----------------------------------------------------------------------
Join ``lhs`` and ``rhs`` into a single identifier using the namespace
delimiter.
Returns ``lhs`` if ``rhs`` is empty and vice verse. Returns an empty
string if both ``lhs`` and ``rhs`` are empty.
Parameters
----------
lhs : str
rhs : str
"""
@staticmethod
@typing.overload
def JoinIdentifier(lhs, rhs) -> str: ...
@staticmethod
def MakeAbsolutePath(anchor) -> Path:
"""
MakeAbsolutePath(anchor) -> Path
Returns the absolute form of this path using ``anchor`` as the
relative basis.
``anchor`` must be an absolute prim path.
If this path is a relative path, resolve it using ``anchor`` as the
relative basis.
If this path is already an absolute path, just return a copy.
Parameters
----------
anchor : Path
"""
@staticmethod
def MakeRelativePath(anchor) -> Path:
"""
MakeRelativePath(anchor) -> Path
Returns the relative form of this path using ``anchor`` as the
relative basis.
``anchor`` must be an absolute prim path.
If this path is an absolute path, return the corresponding relative
path that is relative to the absolute path given by ``anchor`` .
If this path is a relative path, return the optimal relative path to
the absolute path given by ``anchor`` . (The optimal relative path
from a given prim path is the relative path with the least leading
dot-dots.
Parameters
----------
anchor : Path
"""
@staticmethod
def RemoveAncestorPaths(*args, **kwargs) -> None:
"""
**classmethod** RemoveAncestorPaths(paths) -> None
Remove all elements of *paths* that prefix other elements in *paths*.
As a side-effect, the result is left in sorted order.
Parameters
----------
paths : list[SdfPath]
"""
@staticmethod
def RemoveCommonSuffix(otherPath, stopAtRootPrim) -> tuple[Path, Path]:
"""
RemoveCommonSuffix(otherPath, stopAtRootPrim) -> tuple[Path, Path]
Find and remove the longest common suffix from two paths.
Returns this path and ``otherPath`` with the longest common suffix
removed (first and second, respectively). If the two paths have no
common suffix then the paths are returned as-is. If the paths are
equal then this returns empty paths for relative paths and absolute
roots for absolute paths. The paths need not be the same length.
If ``stopAtRootPrim`` is ``true`` then neither returned path will be
the root path. That, in turn, means that some common suffixes will not
be removed. For example, if ``stopAtRootPrim`` is ``true`` then the
paths /A/B and /B will be returned as is. Were it ``false`` then the
result would be /A and /. Similarly paths /A/B/C and /B/C would return
/A/B and /B if ``stopAtRootPrim`` is ``true`` but /A and / if it's
``false`` .
Parameters
----------
otherPath : Path
stopAtRootPrim : bool
"""
@staticmethod
def RemoveDescendentPaths(*args, **kwargs) -> None:
"""
**classmethod** RemoveDescendentPaths(paths) -> None
Remove all elements of *paths* that are prefixed by other elements in
*paths*.
As a side-effect, the result is left in sorted order.
Parameters
----------
paths : list[SdfPath]
"""
@staticmethod
def ReplaceName(newName) -> Path:
"""
ReplaceName(newName) -> Path
Return a copy of this path with its final component changed to
*newName*.
This path must be a prim or property path.
This method is shorthand for path.GetParentPath().AppendChild(newName)
for prim paths, path.GetParentPath().AppendProperty(newName) for prim
property paths, and
path.GetParentPath().AppendRelationalAttribute(newName) for relational
attribute paths.
Note that only the final path component is ever changed. If the name
of the final path component appears elsewhere in the path, it will not
be modified.
Some examples:
Parameters
----------
newName : str
"""
@staticmethod
def ReplacePrefix(oldPrefix, newPrefix, fixTargetPaths) -> Path:
"""
ReplacePrefix(oldPrefix, newPrefix, fixTargetPaths) -> Path
Returns a path with all occurrences of the prefix path ``oldPrefix``
replaced with the prefix path ``newPrefix`` .
If fixTargetPaths is true, any embedded target paths will also have
their paths replaced. This is the default.
If this is not a target, relational attribute or mapper path this will
do zero or one path prefix replacements, if not the number of
replacements can be greater than one.
Parameters
----------
oldPrefix : Path
newPrefix : Path
fixTargetPaths : bool
"""
@staticmethod
def ReplaceTargetPath(newTargetPath) -> Path:
"""
ReplaceTargetPath(newTargetPath) -> Path
Replaces the relational attribute's target path.
The path must be a relational attribute path.
Parameters
----------
newTargetPath : Path
"""
@staticmethod
def StripAllVariantSelections() -> Path:
"""
StripAllVariantSelections() -> Path
Create a path by stripping all variant selections from all components
of this path, leaving a path with no embedded variant selections.
"""
@staticmethod
def StripNamespace(name) -> str:
"""
**classmethod** StripNamespace(name) -> str
Returns ``name`` stripped of any namespaces.
This does not check the validity of the name; it just attempts to
remove anything that looks like a namespace.
Parameters
----------
name : str
----------------------------------------------------------------------
Returns ``name`` stripped of any namespaces.
This does not check the validity of the name; it just attempts to
remove anything that looks like a namespace.
Parameters
----------
name : str
"""
@staticmethod
def StripPrefixNamespace(*args, **kwargs) -> None:
"""
**classmethod** StripPrefixNamespace(name, matchNamespace) -> tuple[str, bool]
Returns ( ``name`` , ``true`` ) where ``name`` is stripped of the
prefix specified by ``matchNamespace`` if ``name`` indeed starts with
``matchNamespace`` .
Returns ( ``name`` , ``false`` ) otherwise, with ``name`` unmodified.
This function deals with both the case where ``matchNamespace``
contains the trailing namespace delimiter':'or not.
Parameters
----------
name : str
matchNamespace : str
"""
@staticmethod
def TokenizeIdentifier(*args, **kwargs) -> None:
"""
**classmethod** TokenizeIdentifier(name) -> list[str]
Tokenizes ``name`` by the namespace delimiter.
Returns the empty vector if ``name`` is not a valid namespaced
identifier.
Parameters
----------
name : str
"""
@property
def elementString(self) -> None:
"""
The string representation of the terminal component of this path.
This path can be reconstructed via
thisPath.GetParentPath().AppendElementString(thisPath.element).
None of absoluteRootPath, reflexiveRelativePath, nor emptyPath
possess the above quality; their .elementString is the empty string.
:type: None
"""
@property
def isEmpty(self) -> None:
"""
type : bool
Returns true if this is the empty path ( SdfPath::EmptyPath() ).
:type: None
"""
@property
def name(self) -> None:
"""
The name of the prim, property or relational
attribute identified by the path.
'' for EmptyPath. '.' for ReflexiveRelativePath.
'..' for a path ending in ParentPathElement.
:type: None
"""
@property
def pathElementCount(self) -> None:
"""
The number of path elements in this path.
:type: None
"""
@property
def pathString(self) -> None:
"""
The string representation of this path.
:type: None
"""
@property
def targetPath(self) -> None:
"""
The relational attribute target path for this path.
EmptyPath if this is not a relational attribute path.
:type: None
"""
__instance_size__ = 24
absoluteIndicator = '/'
absoluteRootPath: pxr.Sdf.Path # value = Sdf.Path('/')
childDelimiter = '/'
emptyPath: pxr.Sdf.Path # value = Sdf.Path.emptyPath
expressionIndicator = 'expression'
mapperArgDelimiter = '.'
mapperIndicator = 'mapper'
namespaceDelimiter = ':'
parentPathElement = '..'
propertyDelimiter = '.'
reflexiveRelativePath: pxr.Sdf.Path # value = Sdf.Path('.')
relationshipTargetEnd = ']'
relationshipTargetStart = '['
pass
class PathArray(Boost.Python.instance):
"""
An array of type SdfPath.
"""
_isVtArray = True
pass
class PathListOp(Boost.Python.instance):
@staticmethod
def ApplyOperations(*args, **kwargs) -> None: ...
@staticmethod
def Clear(*args, **kwargs) -> None: ...
@staticmethod
def ClearAndMakeExplicit(*args, **kwargs) -> None: ...
@staticmethod
def Create(*args, **kwargs) -> None: ...
@staticmethod
def CreateExplicit(*args, **kwargs) -> None: ...
@staticmethod
def GetAddedOrExplicitItems(*args, **kwargs) -> None: ...
@staticmethod
def HasItem(*args, **kwargs) -> None: ...
@property
def addedItems(self) -> None:
"""
:type: None
"""
@property
def appendedItems(self) -> None:
"""
:type: None
"""
@property
def deletedItems(self) -> None:
"""
:type: None
"""
@property
def explicitItems(self) -> None:
"""
:type: None
"""
@property
def isExplicit(self) -> None:
"""
:type: None
"""
@property
def orderedItems(self) -> None:
"""
:type: None
"""
@property
def prependedItems(self) -> None:
"""
:type: None
"""
__instance_size__ = 168
pass
class Payload(Boost.Python.instance):
"""
Represents a payload and all its meta data.
A payload represents a prim reference to an external layer. A payload
is similar to a prim reference (see SdfReference) with the major
difference that payloads are explicitly loaded by the user.
Unloaded payloads represent a boundary that lazy composition and
system behaviors will not traverse across, providing a user-visible
way to manage the working set of the scene.
"""
@property
def assetPath(self) -> None:
"""
type : None
Sets a new asset path for the layer the payload uses.
See SdfAssetPath for what characters are valid in ``assetPath`` . If
``assetPath`` contains invalid characters, issue an error and set this
payload's asset path to the empty asset path.
----------------------------------------------------------------------
type : str
Returns the asset path of the layer that the payload uses.
:type: None
"""
@property
def layerOffset(self) -> None:
"""
type : None
Sets a new layer offset.
----------------------------------------------------------------------
type : LayerOffset
Returns the layer offset associated with the payload.
:type: None
"""
@property
def primPath(self) -> None:
"""
type : None
Sets a new prim path for the prim that the payload uses.
----------------------------------------------------------------------
type : Path
Returns the scene path of the prim for the payload.
:type: None
"""
__instance_size__ = 72
pass
class PayloadListOp(Boost.Python.instance):
@staticmethod
def ApplyOperations(*args, **kwargs) -> None: ...
@staticmethod
def Clear(*args, **kwargs) -> None: ...
@staticmethod
def ClearAndMakeExplicit(*args, **kwargs) -> None: ...
@staticmethod
def Create(*args, **kwargs) -> None: ...
@staticmethod
def CreateExplicit(*args, **kwargs) -> None: ...
@staticmethod
def GetAddedOrExplicitItems(*args, **kwargs) -> None: ...
@staticmethod
def HasItem(*args, **kwargs) -> None: ...
@property
def addedItems(self) -> None:
"""
:type: None
"""
@property
def appendedItems(self) -> None:
"""
:type: None
"""
@property
def deletedItems(self) -> None:
"""
:type: None
"""
@property
def explicitItems(self) -> None:
"""
:type: None
"""
@property
def isExplicit(self) -> None:
"""
:type: None
"""
@property
def orderedItems(self) -> None:
"""
:type: None
"""
@property
def prependedItems(self) -> None:
"""
:type: None
"""
__instance_size__ = 168
pass
class Permission(pxr.Tf.Tf_PyEnumWrapper, pxr.Tf.Enum, Boost.Python.instance):
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = ''
allValues: tuple # value = (Sdf.PermissionPublic, Sdf.PermissionPrivate)
pass
class PrimSpec(Spec, Boost.Python.instance):
"""
Represents a prim description in an SdfLayer object.
Every SdfPrimSpec object is defined in a layer. It is identified by
its path (SdfPath class) in the namespace hierarchy of its layer.
SdfPrimSpecs can be created using the New() method as children of
either the containing SdfLayer itself (for"root level"prims), or as
children of other SdfPrimSpec objects to extend a hierarchy. The
helper function SdfCreatePrimInLayer() can be used to quickly create a
hierarchy of primSpecs.
SdfPrimSpec objects have properties of two general types: attributes
(containing values) and relationships (different types of connections
to other prims and attributes). Attributes are represented by the
SdfAttributeSpec class and relationships by the SdfRelationshipSpec
class. Each prim has its own namespace of properties. Properties are
stored and accessed by their name.
SdfPrimSpec objects have a typeName, permission restriction, and they
reference and inherit prim paths. Permission restrictions control
which other layers may refer to, or express opinions about a prim. See
the SdfPermission class for more information.
- Insert doc about references and inherits here.
- Should have validate\.\.\. methods for name, children,
properties
"""
@staticmethod
def ApplyNameChildrenOrder(vec) -> None:
"""
ApplyNameChildrenOrder(vec) -> None
Reorders the given list of child names according to the reorder
nameChildren statement for this prim.
This routine employs the standard list editing operation for ordered
items in a ListEditor.
Parameters
----------
vec : list[str]
"""
@staticmethod
def ApplyPropertyOrder(vec) -> None:
"""
ApplyPropertyOrder(vec) -> None
Reorders the given list of property names according to the reorder
properties statement for this prim.
This routine employs the standard list editing operation for ordered
items in a ListEditor.
Parameters
----------
vec : list[str]
"""
@staticmethod
def BlockVariantSelection(variantSetName) -> None:
"""
BlockVariantSelection(variantSetName) -> None
Blocks the variant selected for the given variant set by setting the
variant selection to empty.
Parameters
----------
variantSetName : str
"""
@staticmethod
def CanSetName(newName, whyNot) -> bool:
"""
CanSetName(newName, whyNot) -> bool
Returns true if setting the prim spec's name to ``newName`` will
succeed.
Returns false if it won't, and sets ``whyNot`` with a string
describing why not.
Parameters
----------
newName : str
whyNot : str
"""
@staticmethod
def ClearActive() -> None:
"""
ClearActive() -> None
Removes the active opinion in this prim spec if there is one.
"""
@staticmethod
def ClearInstanceable() -> None:
"""
ClearInstanceable() -> None
Clears the value for the prim's instanceable flag.
"""
@staticmethod
def ClearKind() -> None:
"""
ClearKind() -> None
Remove the kind opinion from this prim spec if there is one.
"""
@staticmethod
def ClearPayloadList(*args, **kwargs) -> None:
"""
Clears the payloads for this prim.
"""
@staticmethod
def ClearReferenceList(*args, **kwargs) -> None:
"""
Clears the references for this prim.
"""
@staticmethod
def GetAttributeAtPath(path) -> AttributeSpec:
"""
GetAttributeAtPath(path) -> AttributeSpec
Returns an attribute given its ``path`` .
Returns invalid handle if there is no attribute at ``path`` . This is
simply a more specifically typed version of GetObjectAtPath.
Parameters
----------
path : Path
"""
@staticmethod
def GetObjectAtPath(path) -> object:
"""
path: Path
Returns a prim or property given its namespace path.
If path is relative then it will be interpreted as relative to this prim. If it is absolute then it will be interpreted as absolute in this prim's layer. The return type can be either PrimSpecPtr or PropertySpecPtr.
"""
@staticmethod
def GetPrimAtPath(path) -> PrimSpec:
"""
GetPrimAtPath(path) -> PrimSpec
Returns a prim given its ``path`` .
Returns invalid handle if there is no prim at ``path`` . This is
simply a more specifically typed version of GetObjectAtPath.
Parameters
----------
path : Path
"""
@staticmethod
def GetPropertyAtPath(path) -> PropertySpec:
"""
GetPropertyAtPath(path) -> PropertySpec
Returns a property given its ``path`` .
Returns invalid handle if there is no property at ``path`` . This is
simply a more specifically typed version of GetObjectAtPath.
Parameters
----------
path : Path
"""
@staticmethod
def GetRelationshipAtPath(path) -> RelationshipSpec:
"""
GetRelationshipAtPath(path) -> RelationshipSpec
Returns a relationship given its ``path`` .
Returns invalid handle if there is no relationship at ``path`` . This
is simply a more specifically typed version of GetObjectAtPath.
Parameters
----------
path : Path
"""
@staticmethod
def GetVariantNames(name) -> list[str]:
"""
GetVariantNames(name) -> list[str]
Returns list of variant names for the given variant set.
Parameters
----------
name : str
"""
@staticmethod
def HasActive() -> bool:
"""
HasActive() -> bool
Returns true if this prim spec has an opinion about active.
"""
@staticmethod
def HasInstanceable() -> bool:
"""
HasInstanceable() -> bool
Returns true if this prim spec has a value authored for its
instanceable flag, false otherwise.
"""
@staticmethod
def HasKind() -> bool:
"""
HasKind() -> bool
Returns true if this prim spec has an opinion about kind.
"""
@staticmethod
def RemoveProperty(property) -> None:
"""
RemoveProperty(property) -> None
Removes the property.
Parameters
----------
property : PropertySpec
"""
@property
def active(self) -> None:
"""
Whether this prim spec is active.
The default value is true.
:type: None
"""
@property
def assetInfo(self) -> None:
"""
Returns the asset info dictionary for this prim.
The default value is an empty dictionary.
The asset info dictionary is used to annotate prims representing the root-prims of assets (generally organized as models) with various data related to asset management. For example, asset name, root layer identifier, asset version etc.
:type: None
"""
@property
def attributes(self) -> None:
"""
The attributes of this prim, as an ordered dictionary.
:type: None
"""
@property
def comment(self) -> None:
"""
The prim's comment string.
:type: None
"""
@property
def customData(self) -> None:
"""
The custom data for this prim.
The default value for custom data is an empty dictionary.
Custom data is for use by plugins or other non-tools supplied
extensions that need to be able to store data attached to arbitrary
scene objects. Note that if the only objects you want to store data
on are prims, using custom attributes is probably a better choice.
But if you need to possibly store this data on attributes or
relationships or as annotations on reference arcs, then custom data
is an appropriate choice.
:type: None
"""
@property
def documentation(self) -> None:
"""
The prim's documentation string.
:type: None
"""
@property
def expired(self) -> None:
"""
:type: None
"""
@property
def hasPayloads(self) -> None:
"""
Returns true if this prim has payloads set.
:type: None
"""
@property
def hasReferences(self) -> None:
"""
Returns true if this prim has references set.
:type: None
"""
@property
def hidden(self) -> None:
"""
Whether this prim spec will be hidden in browsers.
The default value is false.
:type: None
"""
@property
def inheritPathList(self) -> None:
"""
A PathListEditor for the prim's inherit paths.
The list of the inherit paths for this prim may be modified with this PathListEditor.
A PathListEditor may express a list either as an explicit value or as a set of list editing operations. See PathListEditor for more information.
:type: None
"""
@property
def instanceable(self) -> None:
"""
Whether this prim spec is flagged as instanceable.
The default value is false.
:type: None
"""
@property
def kind(self) -> None:
"""
What kind of model this prim spec represents, if any.
The default is an empty string
:type: None
"""
@property
def name(self) -> None:
"""
The prim's name.
:type: None
"""
@property
def nameChildren(self) -> None:
"""
The prim name children of this prim, as an ordered dictionary.
Note that although this property is described as being read-only, you can modify the contents to add, remove, or reorder children.
:type: None
"""
@property
def nameChildrenOrder(self) -> None:
"""
Get/set the list of child names for this prim's 'reorder nameChildren' statement.
:type: None
"""
@property
def nameParent(self) -> None:
"""
The name parent of this prim.
:type: None
"""
@property
def nameRoot(self) -> None:
"""
The name pseudo-root of this prim.
:type: None
"""
@property
def payloadList(self) -> None:
"""
A PayloadListEditor for the prim's payloads.
The list of the payloads for this prim may be modified with this PayloadListEditor.
A PayloadListEditor may express a list either as an explicit value or as a set of list editing operations. See PayloadListEditor for more information.
:type: None
"""
@property
def permission(self) -> None:
"""
The prim's permission restriction.
The default value is SdfPermissionPublic.
:type: None
"""
@property
def prefix(self) -> None:
"""
The prim's prefix.
:type: None
"""
@property
def prefixSubstitutions(self) -> None:
"""
Dictionary of prefix substitutions.
:type: None
"""
@property
def properties(self) -> None:
"""
The properties of this prim, as an ordered dictionary.
Note that although this property is described as being read-only, you can modify the contents to add, remove, or reorder properties.
:type: None
"""
@property
def propertyOrder(self) -> None:
"""
Get/set the list of property names for this prim's 'reorder properties' statement.
:type: None
"""
@property
def realNameParent(self) -> None:
"""
The name parent of this prim.
:type: None
"""
@property
def referenceList(self) -> None:
"""
A ReferenceListEditor for the prim's references.
The list of the references for this prim may be modified with this ReferenceListEditor.
A ReferenceListEditor may express a list either as an explicit value or as a set of list editing operations. See ReferenceListEditor for more information.
:type: None
"""
@property
def relationships(self) -> None:
"""
The relationships of this prim, as an ordered dictionary.
:type: None
"""
@property
def relocates(self) -> None:
"""
An editing proxy for the prim's map of relocation paths.
The map of source-to-target paths specifying namespace relocation may be set or cleared whole, or individual map entries may be added, removed, or edited.
:type: None
"""
@property
def specializesList(self) -> None:
"""
A PathListEditor for the prim's specializes.
The list of the specializes for this prim may be modified with this PathListEditor.
A PathListEditor may express a list either as an explicit value or as a set of list editing operations. See PathListEditor for more information.
:type: None
"""
@property
def specifier(self) -> None:
"""
The prim's specifier (SpecifierDef or SpecifierOver).
The default value is SpecifierOver.
:type: None
"""
@property
def suffix(self) -> None:
"""
The prim's suffix.
:type: None
"""
@property
def suffixSubstitutions(self) -> None:
"""
Dictionary of prefix substitutions.
:type: None
"""
@property
def symmetricPeer(self) -> None:
"""
The prims's symmetric peer.
:type: None
"""
@property
def symmetryArguments(self) -> None:
"""
Dictionary with prim symmetry arguments.
Although this property is marked read-only, you can modify the contents to add, change, and clear symmetry arguments.
:type: None
"""
@property
def symmetryFunction(self) -> None:
"""
The prim's symmetry function.
:type: None
"""
@property
def typeName(self) -> None:
"""
The type of this prim.
:type: None
"""
@property
def variantSelections(self) -> None:
"""
Dictionary whose keys are variant set names and whose values are the variants chosen for each set.
Although this property is marked read-only, you can modify the contents to add, change, and clear variants.
:type: None
"""
@property
def variantSetNameList(self) -> None:
"""
A StringListEditor for the names of the variant
sets for this prim.
The list of the names of the variants sets of this prim may be
modified with this StringListEditor.
A StringListEditor may express a list either as an explicit value or as a set of list editing operations. See StringListEditor for more information.
Although this property is marked as read-only, the returned object is modifiable.
:type: None
"""
@property
def variantSets(self) -> None:
"""
The VariantSetSpecs for this prim indexed by name.
Although this property is marked as read-only, you can
modify the contents to remove variant sets. New variant sets
are created by creating them with the prim as the owner.
Although this property is marked as read-only, the returned object
is modifiable.
:type: None
"""
ActiveKey = 'active'
AnyTypeToken = '__AnyType__'
CommentKey = 'comment'
CustomDataKey = 'customData'
DocumentationKey = 'documentation'
HiddenKey = 'hidden'
InheritPathsKey = 'inheritPaths'
KindKey = 'kind'
PayloadKey = 'payload'
PermissionKey = 'permission'
PrefixKey = 'prefix'
PrefixSubstitutionsKey = 'prefixSubstitutions'
PrimOrderKey = 'primOrder'
PropertyOrderKey = 'propertyOrder'
ReferencesKey = 'references'
RelocatesKey = 'relocates'
SpecializesKey = 'specializes'
SpecifierKey = 'specifier'
SymmetricPeerKey = 'symmetricPeer'
SymmetryArgumentsKey = 'symmetryArguments'
SymmetryFunctionKey = 'symmetryFunction'
TypeNameKey = 'typeName'
VariantSelectionKey = 'variantSelection'
VariantSetNamesKey = 'variantSetNames'
pass
class PropertySpec(Spec, Boost.Python.instance):
"""
Base class for SdfAttributeSpec and SdfRelationshipSpec.
Scene Spec Attributes (SdfAttributeSpec) and Relationships
(SdfRelationshipSpec) are the basic properties that make up Scene Spec
Prims (SdfPrimSpec). They share many qualities and can sometimes be
treated uniformly. The common qualities are provided by this base
class.
NOTE: Do not use Python reserved words and keywords as attribute
names. This will cause attribute resolution to fail.
"""
@staticmethod
def ClearDefaultValue() -> None:
"""
ClearDefaultValue() -> None
Clear the attribute's default value.
"""
@staticmethod
def HasDefaultValue() -> bool:
"""
HasDefaultValue() -> bool
Returns true if a default value is set for this attribute.
"""
@property
def assetInfo(self) -> None:
"""
Returns the asset info dictionary for this property.
The default value is an empty dictionary.
The asset info dictionary is used to annotate SdfAssetPath-valued attributes pointing to the root-prims of assets (generally organized as models) with various data related to asset management. For example, asset name, root layer identifier, asset version etc.
Note: It is only valid to author assetInfo on attributes that are of type SdfAssetPath.
:type: None
"""
@property
def comment(self) -> None:
"""
A comment describing the property.
:type: None
"""
@property
def custom(self) -> None:
"""
Whether this property spec declares a custom attribute.
:type: None
"""
@property
def customData(self) -> None:
"""
The property's custom data.
The default value for custom data is an empty dictionary.
Custom data is for use by plugins or other non-tools supplied
extensions that need to be able to store data attached to arbitrary
scene objects. Note that if the only objects you want to store data
on are prims, using custom attributes is probably a better choice.
But if you need to possibly store this data on attributes or
relationships or as annotations on reference arcs, then custom data
is an appropriate choice.
:type: None
"""
@property
def default(self) -> None:
"""
The default value of this property.
:type: None
"""
@property
def displayGroup(self) -> None:
"""
DisplayGroup for the property.
:type: None
"""
@property
def displayName(self) -> None:
"""
DisplayName for the property.
:type: None
"""
@property
def documentation(self) -> None:
"""
Documentation for the property.
:type: None
"""
@property
def expired(self) -> None:
"""
:type: None
"""
@property
def hasOnlyRequiredFields(self) -> None:
"""
Indicates whether this spec has any significant data other
than just what is necessary for instantiation.
This is a less strict version of isInert, returning True if
the spec contains as much as the type and name.
:type: None
"""
@property
def hidden(self) -> None:
"""
Whether this property will be hidden in browsers.
:type: None
"""
@property
def name(self) -> None:
"""
The name of the property.
:type: None
"""
@property
def owner(self) -> None:
"""
The owner of this property. Either a relationship or a prim.
:type: None
"""
@property
def permission(self) -> None:
"""
The property's permission restriction.
:type: None
"""
@property
def prefix(self) -> None:
"""
Prefix for the property.
:type: None
"""
@property
def symmetricPeer(self) -> None:
"""
The property's symmetric peer.
:type: None
"""
@property
def symmetryArguments(self) -> None:
"""
Dictionary with property symmetry arguments.
Although this property is marked read-only, you can modify the contents to add, change, and clear symmetry arguments.
:type: None
"""
@property
def symmetryFunction(self) -> None:
"""
The property's symmetry function.
:type: None
"""
@property
def variability(self) -> None:
"""
Returns the variability of the property.
An attribute's variability may be Varying
Uniform, Config or Computed.
For an attribute, the default is Varying, for a relationship the default is Uniform.
Varying relationships may be directly authored 'animating' targetpaths over time.
Varying attributes may be directly authored, animated and
affected on by Actions. They are the most flexible.
Uniform attributes may be authored only with non-animated values
(default values). They cannot be affected by Actions, but they
can be connected to other Uniform attributes.
Config attributes are the same as Uniform except that a Prim
can choose to alter its collection of built-in properties based
on the values of its Config attributes.
Computed attributes may not be authored in scene description.
Prims determine the values of their Computed attributes through
Prim-specific computation. They may not be connected.
:type: None
"""
AssetInfoKey = 'assetInfo'
CommentKey = 'comment'
CustomDataKey = 'customData'
CustomKey = 'custom'
DisplayGroupKey = 'displayGroup'
DisplayNameKey = 'displayName'
DocumentationKey = 'documentation'
HiddenKey = 'hidden'
PermissionKey = 'permission'
PrefixKey = 'prefix'
SymmetricPeerKey = 'symmetricPeer'
SymmetryArgumentsKey = 'symmetryArguments'
SymmetryFunctionKey = 'symmetryFunction'
pass
class PseudoRootSpec(PrimSpec, Spec, Boost.Python.instance):
@property
def expired(self) -> None:
"""
:type: None
"""
pass
class Reference(Boost.Python.instance):
"""
Represents a reference and all its meta data.
A reference is expressed on a prim in a given layer and it identifies
a prim in a layer stack. All opinions in the namespace hierarchy under
the referenced prim will be composed with the opinions in the
namespace hierarchy under the referencing prim.
The asset path specifies the layer stack being referenced. If this
asset path is non-empty, this reference is considered
an'external'reference to the layer stack rooted at the specified
layer. If this is empty, this reference is considered
an'internal'reference to the layer stack containing (but not
necessarily rooted at) the layer where the reference is authored.
The prim path specifies the prim in the referenced layer stack from
which opinions will be composed. If this prim path is empty, it will
be considered a reference to the default prim specified in the root
layer of the referenced layer stack see SdfLayer::GetDefaultPrim.
The meta data for a reference is its layer offset and custom data. The
layer offset is an affine transformation applied to all anim splines
in the referenced prim's namespace hierarchy, see SdfLayerOffset for
details. Custom data is for use by plugins or other non-tools supplied
extensions that need to be able to store data associated with
references.
"""
@staticmethod
def IsInternal() -> bool:
"""
IsInternal() -> bool
Returns ``true`` in the case of an internal reference.
An internal reference is a reference with an empty asset path.
"""
@property
def assetPath(self) -> None:
"""
type : None
Sets the asset path for the root layer of the referenced layer stack.
This may be set to an empty string to specify an internal reference.
See SdfAssetPath for what characters are valid in ``assetPath`` . If
``assetPath`` contains invalid characters, issue an error and set this
reference's asset path to the empty asset path.
----------------------------------------------------------------------
type : str
Returns the asset path to the root layer of the referenced layer
stack.
This will be empty in the case of an internal reference.
:type: None
"""
@property
def customData(self) -> None:
"""
type : None
Sets the custom data associated with the reference.
----------------------------------------------------------------------
type : None
Sets a custom data entry for the reference.
If *value* is empty, then this removes the given custom data entry.
----------------------------------------------------------------------
type : VtDictionary
Returns the custom data associated with the reference.
:type: None
"""
@property
def layerOffset(self) -> None:
"""
type : None
Sets a new layer offset.
----------------------------------------------------------------------
type : LayerOffset
Returns the layer offset associated with the reference.
:type: None
"""
@property
def primPath(self) -> None:
"""
type : None
Sets the path of the referenced prim.
This may be set to an empty path to specify a reference to the default
prim in the referenced layer stack.
----------------------------------------------------------------------
type : Path
Returns the path of the referenced prim.
This will be empty if the referenced prim is the default prim
specified in the referenced layer stack.
:type: None
"""
__instance_size__ = 80
pass
class ReferenceListOp(Boost.Python.instance):
@staticmethod
def ApplyOperations(*args, **kwargs) -> None: ...
@staticmethod
def Clear(*args, **kwargs) -> None: ...
@staticmethod
def ClearAndMakeExplicit(*args, **kwargs) -> None: ...
@staticmethod
def Create(*args, **kwargs) -> None: ...
@staticmethod
def CreateExplicit(*args, **kwargs) -> None: ...
@staticmethod
def GetAddedOrExplicitItems(*args, **kwargs) -> None: ...
@staticmethod
def HasItem(*args, **kwargs) -> None: ...
@property
def addedItems(self) -> None:
"""
:type: None
"""
@property
def appendedItems(self) -> None:
"""
:type: None
"""
@property
def deletedItems(self) -> None:
"""
:type: None
"""
@property
def explicitItems(self) -> None:
"""
:type: None
"""
@property
def isExplicit(self) -> None:
"""
:type: None
"""
@property
def orderedItems(self) -> None:
"""
:type: None
"""
@property
def prependedItems(self) -> None:
"""
:type: None
"""
__instance_size__ = 168
pass
class RelationshipSpec(PropertySpec, Spec, Boost.Python.instance):
"""
A property that contains a reference to one or more SdfPrimSpec
instances.
A relationship may refer to one or more target prims or attributes.
All targets of a single relationship are considered to be playing the
same role. Note that ``role`` does not imply that the target prims or
attributes are of the same ``type`` .
Relationships may be annotated with relational attributes. Relational
attributes are named SdfAttributeSpec objects containing values that
describe the relationship. For example, point weights are commonly
expressed as relational attributes.
"""
@staticmethod
def RemoveTargetPath(path, preserveTargetOrder) -> None:
"""
RemoveTargetPath(path, preserveTargetOrder) -> None
Removes the specified target path.
Removes the given target path and any relational attributes for the
given target path. If ``preserveTargetOrder`` is ``true`` , Erase() is
called on the list editor instead of RemoveItemEdits(). This preserves
the ordered items list.
Parameters
----------
path : Path
preserveTargetOrder : bool
"""
@staticmethod
def ReplaceTargetPath(oldPath, newPath) -> None:
"""
ReplaceTargetPath(oldPath, newPath) -> None
Updates the specified target path.
Replaces the path given by ``oldPath`` with the one specified by
``newPath`` . Relational attributes are updated if necessary.
Parameters
----------
oldPath : Path
newPath : Path
"""
@property
def expired(self) -> None:
"""
:type: None
"""
@property
def noLoadHint(self) -> None:
"""
whether the target must be loaded to load the prim this
relationship is attached to.
:type: None
"""
@property
def targetPathList(self) -> None:
"""
A PathListEditor for the relationship's target paths.
The list of the target paths for this relationship may be
modified with this PathListEditor.
A PathListEditor may express a list either as an explicit
value or as a set of list editing operations. See PathListEditor
for more information.
:type: None
"""
TargetsKey = 'targetPaths'
pass
class Spec(Boost.Python.instance):
"""
Base class for all Sdf spec classes.
"""
@staticmethod
def ClearInfo(*args, **kwargs) -> None:
"""
key : string
nClears the value for scene spec info with the given key. After calling this, HasInfo() will return false. To make HasInfo() return true, set a value for that scene spec info.
"""
@staticmethod
def GetAsText(*args, **kwargs) -> None: ...
@staticmethod
def GetFallbackForInfo(*args, **kwargs) -> None:
"""
key : string
Returns the fallback value for the given key.
"""
@staticmethod
def GetInfo(key) -> VtValue:
"""
GetInfo(key) -> VtValue
Gets the value for the given metadata key.
This is interim API which is likely to change. Only editors with an
immediate specific need (like the Inspector) should use this API.
Parameters
----------
key : str
"""
@staticmethod
def GetMetaDataDisplayGroup(key) -> str:
"""
GetMetaDataDisplayGroup(key) -> str
Returns this metadata key's displayGroup.
Parameters
----------
key : str
"""
@staticmethod
def GetMetaDataInfoKeys() -> list[str]:
"""
GetMetaDataInfoKeys() -> list[str]
Returns the list of metadata info keys for this object.
This is not the complete list of keys, it is only those that should be
considered to be metadata by inspectors or other presentation UI.
This is interim API which is likely to change. Only editors with an
immediate specific need (like the Inspector) should use this API.
"""
@staticmethod
def GetTypeForInfo(*args, **kwargs) -> None:
"""
key : string
Returns the type of value for the given key.
"""
@staticmethod
def HasInfo(key) -> bool:
"""
key : string
Returns whether there is a setting for the scene spec info with the given key.
When asked for a value for one of its scene spec info, a valid value will always be returned. But if this API returns false for a scene spec info, the value of that info will be the defined default value.
(XXX: This may change such that it is an error to ask for a value when there is none).
When dealing with a composedLayer, it is not necessary to worry about whether a scene spec info 'has a value' because the composed layer will always have a valid value, even if it is the default.
A spec may or may not have an expressed value for some of its scene spec info.
"""
@staticmethod
def IsInert(*args, **kwargs) -> None:
"""
Indicates whether this spec has any significant data. If ignoreChildren is true, child scenegraph objects will be ignored.
"""
@staticmethod
def ListInfoKeys() -> list[str]:
"""
ListInfoKeys() -> list[str]
Returns the full list of info keys currently set on this object.
This does not include fields that represent names of children.
"""
@staticmethod
def SetInfo(key, value) -> None:
"""
SetInfo(key, value) -> None
Sets the value for the given metadata key.
It is an error to pass a value that is not the correct type for that
given key.
This is interim API which is likely to change. Only editors with an
immediate specific need (like the Inspector) should use this API.
Parameters
----------
key : str
value : VtValue
"""
@staticmethod
def SetInfoDictionaryValue(dictionaryKey, entryKey, value) -> None:
"""
SetInfoDictionaryValue(dictionaryKey, entryKey, value) -> None
Sets the value for ``entryKey`` to ``value`` within the dictionary
with the given metadata key ``dictionaryKey`` .
Parameters
----------
dictionaryKey : str
entryKey : str
value : VtValue
"""
@property
def expired(self) -> None:
"""
:type: None
"""
@property
def isInert(self) -> None:
"""
Indicates whether this spec has any significant data. This is for backwards compatibility, use IsInert instead.
Compatibility note: prior to presto 1.9, isInert (then isEmpty) was true for otherwise inert PrimSpecs with inert inherits, references, or variant sets. isInert is now false in such conditions.
:type: None
"""
@property
def layer(self) -> None:
"""
The owning layer.
:type: None
"""
@property
def path(self) -> None:
"""
The absolute scene path.
:type: None
"""
pass
class SpecType(pxr.Tf.Tf_PyEnumWrapper, pxr.Tf.Enum, Boost.Python.instance):
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = ''
allValues: tuple # value = (Sdf.SpecTypeUnknown, Sdf.SpecTypeAttribute, Sdf.SpecTypeConnection, Sdf.SpecTypeExpression, Sdf.SpecTypeMapper, Sdf.SpecTypeMapperArg, Sdf.SpecTypePrim, Sdf.SpecTypePseudoRoot, Sdf.SpecTypeRelationship, Sdf.SpecTypeRelationshipTarget, Sdf.SpecTypeVariant, Sdf.SpecTypeVariantSet)
pass
class Specifier(pxr.Tf.Tf_PyEnumWrapper, pxr.Tf.Enum, Boost.Python.instance):
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = ''
allValues: tuple # value = (Sdf.SpecifierDef, Sdf.SpecifierOver, Sdf.SpecifierClass)
pass
class StringListOp(Boost.Python.instance):
@staticmethod
def ApplyOperations(*args, **kwargs) -> None: ...
@staticmethod
def Clear(*args, **kwargs) -> None: ...
@staticmethod
def ClearAndMakeExplicit(*args, **kwargs) -> None: ...
@staticmethod
def Create(*args, **kwargs) -> None: ...
@staticmethod
def CreateExplicit(*args, **kwargs) -> None: ...
@staticmethod
def GetAddedOrExplicitItems(*args, **kwargs) -> None: ...
@staticmethod
def HasItem(*args, **kwargs) -> None: ...
@property
def addedItems(self) -> None:
"""
:type: None
"""
@property
def appendedItems(self) -> None:
"""
:type: None
"""
@property
def deletedItems(self) -> None:
"""
:type: None
"""
@property
def explicitItems(self) -> None:
"""
:type: None
"""
@property
def isExplicit(self) -> None:
"""
:type: None
"""
@property
def orderedItems(self) -> None:
"""
:type: None
"""
@property
def prependedItems(self) -> None:
"""
:type: None
"""
__instance_size__ = 168
pass
class TimeCode(Boost.Python.instance):
"""
Value type that represents a time code. It's equivalent to a double
type value but is used to indicate that this value should be resolved
by any time based value resolution.
"""
@staticmethod
def GetValue() -> float:
"""
GetValue() -> float
Return the time value.
"""
__instance_size__ = 24
pass
class TimeCodeArray(Boost.Python.instance):
"""
An array of type SdfTimeCode.
"""
_isVtArray = True
pass
class TokenListOp(Boost.Python.instance):
@staticmethod
def ApplyOperations(*args, **kwargs) -> None: ...
@staticmethod
def Clear(*args, **kwargs) -> None: ...
@staticmethod
def ClearAndMakeExplicit(*args, **kwargs) -> None: ...
@staticmethod
def Create(*args, **kwargs) -> None: ...
@staticmethod
def CreateExplicit(*args, **kwargs) -> None: ...
@staticmethod
def GetAddedOrExplicitItems(*args, **kwargs) -> None: ...
@staticmethod
def HasItem(*args, **kwargs) -> None: ...
@property
def addedItems(self) -> None:
"""
:type: None
"""
@property
def appendedItems(self) -> None:
"""
:type: None
"""
@property
def deletedItems(self) -> None:
"""
:type: None
"""
@property
def explicitItems(self) -> None:
"""
:type: None
"""
@property
def isExplicit(self) -> None:
"""
:type: None
"""
@property
def orderedItems(self) -> None:
"""
:type: None
"""
@property
def prependedItems(self) -> None:
"""
:type: None
"""
__instance_size__ = 168
pass
class UInt64ListOp(Boost.Python.instance):
@staticmethod
def ApplyOperations(*args, **kwargs) -> None: ...
@staticmethod
def Clear(*args, **kwargs) -> None: ...
@staticmethod
def ClearAndMakeExplicit(*args, **kwargs) -> None: ...
@staticmethod
def Create(*args, **kwargs) -> None: ...
@staticmethod
def CreateExplicit(*args, **kwargs) -> None: ...
@staticmethod
def GetAddedOrExplicitItems(*args, **kwargs) -> None: ...
@staticmethod
def HasItem(*args, **kwargs) -> None: ...
@property
def addedItems(self) -> None:
"""
:type: None
"""
@property
def appendedItems(self) -> None:
"""
:type: None
"""
@property
def deletedItems(self) -> None:
"""
:type: None
"""
@property
def explicitItems(self) -> None:
"""
:type: None
"""
@property
def isExplicit(self) -> None:
"""
:type: None
"""
@property
def orderedItems(self) -> None:
"""
:type: None
"""
@property
def prependedItems(self) -> None:
"""
:type: None
"""
__instance_size__ = 168
pass
class UIntListOp(Boost.Python.instance):
@staticmethod
def ApplyOperations(*args, **kwargs) -> None: ...
@staticmethod
def Clear(*args, **kwargs) -> None: ...
@staticmethod
def ClearAndMakeExplicit(*args, **kwargs) -> None: ...
@staticmethod
def Create(*args, **kwargs) -> None: ...
@staticmethod
def CreateExplicit(*args, **kwargs) -> None: ...
@staticmethod
def GetAddedOrExplicitItems(*args, **kwargs) -> None: ...
@staticmethod
def HasItem(*args, **kwargs) -> None: ...
@property
def addedItems(self) -> None:
"""
:type: None
"""
@property
def appendedItems(self) -> None:
"""
:type: None
"""
@property
def deletedItems(self) -> None:
"""
:type: None
"""
@property
def explicitItems(self) -> None:
"""
:type: None
"""
@property
def isExplicit(self) -> None:
"""
:type: None
"""
@property
def orderedItems(self) -> None:
"""
:type: None
"""
@property
def prependedItems(self) -> None:
"""
:type: None
"""
__instance_size__ = 168
pass
class UnregisteredValue(Boost.Python.instance):
"""
Stores a representation of the value for an unregistered metadata
field encountered during text layer parsing.
This provides the ability to serialize this data to a layer, as well
as limited inspection and editing capabilities (e.g., moving this data
to a different spec or field) even when the data type of the value
isn't known.
"""
@property
def value(self) -> None:
"""
type : VtValue
Returns the wrapped VtValue specified in the constructor.
:type: None
"""
__instance_size__ = 32
pass
class UnregisteredValueListOp(Boost.Python.instance):
@staticmethod
def ApplyOperations(*args, **kwargs) -> None: ...
@staticmethod
def Clear(*args, **kwargs) -> None: ...
@staticmethod
def ClearAndMakeExplicit(*args, **kwargs) -> None: ...
@staticmethod
def Create(*args, **kwargs) -> None: ...
@staticmethod
def CreateExplicit(*args, **kwargs) -> None: ...
@staticmethod
def GetAddedOrExplicitItems(*args, **kwargs) -> None: ...
@staticmethod
def HasItem(*args, **kwargs) -> None: ...
@property
def addedItems(self) -> None:
"""
:type: None
"""
@property
def appendedItems(self) -> None:
"""
:type: None
"""
@property
def deletedItems(self) -> None:
"""
:type: None
"""
@property
def explicitItems(self) -> None:
"""
:type: None
"""
@property
def isExplicit(self) -> None:
"""
:type: None
"""
@property
def orderedItems(self) -> None:
"""
:type: None
"""
@property
def prependedItems(self) -> None:
"""
:type: None
"""
__instance_size__ = 168
pass
class ValueBlock(Boost.Python.instance):
"""
A special value type that can be used to explicitly author an opinion
for an attribute's default value or time sample value that represents
having no value. Note that this is different from not having a value
authored.
One could author such a value in two ways.
.. code-block:: text
attribute->SetDefaultValue(VtValue(SdfValueBlock());
\.\.\.
layer->SetTimeSample(attribute->GetPath(), 101, VtValue(SdfValueBlock()));
"""
__instance_size__ = 24
pass
class ValueRoleNames(Boost.Python.instance):
Color = 'Color'
EdgeIndex = 'EdgeIndex'
FaceIndex = 'FaceIndex'
Frame = 'Frame'
Normal = 'Normal'
Point = 'Point'
PointIndex = 'PointIndex'
TextureCoordinate = 'TextureCoordinate'
Transform = 'Transform'
Vector = 'Vector'
pass
class ValueTypeName(Boost.Python.instance):
"""
Represents a value type name, i.e. an attribute's type name. Usually,
a value type name associates a string with a ``TfType`` and an
optional role, along with additional metadata. A schema registers all
known value type names and may register multiple names for the same
TfType and role pair. All name strings for a given pair are
collectively called its aliases.
A value type name may also represent just a name string, without a
``TfType`` , role or other metadata. This is currently used
exclusively to unserialize and re-serialize an attribute's type name
where that name is not known to the schema.
Because value type names can have aliases and those aliases may change
in the future, clients should avoid using the value type name's string
representation except to report human readable messages and when
serializing. Clients can look up a value type name by string using
``SdfSchemaBase::FindType()`` and shouldn't otherwise need the string.
Aliases compare equal, even if registered by different schemas.
"""
@property
def aliasesAsStrings(self) -> None:
"""
:type: None
"""
@property
def arrayType(self) -> None:
"""
type : ValueTypeName
Returns the array version of this type name if it's an scalar type
name, otherwise returns this type name.
If there is no array type name then this returns the invalid type
name.
:type: None
"""
@property
def cppTypeName(self) -> None:
"""
:type: None
"""
@property
def defaultUnit(self) -> None:
"""
type : Enum
Returns the default unit enum for the type.
:type: None
"""
@property
def defaultValue(self) -> None:
"""
type : VtValue
Returns the default value for the type.
:type: None
"""
@property
def isArray(self) -> None:
"""
type : bool
Returns ``true`` iff this type is an array.
The invalid type is considered neither scalar nor array.
:type: None
"""
@property
def isScalar(self) -> None:
"""
type : bool
Returns ``true`` iff this type is a scalar.
The invalid type is considered neither scalar nor array.
:type: None
"""
@property
def role(self) -> None:
"""
type : str
Returns the type's role.
:type: None
"""
@property
def scalarType(self) -> None:
"""
type : ValueTypeName
Returns the scalar version of this type name if it's an array type
name, otherwise returns this type name.
If there is no scalar type name then this returns the invalid type
name.
:type: None
"""
@property
def type(self) -> None:
"""
type : Type
Returns the ``TfType`` of the type.
:type: None
"""
pass
class ValueTypeNames(Boost.Python.instance):
@staticmethod
def Find(*args, **kwargs) -> None: ...
Asset: pxr.Sdf.ValueTypeName
AssetArray: pxr.Sdf.ValueTypeName
Bool: pxr.Sdf.ValueTypeName
BoolArray: pxr.Sdf.ValueTypeName
Color3d: pxr.Sdf.ValueTypeName
Color3dArray: pxr.Sdf.ValueTypeName
Color3f: pxr.Sdf.ValueTypeName
Color3fArray: pxr.Sdf.ValueTypeName
Color3h: pxr.Sdf.ValueTypeName
Color3hArray: pxr.Sdf.ValueTypeName
Color4d: pxr.Sdf.ValueTypeName
Color4dArray: pxr.Sdf.ValueTypeName
Color4f: pxr.Sdf.ValueTypeName
Color4fArray: pxr.Sdf.ValueTypeName
Color4h: pxr.Sdf.ValueTypeName
Color4hArray: pxr.Sdf.ValueTypeName
Double: pxr.Sdf.ValueTypeName
Double2: pxr.Sdf.ValueTypeName
Double2Array: pxr.Sdf.ValueTypeName
Double3: pxr.Sdf.ValueTypeName
Double3Array: pxr.Sdf.ValueTypeName
Double4: pxr.Sdf.ValueTypeName
Double4Array: pxr.Sdf.ValueTypeName
DoubleArray: pxr.Sdf.ValueTypeName
Float: pxr.Sdf.ValueTypeName
Float2: pxr.Sdf.ValueTypeName
Float2Array: pxr.Sdf.ValueTypeName
Float3: pxr.Sdf.ValueTypeName
Float3Array: pxr.Sdf.ValueTypeName
Float4: pxr.Sdf.ValueTypeName
Float4Array: pxr.Sdf.ValueTypeName
FloatArray: pxr.Sdf.ValueTypeName
Frame4d: pxr.Sdf.ValueTypeName
Frame4dArray: pxr.Sdf.ValueTypeName
Half: pxr.Sdf.ValueTypeName
Half2: pxr.Sdf.ValueTypeName
Half2Array: pxr.Sdf.ValueTypeName
Half3: pxr.Sdf.ValueTypeName
Half3Array: pxr.Sdf.ValueTypeName
Half4: pxr.Sdf.ValueTypeName
Half4Array: pxr.Sdf.ValueTypeName
HalfArray: pxr.Sdf.ValueTypeName
Int: pxr.Sdf.ValueTypeName
Int2: pxr.Sdf.ValueTypeName
Int2Array: pxr.Sdf.ValueTypeName
Int3: pxr.Sdf.ValueTypeName
Int3Array: pxr.Sdf.ValueTypeName
Int4: pxr.Sdf.ValueTypeName
Int4Array: pxr.Sdf.ValueTypeName
Int64: pxr.Sdf.ValueTypeName
Int64Array: pxr.Sdf.ValueTypeName
IntArray: pxr.Sdf.ValueTypeName
Matrix2d: pxr.Sdf.ValueTypeName
Matrix2dArray: pxr.Sdf.ValueTypeName
Matrix3d: pxr.Sdf.ValueTypeName
Matrix3dArray: pxr.Sdf.ValueTypeName
Matrix4d: pxr.Sdf.ValueTypeName
Matrix4dArray: pxr.Sdf.ValueTypeName
Normal3d: pxr.Sdf.ValueTypeName
Normal3dArray: pxr.Sdf.ValueTypeName
Normal3f: pxr.Sdf.ValueTypeName
Normal3fArray: pxr.Sdf.ValueTypeName
Normal3h: pxr.Sdf.ValueTypeName
Normal3hArray: pxr.Sdf.ValueTypeName
Point3d: pxr.Sdf.ValueTypeName
Point3dArray: pxr.Sdf.ValueTypeName
Point3f: pxr.Sdf.ValueTypeName
Point3fArray: pxr.Sdf.ValueTypeName
Point3h: pxr.Sdf.ValueTypeName
Point3hArray: pxr.Sdf.ValueTypeName
Quatd: pxr.Sdf.ValueTypeName
QuatdArray: pxr.Sdf.ValueTypeName
Quatf: pxr.Sdf.ValueTypeName
QuatfArray: pxr.Sdf.ValueTypeName
Quath: pxr.Sdf.ValueTypeName
QuathArray: pxr.Sdf.ValueTypeName
String: pxr.Sdf.ValueTypeName
StringArray: pxr.Sdf.ValueTypeName
TexCoord2d: pxr.Sdf.ValueTypeName
TexCoord2dArray: pxr.Sdf.ValueTypeName
TexCoord2f: pxr.Sdf.ValueTypeName
TexCoord2fArray: pxr.Sdf.ValueTypeName
TexCoord2h: pxr.Sdf.ValueTypeName
TexCoord2hArray: pxr.Sdf.ValueTypeName
TexCoord3d: pxr.Sdf.ValueTypeName
TexCoord3dArray: pxr.Sdf.ValueTypeName
TexCoord3f: pxr.Sdf.ValueTypeName
TexCoord3fArray: pxr.Sdf.ValueTypeName
TexCoord3h: pxr.Sdf.ValueTypeName
TexCoord3hArray: pxr.Sdf.ValueTypeName
TimeCode: pxr.Sdf.ValueTypeName
TimeCodeArray: pxr.Sdf.ValueTypeName
Token: pxr.Sdf.ValueTypeName
TokenArray: pxr.Sdf.ValueTypeName
UChar: pxr.Sdf.ValueTypeName
UCharArray: pxr.Sdf.ValueTypeName
UInt: pxr.Sdf.ValueTypeName
UInt64: pxr.Sdf.ValueTypeName
UInt64Array: pxr.Sdf.ValueTypeName
UIntArray: pxr.Sdf.ValueTypeName
Vector3d: pxr.Sdf.ValueTypeName
Vector3dArray: pxr.Sdf.ValueTypeName
Vector3f: pxr.Sdf.ValueTypeName
Vector3fArray: pxr.Sdf.ValueTypeName
Vector3h: pxr.Sdf.ValueTypeName
Vector3hArray: pxr.Sdf.ValueTypeName
pass
class Variability(pxr.Tf.Tf_PyEnumWrapper, pxr.Tf.Enum, Boost.Python.instance):
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = ''
allValues: tuple # value = (Sdf.VariabilityVarying, Sdf.VariabilityUniform)
pass
class VariantSetSpec(Spec, Boost.Python.instance):
"""
Represents a coherent set of alternate representations for part of a
scene.
An SdfPrimSpec object may contain one or more named SdfVariantSetSpec
objects that define variations on the prim.
An SdfVariantSetSpec object contains one or more named SdfVariantSpec
objects. It may also define the name of one of its variants to be used
by default.
When a prim references another prim, the referencing prim may specify
one of the variants from each of the variant sets of the target prim.
The chosen variant from each set (or the default variant from those
sets that the referencing prim does not explicitly specify) is
composited over the target prim, and then the referencing prim is
composited over the result.
"""
@staticmethod
def RemoveVariant(variant) -> None:
"""
RemoveVariant(variant) -> None
Removes ``variant`` from the list of variants.
If the variant set does not currently own ``variant`` , no action is
taken.
Parameters
----------
variant : VariantSpec
"""
@property
def expired(self) -> None:
"""
:type: None
"""
@property
def name(self) -> None:
"""
The variant set's name.
:type: None
"""
@property
def owner(self) -> None:
"""
The prim that this variant set belongs to.
:type: None
"""
@property
def variantList(self) -> None:
"""
The variants in this variant set as a list.
:type: None
"""
@property
def variants(self) -> None:
"""
The variants in this variant set as a dict.
:type: None
"""
pass
class VariantSpec(Spec, Boost.Python.instance):
"""
Represents a single variant in a variant set.
A variant contains a prim. This prim is the root prim of the variant.
SdfVariantSpecs are value objects. This means they are immutable once
created and they are passed by copy-in APIs. To change a variant spec,
you make a new one and replace the existing one.
"""
@staticmethod
def GetVariantNames(name) -> list[str]:
"""
GetVariantNames(name) -> list[str]
Returns list of variant names for the given variant set.
Parameters
----------
name : str
"""
@property
def expired(self) -> None:
"""
:type: None
"""
@property
def name(self) -> None:
"""
The variant's name.
:type: None
"""
@property
def owner(self) -> None:
"""
The variant set that this variant belongs to.
:type: None
"""
@property
def primSpec(self) -> None:
"""
The root prim of this variant.
:type: None
"""
@property
def variantSets(self) -> None:
"""
type : SdfVariantSetsProxy
Returns the nested variant sets.
The result maps variant set names to variant sets. Variant sets may be
removed through the proxy.
:type: None
"""
pass
def Cat(*args, **kwargs) -> None:
pass
def ComputeAssetPathRelativeToLayer(*args, **kwargs) -> None:
pass
def ConvertToValidMetadataDictionary(*args, **kwargs) -> None:
pass
def ConvertUnit(*args, **kwargs) -> None:
"""
Convert a unit of measurement to a compatible unit.
"""
def CopySpec(*args, **kwargs) -> None:
pass
def CreatePrimInLayer(*args, **kwargs) -> None:
pass
def CreateVariantInLayer(*args, **kwargs) -> None:
pass
def DefaultUnit(*args, **kwargs) -> None:
"""
For a given unit of measurement get the default compatible unit.
For a given typeName ('Vector', 'Point' etc.) get the default unit of measurement.
"""
def Equal(*args, **kwargs) -> None:
pass
def GetNameForUnit(*args, **kwargs) -> None:
pass
def GetTypeForValueTypeName(*args, **kwargs) -> None:
pass
def GetUnitFromName(*args, **kwargs) -> None:
pass
def GetValueTypeNameForValue(*args, **kwargs) -> None:
pass
def JustCreatePrimAttributeInLayer(*args, **kwargs) -> None:
pass
def JustCreatePrimInLayer(*args, **kwargs) -> None:
pass
def NotEqual(*args, **kwargs) -> None:
pass
def UnitCategory(*args, **kwargs) -> None:
"""
For a given unit of measurement get the unit category.
"""
def ValueHasValidType(*args, **kwargs) -> None:
pass
def _DumpPathStats(*args, **kwargs) -> None:
pass
def _PathGetDebuggerPathText(*args, **kwargs) -> None:
pass
def _PathStress(*args, **kwargs) -> None:
pass
def _TestTakeOwnership(*args, **kwargs) -> None:
pass
AngularUnitDegrees: pxr.Sdf.AngularUnit # value = Sdf.AngularUnitDegrees
AngularUnitRadians: pxr.Sdf.AngularUnit # value = Sdf.AngularUnitRadians
AuthoringErrorUnrecognizedFields: pxr.Sdf.AuthoringError # value = Sdf.AuthoringErrorUnrecognizedFields
AuthoringErrorUnrecognizedSpecType: pxr.Sdf.AuthoringError # value = Sdf.AuthoringErrorUnrecognizedSpecType
DimensionlessUnitDefault: pxr.Sdf.DimensionlessUnit # value = Sdf.DimensionlessUnitDefault
DimensionlessUnitPercent: pxr.Sdf.DimensionlessUnit # value = Sdf.DimensionlessUnitPercent
LengthUnitCentimeter: pxr.Sdf.LengthUnit # value = Sdf.LengthUnitCentimeter
LengthUnitDecimeter: pxr.Sdf.LengthUnit # value = Sdf.LengthUnitDecimeter
LengthUnitFoot: pxr.Sdf.LengthUnit # value = Sdf.LengthUnitFoot
LengthUnitInch: pxr.Sdf.LengthUnit # value = Sdf.LengthUnitInch
LengthUnitKilometer: pxr.Sdf.LengthUnit # value = Sdf.LengthUnitKilometer
LengthUnitMeter: pxr.Sdf.LengthUnit # value = Sdf.LengthUnitMeter
LengthUnitMile: pxr.Sdf.LengthUnit # value = Sdf.LengthUnitMile
LengthUnitMillimeter: pxr.Sdf.LengthUnit # value = Sdf.LengthUnitMillimeter
LengthUnitYard: pxr.Sdf.LengthUnit # value = Sdf.LengthUnitYard
ListOpTypeAdded: pxr.Sdf.ListOpType # value = Sdf.ListOpTypeAdded
ListOpTypeAppended: pxr.Sdf.ListOpType # value = Sdf.ListOpTypeAppended
ListOpTypeDeleted: pxr.Sdf.ListOpType # value = Sdf.ListOpTypeDeleted
ListOpTypeExplicit: pxr.Sdf.ListOpType # value = Sdf.ListOpTypeExplicit
ListOpTypeOrdered: pxr.Sdf.ListOpType # value = Sdf.ListOpTypeOrdered
ListOpTypePrepended: pxr.Sdf.ListOpType # value = Sdf.ListOpTypePrepended
PermissionPrivate: pxr.Sdf.Permission # value = Sdf.PermissionPrivate
PermissionPublic: pxr.Sdf.Permission # value = Sdf.PermissionPublic
SpecTypeAttribute: pxr.Sdf.SpecType # value = Sdf.SpecTypeAttribute
SpecTypeConnection: pxr.Sdf.SpecType # value = Sdf.SpecTypeConnection
SpecTypeExpression: pxr.Sdf.SpecType # value = Sdf.SpecTypeExpression
SpecTypeMapper: pxr.Sdf.SpecType # value = Sdf.SpecTypeMapper
SpecTypeMapperArg: pxr.Sdf.SpecType # value = Sdf.SpecTypeMapperArg
SpecTypePrim: pxr.Sdf.SpecType # value = Sdf.SpecTypePrim
SpecTypePseudoRoot: pxr.Sdf.SpecType # value = Sdf.SpecTypePseudoRoot
SpecTypeRelationship: pxr.Sdf.SpecType # value = Sdf.SpecTypeRelationship
SpecTypeRelationshipTarget: pxr.Sdf.SpecType # value = Sdf.SpecTypeRelationshipTarget
SpecTypeUnknown: pxr.Sdf.SpecType # value = Sdf.SpecTypeUnknown
SpecTypeVariant: pxr.Sdf.SpecType # value = Sdf.SpecTypeVariant
SpecTypeVariantSet: pxr.Sdf.SpecType # value = Sdf.SpecTypeVariantSet
SpecifierClass: pxr.Sdf.Specifier # value = Sdf.SpecifierClass
SpecifierDef: pxr.Sdf.Specifier # value = Sdf.SpecifierDef
SpecifierOver: pxr.Sdf.Specifier # value = Sdf.SpecifierOver
VariabilityUniform: pxr.Sdf.Variability # value = Sdf.VariabilityUniform
VariabilityVarying: pxr.Sdf.Variability # value = Sdf.VariabilityVarying
__MFB_FULL_PACKAGE_NAME = 'sdf'
| 192,206 | unknown | 27.047133 | 311 | 0.603483 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdUI/__init__.py | #
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
from pxr import Tf
Tf.PreparePythonModule()
del Tf
| 1,110 | Python | 40.148147 | 74 | 0.766667 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdUI/__DOC.py | def Execute(result):
result["Backdrop"].__doc__ = """
Provides a'group-box'for the purpose of node graph organization.
Unlike containers, backdrops do not store the Shader nodes inside of
them. Backdrops are an organizational tool that allows Shader nodes to
be visually grouped together in a node-graph UI, but there is no
direct relationship between a Shader node and a Backdrop.
The guideline for a node-graph UI is that a Shader node is considered
part of a Backdrop when the Backdrop is the smallest Backdrop a Shader
node's bounding-box fits inside.
Backdrop objects are contained inside a NodeGraph, similar to how
Shader objects are contained inside a NodeGraph.
Backdrops have no shading inputs or outputs that influence the
rendered results of a NodeGraph. Therefore they can be safely ignored
during import.
Like Shaders and NodeGraphs, Backdrops subscribe to the
NodeGraphNodeAPI to specify position and size.
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdUITokens. So to set an attribute to the value"rightHanded", use
UsdUITokens->rightHanded as the value.
"""
result["Backdrop"].__init__.func_doc = """__init__(prim)
Construct a UsdUIBackdrop on UsdPrim ``prim`` .
Equivalent to UsdUIBackdrop::Get (prim.GetStage(), prim.GetPath()) for
a *valid* ``prim`` , but will not immediately throw an error for an
invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdUIBackdrop on the prim held by ``schemaObj`` .
Should be preferred over UsdUIBackdrop (schemaObj.GetPrim()), as it
preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["Backdrop"].GetDescriptionAttr.func_doc = """GetDescriptionAttr() -> Attribute
The text label that is displayed on the backdrop in the node graph.
This help-description explains what the nodes in a backdrop do.
Declaration
``uniform token ui:description``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
"""
result["Backdrop"].CreateDescriptionAttr.func_doc = """CreateDescriptionAttr(defaultValue, writeSparsely) -> Attribute
See GetDescriptionAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Backdrop"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["Backdrop"].Get.func_doc = """**classmethod** Get(stage, path) -> Backdrop
Return a UsdUIBackdrop holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdUIBackdrop(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["Backdrop"].Define.func_doc = """**classmethod** Define(stage, path) -> Backdrop
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["Backdrop"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["NodeGraphNodeAPI"].__doc__ = """
This api helps storing information about nodes in node graphs.
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdUITokens. So to set an attribute to the value"rightHanded", use
UsdUITokens->rightHanded as the value.
"""
result["NodeGraphNodeAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdUINodeGraphNodeAPI on UsdPrim ``prim`` .
Equivalent to UsdUINodeGraphNodeAPI::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdUINodeGraphNodeAPI on the prim held by ``schemaObj`` .
Should be preferred over UsdUINodeGraphNodeAPI (schemaObj.GetPrim()),
as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["NodeGraphNodeAPI"].GetPosAttr.func_doc = """GetPosAttr() -> Attribute
Declared relative position to the parent in a node graph.
X is the horizontal position. Y is the vertical position. Higher
numbers correspond to lower positions (coordinates are Qt style, not
cartesian).
These positions are not explicitly meant in pixel space, but rather
assume that the size of a node is approximately 1.0x1.0. Where size-x
is the node width and size-y height of the node. Depending on graph UI
implementation, the size of a node may vary in each direction.
Example: If a node's width is 300 and it is position is at 1000, we
store for x-position: 1000 \\* (1.0/300)
Declaration
``uniform float2 ui:nodegraph:node:pos``
C++ Type
GfVec2f
Usd Type
SdfValueTypeNames->Float2
Variability
SdfVariabilityUniform
"""
result["NodeGraphNodeAPI"].CreatePosAttr.func_doc = """CreatePosAttr(defaultValue, writeSparsely) -> Attribute
See GetPosAttr() , and also Create vs Get Property Methods for when to
use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["NodeGraphNodeAPI"].GetStackingOrderAttr.func_doc = """GetStackingOrderAttr() -> Attribute
This optional value is a useful hint when an application cares about
the visibility of a node and whether each node overlaps another.
Nodes with lower stacking order values are meant to be drawn below
higher ones. Negative values are meant as background. Positive values
are meant as foreground. Undefined values should be treated as 0.
There are no set limits in these values.
Declaration
``uniform int ui:nodegraph:node:stackingOrder``
C++ Type
int
Usd Type
SdfValueTypeNames->Int
Variability
SdfVariabilityUniform
"""
result["NodeGraphNodeAPI"].CreateStackingOrderAttr.func_doc = """CreateStackingOrderAttr(defaultValue, writeSparsely) -> Attribute
See GetStackingOrderAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["NodeGraphNodeAPI"].GetDisplayColorAttr.func_doc = """GetDisplayColorAttr() -> Attribute
This hint defines what tint the node should have in the node graph.
Declaration
``uniform color3f ui:nodegraph:node:displayColor``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Color3f
Variability
SdfVariabilityUniform
"""
result["NodeGraphNodeAPI"].CreateDisplayColorAttr.func_doc = """CreateDisplayColorAttr(defaultValue, writeSparsely) -> Attribute
See GetDisplayColorAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["NodeGraphNodeAPI"].GetIconAttr.func_doc = """GetIconAttr() -> Attribute
This points to an image that should be displayed on the node.
It is intended to be useful for summary visual classification of
nodes, rather than a thumbnail preview of the computed result of the
node in some computational system.
Declaration
``uniform asset ui:nodegraph:node:icon``
C++ Type
SdfAssetPath
Usd Type
SdfValueTypeNames->Asset
Variability
SdfVariabilityUniform
"""
result["NodeGraphNodeAPI"].CreateIconAttr.func_doc = """CreateIconAttr(defaultValue, writeSparsely) -> Attribute
See GetIconAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["NodeGraphNodeAPI"].GetExpansionStateAttr.func_doc = """GetExpansionStateAttr() -> Attribute
The current expansionState of the node in the ui.
'open'= fully expanded'closed'= fully collapsed'minimized'= should
take the least space possible
Declaration
``uniform token ui:nodegraph:node:expansionState``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
open, closed, minimized
"""
result["NodeGraphNodeAPI"].CreateExpansionStateAttr.func_doc = """CreateExpansionStateAttr(defaultValue, writeSparsely) -> Attribute
See GetExpansionStateAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["NodeGraphNodeAPI"].GetSizeAttr.func_doc = """GetSizeAttr() -> Attribute
Optional size hint for a node in a node graph.
X is the width. Y is the height.
This value is optional, because node size is often determined based on
the number of in- and outputs of a node.
Declaration
``uniform float2 ui:nodegraph:node:size``
C++ Type
GfVec2f
Usd Type
SdfValueTypeNames->Float2
Variability
SdfVariabilityUniform
"""
result["NodeGraphNodeAPI"].CreateSizeAttr.func_doc = """CreateSizeAttr(defaultValue, writeSparsely) -> Attribute
See GetSizeAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["NodeGraphNodeAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["NodeGraphNodeAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> NodeGraphNodeAPI
Return a UsdUINodeGraphNodeAPI holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdUINodeGraphNodeAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["NodeGraphNodeAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["NodeGraphNodeAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> NodeGraphNodeAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"NodeGraphNodeAPI"to the token-
valued, listOp metadata *apiSchemas* on the prim.
A valid UsdUINodeGraphNodeAPI object is returned upon success. An
invalid (or empty) UsdUINodeGraphNodeAPI object is returned upon
failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["NodeGraphNodeAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["SceneGraphPrimAPI"].__doc__ = """
Utility schema for display properties of a prim
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdUITokens. So to set an attribute to the value"rightHanded", use
UsdUITokens->rightHanded as the value.
"""
result["SceneGraphPrimAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdUISceneGraphPrimAPI on UsdPrim ``prim`` .
Equivalent to UsdUISceneGraphPrimAPI::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdUISceneGraphPrimAPI on the prim held by ``schemaObj`` .
Should be preferred over UsdUISceneGraphPrimAPI (schemaObj.GetPrim()),
as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["SceneGraphPrimAPI"].GetDisplayNameAttr.func_doc = """GetDisplayNameAttr() -> Attribute
When publishing a nodegraph or a material, it can be useful to provide
an optional display name, for readability.
Declaration
``uniform token ui:displayName``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
"""
result["SceneGraphPrimAPI"].CreateDisplayNameAttr.func_doc = """CreateDisplayNameAttr(defaultValue, writeSparsely) -> Attribute
See GetDisplayNameAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["SceneGraphPrimAPI"].GetDisplayGroupAttr.func_doc = """GetDisplayGroupAttr() -> Attribute
When publishing a nodegraph or a material, it can be useful to provide
an optional display group, for organizational purposes and
readability.
This is because often the usd shading hierarchy is rather flat while
we want to display it in organized groups.
Declaration
``uniform token ui:displayGroup``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
"""
result["SceneGraphPrimAPI"].CreateDisplayGroupAttr.func_doc = """CreateDisplayGroupAttr(defaultValue, writeSparsely) -> Attribute
See GetDisplayGroupAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["SceneGraphPrimAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["SceneGraphPrimAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> SceneGraphPrimAPI
Return a UsdUISceneGraphPrimAPI holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdUISceneGraphPrimAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["SceneGraphPrimAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["SceneGraphPrimAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> SceneGraphPrimAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"SceneGraphPrimAPI"to the token-
valued, listOp metadata *apiSchemas* on the prim.
A valid UsdUISceneGraphPrimAPI object is returned upon success. An
invalid (or empty) UsdUISceneGraphPrimAPI object is returned upon
failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["SceneGraphPrimAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
""" | 19,636 | Python | 20.626652 | 143 | 0.733245 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdShaders/__init__.py | #
# Copyright 2018 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
# This file makes this module importable from python, which avoids a warning
# when initializing the SdrRegistry.
| 1,176 | Python | 41.035713 | 77 | 0.767007 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdPhysics/__init__.py | #
#====
# Copyright (c) 2018, NVIDIA CORPORATION
#======
#
#
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
from pxr import Tf
Tf.PreparePythonModule()
del Tf
| 1,172 | Python | 34.545453 | 74 | 0.75256 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdPhysics/__DOC.py | def Execute(result):
result["ArticulationRootAPI"].__doc__ = """
PhysicsArticulationRootAPI can be applied to a scene graph node, and
marks the subtree rooted here for inclusion in one or more reduced
coordinate articulations. For floating articulations, this should be
on the root body. For fixed articulations (robotics jargon for e.g. a
robot arm for welding that is bolted to the floor), this API can be on
a direct or indirect parent of the root joint which is connected to
the world, or on the joint itself\\.\\.
"""
result["ArticulationRootAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdPhysicsArticulationRootAPI on UsdPrim ``prim`` .
Equivalent to UsdPhysicsArticulationRootAPI::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdPhysicsArticulationRootAPI on the prim held by
``schemaObj`` .
Should be preferred over UsdPhysicsArticulationRootAPI
(schemaObj.GetPrim()), as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["ArticulationRootAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["ArticulationRootAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> ArticulationRootAPI
Return a UsdPhysicsArticulationRootAPI holding the prim adhering to
this schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsArticulationRootAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["ArticulationRootAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["ArticulationRootAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> ArticulationRootAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"PhysicsArticulationRootAPI"to the
token-valued, listOp metadata *apiSchemas* on the prim.
A valid UsdPhysicsArticulationRootAPI object is returned upon success.
An invalid (or empty) UsdPhysicsArticulationRootAPI object is returned
upon failure. See UsdPrim::ApplyAPI() for conditions resulting in
failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["ArticulationRootAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["CollisionAPI"].__doc__ = """
Applies collision attributes to a UsdGeomXformable prim. If a
simulation is running, this geometry will collide with other
geometries that have PhysicsCollisionAPI applied. If a prim in the
parent hierarchy has the RigidBodyAPI applied, this collider is a part
of that body. If there is no body in the parent hierarchy, this
collider is considered to be static.
"""
result["CollisionAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdPhysicsCollisionAPI on UsdPrim ``prim`` .
Equivalent to UsdPhysicsCollisionAPI::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdPhysicsCollisionAPI on the prim held by ``schemaObj`` .
Should be preferred over UsdPhysicsCollisionAPI (schemaObj.GetPrim()),
as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["CollisionAPI"].GetCollisionEnabledAttr.func_doc = """GetCollisionEnabledAttr() -> Attribute
Determines if the PhysicsCollisionAPI is enabled.
Declaration
``bool physics:collisionEnabled = 1``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
result["CollisionAPI"].CreateCollisionEnabledAttr.func_doc = """CreateCollisionEnabledAttr(defaultValue, writeSparsely) -> Attribute
See GetCollisionEnabledAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["CollisionAPI"].GetSimulationOwnerRel.func_doc = """GetSimulationOwnerRel() -> Relationship
Single PhysicsScene that will simulate this collider.
By default this object belongs to the first PhysicsScene. Note that if
a RigidBodyAPI in the hierarchy above has a different simulationOwner
then it has a precedence over this relationship.
"""
result["CollisionAPI"].CreateSimulationOwnerRel.func_doc = """CreateSimulationOwnerRel() -> Relationship
See GetSimulationOwnerRel() , and also Create vs Get Property Methods
for when to use Get vs Create.
"""
result["CollisionAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["CollisionAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> CollisionAPI
Return a UsdPhysicsCollisionAPI holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsCollisionAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["CollisionAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["CollisionAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> CollisionAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"PhysicsCollisionAPI"to the token-
valued, listOp metadata *apiSchemas* on the prim.
A valid UsdPhysicsCollisionAPI object is returned upon success. An
invalid (or empty) UsdPhysicsCollisionAPI object is returned upon
failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["CollisionAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["CollisionGroup"].__doc__ = """
Defines a collision group for coarse filtering. When a collision
occurs between two objects that have a PhysicsCollisionGroup assigned,
they will collide with each other unless this PhysicsCollisionGroup
pair is filtered. See filteredGroups attribute.
A CollectionAPI:colliders maintains a list of PhysicsCollisionAPI
rel-s that defines the members of this Collisiongroup.
"""
result["CollisionGroup"].__init__.func_doc = """__init__(prim)
Construct a UsdPhysicsCollisionGroup on UsdPrim ``prim`` .
Equivalent to UsdPhysicsCollisionGroup::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdPhysicsCollisionGroup on the prim held by ``schemaObj``
.
Should be preferred over UsdPhysicsCollisionGroup
(schemaObj.GetPrim()), as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["CollisionGroup"].GetMergeGroupNameAttr.func_doc = """GetMergeGroupNameAttr() -> Attribute
If non-empty, any collision groups in a stage with a matching
mergeGroup should be considered to refer to the same collection.
Matching collision groups should behave as if there were a single
group containing referenced colliders and filter groups from both
collections.
Declaration
``string physics:mergeGroup``
C++ Type
std::string
Usd Type
SdfValueTypeNames->String
"""
result["CollisionGroup"].CreateMergeGroupNameAttr.func_doc = """CreateMergeGroupNameAttr(defaultValue, writeSparsely) -> Attribute
See GetMergeGroupNameAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["CollisionGroup"].GetInvertFilteredGroupsAttr.func_doc = """GetInvertFilteredGroupsAttr() -> Attribute
Normally, the filter will disable collisions against the selected
filter groups.
However, if this option is set, the filter will disable collisions
against all colliders except for those in the selected filter groups.
Declaration
``bool physics:invertFilteredGroups``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
result["CollisionGroup"].CreateInvertFilteredGroupsAttr.func_doc = """CreateInvertFilteredGroupsAttr(defaultValue, writeSparsely) -> Attribute
See GetInvertFilteredGroupsAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["CollisionGroup"].GetFilteredGroupsRel.func_doc = """GetFilteredGroupsRel() -> Relationship
References a list of PhysicsCollisionGroups with which collisions
should be ignored.
"""
result["CollisionGroup"].CreateFilteredGroupsRel.func_doc = """CreateFilteredGroupsRel() -> Relationship
See GetFilteredGroupsRel() , and also Create vs Get Property Methods
for when to use Get vs Create.
"""
result["CollisionGroup"].GetCollidersCollectionAPI.func_doc = """GetCollidersCollectionAPI() -> CollectionAPI
Return the UsdCollectionAPI interface used for defining what colliders
belong to the CollisionGroup.
"""
result["CollisionGroup"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["CollisionGroup"].Get.func_doc = """**classmethod** Get(stage, path) -> CollisionGroup
Return a UsdPhysicsCollisionGroup holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsCollisionGroup(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["CollisionGroup"].Define.func_doc = """**classmethod** Define(stage, path) -> CollisionGroup
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["CollisionGroup"].ComputeCollisionGroupTable.func_doc = """**classmethod** ComputeCollisionGroupTable(stage) -> CollisionGroupTable
Compute a table encoding all the collision groups filter rules for a
stage.
This can be used as a reference to validate an implementation of the
collision groups filters. The returned table is diagonally symmetric.
Parameters
----------
stage : Stage
"""
result["CollisionGroup"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["DistanceJoint"].__doc__ = """
Predefined distance joint type (Distance between rigid bodies may be
limited to given minimum or maximum distance.)
"""
result["DistanceJoint"].__init__.func_doc = """__init__(prim)
Construct a UsdPhysicsDistanceJoint on UsdPrim ``prim`` .
Equivalent to UsdPhysicsDistanceJoint::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdPhysicsDistanceJoint on the prim held by ``schemaObj``
.
Should be preferred over UsdPhysicsDistanceJoint
(schemaObj.GetPrim()), as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["DistanceJoint"].GetMinDistanceAttr.func_doc = """GetMinDistanceAttr() -> Attribute
Minimum distance.
If attribute is negative, the joint is not limited. Units: distance.
Declaration
``float physics:minDistance = -1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["DistanceJoint"].CreateMinDistanceAttr.func_doc = """CreateMinDistanceAttr(defaultValue, writeSparsely) -> Attribute
See GetMinDistanceAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["DistanceJoint"].GetMaxDistanceAttr.func_doc = """GetMaxDistanceAttr() -> Attribute
Maximum distance.
If attribute is negative, the joint is not limited. Units: distance.
Declaration
``float physics:maxDistance = -1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["DistanceJoint"].CreateMaxDistanceAttr.func_doc = """CreateMaxDistanceAttr(defaultValue, writeSparsely) -> Attribute
See GetMaxDistanceAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["DistanceJoint"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["DistanceJoint"].Get.func_doc = """**classmethod** Get(stage, path) -> DistanceJoint
Return a UsdPhysicsDistanceJoint holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsDistanceJoint(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["DistanceJoint"].Define.func_doc = """**classmethod** Define(stage, path) -> DistanceJoint
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["DistanceJoint"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["DriveAPI"].__doc__ = """
The PhysicsDriveAPI when applied to any joint primitive will drive the
joint towards a given target. The PhysicsDriveAPI is a multipleApply
schema: drive can be set per
axis"transX","transY","transZ","rotX","rotY","rotZ"or its"linear"for
prismatic joint or"angular"for revolute joints. Setting these as a
multipleApply schema TfToken name will define the degree of freedom
the DriveAPI is applied to. Each drive is an implicit force-limited
damped spring: Force or acceleration = stiffness \\* (targetPosition -
position)
- damping \\* (targetVelocity - velocity)
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdPhysicsTokens. So to set an attribute to the value"rightHanded",
use UsdPhysicsTokens->rightHanded as the value.
"""
result["DriveAPI"].__init__.func_doc = """__init__(prim, name)
Construct a UsdPhysicsDriveAPI on UsdPrim ``prim`` with name ``name``
.
Equivalent to UsdPhysicsDriveAPI::Get ( prim.GetStage(),
prim.GetPath().AppendProperty("drive:name"));
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
name : str
----------------------------------------------------------------------
__init__(schemaObj, name)
Construct a UsdPhysicsDriveAPI on the prim held by ``schemaObj`` with
name ``name`` .
Should be preferred over UsdPhysicsDriveAPI (schemaObj.GetPrim(),
name), as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
name : str
"""
result["DriveAPI"].GetTypeAttr.func_doc = """GetTypeAttr() -> Attribute
Drive spring is for the acceleration at the joint (rather than the
force).
Declaration
``uniform token physics:type ="force"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
force, acceleration
"""
result["DriveAPI"].CreateTypeAttr.func_doc = """CreateTypeAttr(defaultValue, writeSparsely) -> Attribute
See GetTypeAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["DriveAPI"].GetMaxForceAttr.func_doc = """GetMaxForceAttr() -> Attribute
Maximum force that can be applied to drive.
Units: if linear drive: mass\\*DIST_UNITS/second/second if angular
drive: mass\\*DIST_UNITS\\*DIST_UNITS/second/second inf means not
limited. Must be non-negative.
Declaration
``float physics:maxForce = inf``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["DriveAPI"].CreateMaxForceAttr.func_doc = """CreateMaxForceAttr(defaultValue, writeSparsely) -> Attribute
See GetMaxForceAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["DriveAPI"].GetTargetPositionAttr.func_doc = """GetTargetPositionAttr() -> Attribute
Target value for position.
Units: if linear drive: distance if angular drive: degrees.
Declaration
``float physics:targetPosition = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["DriveAPI"].CreateTargetPositionAttr.func_doc = """CreateTargetPositionAttr(defaultValue, writeSparsely) -> Attribute
See GetTargetPositionAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["DriveAPI"].GetTargetVelocityAttr.func_doc = """GetTargetVelocityAttr() -> Attribute
Target value for velocity.
Units: if linear drive: distance/second if angular drive:
degrees/second.
Declaration
``float physics:targetVelocity = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["DriveAPI"].CreateTargetVelocityAttr.func_doc = """CreateTargetVelocityAttr(defaultValue, writeSparsely) -> Attribute
See GetTargetVelocityAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["DriveAPI"].GetDampingAttr.func_doc = """GetDampingAttr() -> Attribute
Damping of the drive.
Units: if linear drive: mass/second If angular drive:
mass\\*DIST_UNITS\\*DIST_UNITS/second/second/degrees.
Declaration
``float physics:damping = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["DriveAPI"].CreateDampingAttr.func_doc = """CreateDampingAttr(defaultValue, writeSparsely) -> Attribute
See GetDampingAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["DriveAPI"].GetStiffnessAttr.func_doc = """GetStiffnessAttr() -> Attribute
Stiffness of the drive.
Units: if linear drive: mass/second/second if angular drive:
mass\\*DIST_UNITS\\*DIST_UNITS/degree/second/second.
Declaration
``float physics:stiffness = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["DriveAPI"].CreateStiffnessAttr.func_doc = """CreateStiffnessAttr(defaultValue, writeSparsely) -> Attribute
See GetStiffnessAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["DriveAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
----------------------------------------------------------------------
GetSchemaAttributeNames(includeInherited, instanceName) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes for a given instance name.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved. The names returned will have the
proper namespace prefix.
Parameters
----------
includeInherited : bool
instanceName : str
"""
result["DriveAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> DriveAPI
Return a UsdPhysicsDriveAPI holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
``path`` must be of the format<path>.drive:name.
This is shorthand for the following:
.. code-block:: text
TfToken name = SdfPath::StripNamespace(path.GetToken());
UsdPhysicsDriveAPI(
stage->GetPrimAtPath(path.GetPrimPath()), name);
Parameters
----------
stage : Stage
path : Path
----------------------------------------------------------------------
Get(prim, name) -> DriveAPI
Return a UsdPhysicsDriveAPI with name ``name`` holding the prim
``prim`` .
Shorthand for UsdPhysicsDriveAPI(prim, name);
Parameters
----------
prim : Prim
name : str
"""
result["DriveAPI"].GetAll.func_doc = """**classmethod** GetAll(prim) -> list[DriveAPI]
Return a vector of all named instances of UsdPhysicsDriveAPI on the
given ``prim`` .
Parameters
----------
prim : Prim
"""
result["DriveAPI"].IsPhysicsDriveAPIPath.func_doc = """**classmethod** IsPhysicsDriveAPIPath(path, name) -> bool
Checks if the given path ``path`` is of an API schema of type
PhysicsDriveAPI.
If so, it stores the instance name of the schema in ``name`` and
returns true. Otherwise, it returns false.
Parameters
----------
path : Path
name : str
"""
result["DriveAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, name, whyNot) -> bool
Returns true if this **multiple-apply** API schema can be applied,
with the given instance name, ``name`` , to the given ``prim`` .
If this schema can not be a applied the prim, this returns false and,
if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
name : str
whyNot : str
"""
result["DriveAPI"].Apply.func_doc = """**classmethod** Apply(prim, name) -> DriveAPI
Applies this **multiple-apply** API schema to the given ``prim`` along
with the given instance name, ``name`` .
This information is stored by adding"PhysicsDriveAPI:<i>name</i>"to
the token-valued, listOp metadata *apiSchemas* on the prim. For
example, if ``name`` is'instance1', the
token'PhysicsDriveAPI:instance1'is added to'apiSchemas'.
A valid UsdPhysicsDriveAPI object is returned upon success. An invalid
(or empty) UsdPhysicsDriveAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
name : str
"""
result["DriveAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["FilteredPairsAPI"].__doc__ = """
API to describe fine-grained filtering. If a collision between two
objects occurs, this pair might be filtered if the pair is defined
through this API. This API can be applied either to a body or
collision or even articulation. The"filteredPairs"defines what objects
it should not collide against. Note that FilteredPairsAPI filtering
has precedence over CollisionGroup filtering.
"""
result["FilteredPairsAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdPhysicsFilteredPairsAPI on UsdPrim ``prim`` .
Equivalent to UsdPhysicsFilteredPairsAPI::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdPhysicsFilteredPairsAPI on the prim held by
``schemaObj`` .
Should be preferred over UsdPhysicsFilteredPairsAPI
(schemaObj.GetPrim()), as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["FilteredPairsAPI"].GetFilteredPairsRel.func_doc = """GetFilteredPairsRel() -> Relationship
Relationship to objects that should be filtered.
"""
result["FilteredPairsAPI"].CreateFilteredPairsRel.func_doc = """CreateFilteredPairsRel() -> Relationship
See GetFilteredPairsRel() , and also Create vs Get Property Methods
for when to use Get vs Create.
"""
result["FilteredPairsAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["FilteredPairsAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> FilteredPairsAPI
Return a UsdPhysicsFilteredPairsAPI holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsFilteredPairsAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["FilteredPairsAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["FilteredPairsAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> FilteredPairsAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"PhysicsFilteredPairsAPI"to the
token-valued, listOp metadata *apiSchemas* on the prim.
A valid UsdPhysicsFilteredPairsAPI object is returned upon success. An
invalid (or empty) UsdPhysicsFilteredPairsAPI object is returned upon
failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["FilteredPairsAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["FixedJoint"].__doc__ = """
Predefined fixed joint type (All degrees of freedom are removed.)
"""
result["FixedJoint"].__init__.func_doc = """__init__(prim)
Construct a UsdPhysicsFixedJoint on UsdPrim ``prim`` .
Equivalent to UsdPhysicsFixedJoint::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdPhysicsFixedJoint on the prim held by ``schemaObj`` .
Should be preferred over UsdPhysicsFixedJoint (schemaObj.GetPrim()),
as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["FixedJoint"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["FixedJoint"].Get.func_doc = """**classmethod** Get(stage, path) -> FixedJoint
Return a UsdPhysicsFixedJoint holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsFixedJoint(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["FixedJoint"].Define.func_doc = """**classmethod** Define(stage, path) -> FixedJoint
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["FixedJoint"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["Joint"].__doc__ = """
A joint constrains the movement of rigid bodies. Joint can be created
between two rigid bodies or between one rigid body and world. By
default joint primitive defines a D6 joint where all degrees of
freedom are free. Three linear and three angular degrees of freedom.
Note that default behavior is to disable collision between jointed
bodies.
"""
result["Joint"].__init__.func_doc = """__init__(prim)
Construct a UsdPhysicsJoint on UsdPrim ``prim`` .
Equivalent to UsdPhysicsJoint::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdPhysicsJoint on the prim held by ``schemaObj`` .
Should be preferred over UsdPhysicsJoint (schemaObj.GetPrim()), as it
preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["Joint"].GetLocalPos0Attr.func_doc = """GetLocalPos0Attr() -> Attribute
Relative position of the joint frame to body0's frame.
Declaration
``point3f physics:localPos0 = (0, 0, 0)``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Point3f
"""
result["Joint"].CreateLocalPos0Attr.func_doc = """CreateLocalPos0Attr(defaultValue, writeSparsely) -> Attribute
See GetLocalPos0Attr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Joint"].GetLocalRot0Attr.func_doc = """GetLocalRot0Attr() -> Attribute
Relative orientation of the joint frame to body0's frame.
Declaration
``quatf physics:localRot0 = (1, 0, 0, 0)``
C++ Type
GfQuatf
Usd Type
SdfValueTypeNames->Quatf
"""
result["Joint"].CreateLocalRot0Attr.func_doc = """CreateLocalRot0Attr(defaultValue, writeSparsely) -> Attribute
See GetLocalRot0Attr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Joint"].GetLocalPos1Attr.func_doc = """GetLocalPos1Attr() -> Attribute
Relative position of the joint frame to body1's frame.
Declaration
``point3f physics:localPos1 = (0, 0, 0)``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Point3f
"""
result["Joint"].CreateLocalPos1Attr.func_doc = """CreateLocalPos1Attr(defaultValue, writeSparsely) -> Attribute
See GetLocalPos1Attr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Joint"].GetLocalRot1Attr.func_doc = """GetLocalRot1Attr() -> Attribute
Relative orientation of the joint frame to body1's frame.
Declaration
``quatf physics:localRot1 = (1, 0, 0, 0)``
C++ Type
GfQuatf
Usd Type
SdfValueTypeNames->Quatf
"""
result["Joint"].CreateLocalRot1Attr.func_doc = """CreateLocalRot1Attr(defaultValue, writeSparsely) -> Attribute
See GetLocalRot1Attr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Joint"].GetJointEnabledAttr.func_doc = """GetJointEnabledAttr() -> Attribute
Determines if the joint is enabled.
Declaration
``bool physics:jointEnabled = 1``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
result["Joint"].CreateJointEnabledAttr.func_doc = """CreateJointEnabledAttr(defaultValue, writeSparsely) -> Attribute
See GetJointEnabledAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Joint"].GetCollisionEnabledAttr.func_doc = """GetCollisionEnabledAttr() -> Attribute
Determines if the jointed subtrees should collide or not.
Declaration
``bool physics:collisionEnabled = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
result["Joint"].CreateCollisionEnabledAttr.func_doc = """CreateCollisionEnabledAttr(defaultValue, writeSparsely) -> Attribute
See GetCollisionEnabledAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Joint"].GetExcludeFromArticulationAttr.func_doc = """GetExcludeFromArticulationAttr() -> Attribute
Determines if the joint can be included in an Articulation.
Declaration
``uniform bool physics:excludeFromArticulation = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
Variability
SdfVariabilityUniform
"""
result["Joint"].CreateExcludeFromArticulationAttr.func_doc = """CreateExcludeFromArticulationAttr(defaultValue, writeSparsely) -> Attribute
See GetExcludeFromArticulationAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Joint"].GetBreakForceAttr.func_doc = """GetBreakForceAttr() -> Attribute
Joint break force.
If set, joint is to break when this force limit is reached. (Used for
linear DOFs.) Units: mass \\* distance / second / second
Declaration
``float physics:breakForce = inf``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["Joint"].CreateBreakForceAttr.func_doc = """CreateBreakForceAttr(defaultValue, writeSparsely) -> Attribute
See GetBreakForceAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Joint"].GetBreakTorqueAttr.func_doc = """GetBreakTorqueAttr() -> Attribute
Joint break torque.
If set, joint is to break when this torque limit is reached. (Used for
angular DOFs.) Units: mass \\* distance \\* distance / second / second
Declaration
``float physics:breakTorque = inf``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["Joint"].CreateBreakTorqueAttr.func_doc = """CreateBreakTorqueAttr(defaultValue, writeSparsely) -> Attribute
See GetBreakTorqueAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Joint"].GetBody0Rel.func_doc = """GetBody0Rel() -> Relationship
Relationship to any UsdGeomXformable.
"""
result["Joint"].CreateBody0Rel.func_doc = """CreateBody0Rel() -> Relationship
See GetBody0Rel() , and also Create vs Get Property Methods for when
to use Get vs Create.
"""
result["Joint"].GetBody1Rel.func_doc = """GetBody1Rel() -> Relationship
Relationship to any UsdGeomXformable.
"""
result["Joint"].CreateBody1Rel.func_doc = """CreateBody1Rel() -> Relationship
See GetBody1Rel() , and also Create vs Get Property Methods for when
to use Get vs Create.
"""
result["Joint"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["Joint"].Get.func_doc = """**classmethod** Get(stage, path) -> Joint
Return a UsdPhysicsJoint holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsJoint(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["Joint"].Define.func_doc = """**classmethod** Define(stage, path) -> Joint
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["Joint"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["LimitAPI"].__doc__ = """
The PhysicsLimitAPI can be applied to a PhysicsJoint and will restrict
the movement along an axis. PhysicsLimitAPI is a multipleApply schema:
The PhysicsJoint can be restricted
along"transX","transY","transZ","rotX","rotY","rotZ","distance".
Setting these as a multipleApply schema TfToken name will define the
degree of freedom the PhysicsLimitAPI is applied to. Note that if the
low limit is higher than the high limit, motion along this axis is
considered locked.
"""
result["LimitAPI"].__init__.func_doc = """__init__(prim, name)
Construct a UsdPhysicsLimitAPI on UsdPrim ``prim`` with name ``name``
.
Equivalent to UsdPhysicsLimitAPI::Get ( prim.GetStage(),
prim.GetPath().AppendProperty("limit:name"));
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
name : str
----------------------------------------------------------------------
__init__(schemaObj, name)
Construct a UsdPhysicsLimitAPI on the prim held by ``schemaObj`` with
name ``name`` .
Should be preferred over UsdPhysicsLimitAPI (schemaObj.GetPrim(),
name), as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
name : str
"""
result["LimitAPI"].GetLowAttr.func_doc = """GetLowAttr() -> Attribute
Lower limit.
Units: degrees or distance depending on trans or rot axis applied to.
\\-inf means not limited in negative direction.
Declaration
``float physics:low = -inf``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["LimitAPI"].CreateLowAttr.func_doc = """CreateLowAttr(defaultValue, writeSparsely) -> Attribute
See GetLowAttr() , and also Create vs Get Property Methods for when to
use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["LimitAPI"].GetHighAttr.func_doc = """GetHighAttr() -> Attribute
Upper limit.
Units: degrees or distance depending on trans or rot axis applied to.
inf means not limited in positive direction.
Declaration
``float physics:high = inf``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["LimitAPI"].CreateHighAttr.func_doc = """CreateHighAttr(defaultValue, writeSparsely) -> Attribute
See GetHighAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["LimitAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
----------------------------------------------------------------------
GetSchemaAttributeNames(includeInherited, instanceName) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes for a given instance name.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved. The names returned will have the
proper namespace prefix.
Parameters
----------
includeInherited : bool
instanceName : str
"""
result["LimitAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> LimitAPI
Return a UsdPhysicsLimitAPI holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
``path`` must be of the format<path>.limit:name.
This is shorthand for the following:
.. code-block:: text
TfToken name = SdfPath::StripNamespace(path.GetToken());
UsdPhysicsLimitAPI(
stage->GetPrimAtPath(path.GetPrimPath()), name);
Parameters
----------
stage : Stage
path : Path
----------------------------------------------------------------------
Get(prim, name) -> LimitAPI
Return a UsdPhysicsLimitAPI with name ``name`` holding the prim
``prim`` .
Shorthand for UsdPhysicsLimitAPI(prim, name);
Parameters
----------
prim : Prim
name : str
"""
result["LimitAPI"].GetAll.func_doc = """**classmethod** GetAll(prim) -> list[LimitAPI]
Return a vector of all named instances of UsdPhysicsLimitAPI on the
given ``prim`` .
Parameters
----------
prim : Prim
"""
result["LimitAPI"].IsPhysicsLimitAPIPath.func_doc = """**classmethod** IsPhysicsLimitAPIPath(path, name) -> bool
Checks if the given path ``path`` is of an API schema of type
PhysicsLimitAPI.
If so, it stores the instance name of the schema in ``name`` and
returns true. Otherwise, it returns false.
Parameters
----------
path : Path
name : str
"""
result["LimitAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, name, whyNot) -> bool
Returns true if this **multiple-apply** API schema can be applied,
with the given instance name, ``name`` , to the given ``prim`` .
If this schema can not be a applied the prim, this returns false and,
if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
name : str
whyNot : str
"""
result["LimitAPI"].Apply.func_doc = """**classmethod** Apply(prim, name) -> LimitAPI
Applies this **multiple-apply** API schema to the given ``prim`` along
with the given instance name, ``name`` .
This information is stored by adding"PhysicsLimitAPI:<i>name</i>"to
the token-valued, listOp metadata *apiSchemas* on the prim. For
example, if ``name`` is'instance1', the
token'PhysicsLimitAPI:instance1'is added to'apiSchemas'.
A valid UsdPhysicsLimitAPI object is returned upon success. An invalid
(or empty) UsdPhysicsLimitAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
name : str
"""
result["LimitAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["MassAPI"].__doc__ = """
Defines explicit mass properties (mass, density, inertia etc.).
MassAPI can be applied to any object that has a PhysicsCollisionAPI or
a PhysicsRigidBodyAPI.
"""
result["MassAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdPhysicsMassAPI on UsdPrim ``prim`` .
Equivalent to UsdPhysicsMassAPI::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdPhysicsMassAPI on the prim held by ``schemaObj`` .
Should be preferred over UsdPhysicsMassAPI (schemaObj.GetPrim()), as
it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["MassAPI"].GetMassAttr.func_doc = """GetMassAttr() -> Attribute
If non-zero, directly specifies the mass of the object.
Note that any child prim can also have a mass when they apply massAPI.
In this case, the precedence rule is'parent mass overrides the
child's'. This may come as counter-intuitive, but mass is a computed
quantity and in general not accumulative. For example, if a parent has
mass of 10, and one of two children has mass of 20, allowing child's
mass to override its parent results in a mass of -10 for the other
child. Note if mass is 0.0 it is ignored. Units: mass.
Declaration
``float physics:mass = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["MassAPI"].CreateMassAttr.func_doc = """CreateMassAttr(defaultValue, writeSparsely) -> Attribute
See GetMassAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["MassAPI"].GetDensityAttr.func_doc = """GetDensityAttr() -> Attribute
If non-zero, specifies the density of the object.
In the context of rigid body physics, density indirectly results in
setting mass via (mass = density x volume of the object). How the
volume is computed is up to implementation of the physics system. It
is generally computed from the collision approximation rather than the
graphical mesh. In the case where both density and mass are specified
for the same object, mass has precedence over density. Unlike mass,
child's prim's density overrides parent prim's density as it is
accumulative. Note that density of a collisionAPI can be also
alternatively set through a PhysicsMaterialAPI. The material density
has the weakest precedence in density definition. Note if density is
0.0 it is ignored. Units: mass/distance/distance/distance.
Declaration
``float physics:density = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["MassAPI"].CreateDensityAttr.func_doc = """CreateDensityAttr(defaultValue, writeSparsely) -> Attribute
See GetDensityAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["MassAPI"].GetCenterOfMassAttr.func_doc = """GetCenterOfMassAttr() -> Attribute
Center of mass in the prim's local space.
Units: distance.
Declaration
``point3f physics:centerOfMass = (-inf, -inf, -inf)``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Point3f
"""
result["MassAPI"].CreateCenterOfMassAttr.func_doc = """CreateCenterOfMassAttr(defaultValue, writeSparsely) -> Attribute
See GetCenterOfMassAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["MassAPI"].GetDiagonalInertiaAttr.func_doc = """GetDiagonalInertiaAttr() -> Attribute
If non-zero, specifies diagonalized inertia tensor along the principal
axes.
Note if diagonalInertial is (0.0, 0.0, 0.0) it is ignored. Units:
mass\\*distance\\*distance.
Declaration
``float3 physics:diagonalInertia = (0, 0, 0)``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Float3
"""
result["MassAPI"].CreateDiagonalInertiaAttr.func_doc = """CreateDiagonalInertiaAttr(defaultValue, writeSparsely) -> Attribute
See GetDiagonalInertiaAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["MassAPI"].GetPrincipalAxesAttr.func_doc = """GetPrincipalAxesAttr() -> Attribute
Orientation of the inertia tensor's principal axes in the prim's local
space.
Declaration
``quatf physics:principalAxes = (0, 0, 0, 0)``
C++ Type
GfQuatf
Usd Type
SdfValueTypeNames->Quatf
"""
result["MassAPI"].CreatePrincipalAxesAttr.func_doc = """CreatePrincipalAxesAttr(defaultValue, writeSparsely) -> Attribute
See GetPrincipalAxesAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["MassAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["MassAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> MassAPI
Return a UsdPhysicsMassAPI holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsMassAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["MassAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["MassAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> MassAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"PhysicsMassAPI"to the token-
valued, listOp metadata *apiSchemas* on the prim.
A valid UsdPhysicsMassAPI object is returned upon success. An invalid
(or empty) UsdPhysicsMassAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["MassAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["MassUnits"].__doc__ = """
Container class for static double-precision symbols representing
common mass units of measure expressed in kilograms.
"""
result["MaterialAPI"].__doc__ = """
Adds simulation material properties to a Material. All collisions that
have a relationship to this material will have their collision
response defined through this material.
"""
result["MaterialAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdPhysicsMaterialAPI on UsdPrim ``prim`` .
Equivalent to UsdPhysicsMaterialAPI::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdPhysicsMaterialAPI on the prim held by ``schemaObj`` .
Should be preferred over UsdPhysicsMaterialAPI (schemaObj.GetPrim()),
as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["MaterialAPI"].GetDynamicFrictionAttr.func_doc = """GetDynamicFrictionAttr() -> Attribute
Dynamic friction coefficient.
Unitless.
Declaration
``float physics:dynamicFriction = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["MaterialAPI"].CreateDynamicFrictionAttr.func_doc = """CreateDynamicFrictionAttr(defaultValue, writeSparsely) -> Attribute
See GetDynamicFrictionAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["MaterialAPI"].GetStaticFrictionAttr.func_doc = """GetStaticFrictionAttr() -> Attribute
Static friction coefficient.
Unitless.
Declaration
``float physics:staticFriction = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["MaterialAPI"].CreateStaticFrictionAttr.func_doc = """CreateStaticFrictionAttr(defaultValue, writeSparsely) -> Attribute
See GetStaticFrictionAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["MaterialAPI"].GetRestitutionAttr.func_doc = """GetRestitutionAttr() -> Attribute
Restitution coefficient.
Unitless.
Declaration
``float physics:restitution = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["MaterialAPI"].CreateRestitutionAttr.func_doc = """CreateRestitutionAttr(defaultValue, writeSparsely) -> Attribute
See GetRestitutionAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["MaterialAPI"].GetDensityAttr.func_doc = """GetDensityAttr() -> Attribute
If non-zero, defines the density of the material.
This can be used for body mass computation, see PhysicsMassAPI. Note
that if the density is 0.0 it is ignored. Units:
mass/distance/distance/distance.
Declaration
``float physics:density = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["MaterialAPI"].CreateDensityAttr.func_doc = """CreateDensityAttr(defaultValue, writeSparsely) -> Attribute
See GetDensityAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["MaterialAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["MaterialAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> MaterialAPI
Return a UsdPhysicsMaterialAPI holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsMaterialAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["MaterialAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["MaterialAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> MaterialAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"PhysicsMaterialAPI"to the token-
valued, listOp metadata *apiSchemas* on the prim.
A valid UsdPhysicsMaterialAPI object is returned upon success. An
invalid (or empty) UsdPhysicsMaterialAPI object is returned upon
failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["MaterialAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["MeshCollisionAPI"].__doc__ = """
Attributes to control how a Mesh is made into a collider. Can be
applied to only a USDGeomMesh in addition to its PhysicsCollisionAPI.
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdPhysicsTokens. So to set an attribute to the value"rightHanded",
use UsdPhysicsTokens->rightHanded as the value.
"""
result["MeshCollisionAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdPhysicsMeshCollisionAPI on UsdPrim ``prim`` .
Equivalent to UsdPhysicsMeshCollisionAPI::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdPhysicsMeshCollisionAPI on the prim held by
``schemaObj`` .
Should be preferred over UsdPhysicsMeshCollisionAPI
(schemaObj.GetPrim()), as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["MeshCollisionAPI"].GetApproximationAttr.func_doc = """GetApproximationAttr() -> Attribute
Determines the mesh's collision approximation:"none"- The mesh
geometry is used directly as a collider without any approximation.
"convexDecomposition"- A convex mesh decomposition is performed. This
results in a set of convex mesh colliders."convexHull"- A convex hull
of the mesh is generated and used as the collider."boundingSphere"- A
bounding sphere is computed around the mesh and used as a
collider."boundingCube"- An optimally fitting box collider is computed
around the mesh."meshSimplification"- A mesh simplification step is
performed, resulting in a simplified triangle mesh collider.
Declaration
``uniform token physics:approximation ="none"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
none, convexDecomposition, convexHull, boundingSphere, boundingCube,
meshSimplification
"""
result["MeshCollisionAPI"].CreateApproximationAttr.func_doc = """CreateApproximationAttr(defaultValue, writeSparsely) -> Attribute
See GetApproximationAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["MeshCollisionAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["MeshCollisionAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> MeshCollisionAPI
Return a UsdPhysicsMeshCollisionAPI holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsMeshCollisionAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["MeshCollisionAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["MeshCollisionAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> MeshCollisionAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"PhysicsMeshCollisionAPI"to the
token-valued, listOp metadata *apiSchemas* on the prim.
A valid UsdPhysicsMeshCollisionAPI object is returned upon success. An
invalid (or empty) UsdPhysicsMeshCollisionAPI object is returned upon
failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["MeshCollisionAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["PrismaticJoint"].__doc__ = """
Predefined prismatic joint type (translation along prismatic joint
axis is permitted.)
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdPhysicsTokens. So to set an attribute to the value"rightHanded",
use UsdPhysicsTokens->rightHanded as the value.
"""
result["PrismaticJoint"].__init__.func_doc = """__init__(prim)
Construct a UsdPhysicsPrismaticJoint on UsdPrim ``prim`` .
Equivalent to UsdPhysicsPrismaticJoint::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdPhysicsPrismaticJoint on the prim held by ``schemaObj``
.
Should be preferred over UsdPhysicsPrismaticJoint
(schemaObj.GetPrim()), as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["PrismaticJoint"].GetAxisAttr.func_doc = """GetAxisAttr() -> Attribute
Joint axis.
Declaration
``uniform token physics:axis ="X"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
X, Y, Z
"""
result["PrismaticJoint"].CreateAxisAttr.func_doc = """CreateAxisAttr(defaultValue, writeSparsely) -> Attribute
See GetAxisAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["PrismaticJoint"].GetLowerLimitAttr.func_doc = """GetLowerLimitAttr() -> Attribute
Lower limit.
Units: distance. -inf means not limited in negative direction.
Declaration
``float physics:lowerLimit = -inf``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["PrismaticJoint"].CreateLowerLimitAttr.func_doc = """CreateLowerLimitAttr(defaultValue, writeSparsely) -> Attribute
See GetLowerLimitAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["PrismaticJoint"].GetUpperLimitAttr.func_doc = """GetUpperLimitAttr() -> Attribute
Upper limit.
Units: distance. inf means not limited in positive direction.
Declaration
``float physics:upperLimit = inf``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["PrismaticJoint"].CreateUpperLimitAttr.func_doc = """CreateUpperLimitAttr(defaultValue, writeSparsely) -> Attribute
See GetUpperLimitAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["PrismaticJoint"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["PrismaticJoint"].Get.func_doc = """**classmethod** Get(stage, path) -> PrismaticJoint
Return a UsdPhysicsPrismaticJoint holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsPrismaticJoint(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["PrismaticJoint"].Define.func_doc = """**classmethod** Define(stage, path) -> PrismaticJoint
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["PrismaticJoint"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["RevoluteJoint"].__doc__ = """
Predefined revolute joint type (rotation along revolute joint axis is
permitted.)
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdPhysicsTokens. So to set an attribute to the value"rightHanded",
use UsdPhysicsTokens->rightHanded as the value.
"""
result["RevoluteJoint"].__init__.func_doc = """__init__(prim)
Construct a UsdPhysicsRevoluteJoint on UsdPrim ``prim`` .
Equivalent to UsdPhysicsRevoluteJoint::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdPhysicsRevoluteJoint on the prim held by ``schemaObj``
.
Should be preferred over UsdPhysicsRevoluteJoint
(schemaObj.GetPrim()), as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["RevoluteJoint"].GetAxisAttr.func_doc = """GetAxisAttr() -> Attribute
Joint axis.
Declaration
``uniform token physics:axis ="X"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
X, Y, Z
"""
result["RevoluteJoint"].CreateAxisAttr.func_doc = """CreateAxisAttr(defaultValue, writeSparsely) -> Attribute
See GetAxisAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["RevoluteJoint"].GetLowerLimitAttr.func_doc = """GetLowerLimitAttr() -> Attribute
Lower limit.
Units: degrees. -inf means not limited in negative direction.
Declaration
``float physics:lowerLimit = -inf``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["RevoluteJoint"].CreateLowerLimitAttr.func_doc = """CreateLowerLimitAttr(defaultValue, writeSparsely) -> Attribute
See GetLowerLimitAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["RevoluteJoint"].GetUpperLimitAttr.func_doc = """GetUpperLimitAttr() -> Attribute
Upper limit.
Units: degrees. inf means not limited in positive direction.
Declaration
``float physics:upperLimit = inf``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["RevoluteJoint"].CreateUpperLimitAttr.func_doc = """CreateUpperLimitAttr(defaultValue, writeSparsely) -> Attribute
See GetUpperLimitAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["RevoluteJoint"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["RevoluteJoint"].Get.func_doc = """**classmethod** Get(stage, path) -> RevoluteJoint
Return a UsdPhysicsRevoluteJoint holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsRevoluteJoint(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["RevoluteJoint"].Define.func_doc = """**classmethod** Define(stage, path) -> RevoluteJoint
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["RevoluteJoint"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["RigidBodyAPI"].__doc__ = """
Applies physics body attributes to any UsdGeomXformable prim and marks
that prim to be driven by a simulation. If a simulation is running it
will update this prim's pose. All prims in the hierarchy below this
prim should move accordingly.
"""
result["RigidBodyAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdPhysicsRigidBodyAPI on UsdPrim ``prim`` .
Equivalent to UsdPhysicsRigidBodyAPI::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdPhysicsRigidBodyAPI on the prim held by ``schemaObj`` .
Should be preferred over UsdPhysicsRigidBodyAPI (schemaObj.GetPrim()),
as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["RigidBodyAPI"].GetRigidBodyEnabledAttr.func_doc = """GetRigidBodyEnabledAttr() -> Attribute
Determines if this PhysicsRigidBodyAPI is enabled.
Declaration
``bool physics:rigidBodyEnabled = 1``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
result["RigidBodyAPI"].CreateRigidBodyEnabledAttr.func_doc = """CreateRigidBodyEnabledAttr(defaultValue, writeSparsely) -> Attribute
See GetRigidBodyEnabledAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["RigidBodyAPI"].GetKinematicEnabledAttr.func_doc = """GetKinematicEnabledAttr() -> Attribute
Determines whether the body is kinematic or not.
A kinematic body is a body that is moved through animated poses or
through user defined poses. The simulation derives velocities for the
kinematic body based on the external motion. When a continuous motion
is not desired, this kinematic flag should be set to false.
Declaration
``bool physics:kinematicEnabled = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
result["RigidBodyAPI"].CreateKinematicEnabledAttr.func_doc = """CreateKinematicEnabledAttr(defaultValue, writeSparsely) -> Attribute
See GetKinematicEnabledAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["RigidBodyAPI"].GetStartsAsleepAttr.func_doc = """GetStartsAsleepAttr() -> Attribute
Determines if the body is asleep when the simulation starts.
Declaration
``uniform bool physics:startsAsleep = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
Variability
SdfVariabilityUniform
"""
result["RigidBodyAPI"].CreateStartsAsleepAttr.func_doc = """CreateStartsAsleepAttr(defaultValue, writeSparsely) -> Attribute
See GetStartsAsleepAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["RigidBodyAPI"].GetVelocityAttr.func_doc = """GetVelocityAttr() -> Attribute
Linear velocity in the same space as the node's xform.
Units: distance/second.
Declaration
``vector3f physics:velocity = (0, 0, 0)``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Vector3f
"""
result["RigidBodyAPI"].CreateVelocityAttr.func_doc = """CreateVelocityAttr(defaultValue, writeSparsely) -> Attribute
See GetVelocityAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["RigidBodyAPI"].GetAngularVelocityAttr.func_doc = """GetAngularVelocityAttr() -> Attribute
Angular velocity in the same space as the node's xform.
Units: degrees/second.
Declaration
``vector3f physics:angularVelocity = (0, 0, 0)``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Vector3f
"""
result["RigidBodyAPI"].CreateAngularVelocityAttr.func_doc = """CreateAngularVelocityAttr(defaultValue, writeSparsely) -> Attribute
See GetAngularVelocityAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["RigidBodyAPI"].GetSimulationOwnerRel.func_doc = """GetSimulationOwnerRel() -> Relationship
Single PhysicsScene that will simulate this body.
By default this is the first PhysicsScene found in the stage using
UsdStage::Traverse() .
"""
result["RigidBodyAPI"].CreateSimulationOwnerRel.func_doc = """CreateSimulationOwnerRel() -> Relationship
See GetSimulationOwnerRel() , and also Create vs Get Property Methods
for when to use Get vs Create.
"""
result["RigidBodyAPI"].ComputeMassProperties.func_doc = """ComputeMassProperties(diagonalInertia, com, principalAxes, massInfoFn) -> float
Compute mass properties of the rigid body ``diagonalInertia`` Computed
diagonal of the inertial tensor for the rigid body.
``com`` Computed center of mass for the rigid body. ``principalAxes``
Inertia tensor's principal axes orienttion for the rigid body.
``massInfoFn`` Callback function to get collision mass information.
Computed mass of the rigid body
Parameters
----------
diagonalInertia : Vec3f
com : Vec3f
principalAxes : Quatf
massInfoFn : MassInformationFn
"""
result["RigidBodyAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["RigidBodyAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> RigidBodyAPI
Return a UsdPhysicsRigidBodyAPI holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsRigidBodyAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["RigidBodyAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["RigidBodyAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> RigidBodyAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"PhysicsRigidBodyAPI"to the token-
valued, listOp metadata *apiSchemas* on the prim.
A valid UsdPhysicsRigidBodyAPI object is returned upon success. An
invalid (or empty) UsdPhysicsRigidBodyAPI object is returned upon
failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["RigidBodyAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["Scene"].__doc__ = """
General physics simulation properties, required for simulation.
"""
result["Scene"].__init__.func_doc = """__init__(prim)
Construct a UsdPhysicsScene on UsdPrim ``prim`` .
Equivalent to UsdPhysicsScene::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdPhysicsScene on the prim held by ``schemaObj`` .
Should be preferred over UsdPhysicsScene (schemaObj.GetPrim()), as it
preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["Scene"].GetGravityDirectionAttr.func_doc = """GetGravityDirectionAttr() -> Attribute
Gravity direction vector in simulation world space.
Will be normalized before use. A zero vector is a request to use the
negative upAxis. Unitless.
Declaration
``vector3f physics:gravityDirection = (0, 0, 0)``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Vector3f
"""
result["Scene"].CreateGravityDirectionAttr.func_doc = """CreateGravityDirectionAttr(defaultValue, writeSparsely) -> Attribute
See GetGravityDirectionAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Scene"].GetGravityMagnitudeAttr.func_doc = """GetGravityMagnitudeAttr() -> Attribute
Gravity acceleration magnitude in simulation world space.
A negative value is a request to use a value equivalent to earth
gravity regardless of the metersPerUnit scaling used by this scene.
Units: distance/second/second.
Declaration
``float physics:gravityMagnitude = -inf``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["Scene"].CreateGravityMagnitudeAttr.func_doc = """CreateGravityMagnitudeAttr(defaultValue, writeSparsely) -> Attribute
See GetGravityMagnitudeAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Scene"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["Scene"].Get.func_doc = """**classmethod** Get(stage, path) -> Scene
Return a UsdPhysicsScene holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsScene(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["Scene"].Define.func_doc = """**classmethod** Define(stage, path) -> Scene
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["Scene"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["SphericalJoint"].__doc__ = """
Predefined spherical joint type (Removes linear degrees of freedom,
cone limit may restrict the motion in a given range.) It allows two
limit values, which when equal create a circular, else an elliptic
cone limit around the limit axis.
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdPhysicsTokens. So to set an attribute to the value"rightHanded",
use UsdPhysicsTokens->rightHanded as the value.
"""
result["SphericalJoint"].__init__.func_doc = """__init__(prim)
Construct a UsdPhysicsSphericalJoint on UsdPrim ``prim`` .
Equivalent to UsdPhysicsSphericalJoint::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdPhysicsSphericalJoint on the prim held by ``schemaObj``
.
Should be preferred over UsdPhysicsSphericalJoint
(schemaObj.GetPrim()), as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["SphericalJoint"].GetAxisAttr.func_doc = """GetAxisAttr() -> Attribute
Cone limit axis.
Declaration
``uniform token physics:axis ="X"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
X, Y, Z
"""
result["SphericalJoint"].CreateAxisAttr.func_doc = """CreateAxisAttr(defaultValue, writeSparsely) -> Attribute
See GetAxisAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["SphericalJoint"].GetConeAngle0LimitAttr.func_doc = """GetConeAngle0LimitAttr() -> Attribute
Cone limit from the primary joint axis in the local0 frame toward the
next axis.
(Next axis of X is Y, and of Z is X.) A negative value means not
limited. Units: degrees.
Declaration
``float physics:coneAngle0Limit = -1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["SphericalJoint"].CreateConeAngle0LimitAttr.func_doc = """CreateConeAngle0LimitAttr(defaultValue, writeSparsely) -> Attribute
See GetConeAngle0LimitAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["SphericalJoint"].GetConeAngle1LimitAttr.func_doc = """GetConeAngle1LimitAttr() -> Attribute
Cone limit from the primary joint axis in the local0 frame toward the
second to next axis.
A negative value means not limited. Units: degrees.
Declaration
``float physics:coneAngle1Limit = -1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["SphericalJoint"].CreateConeAngle1LimitAttr.func_doc = """CreateConeAngle1LimitAttr(defaultValue, writeSparsely) -> Attribute
See GetConeAngle1LimitAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["SphericalJoint"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["SphericalJoint"].Get.func_doc = """**classmethod** Get(stage, path) -> SphericalJoint
Return a UsdPhysicsSphericalJoint holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsSphericalJoint(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["SphericalJoint"].Define.func_doc = """**classmethod** Define(stage, path) -> SphericalJoint
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["SphericalJoint"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
""" | 104,653 | Python | 20.249543 | 145 | 0.721862 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdPhysics/__init__.pyi | from __future__ import annotations
import pxr.UsdPhysics._usdPhysics
import typing
import Boost.Python
import pxr.Usd
import pxr.UsdGeom
import pxr.UsdPhysics
__all__ = [
"ArticulationRootAPI",
"CollisionAPI",
"CollisionGroup",
"CollisionGroupTable",
"DistanceJoint",
"DriveAPI",
"FilteredPairsAPI",
"FixedJoint",
"GetStageKilogramsPerUnit",
"Joint",
"LimitAPI",
"MassAPI",
"MassUnits",
"MassUnitsAre",
"MaterialAPI",
"MeshCollisionAPI",
"PrismaticJoint",
"RevoluteJoint",
"RigidBodyAPI",
"Scene",
"SetStageKilogramsPerUnit",
"SphericalJoint",
"StageHasAuthoredKilogramsPerUnit",
"Tokens"
]
class ArticulationRootAPI(pxr.Usd.APISchemaBase, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
PhysicsArticulationRootAPI can be applied to a scene graph node, and
marks the subtree rooted here for inclusion in one or more reduced
coordinate articulations. For floating articulations, this should be
on the root body. For fixed articulations (robotics jargon for e.g. a
robot arm for welding that is bolted to the floor), this API can be on
a direct or indirect parent of the root joint which is connected to
the world, or on the joint itself\.\.
"""
@staticmethod
def Apply(*args, **kwargs) -> None:
"""
**classmethod** Apply(prim) -> ArticulationRootAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"PhysicsArticulationRootAPI"to the
token-valued, listOp metadata *apiSchemas* on the prim.
A valid UsdPhysicsArticulationRootAPI object is returned upon success.
An invalid (or empty) UsdPhysicsArticulationRootAPI object is returned
upon failure. See UsdPrim::ApplyAPI() for conditions resulting in
failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
@staticmethod
def CanApply(*args, **kwargs) -> None:
"""
**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> ArticulationRootAPI
Return a UsdPhysicsArticulationRootAPI holding the prim adhering to
this schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsArticulationRootAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 48
pass
class CollisionAPI(pxr.Usd.APISchemaBase, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Applies collision attributes to a UsdGeomXformable prim. If a
simulation is running, this geometry will collide with other
geometries that have PhysicsCollisionAPI applied. If a prim in the
parent hierarchy has the RigidBodyAPI applied, this collider is a part
of that body. If there is no body in the parent hierarchy, this
collider is considered to be static.
"""
@staticmethod
def Apply(*args, **kwargs) -> None:
"""
**classmethod** Apply(prim) -> CollisionAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"PhysicsCollisionAPI"to the token-
valued, listOp metadata *apiSchemas* on the prim.
A valid UsdPhysicsCollisionAPI object is returned upon success. An
invalid (or empty) UsdPhysicsCollisionAPI object is returned upon
failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
@staticmethod
def CanApply(*args, **kwargs) -> None:
"""
**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
@staticmethod
def CreateCollisionEnabledAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateCollisionEnabledAttr(defaultValue, writeSparsely) -> Attribute
See GetCollisionEnabledAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateSimulationOwnerRel() -> Relationship:
"""
CreateSimulationOwnerRel() -> Relationship
See GetSimulationOwnerRel() , and also Create vs Get Property Methods
for when to use Get vs Create.
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> CollisionAPI
Return a UsdPhysicsCollisionAPI holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsCollisionAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetCollisionEnabledAttr() -> Attribute:
"""
GetCollisionEnabledAttr() -> Attribute
Determines if the PhysicsCollisionAPI is enabled.
Declaration
``bool physics:collisionEnabled = 1``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def GetSimulationOwnerRel() -> Relationship:
"""
GetSimulationOwnerRel() -> Relationship
Single PhysicsScene that will simulate this collider.
By default this object belongs to the first PhysicsScene. Note that if
a RigidBodyAPI in the hierarchy above has a different simulationOwner
then it has a precedence over this relationship.
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 48
pass
class CollisionGroup(pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Defines a collision group for coarse filtering. When a collision
occurs between two objects that have a PhysicsCollisionGroup assigned,
they will collide with each other unless this PhysicsCollisionGroup
pair is filtered. See filteredGroups attribute.
A CollectionAPI:colliders maintains a list of PhysicsCollisionAPI
rel-s that defines the members of this Collisiongroup.
"""
@staticmethod
def ComputeCollisionGroupTable(*args, **kwargs) -> None:
"""
**classmethod** ComputeCollisionGroupTable(stage) -> CollisionGroupTable
Compute a table encoding all the collision groups filter rules for a
stage.
This can be used as a reference to validate an implementation of the
collision groups filters. The returned table is diagonally symmetric.
Parameters
----------
stage : Stage
"""
@staticmethod
def CreateFilteredGroupsRel() -> Relationship:
"""
CreateFilteredGroupsRel() -> Relationship
See GetFilteredGroupsRel() , and also Create vs Get Property Methods
for when to use Get vs Create.
"""
@staticmethod
def CreateInvertFilteredGroupsAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateInvertFilteredGroupsAttr(defaultValue, writeSparsely) -> Attribute
See GetInvertFilteredGroupsAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateMergeGroupNameAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateMergeGroupNameAttr(defaultValue, writeSparsely) -> Attribute
See GetMergeGroupNameAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> CollisionGroup
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> CollisionGroup
Return a UsdPhysicsCollisionGroup holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsCollisionGroup(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetCollidersCollectionAPI() -> CollectionAPI:
"""
GetCollidersCollectionAPI() -> CollectionAPI
Return the UsdCollectionAPI interface used for defining what colliders
belong to the CollisionGroup.
"""
@staticmethod
def GetFilteredGroupsRel() -> Relationship:
"""
GetFilteredGroupsRel() -> Relationship
References a list of PhysicsCollisionGroups with which collisions
should be ignored.
"""
@staticmethod
def GetInvertFilteredGroupsAttr() -> Attribute:
"""
GetInvertFilteredGroupsAttr() -> Attribute
Normally, the filter will disable collisions against the selected
filter groups.
However, if this option is set, the filter will disable collisions
against all colliders except for those in the selected filter groups.
Declaration
``bool physics:invertFilteredGroups``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
@staticmethod
def GetMergeGroupNameAttr() -> Attribute:
"""
GetMergeGroupNameAttr() -> Attribute
If non-empty, any collision groups in a stage with a matching
mergeGroup should be considered to refer to the same collection.
Matching collision groups should behave as if there were a single
group containing referenced colliders and filter groups from both
collections.
Declaration
``string physics:mergeGroup``
C++ Type
std::string
Usd Type
SdfValueTypeNames->String
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class CollisionGroupTable(Boost.Python.instance):
@staticmethod
def GetGroups(*args, **kwargs) -> None: ...
@staticmethod
def IsCollisionEnabled(*args, **kwargs) -> None: ...
__instance_size__ = 72
pass
class DistanceJoint(Joint, pxr.UsdGeom.Imageable, pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Predefined distance joint type (Distance between rigid bodies may be
limited to given minimum or maximum distance.)
"""
@staticmethod
def CreateMaxDistanceAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateMaxDistanceAttr(defaultValue, writeSparsely) -> Attribute
See GetMaxDistanceAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateMinDistanceAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateMinDistanceAttr(defaultValue, writeSparsely) -> Attribute
See GetMinDistanceAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> DistanceJoint
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> DistanceJoint
Return a UsdPhysicsDistanceJoint holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsDistanceJoint(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetMaxDistanceAttr() -> Attribute:
"""
GetMaxDistanceAttr() -> Attribute
Maximum distance.
If attribute is negative, the joint is not limited. Units: distance.
Declaration
``float physics:maxDistance = -1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetMinDistanceAttr() -> Attribute:
"""
GetMinDistanceAttr() -> Attribute
Minimum distance.
If attribute is negative, the joint is not limited. Units: distance.
Declaration
``float physics:minDistance = -1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class DriveAPI(pxr.Usd.APISchemaBase, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
The PhysicsDriveAPI when applied to any joint primitive will drive the
joint towards a given target. The PhysicsDriveAPI is a multipleApply
schema: drive can be set per
axis"transX","transY","transZ","rotX","rotY","rotZ"or its"linear"for
prismatic joint or"angular"for revolute joints. Setting these as a
multipleApply schema TfToken name will define the degree of freedom
the DriveAPI is applied to. Each drive is an implicit force-limited
damped spring: Force or acceleration = stiffness \* (targetPosition -
position)
- damping \* (targetVelocity - velocity)
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdPhysicsTokens. So to set an attribute to the value"rightHanded",
use UsdPhysicsTokens->rightHanded as the value.
"""
@staticmethod
def Apply(*args, **kwargs) -> None:
"""
**classmethod** Apply(prim, name) -> DriveAPI
Applies this **multiple-apply** API schema to the given ``prim`` along
with the given instance name, ``name`` .
This information is stored by adding"PhysicsDriveAPI:<i>name</i>"to
the token-valued, listOp metadata *apiSchemas* on the prim. For
example, if ``name`` is'instance1', the
token'PhysicsDriveAPI:instance1'is added to'apiSchemas'.
A valid UsdPhysicsDriveAPI object is returned upon success. An invalid
(or empty) UsdPhysicsDriveAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
name : str
"""
@staticmethod
def CanApply(*args, **kwargs) -> None:
"""
**classmethod** CanApply(prim, name, whyNot) -> bool
Returns true if this **multiple-apply** API schema can be applied,
with the given instance name, ``name`` , to the given ``prim`` .
If this schema can not be a applied the prim, this returns false and,
if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
name : str
whyNot : str
"""
@staticmethod
def CreateDampingAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateDampingAttr(defaultValue, writeSparsely) -> Attribute
See GetDampingAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateMaxForceAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateMaxForceAttr(defaultValue, writeSparsely) -> Attribute
See GetMaxForceAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateStiffnessAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateStiffnessAttr(defaultValue, writeSparsely) -> Attribute
See GetStiffnessAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateTargetPositionAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateTargetPositionAttr(defaultValue, writeSparsely) -> Attribute
See GetTargetPositionAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateTargetVelocityAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateTargetVelocityAttr(defaultValue, writeSparsely) -> Attribute
See GetTargetVelocityAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateTypeAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateTypeAttr(defaultValue, writeSparsely) -> Attribute
See GetTypeAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Get(prim, name) -> DriveAPI:
"""
**classmethod** Get(stage, path) -> DriveAPI
Return a UsdPhysicsDriveAPI holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
``path`` must be of the format<path>.drive:name.
This is shorthand for the following:
.. code-block:: text
TfToken name = SdfPath::StripNamespace(path.GetToken());
UsdPhysicsDriveAPI(
stage->GetPrimAtPath(path.GetPrimPath()), name);
Parameters
----------
stage : Stage
path : Path
----------------------------------------------------------------------
Return a UsdPhysicsDriveAPI with name ``name`` holding the prim
``prim`` .
Shorthand for UsdPhysicsDriveAPI(prim, name);
Parameters
----------
prim : Prim
name : str
"""
@staticmethod
def GetAll(*args, **kwargs) -> None:
"""
**classmethod** GetAll(prim) -> list[DriveAPI]
Return a vector of all named instances of UsdPhysicsDriveAPI on the
given ``prim`` .
Parameters
----------
prim : Prim
"""
@staticmethod
def GetDampingAttr() -> Attribute:
"""
GetDampingAttr() -> Attribute
Damping of the drive.
Units: if linear drive: mass/second If angular drive:
mass\*DIST_UNITS\*DIST_UNITS/second/second/degrees.
Declaration
``float physics:damping = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetMaxForceAttr() -> Attribute:
"""
GetMaxForceAttr() -> Attribute
Maximum force that can be applied to drive.
Units: if linear drive: mass\*DIST_UNITS/second/second if angular
drive: mass\*DIST_UNITS\*DIST_UNITS/second/second inf means not
limited. Must be non-negative.
Declaration
``float physics:maxForce = inf``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetSchemaAttributeNames(includeInherited, instanceName) -> list[TfToken]:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
----------------------------------------------------------------------
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes for a given instance name.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved. The names returned will have the
proper namespace prefix.
Parameters
----------
includeInherited : bool
instanceName : str
"""
@staticmethod
def GetStiffnessAttr() -> Attribute:
"""
GetStiffnessAttr() -> Attribute
Stiffness of the drive.
Units: if linear drive: mass/second/second if angular drive:
mass\*DIST_UNITS\*DIST_UNITS/degree/second/second.
Declaration
``float physics:stiffness = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetTargetPositionAttr() -> Attribute:
"""
GetTargetPositionAttr() -> Attribute
Target value for position.
Units: if linear drive: distance if angular drive: degrees.
Declaration
``float physics:targetPosition = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetTargetVelocityAttr() -> Attribute:
"""
GetTargetVelocityAttr() -> Attribute
Target value for velocity.
Units: if linear drive: distance/second if angular drive:
degrees/second.
Declaration
``float physics:targetVelocity = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetTypeAttr() -> Attribute:
"""
GetTypeAttr() -> Attribute
Drive spring is for the acceleration at the joint (rather than the
force).
Declaration
``uniform token physics:type ="force"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
force, acceleration
"""
@staticmethod
def IsPhysicsDriveAPIPath(*args, **kwargs) -> None:
"""
**classmethod** IsPhysicsDriveAPIPath(path, name) -> bool
Checks if the given path ``path`` is of an API schema of type
PhysicsDriveAPI.
If so, it stores the instance name of the schema in ``name`` and
returns true. Otherwise, it returns false.
Parameters
----------
path : Path
name : str
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 48
pass
class FilteredPairsAPI(pxr.Usd.APISchemaBase, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
API to describe fine-grained filtering. If a collision between two
objects occurs, this pair might be filtered if the pair is defined
through this API. This API can be applied either to a body or
collision or even articulation. The"filteredPairs"defines what objects
it should not collide against. Note that FilteredPairsAPI filtering
has precedence over CollisionGroup filtering.
"""
@staticmethod
def Apply(*args, **kwargs) -> None:
"""
**classmethod** Apply(prim) -> FilteredPairsAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"PhysicsFilteredPairsAPI"to the
token-valued, listOp metadata *apiSchemas* on the prim.
A valid UsdPhysicsFilteredPairsAPI object is returned upon success. An
invalid (or empty) UsdPhysicsFilteredPairsAPI object is returned upon
failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
@staticmethod
def CanApply(*args, **kwargs) -> None:
"""
**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
@staticmethod
def CreateFilteredPairsRel() -> Relationship:
"""
CreateFilteredPairsRel() -> Relationship
See GetFilteredPairsRel() , and also Create vs Get Property Methods
for when to use Get vs Create.
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> FilteredPairsAPI
Return a UsdPhysicsFilteredPairsAPI holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsFilteredPairsAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetFilteredPairsRel() -> Relationship:
"""
GetFilteredPairsRel() -> Relationship
Relationship to objects that should be filtered.
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 48
pass
class FixedJoint(Joint, pxr.UsdGeom.Imageable, pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Predefined fixed joint type (All degrees of freedom are removed.)
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> FixedJoint
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> FixedJoint
Return a UsdPhysicsFixedJoint holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsFixedJoint(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class Joint(pxr.UsdGeom.Imageable, pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
A joint constrains the movement of rigid bodies. Joint can be created
between two rigid bodies or between one rigid body and world. By
default joint primitive defines a D6 joint where all degrees of
freedom are free. Three linear and three angular degrees of freedom.
Note that default behavior is to disable collision between jointed
bodies.
"""
@staticmethod
def CreateBody0Rel() -> Relationship:
"""
CreateBody0Rel() -> Relationship
See GetBody0Rel() , and also Create vs Get Property Methods for when
to use Get vs Create.
"""
@staticmethod
def CreateBody1Rel() -> Relationship:
"""
CreateBody1Rel() -> Relationship
See GetBody1Rel() , and also Create vs Get Property Methods for when
to use Get vs Create.
"""
@staticmethod
def CreateBreakForceAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateBreakForceAttr(defaultValue, writeSparsely) -> Attribute
See GetBreakForceAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateBreakTorqueAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateBreakTorqueAttr(defaultValue, writeSparsely) -> Attribute
See GetBreakTorqueAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateCollisionEnabledAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateCollisionEnabledAttr(defaultValue, writeSparsely) -> Attribute
See GetCollisionEnabledAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateExcludeFromArticulationAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateExcludeFromArticulationAttr(defaultValue, writeSparsely) -> Attribute
See GetExcludeFromArticulationAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateJointEnabledAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateJointEnabledAttr(defaultValue, writeSparsely) -> Attribute
See GetJointEnabledAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateLocalPos0Attr(defaultValue, writeSparsely) -> Attribute:
"""
CreateLocalPos0Attr(defaultValue, writeSparsely) -> Attribute
See GetLocalPos0Attr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateLocalPos1Attr(defaultValue, writeSparsely) -> Attribute:
"""
CreateLocalPos1Attr(defaultValue, writeSparsely) -> Attribute
See GetLocalPos1Attr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateLocalRot0Attr(defaultValue, writeSparsely) -> Attribute:
"""
CreateLocalRot0Attr(defaultValue, writeSparsely) -> Attribute
See GetLocalRot0Attr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateLocalRot1Attr(defaultValue, writeSparsely) -> Attribute:
"""
CreateLocalRot1Attr(defaultValue, writeSparsely) -> Attribute
See GetLocalRot1Attr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> Joint
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> Joint
Return a UsdPhysicsJoint holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsJoint(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetBody0Rel() -> Relationship:
"""
GetBody0Rel() -> Relationship
Relationship to any UsdGeomXformable.
"""
@staticmethod
def GetBody1Rel() -> Relationship:
"""
GetBody1Rel() -> Relationship
Relationship to any UsdGeomXformable.
"""
@staticmethod
def GetBreakForceAttr() -> Attribute:
"""
GetBreakForceAttr() -> Attribute
Joint break force.
If set, joint is to break when this force limit is reached. (Used for
linear DOFs.) Units: mass \* distance / second / second
Declaration
``float physics:breakForce = inf``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetBreakTorqueAttr() -> Attribute:
"""
GetBreakTorqueAttr() -> Attribute
Joint break torque.
If set, joint is to break when this torque limit is reached. (Used for
angular DOFs.) Units: mass \* distance \* distance / second / second
Declaration
``float physics:breakTorque = inf``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetCollisionEnabledAttr() -> Attribute:
"""
GetCollisionEnabledAttr() -> Attribute
Determines if the jointed subtrees should collide or not.
Declaration
``bool physics:collisionEnabled = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
@staticmethod
def GetExcludeFromArticulationAttr() -> Attribute:
"""
GetExcludeFromArticulationAttr() -> Attribute
Determines if the joint can be included in an Articulation.
Declaration
``uniform bool physics:excludeFromArticulation = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
Variability
SdfVariabilityUniform
"""
@staticmethod
def GetJointEnabledAttr() -> Attribute:
"""
GetJointEnabledAttr() -> Attribute
Determines if the joint is enabled.
Declaration
``bool physics:jointEnabled = 1``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
@staticmethod
def GetLocalPos0Attr() -> Attribute:
"""
GetLocalPos0Attr() -> Attribute
Relative position of the joint frame to body0's frame.
Declaration
``point3f physics:localPos0 = (0, 0, 0)``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Point3f
"""
@staticmethod
def GetLocalPos1Attr() -> Attribute:
"""
GetLocalPos1Attr() -> Attribute
Relative position of the joint frame to body1's frame.
Declaration
``point3f physics:localPos1 = (0, 0, 0)``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Point3f
"""
@staticmethod
def GetLocalRot0Attr() -> Attribute:
"""
GetLocalRot0Attr() -> Attribute
Relative orientation of the joint frame to body0's frame.
Declaration
``quatf physics:localRot0 = (1, 0, 0, 0)``
C++ Type
GfQuatf
Usd Type
SdfValueTypeNames->Quatf
"""
@staticmethod
def GetLocalRot1Attr() -> Attribute:
"""
GetLocalRot1Attr() -> Attribute
Relative orientation of the joint frame to body1's frame.
Declaration
``quatf physics:localRot1 = (1, 0, 0, 0)``
C++ Type
GfQuatf
Usd Type
SdfValueTypeNames->Quatf
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class LimitAPI(pxr.Usd.APISchemaBase, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
The PhysicsLimitAPI can be applied to a PhysicsJoint and will restrict
the movement along an axis. PhysicsLimitAPI is a multipleApply schema:
The PhysicsJoint can be restricted
along"transX","transY","transZ","rotX","rotY","rotZ","distance".
Setting these as a multipleApply schema TfToken name will define the
degree of freedom the PhysicsLimitAPI is applied to. Note that if the
low limit is higher than the high limit, motion along this axis is
considered locked.
"""
@staticmethod
def Apply(*args, **kwargs) -> None:
"""
**classmethod** Apply(prim, name) -> LimitAPI
Applies this **multiple-apply** API schema to the given ``prim`` along
with the given instance name, ``name`` .
This information is stored by adding"PhysicsLimitAPI:<i>name</i>"to
the token-valued, listOp metadata *apiSchemas* on the prim. For
example, if ``name`` is'instance1', the
token'PhysicsLimitAPI:instance1'is added to'apiSchemas'.
A valid UsdPhysicsLimitAPI object is returned upon success. An invalid
(or empty) UsdPhysicsLimitAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
name : str
"""
@staticmethod
def CanApply(*args, **kwargs) -> None:
"""
**classmethod** CanApply(prim, name, whyNot) -> bool
Returns true if this **multiple-apply** API schema can be applied,
with the given instance name, ``name`` , to the given ``prim`` .
If this schema can not be a applied the prim, this returns false and,
if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
name : str
whyNot : str
"""
@staticmethod
def CreateHighAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateHighAttr(defaultValue, writeSparsely) -> Attribute
See GetHighAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateLowAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateLowAttr(defaultValue, writeSparsely) -> Attribute
See GetLowAttr() , and also Create vs Get Property Methods for when to
use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Get(prim, name) -> LimitAPI:
"""
**classmethod** Get(stage, path) -> LimitAPI
Return a UsdPhysicsLimitAPI holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
``path`` must be of the format<path>.limit:name.
This is shorthand for the following:
.. code-block:: text
TfToken name = SdfPath::StripNamespace(path.GetToken());
UsdPhysicsLimitAPI(
stage->GetPrimAtPath(path.GetPrimPath()), name);
Parameters
----------
stage : Stage
path : Path
----------------------------------------------------------------------
Return a UsdPhysicsLimitAPI with name ``name`` holding the prim
``prim`` .
Shorthand for UsdPhysicsLimitAPI(prim, name);
Parameters
----------
prim : Prim
name : str
"""
@staticmethod
def GetAll(*args, **kwargs) -> None:
"""
**classmethod** GetAll(prim) -> list[LimitAPI]
Return a vector of all named instances of UsdPhysicsLimitAPI on the
given ``prim`` .
Parameters
----------
prim : Prim
"""
@staticmethod
def GetHighAttr() -> Attribute:
"""
GetHighAttr() -> Attribute
Upper limit.
Units: degrees or distance depending on trans or rot axis applied to.
inf means not limited in positive direction.
Declaration
``float physics:high = inf``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetLowAttr() -> Attribute:
"""
GetLowAttr() -> Attribute
Lower limit.
Units: degrees or distance depending on trans or rot axis applied to.
\-inf means not limited in negative direction.
Declaration
``float physics:low = -inf``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetSchemaAttributeNames(includeInherited, instanceName) -> list[TfToken]:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
----------------------------------------------------------------------
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes for a given instance name.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved. The names returned will have the
proper namespace prefix.
Parameters
----------
includeInherited : bool
instanceName : str
"""
@staticmethod
def IsPhysicsLimitAPIPath(*args, **kwargs) -> None:
"""
**classmethod** IsPhysicsLimitAPIPath(path, name) -> bool
Checks if the given path ``path`` is of an API schema of type
PhysicsLimitAPI.
If so, it stores the instance name of the schema in ``name`` and
returns true. Otherwise, it returns false.
Parameters
----------
path : Path
name : str
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 48
pass
class MassAPI(pxr.Usd.APISchemaBase, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Defines explicit mass properties (mass, density, inertia etc.).
MassAPI can be applied to any object that has a PhysicsCollisionAPI or
a PhysicsRigidBodyAPI.
"""
@staticmethod
def Apply(*args, **kwargs) -> None:
"""
**classmethod** Apply(prim) -> MassAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"PhysicsMassAPI"to the token-
valued, listOp metadata *apiSchemas* on the prim.
A valid UsdPhysicsMassAPI object is returned upon success. An invalid
(or empty) UsdPhysicsMassAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
@staticmethod
def CanApply(*args, **kwargs) -> None:
"""
**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
@staticmethod
def CreateCenterOfMassAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateCenterOfMassAttr(defaultValue, writeSparsely) -> Attribute
See GetCenterOfMassAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateDensityAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateDensityAttr(defaultValue, writeSparsely) -> Attribute
See GetDensityAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateDiagonalInertiaAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateDiagonalInertiaAttr(defaultValue, writeSparsely) -> Attribute
See GetDiagonalInertiaAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateMassAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateMassAttr(defaultValue, writeSparsely) -> Attribute
See GetMassAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreatePrincipalAxesAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreatePrincipalAxesAttr(defaultValue, writeSparsely) -> Attribute
See GetPrincipalAxesAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> MassAPI
Return a UsdPhysicsMassAPI holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsMassAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetCenterOfMassAttr() -> Attribute:
"""
GetCenterOfMassAttr() -> Attribute
Center of mass in the prim's local space.
Units: distance.
Declaration
``point3f physics:centerOfMass = (-inf, -inf, -inf)``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Point3f
"""
@staticmethod
def GetDensityAttr() -> Attribute:
"""
GetDensityAttr() -> Attribute
If non-zero, specifies the density of the object.
In the context of rigid body physics, density indirectly results in
setting mass via (mass = density x volume of the object). How the
volume is computed is up to implementation of the physics system. It
is generally computed from the collision approximation rather than the
graphical mesh. In the case where both density and mass are specified
for the same object, mass has precedence over density. Unlike mass,
child's prim's density overrides parent prim's density as it is
accumulative. Note that density of a collisionAPI can be also
alternatively set through a PhysicsMaterialAPI. The material density
has the weakest precedence in density definition. Note if density is
0.0 it is ignored. Units: mass/distance/distance/distance.
Declaration
``float physics:density = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetDiagonalInertiaAttr() -> Attribute:
"""
GetDiagonalInertiaAttr() -> Attribute
If non-zero, specifies diagonalized inertia tensor along the principal
axes.
Note if diagonalInertial is (0.0, 0.0, 0.0) it is ignored. Units:
mass\*distance\*distance.
Declaration
``float3 physics:diagonalInertia = (0, 0, 0)``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Float3
"""
@staticmethod
def GetMassAttr() -> Attribute:
"""
GetMassAttr() -> Attribute
If non-zero, directly specifies the mass of the object.
Note that any child prim can also have a mass when they apply massAPI.
In this case, the precedence rule is'parent mass overrides the
child's'. This may come as counter-intuitive, but mass is a computed
quantity and in general not accumulative. For example, if a parent has
mass of 10, and one of two children has mass of 20, allowing child's
mass to override its parent results in a mass of -10 for the other
child. Note if mass is 0.0 it is ignored. Units: mass.
Declaration
``float physics:mass = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetPrincipalAxesAttr() -> Attribute:
"""
GetPrincipalAxesAttr() -> Attribute
Orientation of the inertia tensor's principal axes in the prim's local
space.
Declaration
``quatf physics:principalAxes = (0, 0, 0, 0)``
C++ Type
GfQuatf
Usd Type
SdfValueTypeNames->Quatf
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 48
pass
class MassUnits(Boost.Python.instance):
"""
Container class for static double-precision symbols representing
common mass units of measure expressed in kilograms.
"""
grams = 0.001
kilograms = 1.0
slugs = 14.5939
pass
class MaterialAPI(pxr.Usd.APISchemaBase, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Adds simulation material properties to a Material. All collisions that
have a relationship to this material will have their collision
response defined through this material.
"""
@staticmethod
def Apply(*args, **kwargs) -> None:
"""
**classmethod** Apply(prim) -> MaterialAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"PhysicsMaterialAPI"to the token-
valued, listOp metadata *apiSchemas* on the prim.
A valid UsdPhysicsMaterialAPI object is returned upon success. An
invalid (or empty) UsdPhysicsMaterialAPI object is returned upon
failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
@staticmethod
def CanApply(*args, **kwargs) -> None:
"""
**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
@staticmethod
def CreateDensityAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateDensityAttr(defaultValue, writeSparsely) -> Attribute
See GetDensityAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateDynamicFrictionAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateDynamicFrictionAttr(defaultValue, writeSparsely) -> Attribute
See GetDynamicFrictionAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateRestitutionAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateRestitutionAttr(defaultValue, writeSparsely) -> Attribute
See GetRestitutionAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateStaticFrictionAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateStaticFrictionAttr(defaultValue, writeSparsely) -> Attribute
See GetStaticFrictionAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> MaterialAPI
Return a UsdPhysicsMaterialAPI holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsMaterialAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetDensityAttr() -> Attribute:
"""
GetDensityAttr() -> Attribute
If non-zero, defines the density of the material.
This can be used for body mass computation, see PhysicsMassAPI. Note
that if the density is 0.0 it is ignored. Units:
mass/distance/distance/distance.
Declaration
``float physics:density = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetDynamicFrictionAttr() -> Attribute:
"""
GetDynamicFrictionAttr() -> Attribute
Dynamic friction coefficient.
Unitless.
Declaration
``float physics:dynamicFriction = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetRestitutionAttr() -> Attribute:
"""
GetRestitutionAttr() -> Attribute
Restitution coefficient.
Unitless.
Declaration
``float physics:restitution = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def GetStaticFrictionAttr() -> Attribute:
"""
GetStaticFrictionAttr() -> Attribute
Static friction coefficient.
Unitless.
Declaration
``float physics:staticFriction = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 48
pass
class MeshCollisionAPI(pxr.Usd.APISchemaBase, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Attributes to control how a Mesh is made into a collider. Can be
applied to only a USDGeomMesh in addition to its PhysicsCollisionAPI.
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdPhysicsTokens. So to set an attribute to the value"rightHanded",
use UsdPhysicsTokens->rightHanded as the value.
"""
@staticmethod
def Apply(*args, **kwargs) -> None:
"""
**classmethod** Apply(prim) -> MeshCollisionAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"PhysicsMeshCollisionAPI"to the
token-valued, listOp metadata *apiSchemas* on the prim.
A valid UsdPhysicsMeshCollisionAPI object is returned upon success. An
invalid (or empty) UsdPhysicsMeshCollisionAPI object is returned upon
failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
@staticmethod
def CanApply(*args, **kwargs) -> None:
"""
**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
@staticmethod
def CreateApproximationAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateApproximationAttr(defaultValue, writeSparsely) -> Attribute
See GetApproximationAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> MeshCollisionAPI
Return a UsdPhysicsMeshCollisionAPI holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsMeshCollisionAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetApproximationAttr() -> Attribute:
"""
GetApproximationAttr() -> Attribute
Determines the mesh's collision approximation:"none"- The mesh
geometry is used directly as a collider without any approximation.
"convexDecomposition"- A convex mesh decomposition is performed. This
results in a set of convex mesh colliders."convexHull"- A convex hull
of the mesh is generated and used as the collider."boundingSphere"- A
bounding sphere is computed around the mesh and used as a
collider."boundingCube"- An optimally fitting box collider is computed
around the mesh."meshSimplification"- A mesh simplification step is
performed, resulting in a simplified triangle mesh collider.
Declaration
``uniform token physics:approximation ="none"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
none, convexDecomposition, convexHull, boundingSphere, boundingCube,
meshSimplification
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 48
pass
class PrismaticJoint(Joint, pxr.UsdGeom.Imageable, pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Predefined prismatic joint type (translation along prismatic joint
axis is permitted.)
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdPhysicsTokens. So to set an attribute to the value"rightHanded",
use UsdPhysicsTokens->rightHanded as the value.
"""
@staticmethod
def CreateAxisAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateAxisAttr(defaultValue, writeSparsely) -> Attribute
See GetAxisAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateLowerLimitAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateLowerLimitAttr(defaultValue, writeSparsely) -> Attribute
See GetLowerLimitAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateUpperLimitAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateUpperLimitAttr(defaultValue, writeSparsely) -> Attribute
See GetUpperLimitAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> PrismaticJoint
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> PrismaticJoint
Return a UsdPhysicsPrismaticJoint holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsPrismaticJoint(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetAxisAttr() -> Attribute:
"""
GetAxisAttr() -> Attribute
Joint axis.
Declaration
``uniform token physics:axis ="X"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
X, Y, Z
"""
@staticmethod
def GetLowerLimitAttr() -> Attribute:
"""
GetLowerLimitAttr() -> Attribute
Lower limit.
Units: distance. -inf means not limited in negative direction.
Declaration
``float physics:lowerLimit = -inf``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def GetUpperLimitAttr() -> Attribute:
"""
GetUpperLimitAttr() -> Attribute
Upper limit.
Units: distance. inf means not limited in positive direction.
Declaration
``float physics:upperLimit = inf``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class RevoluteJoint(Joint, pxr.UsdGeom.Imageable, pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Predefined revolute joint type (rotation along revolute joint axis is
permitted.)
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdPhysicsTokens. So to set an attribute to the value"rightHanded",
use UsdPhysicsTokens->rightHanded as the value.
"""
@staticmethod
def CreateAxisAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateAxisAttr(defaultValue, writeSparsely) -> Attribute
See GetAxisAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateLowerLimitAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateLowerLimitAttr(defaultValue, writeSparsely) -> Attribute
See GetLowerLimitAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateUpperLimitAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateUpperLimitAttr(defaultValue, writeSparsely) -> Attribute
See GetUpperLimitAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> RevoluteJoint
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> RevoluteJoint
Return a UsdPhysicsRevoluteJoint holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsRevoluteJoint(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetAxisAttr() -> Attribute:
"""
GetAxisAttr() -> Attribute
Joint axis.
Declaration
``uniform token physics:axis ="X"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
X, Y, Z
"""
@staticmethod
def GetLowerLimitAttr() -> Attribute:
"""
GetLowerLimitAttr() -> Attribute
Lower limit.
Units: degrees. -inf means not limited in negative direction.
Declaration
``float physics:lowerLimit = -inf``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def GetUpperLimitAttr() -> Attribute:
"""
GetUpperLimitAttr() -> Attribute
Upper limit.
Units: degrees. inf means not limited in positive direction.
Declaration
``float physics:upperLimit = inf``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class RigidBodyAPI(pxr.Usd.APISchemaBase, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Applies physics body attributes to any UsdGeomXformable prim and marks
that prim to be driven by a simulation. If a simulation is running it
will update this prim's pose. All prims in the hierarchy below this
prim should move accordingly.
"""
class MassInformation(Boost.Python.instance):
@property
def centerOfMass(self) -> None:
"""
:type: None
"""
@property
def inertia(self) -> None:
"""
:type: None
"""
@property
def localPos(self) -> None:
"""
:type: None
"""
@property
def localRot(self) -> None:
"""
:type: None
"""
@property
def volume(self) -> None:
"""
:type: None
"""
__instance_size__ = 96
pass
@staticmethod
def Apply(*args, **kwargs) -> None:
"""
**classmethod** Apply(prim) -> RigidBodyAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"PhysicsRigidBodyAPI"to the token-
valued, listOp metadata *apiSchemas* on the prim.
A valid UsdPhysicsRigidBodyAPI object is returned upon success. An
invalid (or empty) UsdPhysicsRigidBodyAPI object is returned upon
failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
@staticmethod
def CanApply(*args, **kwargs) -> None:
"""
**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
@staticmethod
def ComputeMassProperties(diagonalInertia, com, principalAxes, massInfoFn) -> float:
"""
ComputeMassProperties(diagonalInertia, com, principalAxes, massInfoFn) -> float
Compute mass properties of the rigid body ``diagonalInertia`` Computed
diagonal of the inertial tensor for the rigid body.
``com`` Computed center of mass for the rigid body. ``principalAxes``
Inertia tensor's principal axes orienttion for the rigid body.
``massInfoFn`` Callback function to get collision mass information.
Computed mass of the rigid body
Parameters
----------
diagonalInertia : Vec3f
com : Vec3f
principalAxes : Quatf
massInfoFn : MassInformationFn
"""
@staticmethod
def CreateAngularVelocityAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateAngularVelocityAttr(defaultValue, writeSparsely) -> Attribute
See GetAngularVelocityAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateKinematicEnabledAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateKinematicEnabledAttr(defaultValue, writeSparsely) -> Attribute
See GetKinematicEnabledAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateRigidBodyEnabledAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateRigidBodyEnabledAttr(defaultValue, writeSparsely) -> Attribute
See GetRigidBodyEnabledAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateSimulationOwnerRel() -> Relationship:
"""
CreateSimulationOwnerRel() -> Relationship
See GetSimulationOwnerRel() , and also Create vs Get Property Methods
for when to use Get vs Create.
"""
@staticmethod
def CreateStartsAsleepAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateStartsAsleepAttr(defaultValue, writeSparsely) -> Attribute
See GetStartsAsleepAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateVelocityAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateVelocityAttr(defaultValue, writeSparsely) -> Attribute
See GetVelocityAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> RigidBodyAPI
Return a UsdPhysicsRigidBodyAPI holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsRigidBodyAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetAngularVelocityAttr() -> Attribute:
"""
GetAngularVelocityAttr() -> Attribute
Angular velocity in the same space as the node's xform.
Units: degrees/second.
Declaration
``vector3f physics:angularVelocity = (0, 0, 0)``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Vector3f
"""
@staticmethod
def GetKinematicEnabledAttr() -> Attribute:
"""
GetKinematicEnabledAttr() -> Attribute
Determines whether the body is kinematic or not.
A kinematic body is a body that is moved through animated poses or
through user defined poses. The simulation derives velocities for the
kinematic body based on the external motion. When a continuous motion
is not desired, this kinematic flag should be set to false.
Declaration
``bool physics:kinematicEnabled = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
@staticmethod
def GetRigidBodyEnabledAttr() -> Attribute:
"""
GetRigidBodyEnabledAttr() -> Attribute
Determines if this PhysicsRigidBodyAPI is enabled.
Declaration
``bool physics:rigidBodyEnabled = 1``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def GetSimulationOwnerRel() -> Relationship:
"""
GetSimulationOwnerRel() -> Relationship
Single PhysicsScene that will simulate this body.
By default this is the first PhysicsScene found in the stage using
UsdStage::Traverse() .
"""
@staticmethod
def GetStartsAsleepAttr() -> Attribute:
"""
GetStartsAsleepAttr() -> Attribute
Determines if the body is asleep when the simulation starts.
Declaration
``uniform bool physics:startsAsleep = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
Variability
SdfVariabilityUniform
"""
@staticmethod
def GetVelocityAttr() -> Attribute:
"""
GetVelocityAttr() -> Attribute
Linear velocity in the same space as the node's xform.
Units: distance/second.
Declaration
``vector3f physics:velocity = (0, 0, 0)``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Vector3f
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 48
pass
class Scene(pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
General physics simulation properties, required for simulation.
"""
@staticmethod
def CreateGravityDirectionAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateGravityDirectionAttr(defaultValue, writeSparsely) -> Attribute
See GetGravityDirectionAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateGravityMagnitudeAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateGravityMagnitudeAttr(defaultValue, writeSparsely) -> Attribute
See GetGravityMagnitudeAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> Scene
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> Scene
Return a UsdPhysicsScene holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsScene(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetGravityDirectionAttr() -> Attribute:
"""
GetGravityDirectionAttr() -> Attribute
Gravity direction vector in simulation world space.
Will be normalized before use. A zero vector is a request to use the
negative upAxis. Unitless.
Declaration
``vector3f physics:gravityDirection = (0, 0, 0)``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Vector3f
"""
@staticmethod
def GetGravityMagnitudeAttr() -> Attribute:
"""
GetGravityMagnitudeAttr() -> Attribute
Gravity acceleration magnitude in simulation world space.
A negative value is a request to use a value equivalent to earth
gravity regardless of the metersPerUnit scaling used by this scene.
Units: distance/second/second.
Declaration
``float physics:gravityMagnitude = -inf``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class SphericalJoint(Joint, pxr.UsdGeom.Imageable, pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Predefined spherical joint type (Removes linear degrees of freedom,
cone limit may restrict the motion in a given range.) It allows two
limit values, which when equal create a circular, else an elliptic
cone limit around the limit axis.
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdPhysicsTokens. So to set an attribute to the value"rightHanded",
use UsdPhysicsTokens->rightHanded as the value.
"""
@staticmethod
def CreateAxisAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateAxisAttr(defaultValue, writeSparsely) -> Attribute
See GetAxisAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateConeAngle0LimitAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateConeAngle0LimitAttr(defaultValue, writeSparsely) -> Attribute
See GetConeAngle0LimitAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateConeAngle1LimitAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateConeAngle1LimitAttr(defaultValue, writeSparsely) -> Attribute
See GetConeAngle1LimitAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> SphericalJoint
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> SphericalJoint
Return a UsdPhysicsSphericalJoint holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdPhysicsSphericalJoint(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetAxisAttr() -> Attribute:
"""
GetAxisAttr() -> Attribute
Cone limit axis.
Declaration
``uniform token physics:axis ="X"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
X, Y, Z
"""
@staticmethod
def GetConeAngle0LimitAttr() -> Attribute:
"""
GetConeAngle0LimitAttr() -> Attribute
Cone limit from the primary joint axis in the local0 frame toward the
next axis.
(Next axis of X is Y, and of Z is X.) A negative value means not
limited. Units: degrees.
Declaration
``float physics:coneAngle0Limit = -1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetConeAngle1LimitAttr() -> Attribute:
"""
GetConeAngle1LimitAttr() -> Attribute
Cone limit from the primary joint axis in the local0 frame toward the
second to next axis.
A negative value means not limited. Units: degrees.
Declaration
``float physics:coneAngle1Limit = -1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class Tokens(Boost.Python.instance):
acceleration = 'acceleration'
angular = 'angular'
boundingCube = 'boundingCube'
boundingSphere = 'boundingSphere'
colliders = 'colliders'
convexDecomposition = 'convexDecomposition'
convexHull = 'convexHull'
distance = 'distance'
drive = 'drive'
drive_MultipleApplyTemplate_PhysicsDamping = 'drive:__INSTANCE_NAME__:physics:damping'
drive_MultipleApplyTemplate_PhysicsMaxForce = 'drive:__INSTANCE_NAME__:physics:maxForce'
drive_MultipleApplyTemplate_PhysicsStiffness = 'drive:__INSTANCE_NAME__:physics:stiffness'
drive_MultipleApplyTemplate_PhysicsTargetPosition = 'drive:__INSTANCE_NAME__:physics:targetPosition'
drive_MultipleApplyTemplate_PhysicsTargetVelocity = 'drive:__INSTANCE_NAME__:physics:targetVelocity'
drive_MultipleApplyTemplate_PhysicsType = 'drive:__INSTANCE_NAME__:physics:type'
force = 'force'
kilogramsPerUnit = 'kilogramsPerUnit'
limit = 'limit'
limit_MultipleApplyTemplate_PhysicsHigh = 'limit:__INSTANCE_NAME__:physics:high'
limit_MultipleApplyTemplate_PhysicsLow = 'limit:__INSTANCE_NAME__:physics:low'
linear = 'linear'
meshSimplification = 'meshSimplification'
none = 'none'
physicsAngularVelocity = 'physics:angularVelocity'
physicsApproximation = 'physics:approximation'
physicsAxis = 'physics:axis'
physicsBody0 = 'physics:body0'
physicsBody1 = 'physics:body1'
physicsBreakForce = 'physics:breakForce'
physicsBreakTorque = 'physics:breakTorque'
physicsCenterOfMass = 'physics:centerOfMass'
physicsCollisionEnabled = 'physics:collisionEnabled'
physicsConeAngle0Limit = 'physics:coneAngle0Limit'
physicsConeAngle1Limit = 'physics:coneAngle1Limit'
physicsDensity = 'physics:density'
physicsDiagonalInertia = 'physics:diagonalInertia'
physicsDynamicFriction = 'physics:dynamicFriction'
physicsExcludeFromArticulation = 'physics:excludeFromArticulation'
physicsFilteredGroups = 'physics:filteredGroups'
physicsFilteredPairs = 'physics:filteredPairs'
physicsGravityDirection = 'physics:gravityDirection'
physicsGravityMagnitude = 'physics:gravityMagnitude'
physicsInvertFilteredGroups = 'physics:invertFilteredGroups'
physicsJointEnabled = 'physics:jointEnabled'
physicsKinematicEnabled = 'physics:kinematicEnabled'
physicsLocalPos0 = 'physics:localPos0'
physicsLocalPos1 = 'physics:localPos1'
physicsLocalRot0 = 'physics:localRot0'
physicsLocalRot1 = 'physics:localRot1'
physicsLowerLimit = 'physics:lowerLimit'
physicsMass = 'physics:mass'
physicsMaxDistance = 'physics:maxDistance'
physicsMergeGroup = 'physics:mergeGroup'
physicsMinDistance = 'physics:minDistance'
physicsPrincipalAxes = 'physics:principalAxes'
physicsRestitution = 'physics:restitution'
physicsRigidBodyEnabled = 'physics:rigidBodyEnabled'
physicsSimulationOwner = 'physics:simulationOwner'
physicsStartsAsleep = 'physics:startsAsleep'
physicsStaticFriction = 'physics:staticFriction'
physicsUpperLimit = 'physics:upperLimit'
physicsVelocity = 'physics:velocity'
rotX = 'rotX'
rotY = 'rotY'
rotZ = 'rotZ'
transX = 'transX'
transY = 'transY'
transZ = 'transZ'
x = 'X'
y = 'Y'
z = 'Z'
pass
class _CanApplyResult(Boost.Python.instance):
@property
def whyNot(self) -> None:
"""
:type: None
"""
__instance_size__ = 56
pass
def GetStageKilogramsPerUnit(*args, **kwargs) -> None:
pass
def MassUnitsAre(*args, **kwargs) -> None:
pass
def SetStageKilogramsPerUnit(*args, **kwargs) -> None:
pass
def StageHasAuthoredKilogramsPerUnit(*args, **kwargs) -> None:
pass
__MFB_FULL_PACKAGE_NAME = 'usdPhysics'
| 122,712 | unknown | 25.613099 | 109 | 0.611546 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Work/__init__.py | #
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
"""
Work
Allows for configuration of the system's multithreading subsystem.
"""
from pxr import Tf
Tf.PreparePythonModule()
del Tf
| 1,193 | Python | 34.117646 | 74 | 0.764459 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Work/__DOC.py | def Execute(result):
pass | 29 | Python | 13.999993 | 20 | 0.689655 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Work/__init__.pyi | from __future__ import annotations
import pxr.Work._work
import typing
__all__ = [
"GetConcurrencyLimit",
"GetPhysicalConcurrencyLimit",
"HasConcurrency",
"SetConcurrencyLimit",
"SetConcurrencyLimitArgument",
"SetMaximumConcurrencyLimit"
]
def GetConcurrencyLimit(*args, **kwargs) -> None:
pass
def GetPhysicalConcurrencyLimit(*args, **kwargs) -> None:
pass
def HasConcurrency(*args, **kwargs) -> None:
pass
def SetConcurrencyLimit(*args, **kwargs) -> None:
pass
def SetConcurrencyLimitArgument(*args, **kwargs) -> None:
pass
def SetMaximumConcurrencyLimit(*args, **kwargs) -> None:
pass
__MFB_FULL_PACKAGE_NAME = 'work'
| 672 | unknown | 23.035713 | 57 | 0.700893 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Ar/__init__.py | #
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
from pxr import Tf
Tf.PreparePythonModule()
del Tf
| 1,110 | Python | 40.148147 | 74 | 0.766667 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Ar/__DOC.py | def Execute(result):
result["DefaultResolver"].__doc__ = """
Default asset resolution implementation used when no plugin
implementation is provided.
In order to resolve assets specified by relative paths, this resolver
implements a simple"search path"scheme. The resolver will anchor the
relative path to a series of directories and return the first absolute
path where the asset exists.
The first directory will always be the current working directory. The
resolver will then examine the directories specified via the following
mechanisms (in order):
- The currently-bound ArDefaultResolverContext for the calling
thread
- ArDefaultResolver::SetDefaultSearchPath
- The environment variable PXR_AR_DEFAULT_SEARCH_PATH. This is
expected to be a list of directories delimited by the platform's
standard path separator.
ArDefaultResolver supports creating an ArDefaultResolverContext via
ArResolver::CreateContextFromString by passing a list of directories
delimited by the platform's standard path separator.
"""
result["DefaultResolver"].SetDefaultSearchPath.func_doc = """**classmethod** SetDefaultSearchPath(searchPath) -> None
Set the default search path that will be used during asset resolution.
This must be called before the first call to ArGetResolver. The
specified paths will be searched *in addition to, and before* paths
specified via the environment variable PXR_AR_DEFAULT_SEARCH_PATH
Parameters
----------
searchPath : list[str]
"""
result["DefaultResolverContext"].__doc__ = """
Resolver context object that specifies a search path to use during
asset resolution. This object is intended for use with the default
ArDefaultResolver asset resolution implementation; see documentation
for that class for more details on the search path resolution
algorithm.
Example usage:
.. code-block:: text
ArDefaultResolverContext ctx({"/Local/Models", "/Installed/Models"});
{
// Bind the context object:
ArResolverContextBinder binder(ctx);
// While the context is bound, all calls to ArResolver::Resolve
// (assuming ArDefaultResolver is the underlying implementation being
// used) will include the specified paths during resolution.
std::string resolvedPath = resolver.Resolve("ModelName/File.txt")
}
// Once the context is no longer bound (due to the ArResolverContextBinder
// going out of scope), its search path no longer factors into asset
// resolution.
"""
result["DefaultResolverContext"].__init__.func_doc = """__init__()
Default construct a context with no search path.
----------------------------------------------------------------------
__init__(searchPath)
Construct a context with the given ``searchPath`` .
Elements in ``searchPath`` should be absolute paths. If they are not,
they will be anchored to the current working directory.
Parameters
----------
searchPath : list[str]
"""
result["DefaultResolverContext"].GetSearchPath.func_doc = """GetSearchPath() -> list[str]
Return this context's search path.
"""
result["Notice"].__doc__ = """"""
result["ResolvedPath"].__doc__ = """
Represents a resolved asset path.
"""
result["ResolvedPath"].__init__.func_doc = """__init__(resolvedPath)
Construct an ArResolvedPath holding the given ``resolvedPath`` .
Parameters
----------
resolvedPath : str
----------------------------------------------------------------------
__init__(resolvedPath)
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
resolvedPath : str
----------------------------------------------------------------------
__init__()
----------------------------------------------------------------------
__init__(rhs)
Parameters
----------
rhs : ResolvedPath
----------------------------------------------------------------------
__init__(rhs)
Parameters
----------
rhs : ResolvedPath
"""
result["ResolvedPath"].GetPathString.func_doc = """GetPathString() -> str
Return the resolved path held by this object as a string.
"""
result["Resolver"].__doc__ = """
Interface for the asset resolution system. An asset resolver is
responsible for resolving asset information (including the asset's
physical path) from a logical path.
See ar_implementing_resolver for information on how to customize asset
resolution behavior by implementing a subclass of ArResolver. Clients
may use ArGetResolver to access the configured asset resolver.
"""
result["Resolver"].CreateIdentifier.func_doc = """CreateIdentifier(assetPath, anchorAssetPath) -> str
Returns an identifier for the asset specified by ``assetPath`` .
If ``anchorAssetPath`` is not empty, it is the resolved asset path
that ``assetPath`` should be anchored to if it is a relative path.
Parameters
----------
assetPath : str
anchorAssetPath : ResolvedPath
"""
result["Resolver"].CreateIdentifierForNewAsset.func_doc = """CreateIdentifierForNewAsset(assetPath, anchorAssetPath) -> str
Returns an identifier for a new asset specified by ``assetPath`` .
If ``anchorAssetPath`` is not empty, it is the resolved asset path
that ``assetPath`` should be anchored to if it is a relative path.
Parameters
----------
assetPath : str
anchorAssetPath : ResolvedPath
"""
result["Resolver"].Resolve.func_doc = """Resolve(assetPath) -> ResolvedPath
Returns the resolved path for the asset identified by the given
``assetPath`` if it exists.
If the asset does not exist, returns an empty ArResolvedPath.
Parameters
----------
assetPath : str
"""
result["Resolver"].ResolveForNewAsset.func_doc = """ResolveForNewAsset(assetPath) -> ResolvedPath
Returns the resolved path for the given ``assetPath`` that may be used
to create a new asset.
If such a path cannot be computed for ``assetPath`` , returns an empty
ArResolvedPath.
Note that an asset might or might not already exist at the returned
resolved path.
Parameters
----------
assetPath : str
"""
result["Resolver"].CreateDefaultContext.func_doc = """CreateDefaultContext() -> ResolverContext
Return an ArResolverContext that may be bound to this resolver to
resolve assets when no other context is explicitly specified.
The returned ArResolverContext will contain the default context
returned by the primary resolver and all URI resolvers.
"""
result["Resolver"].CreateDefaultContextForAsset.func_doc = """CreateDefaultContextForAsset(assetPath) -> ResolverContext
Return an ArResolverContext that may be bound to this resolver to
resolve the asset located at ``assetPath`` or referenced by that asset
when no other context is explicitly specified.
The returned ArResolverContext will contain the default context for
``assetPath`` returned by the primary resolver and all URI resolvers.
Parameters
----------
assetPath : str
"""
result["Resolver"].CreateContextFromString.func_doc = """CreateContextFromString(contextStr) -> ResolverContext
Return an ArResolverContext created from the primary ArResolver
implementation using the given ``contextStr`` .
Parameters
----------
contextStr : str
----------------------------------------------------------------------
CreateContextFromString(uriScheme, contextStr) -> ResolverContext
Return an ArResolverContext created from the ArResolver registered for
the given ``uriScheme`` using the given ``contextStr`` .
An empty ``uriScheme`` indicates the primary resolver and is
equivalent to CreateContextFromString(string).
If no resolver is registered for ``uriScheme`` , returns an empty
ArResolverContext.
Parameters
----------
uriScheme : str
contextStr : str
"""
result["Resolver"].CreateContextFromStrings.func_doc = """CreateContextFromStrings(contextStrs) -> ResolverContext
Return an ArResolverContext created by combining the ArResolverContext
objects created from the given ``contextStrs`` .
``contextStrs`` is a list of pairs of strings. The first element in
the pair is the URI scheme for the ArResolver that will be used to
create the ArResolverContext from the second element in the pair. An
empty URI scheme indicates the primary resolver.
For example:
.. code-block:: text
ArResolverContext ctx = ArGetResolver().CreateContextFromStrings(
{ {"", "context str 1"},
{"my_scheme", "context str 2"} });
This will use the primary resolver to create an ArResolverContext
using the string"context str 1"and use the resolver registered for
the"my_scheme"URI scheme to create an ArResolverContext using"context
str 2". These contexts will be combined into a single
ArResolverContext and returned.
If no resolver is registered for a URI scheme in an entry in
``contextStrs`` , that entry will be ignored.
Parameters
----------
contextStrs : list[tuple[str, str]]
"""
result["Resolver"].RefreshContext.func_doc = """RefreshContext(context) -> None
Refresh any caches associated with the given context.
If doing so would invalidate asset paths that had previously been
resolved, an ArNotice::ResolverChanged notice will be sent to inform
clients of this.
Parameters
----------
context : ResolverContext
"""
result["Resolver"].GetCurrentContext.func_doc = """GetCurrentContext() -> ResolverContext
Returns the asset resolver context currently bound in this thread.
ArResolver::BindContext, ArResolver::UnbindContext
"""
result["Resolver"].IsContextDependentPath.func_doc = """IsContextDependentPath(assetPath) -> bool
Returns true if ``assetPath`` is a context-dependent path, false
otherwise.
A context-dependent path may result in different resolved paths
depending on what asset resolver context is bound when Resolve is
called. Assets located at the same context-dependent path may not be
the same since those assets may have been loaded from different
resolved paths. In this case, the assets'resolved paths must be
consulted to determine if they are the same.
Parameters
----------
assetPath : str
"""
result["Resolver"].GetExtension.func_doc = """GetExtension(assetPath) -> str
Returns the file extension for the given ``assetPath`` .
The returned extension does not include a"."at the beginning.
Parameters
----------
assetPath : str
"""
result["Resolver"].GetAssetInfo.func_doc = """GetAssetInfo(assetPath, resolvedPath) -> ArAssetInfo
Returns an ArAssetInfo populated with additional metadata (if any)
about the asset at the given ``assetPath`` .
``resolvedPath`` is the resolved path computed for the given
``assetPath`` .
Parameters
----------
assetPath : str
resolvedPath : ResolvedPath
"""
result["Resolver"].GetModificationTimestamp.func_doc = """GetModificationTimestamp(assetPath, resolvedPath) -> Timestamp
Returns an ArTimestamp representing the last time the asset at
``assetPath`` was modified.
``resolvedPath`` is the resolved path computed for the given
``assetPath`` . If a timestamp cannot be retrieved, return an invalid
ArTimestamp.
Parameters
----------
assetPath : str
resolvedPath : ResolvedPath
"""
result["Resolver"].CanWriteAssetToPath.func_doc = """CanWriteAssetToPath(resolvedPath, whyNot) -> bool
Returns true if an asset may be written to the given ``resolvedPath``
, false otherwise.
If this function returns false and ``whyNot`` is not ``nullptr`` , it
may be filled with an explanation.
Parameters
----------
resolvedPath : ResolvedPath
whyNot : str
"""
result["ResolverContext"].__doc__ = """
An asset resolver context allows clients to provide additional data to
the resolver for use during resolution. Clients may provide this data
via context objects of their own (subject to restrictions below). An
ArResolverContext is simply a wrapper around these objects that allows
it to be treated as a single type. Note that an ArResolverContext may
not hold multiple context objects with the same type.
A client-defined context object must provide the following:
- Default and copy constructors
- operator<
- operator==
- An overload for size_t hash_value(const T&)
Note that the user may define a free function:
std::string ArGetDebugString(const Context & ctx); (Where Context is
the type of the user's path resolver context.)
This is optional; a default generic implementation has been
predefined. This function should return a string representation of the
context to be utilized for debugging purposes(such as in TF_DEBUG
statements).
The ArIsContextObject template must also be specialized for this
object to declare that it can be used as a context object. This is to
avoid accidental use of an unexpected object as a context object. The
AR_DECLARE_RESOLVER_CONTEXT macro can be used to do this as a
convenience.
AR_DECLARE_RESOLVER_CONTEXT
ArResolver::BindContext
ArResolver::UnbindContext
ArResolverContextBinder
"""
result["ResolverContext"].__init__.func_doc = """__init__()
Construct an empty asset resolver context.
----------------------------------------------------------------------
__init__(objs)
Construct a resolver context using the given objects ``objs`` .
Each argument must either be an ArResolverContext or a registered
context object. See class documentation for requirements on context
objects.
If an argument is a context object, it will be added to the
constructed ArResolverContext. If an argument is an ArResolverContext,
all of the context objects it holds will be added to the constructed
ArResolverContext.
Arguments are ordered from strong-to-weak. If a context object is
encountered with the same type as a previously-added object, the
previously-added object will remain and the other context object will
be ignored.
Parameters
----------
objs : Objects...
----------------------------------------------------------------------
__init__(ctxs)
Construct a resolver context using the ArResolverContexts in ``ctxs``
.
All of the context objects held by each ArResolverContext in ``ctxs``
will be added to the constructed ArResolverContext.
Arguments are ordered from strong-to-weak. If a context object is
encountered with the same type as a previously-added object, the
previously-added object will remain and the other context object will
be ignored.
Parameters
----------
ctxs : list[ResolverContext]
"""
result["ResolverContext"].IsEmpty.func_doc = """IsEmpty() -> bool
Returns whether this resolver context is empty.
"""
result["ResolverContext"].Get.func_doc = """Get() -> ContextObj
Returns pointer to the context object of the given type held in this
resolver context.
Returns None if this resolver context is not holding an object of the
requested type.
"""
result["ResolverContext"].GetDebugString.func_doc = """GetDebugString() -> str
Returns a debug string representing the contained context objects.
"""
result["ResolverContextBinder"].__doc__ = """
Helper object for managing the binding and unbinding of
ArResolverContext objects with the asset resolver.
Asset Resolver Context Operations
"""
result["ResolverContextBinder"].__init__.func_doc = """__init__(context)
Bind the given ``context`` with the asset resolver.
Calls ArResolver::BindContext on the configured asset resolver and
saves the bindingData populated by that function.
Parameters
----------
context : ResolverContext
----------------------------------------------------------------------
__init__(assetResolver, context)
Bind the given ``context`` to the given ``assetResolver`` .
Calls ArResolver::BindContext on the given ``assetResolver`` and saves
the bindingData populated by that function.
Parameters
----------
assetResolver : Resolver
context : ResolverContext
"""
result["ResolverScopedCache"].__doc__ = """
Helper object for managing asset resolver cache scopes.
A scoped resolution cache indicates to the resolver that results of
calls to Resolve should be cached for a certain scope. This is
important for performance and also for consistency it ensures that
repeated calls to Resolve with the same parameters will return the
same result.
Scoped Resolution Cache
"""
result["ResolverScopedCache"].__init__.func_doc = """__init__(arg1)
Parameters
----------
arg1 : ResolverScopedCache
----------------------------------------------------------------------
__init__()
Begin an asset resolver cache scope.
Calls ArResolver::BeginCacheScope on the configured asset resolver and
saves the cacheScopeData populated by that function.
----------------------------------------------------------------------
__init__(parent)
Begin an asset resolver cache scope that shares data with the given
``parent`` scope.
Calls ArResolver::BeginCacheScope on the configured asset resolver,
saves the cacheScopeData stored in ``parent`` and passes that to that
function.
Parameters
----------
parent : ResolverScopedCache
"""
result["Timestamp"].__doc__ = """
Represents a timestamp for an asset. Timestamps are represented by
Unix time, the number of seconds elapsed since 00:00:00 UTC 1/1/1970.
"""
result["Timestamp"].__init__.func_doc = """__init__()
Create an invalid timestamp.
----------------------------------------------------------------------
__init__(time)
Create a timestamp at ``time`` , which must be a Unix time value.
Parameters
----------
time : float
"""
result["Timestamp"].IsValid.func_doc = """IsValid() -> bool
Return true if this timestamp is valid, false otherwise.
"""
result["Timestamp"].GetTime.func_doc = """GetTime() -> float
Return the time represented by this timestamp as a double.
If this timestamp is invalid, issue a coding error and return a quiet
NaN value.
""" | 17,675 | Python | 22.166448 | 126 | 0.709873 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Ar/__init__.pyi | from __future__ import annotations
import pxr.Ar._ar
import typing
import Boost.Python
import pxr.Ar
__all__ = [
"DefaultResolver",
"DefaultResolverContext",
"GetResolver",
"GetUnderlyingResolver",
"IsPackageRelativePath",
"JoinPackageRelativePath",
"Notice",
"ResolvedPath",
"Resolver",
"ResolverContext",
"ResolverContextBinder",
"ResolverScopedCache",
"SetPreferredResolver",
"SplitPackageRelativePathInner",
"SplitPackageRelativePathOuter",
"Timestamp"
]
class DefaultResolver(Resolver, Boost.Python.instance):
"""
Default asset resolution implementation used when no plugin
implementation is provided.
In order to resolve assets specified by relative paths, this resolver
implements a simple"search path"scheme. The resolver will anchor the
relative path to a series of directories and return the first absolute
path where the asset exists.
The first directory will always be the current working directory. The
resolver will then examine the directories specified via the following
mechanisms (in order):
- The currently-bound ArDefaultResolverContext for the calling
thread
- ArDefaultResolver::SetDefaultSearchPath
- The environment variable PXR_AR_DEFAULT_SEARCH_PATH. This is
expected to be a list of directories delimited by the platform's
standard path separator.
ArDefaultResolver supports creating an ArDefaultResolverContext via
ArResolver::CreateContextFromString by passing a list of directories
delimited by the platform's standard path separator.
"""
@staticmethod
def SetDefaultSearchPath(*args, **kwargs) -> None:
"""
**classmethod** SetDefaultSearchPath(searchPath) -> None
Set the default search path that will be used during asset resolution.
This must be called before the first call to ArGetResolver. The
specified paths will be searched *in addition to, and before* paths
specified via the environment variable PXR_AR_DEFAULT_SEARCH_PATH
Parameters
----------
searchPath : list[str]
"""
pass
class DefaultResolverContext(Boost.Python.instance):
"""
Resolver context object that specifies a search path to use during
asset resolution. This object is intended for use with the default
ArDefaultResolver asset resolution implementation; see documentation
for that class for more details on the search path resolution
algorithm.
Example usage:
.. code-block:: text
ArDefaultResolverContext ctx({"/Local/Models", "/Installed/Models"});
{
// Bind the context object:
ArResolverContextBinder binder(ctx);
// While the context is bound, all calls to ArResolver::Resolve
// (assuming ArDefaultResolver is the underlying implementation being
// used) will include the specified paths during resolution.
std::string resolvedPath = resolver.Resolve("ModelName/File.txt")
}
// Once the context is no longer bound (due to the ArResolverContextBinder
// going out of scope), its search path no longer factors into asset
// resolution.
"""
@staticmethod
def GetSearchPath() -> list[str]:
"""
GetSearchPath() -> list[str]
Return this context's search path.
"""
pass
class Notice(Boost.Python.instance):
class ResolverChanged(ResolverNotice, pxr.Tf.Notice, Boost.Python.instance):
@staticmethod
def AffectsContext(*args, **kwargs) -> None: ...
pass
class ResolverNotice(pxr.Tf.Notice, Boost.Python.instance):
pass
pass
class ResolvedPath(Boost.Python.instance):
"""
Represents a resolved asset path.
"""
@staticmethod
def GetPathString() -> str:
"""
GetPathString() -> str
Return the resolved path held by this object as a string.
"""
__instance_size__ = 48
pass
class Resolver(Boost.Python.instance):
"""
Interface for the asset resolution system. An asset resolver is
responsible for resolving asset information (including the asset's
physical path) from a logical path.
See ar_implementing_resolver for information on how to customize asset
resolution behavior by implementing a subclass of ArResolver. Clients
may use ArGetResolver to access the configured asset resolver.
"""
@staticmethod
def CanWriteAssetToPath(resolvedPath, whyNot) -> bool:
"""
CanWriteAssetToPath(resolvedPath, whyNot) -> bool
Returns true if an asset may be written to the given ``resolvedPath``
, false otherwise.
If this function returns false and ``whyNot`` is not ``nullptr`` , it
may be filled with an explanation.
Parameters
----------
resolvedPath : ResolvedPath
whyNot : str
"""
@staticmethod
@typing.overload
def CreateContextFromString(contextStr) -> ResolverContext:
"""
CreateContextFromString(contextStr) -> ResolverContext
Return an ArResolverContext created from the primary ArResolver
implementation using the given ``contextStr`` .
Parameters
----------
contextStr : str
----------------------------------------------------------------------
Return an ArResolverContext created from the ArResolver registered for
the given ``uriScheme`` using the given ``contextStr`` .
An empty ``uriScheme`` indicates the primary resolver and is
equivalent to CreateContextFromString(string).
If no resolver is registered for ``uriScheme`` , returns an empty
ArResolverContext.
Parameters
----------
uriScheme : str
contextStr : str
"""
@staticmethod
@typing.overload
def CreateContextFromString(uriScheme, contextStr) -> ResolverContext: ...
@staticmethod
def CreateContextFromStrings(contextStrs) -> ResolverContext:
"""
CreateContextFromStrings(contextStrs) -> ResolverContext
Return an ArResolverContext created by combining the ArResolverContext
objects created from the given ``contextStrs`` .
``contextStrs`` is a list of pairs of strings. The first element in
the pair is the URI scheme for the ArResolver that will be used to
create the ArResolverContext from the second element in the pair. An
empty URI scheme indicates the primary resolver.
For example:
.. code-block:: text
ArResolverContext ctx = ArGetResolver().CreateContextFromStrings(
{ {"", "context str 1"},
{"my_scheme", "context str 2"} });
This will use the primary resolver to create an ArResolverContext
using the string"context str 1"and use the resolver registered for
the"my_scheme"URI scheme to create an ArResolverContext using"context
str 2". These contexts will be combined into a single
ArResolverContext and returned.
If no resolver is registered for a URI scheme in an entry in
``contextStrs`` , that entry will be ignored.
Parameters
----------
contextStrs : list[tuple[str, str]]
"""
@staticmethod
def CreateDefaultContext() -> ResolverContext:
"""
CreateDefaultContext() -> ResolverContext
Return an ArResolverContext that may be bound to this resolver to
resolve assets when no other context is explicitly specified.
The returned ArResolverContext will contain the default context
returned by the primary resolver and all URI resolvers.
"""
@staticmethod
def CreateDefaultContextForAsset(assetPath) -> ResolverContext:
"""
CreateDefaultContextForAsset(assetPath) -> ResolverContext
Return an ArResolverContext that may be bound to this resolver to
resolve the asset located at ``assetPath`` or referenced by that asset
when no other context is explicitly specified.
The returned ArResolverContext will contain the default context for
``assetPath`` returned by the primary resolver and all URI resolvers.
Parameters
----------
assetPath : str
"""
@staticmethod
def CreateIdentifier(assetPath, anchorAssetPath) -> str:
"""
CreateIdentifier(assetPath, anchorAssetPath) -> str
Returns an identifier for the asset specified by ``assetPath`` .
If ``anchorAssetPath`` is not empty, it is the resolved asset path
that ``assetPath`` should be anchored to if it is a relative path.
Parameters
----------
assetPath : str
anchorAssetPath : ResolvedPath
"""
@staticmethod
def CreateIdentifierForNewAsset(assetPath, anchorAssetPath) -> str:
"""
CreateIdentifierForNewAsset(assetPath, anchorAssetPath) -> str
Returns an identifier for a new asset specified by ``assetPath`` .
If ``anchorAssetPath`` is not empty, it is the resolved asset path
that ``assetPath`` should be anchored to if it is a relative path.
Parameters
----------
assetPath : str
anchorAssetPath : ResolvedPath
"""
@staticmethod
def GetAssetInfo(assetPath, resolvedPath) -> ArAssetInfo:
"""
GetAssetInfo(assetPath, resolvedPath) -> ArAssetInfo
Returns an ArAssetInfo populated with additional metadata (if any)
about the asset at the given ``assetPath`` .
``resolvedPath`` is the resolved path computed for the given
``assetPath`` .
Parameters
----------
assetPath : str
resolvedPath : ResolvedPath
"""
@staticmethod
def GetCurrentContext() -> ResolverContext:
"""
GetCurrentContext() -> ResolverContext
Returns the asset resolver context currently bound in this thread.
ArResolver::BindContext, ArResolver::UnbindContext
"""
@staticmethod
def GetExtension(assetPath) -> str:
"""
GetExtension(assetPath) -> str
Returns the file extension for the given ``assetPath`` .
The returned extension does not include a"."at the beginning.
Parameters
----------
assetPath : str
"""
@staticmethod
def GetModificationTimestamp(assetPath, resolvedPath) -> Timestamp:
"""
GetModificationTimestamp(assetPath, resolvedPath) -> Timestamp
Returns an ArTimestamp representing the last time the asset at
``assetPath`` was modified.
``resolvedPath`` is the resolved path computed for the given
``assetPath`` . If a timestamp cannot be retrieved, return an invalid
ArTimestamp.
Parameters
----------
assetPath : str
resolvedPath : ResolvedPath
"""
@staticmethod
def IsContextDependentPath(assetPath) -> bool:
"""
IsContextDependentPath(assetPath) -> bool
Returns true if ``assetPath`` is a context-dependent path, false
otherwise.
A context-dependent path may result in different resolved paths
depending on what asset resolver context is bound when Resolve is
called. Assets located at the same context-dependent path may not be
the same since those assets may have been loaded from different
resolved paths. In this case, the assets'resolved paths must be
consulted to determine if they are the same.
Parameters
----------
assetPath : str
"""
@staticmethod
def RefreshContext(context) -> None:
"""
RefreshContext(context) -> None
Refresh any caches associated with the given context.
If doing so would invalidate asset paths that had previously been
resolved, an ArNotice::ResolverChanged notice will be sent to inform
clients of this.
Parameters
----------
context : ResolverContext
"""
@staticmethod
def Resolve(assetPath) -> ResolvedPath:
"""
Resolve(assetPath) -> ResolvedPath
Returns the resolved path for the asset identified by the given
``assetPath`` if it exists.
If the asset does not exist, returns an empty ArResolvedPath.
Parameters
----------
assetPath : str
"""
@staticmethod
def ResolveForNewAsset(assetPath) -> ResolvedPath:
"""
ResolveForNewAsset(assetPath) -> ResolvedPath
Returns the resolved path for the given ``assetPath`` that may be used
to create a new asset.
If such a path cannot be computed for ``assetPath`` , returns an empty
ArResolvedPath.
Note that an asset might or might not already exist at the returned
resolved path.
Parameters
----------
assetPath : str
"""
pass
class ResolverContext(Boost.Python.instance):
"""
An asset resolver context allows clients to provide additional data to
the resolver for use during resolution. Clients may provide this data
via context objects of their own (subject to restrictions below). An
ArResolverContext is simply a wrapper around these objects that allows
it to be treated as a single type. Note that an ArResolverContext may
not hold multiple context objects with the same type.
A client-defined context object must provide the following:
- Default and copy constructors
- operator<
- operator==
- An overload for size_t hash_value(const T&)
Note that the user may define a free function:
std::string ArGetDebugString(const Context & ctx); (Where Context is
the type of the user's path resolver context.)
This is optional; a default generic implementation has been
predefined. This function should return a string representation of the
context to be utilized for debugging purposes(such as in TF_DEBUG
statements).
The ArIsContextObject template must also be specialized for this
object to declare that it can be used as a context object. This is to
avoid accidental use of an unexpected object as a context object. The
AR_DECLARE_RESOLVER_CONTEXT macro can be used to do this as a
convenience.
AR_DECLARE_RESOLVER_CONTEXT
ArResolver::BindContext
ArResolver::UnbindContext
ArResolverContextBinder
"""
@staticmethod
def Get() -> ContextObj:
"""
Get() -> ContextObj
Returns pointer to the context object of the given type held in this
resolver context.
Returns None if this resolver context is not holding an object of the
requested type.
"""
@staticmethod
def GetDebugString() -> str:
"""
GetDebugString() -> str
Returns a debug string representing the contained context objects.
"""
@staticmethod
def IsEmpty() -> bool:
"""
IsEmpty() -> bool
Returns whether this resolver context is empty.
"""
pass
class ResolverContextBinder(Boost.Python.instance):
"""
Helper object for managing the binding and unbinding of
ArResolverContext objects with the asset resolver.
Asset Resolver Context Operations
"""
__instance_size__ = 48
pass
class ResolverScopedCache(Boost.Python.instance):
"""
Helper object for managing asset resolver cache scopes.
A scoped resolution cache indicates to the resolver that results of
calls to Resolve should be cached for a certain scope. This is
important for performance and also for consistency it ensures that
repeated calls to Resolve with the same parameters will return the
same result.
Scoped Resolution Cache
"""
__instance_size__ = 24
pass
class Timestamp(Boost.Python.instance):
"""
Represents a timestamp for an asset. Timestamps are represented by
Unix time, the number of seconds elapsed since 00:00:00 UTC 1/1/1970.
"""
@staticmethod
def GetTime() -> float:
"""
GetTime() -> float
Return the time represented by this timestamp as a double.
If this timestamp is invalid, issue a coding error and return a quiet
NaN value.
"""
@staticmethod
def IsValid() -> bool:
"""
IsValid() -> bool
Return true if this timestamp is valid, false otherwise.
"""
__instance_size__ = 24
pass
class _PyAnnotatedBoolResult(Boost.Python.instance):
@property
def whyNot(self) -> None:
"""
:type: None
"""
__instance_size__ = 56
pass
def GetResolver(*args, **kwargs) -> None:
pass
def GetUnderlyingResolver(*args, **kwargs) -> None:
pass
def IsPackageRelativePath(*args, **kwargs) -> None:
pass
def JoinPackageRelativePath(*args, **kwargs) -> None:
pass
def SetPreferredResolver(*args, **kwargs) -> None:
pass
def SplitPackageRelativePathInner(*args, **kwargs) -> None:
pass
def SplitPackageRelativePathOuter(*args, **kwargs) -> None:
pass
def _TestImplicitConversion(*args, **kwargs) -> None:
pass
__MFB_FULL_PACKAGE_NAME = 'ar'
| 17,477 | unknown | 27.937086 | 80 | 0.650684 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Tf/__init__.py | #
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
"""
Tf -- Tools Foundation
"""
# Type to help handle DLL import paths on Windows with python interpreters v3.8
# and newer. These interpreters don't search for DLLs in the path anymore, you
# have to provide a path explicitly. This re-enables path searching for USD
# dependency libraries
import platform, sys
if sys.version_info >= (3, 8) and platform.system() == "Windows":
import contextlib
@contextlib.contextmanager
def WindowsImportWrapper():
import os
dirs = []
import_paths = os.getenv('PXR_USD_WINDOWS_DLL_PATH')
if import_paths is None:
import_paths = os.getenv('PATH', '')
for path in import_paths.split(os.pathsep):
# Calling add_dll_directory raises an exception if paths don't
# exist, or if you pass in dot
if os.path.exists(path) and path != '.':
dirs.append(os.add_dll_directory(path))
# This block guarantees we clear the dll directories if an exception
# is raised in the with block.
try:
yield
finally:
for dll_dir in dirs:
dll_dir.close()
del os
del contextlib
else:
class WindowsImportWrapper(object):
def __enter__(self):
pass
def __exit__(self, exc_type, ex_val, exc_tb):
pass
del platform, sys
def PreparePythonModule(moduleName=None):
"""Prepare an extension module at import time. This will import the
Python module associated with the caller's module (e.g. '_tf' for 'pxr.Tf')
or the module with the specified moduleName and copy its contents into
the caller's local namespace.
Generally, this should only be called by the __init__.py script for a module
upon loading a boost python module (generally '_libName.so')."""
import importlib
import inspect
import os
frame = inspect.currentframe().f_back
try:
f_locals = frame.f_locals
# If an explicit moduleName is not supplied, construct it from the
# caller's module name, like "pxr.Tf", and our naming conventions,
# which results in "_tf".
if moduleName is None:
moduleName = f_locals["__name__"].split(".")[-1]
moduleName = "_" + moduleName[0].lower() + moduleName[1:]
with WindowsImportWrapper():
module = importlib.import_module(
"." + moduleName, f_locals["__name__"])
PrepareModule(module, f_locals)
try:
del f_locals[moduleName]
except KeyError:
pass
if not os.environ.get("PXR_DISABLE_EXTERNAL_PY_DOCSTRINGS"):
try:
module = importlib.import_module(".__DOC", f_locals["__name__"])
module.Execute(f_locals)
try:
del f_locals["__DOC"]
except KeyError:
pass
except Exception:
pass
finally:
del frame
def PrepareModule(module, result):
"""PrepareModule(module, result) -- Prepare an extension module at import
time. Generally, this should only be called by the __init__.py script for a
module upon loading a boost python module (generally '_libName.so')."""
# inject into result.
ignore = frozenset(['__name__', '__package__', '__builtins__',
'__doc__', '__file__', '__path__'])
newModuleName = result.get('__name__')
for key, value in module.__dict__.items():
if not key in ignore:
result[key] = value
# Lie about the module from which value came.
if newModuleName and hasattr(value, '__module__'):
try:
setattr(value, '__module__', newModuleName)
except AttributeError as e:
# The __module__ attribute of Boost.Python.function
# objects is not writable, so we get this exception
# a lot. Just ignore it. We're really only concerned
# about the data objects like enum values and such.
#
pass
def GetCodeLocation(framesUp):
"""Returns a tuple (moduleName, functionName, fileName, lineNo).
To trace the current location of python execution, use GetCodeLocation().
By default, the information is returned at the current stack-frame; thus::
info = GetCodeLocation()
will return information about the line that GetCodeLocation() was called
from. One can write: ::
def genericDebugFacility():
info = GetCodeLocation(1)
# print out data
def someCode():
...
if bad:
genericDebugFacility()
and genericDebugFacility() will get information associated with its caller,
i.e. the function someCode()."""
import sys
f_back = sys._getframe(framesUp).f_back
return (f_back.f_globals['__name__'], f_back.f_code.co_name,
f_back.f_code.co_filename, f_back.f_lineno)
PreparePythonModule()
# Need to provide an exception type that tf errors will show up as.
class ErrorException(RuntimeError):
def __init__(self, *args):
RuntimeError.__init__(self, *args)
self.__TfException = True
def __str__(self):
return '\n\t' + '\n\t'.join([str(e) for e in self.args])
__SetErrorExceptionClass(ErrorException)
def Warn(msg, template=""):
"""Issue a warning via the TfDiagnostic system.
At this time, template is ignored.
"""
codeInfo = GetCodeLocation(framesUp=1)
_Warn(msg, codeInfo[0], codeInfo[1], codeInfo[2], codeInfo[3])
def Status(msg, verbose=True):
"""Issues a status update to the Tf diagnostic system.
If verbose is True (the default) then information about where in the code
the status update was issued from is included.
"""
if verbose:
codeInfo = GetCodeLocation(framesUp=1)
_Status(msg, codeInfo[0], codeInfo[1], codeInfo[2], codeInfo[3])
else:
_Status(msg, "", "", "", 0)
def RaiseCodingError(msg):
"""Raise a coding error to the Tf Diagnostic system."""
codeInfo = GetCodeLocation(framesUp=1)
_RaiseCodingError(msg, codeInfo[0], codeInfo[1], codeInfo[2], codeInfo[3])
def RaiseRuntimeError(msg):
"""Raise a runtime error to the Tf Diagnostic system."""
codeInfo = GetCodeLocation(framesUp=1)
_RaiseRuntimeError(msg, codeInfo[0], codeInfo[1], codeInfo[2], codeInfo[3])
def Fatal(msg):
"""Raise a fatal error to the Tf Diagnostic system."""
codeInfo = GetCodeLocation(framesUp=1)
_Fatal(msg, codeInfo[0], codeInfo[1], codeInfo[2], codeInfo[3])
class NamedTemporaryFile(object):
"""A named temporary file which keeps the internal file handle closed.
A class which constructs a temporary file(that isn't open) on __enter__,
provides its name as an attribute, and deletes it on __exit__.
Note: The constructor args for this object match those of
python's tempfile.mkstemp() function, and will have the same effect on
the underlying file created."""
def __init__(self, suffix='', prefix='', dir=None, text=False):
# Note that we defer creation until the enter block to
# prevent users from unintentionally creating a bunch of
# temp files that don't get cleaned up.
self._args = (suffix, prefix, dir, text)
def __enter__(self):
from tempfile import mkstemp
from os import close
fd, path = mkstemp(*self._args)
close(fd)
# XXX: We currently only expose the name attribute
# more can be added based on client needs in the future.
self._name = path
return self
def __exit__(self, *args):
import os
os.remove(self.name)
@property
def name(self):
"""The path for the temporary file created."""
return self._name
| 9,036 | Python | 35.293173 | 80 | 0.625609 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Tf/__DOC.py | def Execute(result):
result["CallContext"].__doc__ = """"""
result["Debug"].__doc__ = """
Enum-based debugging messages.
The ``TfDebug`` class encapsulates a simple enum-based conditional
debugging message system. It is meant as a tool for developers, and
*NOT* as a means of issuing diagnostic messages to end-users. (This is
not strictly true. The TfDebug class is extremely useful and has many
properties that make its use attractive for issuing messages to end-
users. However, for this purpose, please use the ``TF_INFO`` macro
which more clearly indicates its intent.)
The features of ``TfDebug`` are:
- Debugging messages/calls for an entire enum group can be compiled
out-of-existence.
- The cost of checking if a specific message should be printed at
runtime (assuming the enum group of the message has not been compile-
time disabled) is a single inline array lookup, with a compile-time
index into a global array.
The use of the facility is simple:
.. code-block:: text
// header file
#include "pxr/base/tf/debug.h"
TF_DEBUG_CODES(MY_E1, MY_E2, MY_E3);
// source file
TF_DEBUG(MY_E2).Msg("something about e2\n");
TF_DEBUG(MY_E3).Msg("val = %d\n", value);
The code in the header file declares the debug symbols to use. Under
the hood, this creates an enum with the values given in the argument
to TF_DEBUG_CODES, along with a first and last sentinel values and
passes that to TF_DEBUG_RANGE.
If you need to obtain the enum type name, use
decltype(SOME_ENUM_VALUE).
In the source file, the indicated debugging messages are printed only
if the debugging symbols are enabled. Effectively, the construct
.. code-block:: text
TF_DEBUG(MY_E1).Msg(msgExpr)
is translated to
.. code-block:: text
if (symbol-MY_E1-is-enabled)
output(msgExpr)
The implications are that ``msgExpr`` is only evaluated if symbol
``MY_E1`` symbol is enabled.
To totally disable TF_DEBUG output for a set of codes at compile time,
declare the codes using
TF_CONDITIONALLY_COMPILE_TIME_ENABLED_DEBUG_CODES(condition,
\\.\\.\\.) where \\.\\.\\. is all the debug codes. If'condition'is
false at compile time then all TF_DEBUG() .Msg()s for these codes are
elminated at compile time, so they have zero cost.
Most commonly debug symbols are inactive by default, but can be turned
on either by an environment variable ``TF_DEBUG`` , or interactively
once a program has started.
.. code-block:: text
TfDebug::DisableAll<MyDebugCodes>(); // disable everything
TfDebug::Enable(MY_E1); // enable just MY_E1
Description strings may be associated with debug codes as follows:
.. code-block:: text
// source file xyz/debugCodes.cpp
#include "proj/my/debugCodes.h"
#include "pxr/base/tf/debug.h"
#include "pxr/base/tf/registryManager.h"
TF_REGISTRY_FUNCTION(TfDebug) {
TF_DEBUG_ENVIRONMENT_SYMBOL(MY_E1, "loading of blah-blah files");
TF_DEBUG_ENVIRONMENT_SYMBOL(MY_E2, "parsing of mdl code");
// etc.
}
"""
result["Debug"].SetDebugSymbolsByName.func_doc = """**classmethod** SetDebugSymbolsByName(pattern, value) -> list[str]
Set registered debug symbols matching ``pattern`` to ``value`` .
All registered debug symbols matching ``pattern`` are set to ``value``
. The only matching is an exact match with ``pattern`` , or if
``pattern`` ends with an'\\*'as is otherwise a prefix of a debug
symbols. The names of all debug symbols set by this call are returned
as a vector.
Parameters
----------
pattern : str
value : bool
"""
result["Debug"].IsDebugSymbolNameEnabled.func_doc = """**classmethod** IsDebugSymbolNameEnabled(name) -> bool
True if the specified debug symbol is set.
Parameters
----------
name : str
"""
result["Debug"].GetDebugSymbolDescriptions.func_doc = """**classmethod** GetDebugSymbolDescriptions() -> str
Get a description of all debug symbols and their purpose.
A single string describing all registered debug symbols along with
short descriptions is returned.
"""
result["Debug"].GetDebugSymbolNames.func_doc = """**classmethod** GetDebugSymbolNames() -> list[str]
Get a listing of all debug symbols.
"""
result["Debug"].GetDebugSymbolDescription.func_doc = """**classmethod** GetDebugSymbolDescription(name) -> str
Get a description for the specified debug symbol.
A short description of the debug symbol is returned. This is the same
description string that is embedded in the return value of
GetDebugSymbolDescriptions.
Parameters
----------
name : str
"""
result["Debug"].SetOutputFile.func_doc = """**classmethod** SetOutputFile(file) -> None
Direct debug output to *either* stdout or stderr.
Note that *file* MUST be either stdout or stderr. If not, issue an
error and do nothing. Debug output is issued to stdout by default. If
the environment variable TF_DEBUG_OUTPUT_FILE is set to'stderr', then
output is issued to stderr by default.
Parameters
----------
file : FILE
"""
result["Enum"].__doc__ = """
An enum class that records both enum type and enum value.
"""
result["Enum"].GetValueFromFullName.func_doc = """**classmethod** GetValueFromFullName(fullname, foundIt) -> Enum
Returns the enumerated value for a fully-qualified name.
This takes a fully-qualified enumerated value name (e.g.,
``"Season::WINTER"`` ) and returns the associated value. If there is
no such name, this returns -1. Since -1 can sometimes be a valid
value, the ``foundIt`` flag pointer, if not ``None`` , is set to
``true`` if the name was found and ``false`` otherwise. Also, since
this is not a templated function, it has to return a generic value
type, so we use ``TfEnum`` .
Parameters
----------
fullname : str
foundIt : bool
"""
result["Error"].__doc__ = """
Represents an object that contains error information.
See Guide To Diagnostic Facilities in the C++ API reference for a
detailed description of the error issuing API. For a example of how to
post an error, see ``TF_ERROR()`` , also in the C++ API reference.
In the Python API, you can raise several different types of errors,
including coding errors (Tf.RaiseCodingError), run time errors
(Tf.RaiseRuntimeError), fatal errors (Tf.Fatal).
"""
result["MallocTag"].__doc__ = """
Top-down memory tagging system.
See The TfMallocTag Memory Tagging System for a detailed description.
"""
result["MallocTag"].Initialize.func_doc = """**classmethod** Initialize(errMsg) -> bool
Initialize the memory tagging system.
This function returns ``true`` if the memory tagging system can be
successfully initialized or it has already been initialized.
Otherwise, ``\\*errMsg`` is set with an explanation for the failure.
Until the system is initialized, the various memory reporting calls
will indicate that no memory has been allocated. Note also that memory
allocated prior to calling ``Initialize()`` is not tracked i.e. all
data refers to allocations that happen subsequent to calling
``Initialize()`` .
Parameters
----------
errMsg : str
"""
result["MallocTag"].IsInitialized.func_doc = """**classmethod** IsInitialized() -> bool
Return true if the tagging system is active.
If ``Initialize()`` has been successfully called, this function
returns ``true`` .
"""
result["MallocTag"].GetTotalBytes.func_doc = """**classmethod** GetTotalBytes() -> int
Return total number of allocated bytes.
The current total memory that has been allocated and not freed is
returned. Memory allocated before calling ``Initialize()`` is not
accounted for.
"""
result["MallocTag"].GetMaxTotalBytes.func_doc = """**classmethod** GetMaxTotalBytes() -> int
Return the maximum total number of bytes that have ever been allocated
at one time.
This is simply the maximum value of GetTotalBytes() since Initialize()
was called.
"""
result["MallocTag"].GetCallTree.func_doc = """**classmethod** GetCallTree(tree, skipRepeated) -> bool
Return a snapshot of memory usage.
Returns a snapshot by writing into ``\\*tree`` . See the ``C`` \\*tree
structure for documentation. If ``Initialize()`` has not been called,
\ \\*tree is set to a rather blank structure (empty vectors, empty
strings, zero in all integral fields) and ``false`` is returned;
otherwise, ``\\*tree`` is set with the contents of the current memory
snapshot and ``true`` is returned. It is fine to call this function on
the same ``\\*tree`` instance; each call simply overwrites the data
from the last call. If /p skipRepeated is ``true`` , then any repeated
callsite is skipped. See the ``CallTree`` documentation for more
details.
Parameters
----------
tree : CallTree
skipRepeated : bool
"""
result["MallocTag"].SetDebugMatchList.func_doc = """**classmethod** SetDebugMatchList(matchList) -> None
Sets the tags to trap in the debugger.
When memory is allocated or freed for any tag that matches
``matchList`` the debugger trap is invoked. If a debugger is attached
the program will stop in the debugger, otherwise the program will
continue to run. See ``ArchDebuggerTrap()`` and ``ArchDebuggerWait()``
.
``matchList`` is a comma, tab or newline separated list of malloc tag
names. The names can have internal spaces but leading and trailing
spaces are stripped. If a name ends in'\\*'then the suffix is
wildcarded. A name can have a leading'-'or'+'to prevent or allow a
match. Each name is considered in order and later matches override
earlier matches. For example,'Csd\\*, -CsdScene::_Populate\\*,
+CsdScene::_PopulatePrimCacheLocal'matches any malloc tag starting
with'Csd'but nothing starting
with'CsdScene::_Populate'except'CsdScene::_PopulatePrimCacheLocal'.
Use the empty string to disable debugging traps.
Parameters
----------
matchList : str
"""
result["MallocTag"].SetCapturedMallocStacksMatchList.func_doc = """**classmethod** SetCapturedMallocStacksMatchList(matchList) -> None
Sets the tags to trace.
When memory is allocated for any tag that matches ``matchList`` a
stack trace is recorded. When that memory is released the stack trace
is discarded. Clients can call ``GetCapturedMallocStacks()`` to get a
list of all recorded stack traces. This is useful for finding leaks.
Traces recorded for any tag that will no longer be matched are
discarded by this call. Traces recorded for tags that continue to be
matched are retained.
``matchList`` is a comma, tab or newline separated list of malloc tag
names. The names can have internal spaces but leading and trailing
spaces are stripped. If a name ends in'\\*'then the suffix is
wildcarded. A name can have a leading'-'or'+'to prevent or allow a
match. Each name is considered in order and later matches override
earlier matches. For example,'Csd\\*, -CsdScene::_Populate\\*,
+CsdScene::_PopulatePrimCacheLocal'matches any malloc tag starting
with'Csd'but nothing starting
with'CsdScene::_Populate'except'CsdScene::_PopulatePrimCacheLocal'.
Use the empty string to disable stack capturing.
Parameters
----------
matchList : str
"""
result["Notice"].__doc__ = """
The base class for objects used to notify interested parties
(listeners) when events have occurred. The TfNotice class also serves
as a container for various dispatching routines such as Register() and
Send() .
See The TfNotice Notification System in the C++ API reference for a
detailed description of the notification system.
Python Example: Registering For and Sending
===========================================
Notices The following code provides examples of how to set up a Notice
listener connection (represented in Python by the Listener class),
including creating and sending notices, registering to receive
notices, and breaking a listener connection.
.. code-block:: text
# To create a new notice type:
class APythonClass(Tf.Notice):
'''TfNotice sent when APythonClass does something of interest.'''
pass
Tf.Type.Define(APythonClass)
# An interested listener can register to receive notices from all
# senders, or from a particular type of sender.
# To send a notice to all registered listeners:;
APythonClass().SendGlobally()
# To send a notice to listeners who register with a specific sender:
APythonClass().Send(self)
# To register for the notice from any sender:
my_listener = Tf.Notice.RegisterGlobally(APythonClass, self._HandleNotice)
# To register for the notice from a specific sender
my_listener = Tf.Notice.Register(APythonClass, self._HandleNotice, sender)
def _HandleNotice(self, notice, sender):
'''callback function for handling a notice'''
# do something when the notice arrives
# To revoke interest in a notice
my_listener.Revoke()
For more on using notices in Python, see the Editor With Notices
tutorial.
"""
result["PyModuleWasLoaded"].__doc__ = """
A *TfNotice* that is sent when a script module is loaded. Since many
modules may be loaded at once, listeners are encouraged to defer work
triggered by this notice to the end of an application iteration. This,
of course, is good practice in general.
"""
result["RefPtrTracker"].__doc__ = """
Provides tracking of ``TfRefPtr`` objects to particular objects.
Clients can enable, at compile time, tracking of ``TfRefPtr`` objects
that point to particular instances of classes derived from
``TfRefBase`` . This is useful if you have a ref counted object with a
ref count that should've gone to zero but didn't. This tracker can
tell you every ``TfRefPtr`` that's holding the ``TfRefBase`` and a
stack trace where it was created or last assigned to.
Clients can get a report of all watched instances and how many
``TfRefPtr`` objects are holding them using
``ReportAllWatchedCounts()`` (in python use ``Tf.RefPtrTracker()``
.GetAllWatchedCountsReport()). You can see all of the stack traces
using ``ReportAllTraces()`` (in python use ``Tf.RefPtrTracker()``
.GetAllTracesReport()).
Clients will typically enable tracking using code like this:
.. code-block:: text
#include "pxr/base/tf/refPtrTracker.h"
class MyRefBaseType;
typedef TfRefPtr<MyRefBaseType> MyRefBaseTypeRefPtr;
TF_DECLARE_REFPTR_TRACK(MyRefBaseType);
class MyRefBaseType {
\\.\\.\\.
public:
static bool _ShouldWatch(const MyRefBaseType\\*);
\\.\\.\\.
};
TF_DEFINE_REFPTR_TRACK(MyRefBaseType, MyRefBaseType::_ShouldWatch);
Note that the ``TF_DECLARE_REFPTR_TRACK()`` macro must be invoked
before any use of the ``MyRefBaseTypeRefPtr`` type.
The ``MyRefBaseType::_ShouldWatch()`` function returns ``true`` if the
given instance of ``MyRefBaseType`` should be tracked. You can also
use ``TfRefPtrTracker::WatchAll()`` to watch every instance (but that
might use a lot of memory and time).
If you have a base type, ``B`` , and a derived type, ``D`` , and you
hold instances of ``D`` in a ``TfRefPtr < ``B>```` (i.e. a pointer to
the base) then you must track both type ``B`` and type ``D`` . But you
can use ``TfRefPtrTracker::WatchNone()`` when tracking ``B`` if you're
not interested in instances of ``B`` .
"""
result["RefPtrTracker"].__init__.func_doc = """__init__()
"""
result["ScopeDescription"].__doc__ = """
This class is used to provide high-level descriptions about scopes of
execution that could possibly block, or to provide relevant
information about high-level action that would be useful in a crash
report.
This class is reasonably fast to use, especially if the message
strings are not dynamically created, however it should not be used in
very highly performance sensitive contexts. The cost to push & pop is
essentially a TLS lookup plus a couple of atomic operations.
"""
result["ScopeDescription"].__init__.func_doc = """__init__()
----------------------------------------------------------------------
__init__(arg1)
Parameters
----------
arg1 : ScopeDescription
----------------------------------------------------------------------
__init__(description, context)
Construct with a description.
Push *description* on the stack of descriptions for this thread.
Caller guarantees that the string ``description`` lives at least as
long as this TfScopeDescription object.
Parameters
----------
description : str
context : CallContext
----------------------------------------------------------------------
__init__(description, context)
Construct with a description.
Push *description* on the stack of descriptions for this thread. This
object adopts ownership of the rvalue ``description`` .
Parameters
----------
description : str
context : CallContext
----------------------------------------------------------------------
__init__(description, context)
Construct with a description.
Push *description* on the stack of descriptions for this thread.
Caller guarantees that the string ``description`` lives at least as
long as this TfScopeDescription object.
Parameters
----------
description : char
context : CallContext
"""
result["ScopeDescription"].SetDescription.func_doc = """SetDescription(description) -> None
Replace the description stack entry for this scope description.
Caller guarantees that the string ``description`` lives at least as
long as this TfScopeDescription object.
Parameters
----------
description : str
----------------------------------------------------------------------
SetDescription(description) -> None
Replace the description stack entry for this scope description.
This object adopts ownership of the rvalue ``description`` .
Parameters
----------
description : str
----------------------------------------------------------------------
SetDescription(description) -> None
Replace the description stack entry for this scope description.
Caller guarantees that the string ``description`` lives at least as
long as this TfScopeDescription object.
Parameters
----------
description : char
"""
result["ScriptModuleLoader"].__doc__ = """
Provides low-level facilities for shared modules with script
bindings to register themselves with their dependences, and provides a
mechanism whereby those script modules will be loaded when necessary.
Currently, this is when one of our script modules is loaded, when
TfPyInitialize is called, and when Plug opens shared modules.
Generally, user code will not make use of this.
"""
result["ScriptModuleLoader"].GetModuleNames.func_doc = """GetModuleNames() -> list[str]
Return a list of all currently known modules in a valid dependency
order.
"""
result["ScriptModuleLoader"].GetModulesDict.func_doc = """GetModulesDict() -> python.dict
Return a python dict containing all currently known modules under
their canonical names.
"""
result["ScriptModuleLoader"].WriteDotFile.func_doc = """WriteDotFile(file) -> None
Write a graphviz dot-file for the dependency graph of all.
currently known modules/modules to *file*.
Parameters
----------
file : str
"""
result["ScriptModuleLoader"].__init__.func_doc = """__init__()
"""
result["Singleton"].__doc__ = """
Manage a single instance of an object (see
Typical Use for a canonical example).
"""
result["Stopwatch"].__doc__ = """
Low-cost, high-resolution timer datatype.
A ``TfStopwatch`` can be used to perform very precise timings at
runtime, even in very tight loops. The cost of"starting"or"stopping"a
``TfStopwatch`` is very small: approximately 40 nanoseconds on a 900
Mhz Pentium III Linux box, 300 nanoseconds on a 400 Mhz Sun, and 200
nanoseconds on a 250 Mhz SGI.
Note that this class is not thread-safe: if you need to take timings
in a multi-threaded region of a process, let each thread have its own
``TfStopwatch`` and then combine results using the ``AddFrom()``
member function.
"""
result["Stopwatch"].Start.func_doc = """Start() -> None
Record the current time for use by the next ``Stop()`` call.
The ``Start()`` function records the current time. A subsequent call
to ``Start()`` before a call to ``Stop()`` simply records a later
current time, but does not change the accumulated time of the
``TfStopwatch`` .
"""
result["Stopwatch"].Stop.func_doc = """Stop() -> None
Increases the accumulated time stored in the ``TfStopwatch`` .
The ``Stop()`` function increases the accumulated time by the duration
between the current time and the last time recorded by a ``Start()``
call. A subsequent call to ``Stop()`` before another call to
``Start()`` will therefore double-count time and throw off the
results.
A ``TfStopwatch`` also counts the number of samples it has taken.
The"sample count"is simply the number of times that ``Stop()`` has
been called.
"""
result["Stopwatch"].Reset.func_doc = """Reset() -> None
Resets the accumulated time and the sample count to zero.
"""
result["Stopwatch"].AddFrom.func_doc = """AddFrom(t) -> None
Adds the accumulated time and sample count from ``t`` into the
``TfStopwatch`` .
If you have several timers taking measurements, and you wish to
combine them together, you can add one timer's results into another;
for example, ``t2.AddFrom(t1)`` will add ``t1`` 's time and sample
count into ``t2`` .
Parameters
----------
t : Stopwatch
"""
result["TemplateString"].__doc__ = """
TfTemplateString provides simple string substitutions based on named
placeholders. Instead of the''-based substitutions used by printf,
template strings use'$'-based substitutions, using the following
rules:
- "$$"is replaced with a single"$"
- "$identifier"names a substitution placeholder matching a mapping
key of"identifier". The first non-identifier character after
the"$"character terminates the placeholder specification.
- "${identifier}"is equivalent to"$identifier". It is required when
valid identifier characters follow the placeholder but are not part of
the placeholder, such as"${noun}ification".
- An identifier is a sequence of characters"[A-Z][a-z][0-9]_".
*TfTemplateString* is immutable: once one is created it may not be
modified. *TfTemplateString* is fast to copy, since it shares state
internally between copies. *TfTemplateString* is thread-safe. It may
be read freely by multiple threads concurrently.
"""
result["TemplateString"].__init__.func_doc = """__init__()
Constructs a new template string.
----------------------------------------------------------------------
__init__(template_)
Constructs a new template string.
Parameters
----------
template_ : str
"""
result["TemplateString"].Substitute.func_doc = """Substitute(arg1) -> str
Performs the template substitution, returning a new string.
The mapping contains keys which match the placeholders in the
template. If a placeholder is found for which no mapping is present, a
coding error is raised.
Parameters
----------
arg1 : Mapping
"""
result["TemplateString"].SafeSubstitute.func_doc = """SafeSubstitute(arg1) -> str
Like Substitute() , except that if placeholders are missing from the
mapping, instead of raising a coding error, the original placeholder
will appear in the resulting string intact.
Parameters
----------
arg1 : Mapping
"""
result["TemplateString"].GetEmptyMapping.func_doc = """GetEmptyMapping() -> Mapping
Returns an empty mapping for the current template.
This method first calls IsValid to ensure that the template is valid.
"""
result["TemplateString"].GetParseErrors.func_doc = """GetParseErrors() -> list[str]
Returns any error messages generated during template parsing.
"""
result["Type"].__doc__ = """
TfType represents a dynamic runtime type.
TfTypes are created and discovered at runtime, rather than compile
time.
Features:
- unique typename
- safe across DSO boundaries
- can represent C++ types, pure Python types, or Python subclasses
of wrapped C++ types
- lightweight value semantics you can copy and default construct
TfType, unlike ``std::type_info`` .
- totally ordered can use as a ``std::map`` key
"""
result["Type"].FindDerivedByName.func_doc = """**classmethod** FindDerivedByName(name) -> Type
Retrieve the ``TfType`` that derives from this type and has the given
alias or typename.
AddAlias
Parameters
----------
name : str
----------------------------------------------------------------------
FindDerivedByName(name) -> Type
Retrieve the ``TfType`` that derives from BASE and has the given alias
or typename.
This is a convenience method, and is equivalent to:
.. code-block:: text
TfType::Find<BASE>().FindDerivedByName(name)
Parameters
----------
name : str
"""
result["Type"].Find.func_doc = """**classmethod** Find() -> Type
Retrieve the ``TfType`` corresponding to type ``T`` .
The type ``T`` must have been declared or defined in the type system
or the ``TfType`` corresponding to an unknown type is returned.
IsUnknown()
----------------------------------------------------------------------
Find(obj) -> Type
Retrieve the ``TfType`` corresponding to ``obj`` .
The ``TfType`` corresponding to the actual object represented by
``obj`` is returned; this may not be the object returned by
``TfType::Find<T>()`` if ``T`` is a polymorphic type.
This works for Python subclasses of the C++ type ``T`` as well, as
long as ``T`` has been wrapped using TfPyPolymorphic.
Of course, the object's type must have been declared or defined in the
type system or the ``TfType`` corresponding to an unknown type is
returned.
IsUnknown()
Parameters
----------
obj : T
----------------------------------------------------------------------
Find(t) -> Type
Retrieve the ``TfType`` corresponding to an obj with the given
``type_info`` .
Parameters
----------
t : type_info
"""
result["Type"].FindByName.func_doc = """**classmethod** FindByName(name) -> Type
Retrieve the ``TfType`` corresponding to the given ``name`` .
Every type defined in the TfType system has a unique, implementation
independent name. In addition, aliases can be added to identify a type
underneath a specific base type; see TfType::AddAlias() . The given
name will first be tried as an alias under the root type, and
subsequently as a typename.
This method is equivalent to:
.. code-block:: text
TfType::GetRoot().FindDerivedByName(name)
For any object ``obj`` ,
.. code-block:: text
Find(obj) == FindByName( Find(obj).GetTypeName() )
Parameters
----------
name : str
"""
result["Type"].GetAliases.func_doc = """GetAliases(derivedType) -> list[str]
Returns a vector of the aliases registered for the derivedType under
this, the base type.
AddAlias()
Parameters
----------
derivedType : Type
"""
result["Type"].GetAllDerivedTypes.func_doc = """GetAllDerivedTypes(result) -> None
Return the set of all types derived (directly or indirectly) from this
type.
Parameters
----------
result : set[Type]
"""
result["Type"].GetAllAncestorTypes.func_doc = """GetAllAncestorTypes(result) -> None
Build a vector of all ancestor types inherited by this type.
The starting type is itself included, as the first element of the
results vector.
Types are given in"C3"resolution order, as used for new-style classes
starting in Python 2.3. This algorithm is more complicated than a
simple depth-first traversal of base classes, in order to prevent some
subtle errors with multiple-inheritance. See the references below for
more background.
This can be expensive; consider caching the results. TfType does not
cache this itself since it is not needed internally.
Guido van Rossum."Unifying types and classes in Python 2.2: Method
resolution order."
http://www.python.org/download/releases/2.2.2/descrintro/#mro
Barrett, Cassels, Haahr, Moon, Playford, Withington."A Monotonic
Superclass Linearization for Dylan."OOPSLA 96.
http://www.webcom.com/haahr/dylan/linearization-oopsla96.html
Parameters
----------
result : list[Type]
"""
result["Type"].IsA.func_doc = """IsA(queryType) -> bool
Return true if this type is the same as or derived from ``queryType``
.
If ``queryType`` is unknown, this always returns ``false`` .
Parameters
----------
queryType : Type
----------------------------------------------------------------------
IsA() -> bool
Return true if this type is the same as or derived from T.
This is equivalent to:
.. code-block:: text
IsA(Find<T>())
"""
result["Type"].GetRoot.func_doc = """**classmethod** GetRoot() -> Type
Return the root type of the type hierarchy.
All known types derive (directly or indirectly) from the root. If a
type is specified with no bases, it is implicitly considered to derive
from the root type.
"""
result["Type"].AddAlias.func_doc = """**classmethod** AddAlias(base, name) -> None
Add an alias name for this type under the given base type.
Aliases are similar to typedefs in C++: they provide an alternate name
for a type. The alias is defined with respect to the given ``base``
type. Aliases must be unique with respect to both other aliases
beneath that base type and names of derived types of that base.
Parameters
----------
base : Type
name : str
----------------------------------------------------------------------
AddAlias(name) -> None
Add an alias for DERIVED beneath BASE.
This is a convenience method, that declares both DERIVED and BASE as
TfTypes before adding the alias.
Parameters
----------
name : str
"""
result["Type"].Define.func_doc = """**classmethod** Define() -> Type
Define a TfType with the given C++ type T and C++ base types B.
Each of the base types will be declared (but not defined) as TfTypes
if they have not already been.
The typeName of the created TfType will be the canonical demangled
RTTI type name, as defined by GetCanonicalTypeName() .
It is an error to attempt to define a type that has already been
defined.
----------------------------------------------------------------------
Define() -> Type
Define a TfType with the given C++ type T and no bases.
See the other Define() template for more details.
C++ does not allow default template arguments for function templates,
so we provide this separate definition for the case of no bases.
"""
result["Type"].__init__.func_doc = """__init__()
Construct an TfType representing an unknown type.
To actually register a new type with the TfType system, see
TfType::Declare() .
Note that this always holds true:
.. code-block:: text
TfType().IsUnknown() == true
----------------------------------------------------------------------
__init__(info)
Parameters
----------
info : _TypeInfo
"""
result["Warning"].__doc__ = """
Represents an object that contains information about a warning.
See Guide To Diagnostic Facilities in the C++ API reference for a
detailed description of the warning issuing API. For a example of how
to post a warning, see ``TF_WARN()`` , also in the C++ API reference.
In the Python API, you can issue a warning with Tf.Warn().
"""
result["Notice"].__doc__ = """"""
result["ReportActiveErrorMarks"].func_doc = """ReportActiveErrorMarks() -> None
Report current TfErrorMark instances and the stack traces that created
them to stdout for debugging purposes.
To call this function, set _enableTfErrorMarkStackTraces in
errorMark.cpp and enable the TF_ERROR_MARK_TRACKING TfDebug code.
"""
result["Error"].__doc__ = """"""
result["Warning"].__doc__ = """"""
result["InstallTerminateAndCrashHandlers"].func_doc = """InstallTerminateAndCrashHandlers() -> None
(Re)install Tf's crash handler.
This should not generally need to be called since Tf does this itself
when loaded. However, when run in 3rd party environments that install
their own signal handlers, possibly overriding Tf's, this provides a
way to reinstall them, in hopes that they'll stick.
This calls std::set_terminate() and installs signal handlers for
SIGSEGV, SIGBUS, SIGFPE, and SIGABRT.
"""
result["MallocTag"].__doc__ = """"""
result["Singleton"].__doc__ = """"""
result["Enum"].__doc__ = """"""
result["Debug"].__doc__ = """"""
result["TemplateString"].__doc__ = """"""
result["StringToDouble"].func_doc = """StringToDouble(txt) -> float
Converts text string to double.
This method converts strings to floating point numbers. It is similar
to libc's atof(), but performs the conversion much more quickly.
It expects somewhat valid input: it will continue parsing the input
until it hits an unrecognized character, as described by the regexp
below, and at that point will return the results up to that point.
(-?[0-9]+(.[0-9]\\*)?|-?.[0-9]+)([eE][-+]?[0-9]+)?
It will not check to see if there is any input at all, or whitespace
after the digits. Ie: TfStringToDouble("") == 0.0
TfStringToDouble("blah") == 0.0 TfStringToDouble("-") == -0.0
TfStringToDouble("1.2foo") == 1.2
``TfStringToDouble`` is a wrapper around the extern-c TfStringToDouble
Parameters
----------
txt : str
----------------------------------------------------------------------
StringToDouble(text) -> float
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
text : str
----------------------------------------------------------------------
StringToDouble(text, len) -> float
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
text : str
len : int
"""
result["StringToLong"].func_doc = """StringToLong(txt, outOfRange) -> long
Convert a sequence of digits in ``txt`` to a long int value.
Caller is responsible for ensuring that ``txt`` has content matching:
.. code-block:: text
-?[0-9]+
If the digit sequence's value is out of range, set ``\\*outOfRange``
to true (if ``outOfRange`` is not None) and return either
std::numeric_limits<long>::min() or max(), whichever is closest to the
true value.
Parameters
----------
txt : str
outOfRange : bool
----------------------------------------------------------------------
StringToLong(txt, outOfRange) -> long
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
txt : str
outOfRange : bool
"""
result["StringToULong"].func_doc = """StringToULong(txt, outOfRange) -> int
Convert a sequence of digits in ``txt`` to an unsigned long value.
Caller is responsible for ensuring that ``txt`` has content matching:
.. code-block:: text
[0-9]+
If the digit sequence's value is out of range, set ``\\*outOfRange``
to true (if ``outOfRange`` is not None) and return
std::numeric_limits<unsignedlong>::max().
Parameters
----------
txt : str
outOfRange : bool
----------------------------------------------------------------------
StringToULong(txt, outOfRange) -> int
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
txt : str
outOfRange : bool
"""
result["StringSplit"].func_doc = """StringSplit(src, separator) -> list[str]
Breaks the given string apart, returning a vector of strings.
The string ``source`` is broken apart into individual words, where a
word is delimited by the string ``separator`` . This function behaves
like pythons string split method.
Parameters
----------
src : str
separator : str
"""
result["IsValidIdentifier"].func_doc = """IsValidIdentifier(identifier) -> bool
Test whether *identifier* is valid.
An identifier is valid if it follows the C/Python identifier
convention; that is, it must be at least one character long, must
start with a letter or underscore, and must contain only letters,
underscores, and numerals.
Parameters
----------
identifier : str
"""
result["MakeValidIdentifier"].func_doc = """MakeValidIdentifier(in) -> str
Produce a valid identifier (see TfIsValidIdentifier) from ``in`` by
replacing invalid characters with'_'.
If ``in`` is empty, return"_".
Parameters
----------
in : str
"""
result["Stopwatch"].__doc__ = """"""
result["CallContext"].file = property(result["CallContext"].file.fget, result["CallContext"].file.fset, result["CallContext"].file.fdel, """type : char
""")
result["CallContext"].function = property(result["CallContext"].function.fget, result["CallContext"].function.fset, result["CallContext"].function.fdel, """type : char
""")
result["CallContext"].line = property(result["CallContext"].line.fget, result["CallContext"].line.fset, result["CallContext"].line.fdel, """type : int
""")
result["CallContext"].prettyFunction = property(result["CallContext"].prettyFunction.fget, result["CallContext"].prettyFunction.fset, result["CallContext"].prettyFunction.fdel, """type : char
""")
result["PyModuleWasLoaded"].name.func_doc = """name() -> str
Return the name of the module that was loaded.
"""
result["Stopwatch"].nanoseconds = property(result["Stopwatch"].nanoseconds.fget, result["Stopwatch"].nanoseconds.fset, result["Stopwatch"].nanoseconds.fdel, """type : int
Return the accumulated time in nanoseconds.
Note that this number can easily overflow a 32-bit counter, so take
care to save the result in an ``int64_t`` , and not a regular ``int``
or ``long`` .
""")
result["Stopwatch"].microseconds = property(result["Stopwatch"].microseconds.fget, result["Stopwatch"].microseconds.fset, result["Stopwatch"].microseconds.fdel, """type : int
Return the accumulated time in microseconds.
Note that 45 minutes will overflow a 32-bit counter, so take care to
save the result in an ``int64_t`` , and not a regular ``int`` or
``long`` .
""")
result["Stopwatch"].milliseconds = property(result["Stopwatch"].milliseconds.fget, result["Stopwatch"].milliseconds.fset, result["Stopwatch"].milliseconds.fdel, """type : int
Return the accumulated time in milliseconds.
""")
result["Stopwatch"].sampleCount = property(result["Stopwatch"].sampleCount.fget, result["Stopwatch"].sampleCount.fset, result["Stopwatch"].sampleCount.fdel, """type : int
Return the current sample count.
The sample count, which is simply the number of calls to ``Stop()``
since creation or a call to ``Reset()`` , is useful for computing
average running times of a repeated task.
""")
result["Stopwatch"].seconds = property(result["Stopwatch"].seconds.fget, result["Stopwatch"].seconds.fset, result["Stopwatch"].seconds.fdel, """type : float
Return the accumulated time in seconds as a ``double`` .
""")
result["TemplateString"].template = property(result["TemplateString"].template.fget, result["TemplateString"].template.fset, result["TemplateString"].template.fdel, """type : str
Returns the template source string supplied to the constructor.
""")
result["TemplateString"].valid = property(result["TemplateString"].valid.fget, result["TemplateString"].valid.fset, result["TemplateString"].valid.fdel, """type : bool
Returns true if the current template is well formed.
Empty templates are valid.
""")
result["Type"].typeName = property(result["Type"].typeName.fget, result["Type"].typeName.fset, result["Type"].typeName.fdel, """type : str
Return the machine-independent name for this type.
This name is specified when the TfType is declared.
Declare()
""")
result["Type"].pythonClass = property(result["Type"].pythonClass.fget, result["Type"].pythonClass.fset, result["Type"].pythonClass.fdel, """type : TfPyObjWrapper
Return the Python class object for this type.
If this type is unknown or has not yet had a Python class defined,
this will return ``None`` , as an empty ``TfPyObjWrapper``
DefinePythonClass()
""")
result["Type"].baseTypes = property(result["Type"].baseTypes.fget, result["Type"].baseTypes.fset, result["Type"].baseTypes.fdel, """type : list[Type]
Return a vector of types from which this type was derived.
""")
result["Type"].isUnknown = property(result["Type"].isUnknown.fget, result["Type"].isUnknown.fset, result["Type"].isUnknown.fdel, """type : bool
Return true if this is the unknown type, representing a type unknown
to the TfType system.
The unknown type does not derive from the root type, or any other
type.
""")
result["Type"].isEnumType = property(result["Type"].isEnumType.fget, result["Type"].isEnumType.fset, result["Type"].isEnumType.fdel, """type : bool
Return true if this is an enum type.
""")
result["Type"].isPlainOldDataType = property(result["Type"].isPlainOldDataType.fget, result["Type"].isPlainOldDataType.fset, result["Type"].isPlainOldDataType.fdel, """type : bool
Return true if this is a plain old data type, as defined by C++.
""")
result["Type"].sizeof = property(result["Type"].sizeof.fget, result["Type"].sizeof.fset, result["Type"].sizeof.fdel, """type : int
Return the size required to hold an instance of this type on the stack
(does not include any heap allocated memory the instance uses).
This is what the C++ sizeof operator returns for the type, so this
value is not very useful for Python types (it will always be
sizeof(boost::python::object)).
""") | 41,089 | Python | 24.474272 | 194 | 0.696731 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Tf/__init__.pyi | from __future__ import annotations
import pxr.Tf._tf
import typing
import Boost.Python
import pxr.Tf
import python
__all__ = [
"CallContext",
"CppException",
"Debug",
"DiagnosticType",
"DictionaryStrcmp",
"DumpTokenStats",
"Enum",
"Error",
"FindLongestAccessiblePrefix",
"GetAppLaunchTime",
"GetCurrentScopeDescriptionStack",
"GetEnvSetting",
"GetStackTrace",
"InstallTerminateAndCrashHandlers",
"InvokeWithErrorHandling",
"IsValidIdentifier",
"LogStackTrace",
"MakeValidIdentifier",
"MallocTag",
"Notice",
"PrintStackTrace",
"PyModuleWasLoaded",
"RealPath",
"RefPtrTracker",
"ReportActiveErrorMarks",
"RepostErrors",
"ScopeDescription",
"ScriptModuleLoader",
"SetPythonExceptionDebugTracingEnabled",
"Singleton",
"StatusObject",
"Stopwatch",
"StringSplit",
"StringToDouble",
"StringToLong",
"StringToULong",
"TF_APPLICATION_EXIT_TYPE",
"TF_DIAGNOSTIC_CODING_ERROR_TYPE",
"TF_DIAGNOSTIC_FATAL_CODING_ERROR_TYPE",
"TF_DIAGNOSTIC_FATAL_ERROR_TYPE",
"TF_DIAGNOSTIC_NONFATAL_ERROR_TYPE",
"TF_DIAGNOSTIC_RUNTIME_ERROR_TYPE",
"TF_DIAGNOSTIC_STATUS_TYPE",
"TF_DIAGNOSTIC_WARNING_TYPE",
"TemplateString",
"Tf_PyEnumWrapper",
"Tf_TestAnnotatedBoolResult",
"Tf_TestPyContainerConversions",
"Tf_TestPyOptional",
"TouchFile",
"Type",
"Warning"
]
class CallContext(Boost.Python.instance):
@property
def file(self) -> None:
"""
type : char
:type: None
"""
@property
def function(self) -> None:
"""
type : char
:type: None
"""
@property
def line(self) -> None:
"""
type : int
:type: None
"""
@property
def prettyFunction(self) -> None:
"""
type : char
:type: None
"""
pass
class CppException(Exception, BaseException):
pass
class Debug(Boost.Python.instance):
@staticmethod
def GetDebugSymbolDescription(*args, **kwargs) -> None:
"""
**classmethod** GetDebugSymbolDescription(name) -> str
Get a description for the specified debug symbol.
A short description of the debug symbol is returned. This is the same
description string that is embedded in the return value of
GetDebugSymbolDescriptions.
Parameters
----------
name : str
"""
@staticmethod
def GetDebugSymbolDescriptions(*args, **kwargs) -> None:
"""
**classmethod** GetDebugSymbolDescriptions() -> str
Get a description of all debug symbols and their purpose.
A single string describing all registered debug symbols along with
short descriptions is returned.
"""
@staticmethod
def GetDebugSymbolNames(*args, **kwargs) -> None:
"""
**classmethod** GetDebugSymbolNames() -> list[str]
Get a listing of all debug symbols.
"""
@staticmethod
def IsDebugSymbolNameEnabled(*args, **kwargs) -> None:
"""
**classmethod** IsDebugSymbolNameEnabled(name) -> bool
True if the specified debug symbol is set.
Parameters
----------
name : str
"""
@staticmethod
def SetDebugSymbolsByName(*args, **kwargs) -> None:
"""
**classmethod** SetDebugSymbolsByName(pattern, value) -> list[str]
Set registered debug symbols matching ``pattern`` to ``value`` .
All registered debug symbols matching ``pattern`` are set to ``value``
. The only matching is an exact match with ``pattern`` , or if
``pattern`` ends with an'\*'as is otherwise a prefix of a debug
symbols. The names of all debug symbols set by this call are returned
as a vector.
Parameters
----------
pattern : str
value : bool
"""
@staticmethod
def SetOutputFile(*args, **kwargs) -> None:
"""
**classmethod** SetOutputFile(file) -> None
Direct debug output to *either* stdout or stderr.
Note that *file* MUST be either stdout or stderr. If not, issue an
error and do nothing. Debug output is issued to stdout by default. If
the environment variable TF_DEBUG_OUTPUT_FILE is set to'stderr', then
output is issued to stderr by default.
Parameters
----------
file : FILE
"""
pass
class DiagnosticType(Tf_PyEnumWrapper, Enum, Boost.Python.instance):
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = ''
allValues: tuple # value = (Tf.TF_DIAGNOSTIC_CODING_ERROR_TYPE, Tf.TF_DIAGNOSTIC_FATAL_CODING_ERROR_TYPE, Tf.TF_DIAGNOSTIC_RUNTIME_ERROR_TYPE, Tf.TF_DIAGNOSTIC_FATAL_ERROR_TYPE, Tf.TF_DIAGNOSTIC_NONFATAL_ERROR_TYPE, Tf.TF_DIAGNOSTIC_WARNING_TYPE, Tf.TF_DIAGNOSTIC_STATUS_TYPE, Tf.TF_APPLICATION_EXIT_TYPE)
pass
class Enum(Boost.Python.instance):
@staticmethod
def GetValueFromFullName(*args, **kwargs) -> None:
"""
**classmethod** GetValueFromFullName(fullname, foundIt) -> Enum
Returns the enumerated value for a fully-qualified name.
This takes a fully-qualified enumerated value name (e.g.,
``"Season::WINTER"`` ) and returns the associated value. If there is
no such name, this returns -1. Since -1 can sometimes be a valid
value, the ``foundIt`` flag pointer, if not ``None`` , is set to
``true`` if the name was found and ``false`` otherwise. Also, since
this is not a templated function, it has to return a generic value
type, so we use ``TfEnum`` .
Parameters
----------
fullname : str
foundIt : bool
"""
pass
class Error(_DiagnosticBase, Boost.Python.instance):
class Mark(Boost.Python.instance):
@staticmethod
def Clear(*args, **kwargs) -> None: ...
@staticmethod
def GetErrors(*args, **kwargs) -> None:
"""
A list of the errors held by this mark.
"""
@staticmethod
def IsClean(*args, **kwargs) -> None: ...
@staticmethod
def SetMark(*args, **kwargs) -> None: ...
__instance_size__ = 24
pass
@property
def errorCode(self) -> None:
"""
The error code posted for this error.
:type: None
"""
@property
def errorCodeString(self) -> None:
"""
The error code posted for this error, as a string.
:type: None
"""
pass
class MallocTag(Boost.Python.instance):
class CallTree(Boost.Python.instance):
class CallSite(Boost.Python.instance):
@property
def nBytes(self) -> None:
"""
:type: None
"""
@property
def name(self) -> None:
"""
:type: None
"""
pass
class PathNode(Boost.Python.instance):
@staticmethod
def GetChildren(*args, **kwargs) -> None: ...
@property
def nAllocations(self) -> None:
"""
:type: None
"""
@property
def nBytes(self) -> None:
"""
:type: None
"""
@property
def nBytesDirect(self) -> None:
"""
:type: None
"""
@property
def siteName(self) -> None:
"""
:type: None
"""
pass
@staticmethod
def GetCallSites(*args, **kwargs) -> None: ...
@staticmethod
def GetPrettyPrintString(*args, **kwargs) -> None: ...
@staticmethod
def GetRoot(*args, **kwargs) -> None: ...
@staticmethod
def LogReport(*args, **kwargs) -> None: ...
@staticmethod
def Report(*args, **kwargs) -> None: ...
pass
@staticmethod
def GetCallStacks(*args, **kwargs) -> None: ...
@staticmethod
def GetCallTree(*args, **kwargs) -> None:
"""
**classmethod** GetCallTree(tree, skipRepeated) -> bool
Return a snapshot of memory usage.
Returns a snapshot by writing into ``\*tree`` . See the ``C`` \*tree
structure for documentation. If ``Initialize()`` has not been called,
\ \*tree is set to a rather blank structure (empty vectors, empty
strings, zero in all integral fields) and ``false`` is returned;
otherwise, ``\*tree`` is set with the contents of the current memory
snapshot and ``true`` is returned. It is fine to call this function on
the same ``\*tree`` instance; each call simply overwrites the data
from the last call. If /p skipRepeated is ``true`` , then any repeated
callsite is skipped. See the ``CallTree`` documentation for more
details.
Parameters
----------
tree : CallTree
skipRepeated : bool
"""
@staticmethod
def GetMaxTotalBytes(*args, **kwargs) -> None:
"""
**classmethod** GetMaxTotalBytes() -> int
Return the maximum total number of bytes that have ever been allocated
at one time.
This is simply the maximum value of GetTotalBytes() since Initialize()
was called.
"""
@staticmethod
def GetTotalBytes(*args, **kwargs) -> None:
"""
**classmethod** GetTotalBytes() -> int
Return total number of allocated bytes.
The current total memory that has been allocated and not freed is
returned. Memory allocated before calling ``Initialize()`` is not
accounted for.
"""
@staticmethod
def Initialize(*args, **kwargs) -> None:
"""
**classmethod** Initialize(errMsg) -> bool
Initialize the memory tagging system.
This function returns ``true`` if the memory tagging system can be
successfully initialized or it has already been initialized.
Otherwise, ``\*errMsg`` is set with an explanation for the failure.
Until the system is initialized, the various memory reporting calls
will indicate that no memory has been allocated. Note also that memory
allocated prior to calling ``Initialize()`` is not tracked i.e. all
data refers to allocations that happen subsequent to calling
``Initialize()`` .
Parameters
----------
errMsg : str
"""
@staticmethod
def IsInitialized(*args, **kwargs) -> None:
"""
**classmethod** IsInitialized() -> bool
Return true if the tagging system is active.
If ``Initialize()`` has been successfully called, this function
returns ``true`` .
"""
@staticmethod
def SetCapturedMallocStacksMatchList(*args, **kwargs) -> None:
"""
**classmethod** SetCapturedMallocStacksMatchList(matchList) -> None
Sets the tags to trace.
When memory is allocated for any tag that matches ``matchList`` a
stack trace is recorded. When that memory is released the stack trace
is discarded. Clients can call ``GetCapturedMallocStacks()`` to get a
list of all recorded stack traces. This is useful for finding leaks.
Traces recorded for any tag that will no longer be matched are
discarded by this call. Traces recorded for tags that continue to be
matched are retained.
``matchList`` is a comma, tab or newline separated list of malloc tag
names. The names can have internal spaces but leading and trailing
spaces are stripped. If a name ends in'\*'then the suffix is
wildcarded. A name can have a leading'-'or'+'to prevent or allow a
match. Each name is considered in order and later matches override
earlier matches. For example,'Csd\*, -CsdScene::_Populate\*,
+CsdScene::_PopulatePrimCacheLocal'matches any malloc tag starting
with'Csd'but nothing starting
with'CsdScene::_Populate'except'CsdScene::_PopulatePrimCacheLocal'.
Use the empty string to disable stack capturing.
Parameters
----------
matchList : str
"""
@staticmethod
def SetDebugMatchList(*args, **kwargs) -> None:
"""
**classmethod** SetDebugMatchList(matchList) -> None
Sets the tags to trap in the debugger.
When memory is allocated or freed for any tag that matches
``matchList`` the debugger trap is invoked. If a debugger is attached
the program will stop in the debugger, otherwise the program will
continue to run. See ``ArchDebuggerTrap()`` and ``ArchDebuggerWait()``
.
``matchList`` is a comma, tab or newline separated list of malloc tag
names. The names can have internal spaces but leading and trailing
spaces are stripped. If a name ends in'\*'then the suffix is
wildcarded. A name can have a leading'-'or'+'to prevent or allow a
match. Each name is considered in order and later matches override
earlier matches. For example,'Csd\*, -CsdScene::_Populate\*,
+CsdScene::_PopulatePrimCacheLocal'matches any malloc tag starting
with'Csd'but nothing starting
with'CsdScene::_Populate'except'CsdScene::_PopulatePrimCacheLocal'.
Use the empty string to disable debugging traps.
Parameters
----------
matchList : str
"""
pass
class PyModuleWasLoaded(Notice, Boost.Python.instance):
"""
A *TfNotice* that is sent when a script module is loaded. Since many
modules may be loaded at once, listeners are encouraged to defer work
triggered by this notice to the end of an application iteration. This,
of course, is good practice in general.
"""
@staticmethod
def name() -> str:
"""
name() -> str
Return the name of the module that was loaded.
"""
pass
class Notice(Boost.Python.instance):
class Listener(Boost.Python.instance):
"""
Represents the Notice connection between senders and receivers of notices. When a Listener object expires the connection is broken. You can also use the Revoke() function to break the connection. A Listener object is returned from the Register() and RegisterGlobally() functions.
"""
@staticmethod
def Revoke(*args, **kwargs) -> None:
"""
Revoke interest by a notice listener. This function revokes interest in the particular notice type and call-back method that its Listener object was registered for.
"""
pass
@staticmethod
def Register( noticeType, callback, sender ) -> Listener :
"""
noticeType : Tf.Notice
callback : function
sender : object
Register a listener as being interested in a TfNotice type from a specific sender. Notice listener will get sender as an argument. Registration of interest in a notice class N automatically registers interest in all classes derived from N. When a notice of appropriate type is received, the listening object's member-function method is called with the notice. To reverse the registration, call Revoke() on the Listener object returned by this call.
noticeType : Tf.Notice
callback : function
sender : object
Register a listener as being interested in a TfNotice type from a specific sender. Notice listener will get sender as an argument. Registration of interest in a notice class N automatically registers interest in all classes derived from N. When a notice of appropriate type is received, the listening object's member-function method is called with the notice. To reverse the registration, call Revoke() on the Listener object returned by this call.
"""
@staticmethod
def RegisterGlobally( noticeType, callback ) -> Listener :
"""
noticeType : Tf.Notice
callback : function
Register a listener as being interested in a TfNotice type from any sender. The notice listener does not get sender as an argument.
"""
@staticmethod
def Send(*args, **kwargs) -> None:
"""
sender : object
Deliver the notice to interested listeners, returning the number of interested listeners. This is the recommended form of Send. It takes the sender as an argument. Listeners that registered for the given sender AND listeners that registered globally will get the notice.
sender : object
Deliver the notice to interested listeners, returning the number of interested listeners. This is the recommended form of Send. It takes the sender as an argument. Listeners that registered for the given sender AND listeners that registered globally will get the notice.
"""
@staticmethod
def SendGlobally(*args, **kwargs) -> None:
"""
Deliver the notice to interested listeners. For most clients it is recommended to use the Send(sender) version of Send() rather than this one. Clients that use this form of Send will prevent listeners from being able to register to receive notices based on the sender of the notice. ONLY listeners that registered globally will get the notice.
"""
pass
class RefPtrTracker(Boost.Python.instance):
"""
Provides tracking of ``TfRefPtr`` objects to particular objects.
Clients can enable, at compile time, tracking of ``TfRefPtr`` objects
that point to particular instances of classes derived from
``TfRefBase`` . This is useful if you have a ref counted object with a
ref count that should've gone to zero but didn't. This tracker can
tell you every ``TfRefPtr`` that's holding the ``TfRefBase`` and a
stack trace where it was created or last assigned to.
Clients can get a report of all watched instances and how many
``TfRefPtr`` objects are holding them using
``ReportAllWatchedCounts()`` (in python use ``Tf.RefPtrTracker()``
.GetAllWatchedCountsReport()). You can see all of the stack traces
using ``ReportAllTraces()`` (in python use ``Tf.RefPtrTracker()``
.GetAllTracesReport()).
Clients will typically enable tracking using code like this:
.. code-block:: text
#include "pxr/base/tf/refPtrTracker.h"
class MyRefBaseType;
typedef TfRefPtr<MyRefBaseType> MyRefBaseTypeRefPtr;
TF_DECLARE_REFPTR_TRACK(MyRefBaseType);
class MyRefBaseType {
\.\.\.
public:
static bool _ShouldWatch(const MyRefBaseType\*);
\.\.\.
};
TF_DEFINE_REFPTR_TRACK(MyRefBaseType, MyRefBaseType::_ShouldWatch);
Note that the ``TF_DECLARE_REFPTR_TRACK()`` macro must be invoked
before any use of the ``MyRefBaseTypeRefPtr`` type.
The ``MyRefBaseType::_ShouldWatch()`` function returns ``true`` if the
given instance of ``MyRefBaseType`` should be tracked. You can also
use ``TfRefPtrTracker::WatchAll()`` to watch every instance (but that
might use a lot of memory and time).
If you have a base type, ``B`` , and a derived type, ``D`` , and you
hold instances of ``D`` in a ``TfRefPtr < ``B>```` (i.e. a pointer to
the base) then you must track both type ``B`` and type ``D`` . But you
can use ``TfRefPtrTracker::WatchNone()`` when tracking ``B`` if you're
not interested in instances of ``B`` .
"""
@staticmethod
def GetAllTracesReport(*args, **kwargs) -> None: ...
@staticmethod
def GetAllWatchedCountsReport(*args, **kwargs) -> None: ...
@staticmethod
def GetTracesReportForWatched(*args, **kwargs) -> None: ...
@property
def expired(self) -> None:
"""
True if this object has expired, False otherwise.
:type: None
"""
pass
class ScopeDescription(Boost.Python.instance):
"""
This class is used to provide high-level descriptions about scopes of
execution that could possibly block, or to provide relevant
information about high-level action that would be useful in a crash
report.
This class is reasonably fast to use, especially if the message
strings are not dynamically created, however it should not be used in
very highly performance sensitive contexts. The cost to push & pop is
essentially a TLS lookup plus a couple of atomic operations.
"""
@staticmethod
def SetDescription(description) -> None:
"""
SetDescription(description) -> None
Replace the description stack entry for this scope description.
Caller guarantees that the string ``description`` lives at least as
long as this TfScopeDescription object.
Parameters
----------
description : str
----------------------------------------------------------------------
Replace the description stack entry for this scope description.
This object adopts ownership of the rvalue ``description`` .
Parameters
----------
description : str
----------------------------------------------------------------------
Replace the description stack entry for this scope description.
Caller guarantees that the string ``description`` lives at least as
long as this TfScopeDescription object.
Parameters
----------
description : char
"""
__instance_size__ = 56
pass
class ScriptModuleLoader(Boost.Python.instance):
"""
Provides low-level facilities for shared modules with script
bindings to register themselves with their dependences, and provides a
mechanism whereby those script modules will be loaded when necessary.
Currently, this is when one of our script modules is loaded, when
TfPyInitialize is called, and when Plug opens shared modules.
Generally, user code will not make use of this.
"""
@staticmethod
def GetModuleNames() -> list[str]:
"""
GetModuleNames() -> list[str]
Return a list of all currently known modules in a valid dependency
order.
"""
@staticmethod
def GetModulesDict() -> python.dict:
"""
GetModulesDict() -> python.dict
Return a python dict containing all currently known modules under
their canonical names.
"""
@staticmethod
def WriteDotFile(file) -> None:
"""
WriteDotFile(file) -> None
Write a graphviz dot-file for the dependency graph of all.
currently known modules/modules to *file*.
Parameters
----------
file : str
"""
@staticmethod
def _LoadModulesForLibrary(*args, **kwargs) -> None: ...
@staticmethod
def _RegisterLibrary(*args, **kwargs) -> None: ...
@property
def expired(self) -> None:
"""
True if this object has expired, False otherwise.
:type: None
"""
pass
class Singleton(Boost.Python.instance):
pass
class StatusObject(_DiagnosticBase, Boost.Python.instance):
pass
class Stopwatch(Boost.Python.instance):
@staticmethod
def AddFrom(t) -> None:
"""
AddFrom(t) -> None
Adds the accumulated time and sample count from ``t`` into the
``TfStopwatch`` .
If you have several timers taking measurements, and you wish to
combine them together, you can add one timer's results into another;
for example, ``t2.AddFrom(t1)`` will add ``t1`` 's time and sample
count into ``t2`` .
Parameters
----------
t : Stopwatch
"""
@staticmethod
def Reset() -> None:
"""
Reset() -> None
Resets the accumulated time and the sample count to zero.
"""
@staticmethod
def Start() -> None:
"""
Start() -> None
Record the current time for use by the next ``Stop()`` call.
The ``Start()`` function records the current time. A subsequent call
to ``Start()`` before a call to ``Stop()`` simply records a later
current time, but does not change the accumulated time of the
``TfStopwatch`` .
"""
@staticmethod
def Stop() -> None:
"""
Stop() -> None
Increases the accumulated time stored in the ``TfStopwatch`` .
The ``Stop()`` function increases the accumulated time by the duration
between the current time and the last time recorded by a ``Start()``
call. A subsequent call to ``Stop()`` before another call to
``Start()`` will therefore double-count time and throw off the
results.
A ``TfStopwatch`` also counts the number of samples it has taken.
The"sample count"is simply the number of times that ``Stop()`` has
been called.
"""
@property
def microseconds(self) -> None:
"""
type : int
Return the accumulated time in microseconds.
Note that 45 minutes will overflow a 32-bit counter, so take care to
save the result in an ``int64_t`` , and not a regular ``int`` or
``long`` .
:type: None
"""
@property
def milliseconds(self) -> None:
"""
type : int
Return the accumulated time in milliseconds.
:type: None
"""
@property
def nanoseconds(self) -> None:
"""
type : int
Return the accumulated time in nanoseconds.
Note that this number can easily overflow a 32-bit counter, so take
care to save the result in an ``int64_t`` , and not a regular ``int``
or ``long`` .
:type: None
"""
@property
def sampleCount(self) -> None:
"""
type : int
Return the current sample count.
The sample count, which is simply the number of calls to ``Stop()``
since creation or a call to ``Reset()`` , is useful for computing
average running times of a repeated task.
:type: None
"""
@property
def seconds(self) -> None:
"""
type : float
Return the accumulated time in seconds as a ``double`` .
:type: None
"""
__instance_size__ = 40
pass
class TemplateString(Boost.Python.instance):
@staticmethod
def GetEmptyMapping() -> Mapping:
"""
GetEmptyMapping() -> Mapping
Returns an empty mapping for the current template.
This method first calls IsValid to ensure that the template is valid.
"""
@staticmethod
def GetParseErrors() -> list[str]:
"""
GetParseErrors() -> list[str]
Returns any error messages generated during template parsing.
"""
@staticmethod
def SafeSubstitute(arg1) -> str:
"""
SafeSubstitute(arg1) -> str
Like Substitute() , except that if placeholders are missing from the
mapping, instead of raising a coding error, the original placeholder
will appear in the resulting string intact.
Parameters
----------
arg1 : Mapping
"""
@staticmethod
def Substitute(arg1) -> str:
"""
Substitute(arg1) -> str
Performs the template substitution, returning a new string.
The mapping contains keys which match the placeholders in the
template. If a placeholder is found for which no mapping is present, a
coding error is raised.
Parameters
----------
arg1 : Mapping
"""
@property
def template(self) -> None:
"""
type : str
Returns the template source string supplied to the constructor.
:type: None
"""
@property
def valid(self) -> None:
"""
type : bool
Returns true if the current template is well formed.
Empty templates are valid.
:type: None
"""
__instance_size__ = 32
pass
class Tf_PyEnumWrapper(Enum, Boost.Python.instance):
@property
def displayName(self) -> None:
"""
:type: None
"""
@property
def fullName(self) -> None:
"""
:type: None
"""
@property
def name(self) -> None:
"""
:type: None
"""
@property
def value(self) -> None:
"""
:type: None
"""
pass
class Tf_TestAnnotatedBoolResult(Boost.Python.instance):
@property
def annotation(self) -> None:
"""
:type: None
"""
__instance_size__ = 56
pass
class Tf_TestPyContainerConversions(Boost.Python.instance):
@staticmethod
def GetPairTimesTwo(*args, **kwargs) -> None: ...
@staticmethod
def GetTokens(*args, **kwargs) -> None: ...
@staticmethod
def GetVectorTimesTwo(*args, **kwargs) -> None: ...
__instance_size__ = 24
pass
class Tf_TestPyOptional(Boost.Python.instance):
@staticmethod
def TakesOptional(*args, **kwargs) -> None: ...
@staticmethod
def TestOptionalChar(*args, **kwargs) -> None: ...
@staticmethod
def TestOptionalDouble(*args, **kwargs) -> None: ...
@staticmethod
def TestOptionalFloat(*args, **kwargs) -> None: ...
@staticmethod
def TestOptionalInt(*args, **kwargs) -> None: ...
@staticmethod
def TestOptionalLong(*args, **kwargs) -> None: ...
@staticmethod
def TestOptionalShort(*args, **kwargs) -> None: ...
@staticmethod
def TestOptionalString(*args, **kwargs) -> None: ...
@staticmethod
def TestOptionalStringVector(*args, **kwargs) -> None: ...
@staticmethod
def TestOptionalUChar(*args, **kwargs) -> None: ...
@staticmethod
def TestOptionalUInt(*args, **kwargs) -> None: ...
@staticmethod
def TestOptionalULong(*args, **kwargs) -> None: ...
@staticmethod
def TestOptionalUShort(*args, **kwargs) -> None: ...
__instance_size__ = 24
pass
class Type(Boost.Python.instance):
"""
TfType represents a dynamic runtime type.
TfTypes are created and discovered at runtime, rather than compile
time.
Features:
- unique typename
- safe across DSO boundaries
- can represent C++ types, pure Python types, or Python subclasses
of wrapped C++ types
- lightweight value semantics you can copy and default construct
TfType, unlike ``std::type_info`` .
- totally ordered can use as a ``std::map`` key
"""
@staticmethod
def AddAlias(name) -> None:
"""
**classmethod** AddAlias(base, name) -> None
Add an alias name for this type under the given base type.
Aliases are similar to typedefs in C++: they provide an alternate name
for a type. The alias is defined with respect to the given ``base``
type. Aliases must be unique with respect to both other aliases
beneath that base type and names of derived types of that base.
Parameters
----------
base : Type
name : str
----------------------------------------------------------------------
Add an alias for DERIVED beneath BASE.
This is a convenience method, that declares both DERIVED and BASE as
TfTypes before adding the alias.
Parameters
----------
name : str
"""
@staticmethod
def Define() -> Type:
"""
**classmethod** Define() -> Type
Define a TfType with the given C++ type T and C++ base types B.
Each of the base types will be declared (but not defined) as TfTypes
if they have not already been.
The typeName of the created TfType will be the canonical demangled
RTTI type name, as defined by GetCanonicalTypeName() .
It is an error to attempt to define a type that has already been
defined.
----------------------------------------------------------------------
Define a TfType with the given C++ type T and no bases.
See the other Define() template for more details.
C++ does not allow default template arguments for function templates,
so we provide this separate definition for the case of no bases.
"""
@staticmethod
@typing.overload
def Find(obj) -> Type:
"""
**classmethod** Find() -> Type
Retrieve the ``TfType`` corresponding to type ``T`` .
The type ``T`` must have been declared or defined in the type system
or the ``TfType`` corresponding to an unknown type is returned.
----------------------------------------------------------------------
Retrieve the ``TfType`` corresponding to ``obj`` .
The ``TfType`` corresponding to the actual object represented by
``obj`` is returned; this may not be the object returned by
``TfType::Find<T>()`` if ``T`` is a polymorphic type.
This works for Python subclasses of the C++ type ``T`` as well, as
long as ``T`` has been wrapped using TfPyPolymorphic.
Of course, the object's type must have been declared or defined in the
type system or the ``TfType`` corresponding to an unknown type is
returned.
Parameters
----------
obj : T
----------------------------------------------------------------------
Retrieve the ``TfType`` corresponding to an obj with the given
``type_info`` .
Parameters
----------
t : type_info
"""
@staticmethod
@typing.overload
def Find(t) -> Type: ...
@staticmethod
def FindByName(*args, **kwargs) -> None:
"""
**classmethod** FindByName(name) -> Type
Retrieve the ``TfType`` corresponding to the given ``name`` .
Every type defined in the TfType system has a unique, implementation
independent name. In addition, aliases can be added to identify a type
underneath a specific base type; see TfType::AddAlias() . The given
name will first be tried as an alias under the root type, and
subsequently as a typename.
This method is equivalent to:
.. code-block:: text
TfType::GetRoot().FindDerivedByName(name)
For any object ``obj`` ,
.. code-block:: text
Find(obj) == FindByName( Find(obj).GetTypeName() )
Parameters
----------
name : str
"""
@staticmethod
def FindDerivedByName(name) -> Type:
"""
**classmethod** FindDerivedByName(name) -> Type
Retrieve the ``TfType`` that derives from this type and has the given
alias or typename.
AddAlias
Parameters
----------
name : str
----------------------------------------------------------------------
Retrieve the ``TfType`` that derives from BASE and has the given alias
or typename.
This is a convenience method, and is equivalent to:
.. code-block:: text
TfType::Find<BASE>().FindDerivedByName(name)
Parameters
----------
name : str
"""
@staticmethod
def GetAliases(derivedType) -> list[str]:
"""
GetAliases(derivedType) -> list[str]
Returns a vector of the aliases registered for the derivedType under
this, the base type.
Parameters
----------
derivedType : Type
"""
@staticmethod
def GetAllAncestorTypes(result) -> None:
"""
GetAllAncestorTypes(result) -> None
Build a vector of all ancestor types inherited by this type.
The starting type is itself included, as the first element of the
results vector.
Types are given in"C3"resolution order, as used for new-style classes
starting in Python 2.3. This algorithm is more complicated than a
simple depth-first traversal of base classes, in order to prevent some
subtle errors with multiple-inheritance. See the references below for
more background.
This can be expensive; consider caching the results. TfType does not
cache this itself since it is not needed internally.
Guido van Rossum."Unifying types and classes in Python 2.2: Method
resolution order."
http://www.python.org/download/releases/2.2.2/descrintro/#mro
Barrett, Cassels, Haahr, Moon, Playford, Withington."A Monotonic
Superclass Linearization for Dylan."OOPSLA 96.
http://www.webcom.com/haahr/dylan/linearization-oopsla96.html
Parameters
----------
result : list[Type]
"""
@staticmethod
def GetAllDerivedTypes(result) -> None:
"""
GetAllDerivedTypes(result) -> None
Return the set of all types derived (directly or indirectly) from this
type.
Parameters
----------
result : set[Type]
"""
@staticmethod
def GetRoot(*args, **kwargs) -> None:
"""
**classmethod** GetRoot() -> Type
Return the root type of the type hierarchy.
All known types derive (directly or indirectly) from the root. If a
type is specified with no bases, it is implicitly considered to derive
from the root type.
"""
@staticmethod
@typing.overload
def IsA(queryType) -> bool:
"""
IsA(queryType) -> bool
Return true if this type is the same as or derived from ``queryType``
.
If ``queryType`` is unknown, this always returns ``false`` .
Parameters
----------
queryType : Type
----------------------------------------------------------------------
Return true if this type is the same as or derived from T.
This is equivalent to:
.. code-block:: text
IsA(Find<T>())
"""
@staticmethod
@typing.overload
def IsA() -> bool: ...
@staticmethod
def _DumpTypeHierarchy(*args, **kwargs) -> None: ...
@property
def baseTypes(self) -> None:
"""
type : list[Type]
Return a vector of types from which this type was derived.
:type: None
"""
@property
def derivedTypes(self) -> None:
"""
:type: None
"""
@property
def isEnumType(self) -> None:
"""
type : bool
Return true if this is an enum type.
:type: None
"""
@property
def isPlainOldDataType(self) -> None:
"""
type : bool
Return true if this is a plain old data type, as defined by C++.
:type: None
"""
@property
def isUnknown(self) -> None:
"""
type : bool
Return true if this is the unknown type, representing a type unknown
to the TfType system.
The unknown type does not derive from the root type, or any other
type.
:type: None
"""
@property
def pythonClass(self) -> None:
"""
type : TfPyObjWrapper
Return the Python class object for this type.
If this type is unknown or has not yet had a Python class defined,
this will return ``None`` , as an empty ``TfPyObjWrapper``
:type: None
"""
@property
def sizeof(self) -> None:
"""
type : int
Return the size required to hold an instance of this type on the stack
(does not include any heap allocated memory the instance uses).
This is what the C++ sizeof operator returns for the type, so this
value is not very useful for Python types (it will always be
sizeof(boost::python::object)).
:type: None
"""
@property
def typeName(self) -> None:
"""
type : str
Return the machine-independent name for this type.
This name is specified when the TfType is declared.
:type: None
"""
Unknown: pxr.Tf.Type # value = Tf.Type.Unknown
__instance_size__ = 24
pass
class Warning(_DiagnosticBase, Boost.Python.instance):
pass
class _ClassWithClassMethod(Boost.Python.instance):
@staticmethod
def Test(*args, **kwargs) -> None: ...
__instance_size__ = 24
pass
class _ClassWithVarArgInit(Boost.Python.instance):
@property
def allowExtraArgs(self) -> None:
"""
:type: None
"""
@property
def args(self) -> None:
"""
:type: None
"""
@property
def expired(self) -> None:
"""
True if this object has expired, False otherwise.
:type: None
"""
@property
def kwargs(self) -> None:
"""
:type: None
"""
pass
class _DiagnosticBase(Boost.Python.instance):
@property
def commentary(self) -> None:
"""
The commentary string describing this error.
:type: None
"""
@property
def diagnosticCode(self) -> None:
"""
The diagnostic code posted.
:type: None
"""
@property
def diagnosticCodeString(self) -> None:
"""
The error code posted for this error, as a string.
:type: None
"""
@property
def sourceFileName(self) -> None:
"""
The source file name that the error was posted from.
:type: None
"""
@property
def sourceFunction(self) -> None:
"""
The source function that the error was posted from.
:type: None
"""
@property
def sourceLineNumber(self) -> None:
"""
The source line number that the error was posted from.
:type: None
"""
pass
class _Enum(Boost.Python.instance):
class TestEnum2(Tf_PyEnumWrapper, Enum, Boost.Python.instance):
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = '_Enum'
allValues: tuple # value = (Tf._Enum.One, Tf._Enum.Two, Tf._Enum.Three)
pass
class TestKeywords(Tf_PyEnumWrapper, Enum, Boost.Python.instance):
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
False_: pxr.Tf.TestKeywords # value = Tf._Enum.TestKeywords.False_
None_: pxr.Tf.TestKeywords # value = Tf._Enum.TestKeywords.None_
True_: pxr.Tf.TestKeywords # value = Tf._Enum.TestKeywords.True_
_baseName = '_Enum.TestKeywords'
allValues: tuple # value = (Tf._Enum.TestKeywords.None_, Tf._Enum.TestKeywords.False_, Tf._Enum.TestKeywords.True_, Tf._Enum.TestKeywords.print_, Tf._Enum.TestKeywords.import_, Tf._Enum.TestKeywords.global_)
global_: pxr.Tf.TestKeywords # value = Tf._Enum.TestKeywords.global_
import_: pxr.Tf.TestKeywords # value = Tf._Enum.TestKeywords.import_
print_: pxr.Tf.TestKeywords # value = Tf._Enum.TestKeywords.print_
pass
class TestScopedEnum(Tf_PyEnumWrapper, Enum, Boost.Python.instance):
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
Alef: pxr.Tf.TestScopedEnum # value = Tf._Enum.TestScopedEnum.Alef
Bet: pxr.Tf.TestScopedEnum # value = Tf._Enum.TestScopedEnum.Bet
Gimel: pxr.Tf.TestScopedEnum # value = Tf._Enum.TestScopedEnum.Gimel
_baseName = '_Enum.TestScopedEnum'
allValues: tuple # value = (Tf._Enum.TestScopedEnum.Alef, Tf._Enum.TestScopedEnum.Bet, Tf._Enum.TestScopedEnum.Gimel)
pass
One: pxr.Tf.TestEnum2 # value = Tf._Enum.One
Three: pxr.Tf.TestEnum2 # value = Tf._Enum.Three
Two: pxr.Tf.TestEnum2 # value = Tf._Enum.Two
pass
class _TestDerived(_TestBase, Boost.Python.instance):
@staticmethod
def Virtual(*args, **kwargs) -> None: ...
@staticmethod
def Virtual2(*args, **kwargs) -> None: ...
@staticmethod
def Virtual3(*args, **kwargs) -> None: ...
@property
def expired(self) -> None:
"""
True if this object has expired, False otherwise.
:type: None
"""
pass
class _TestBase(Boost.Python.instance):
@staticmethod
def TestCallVirtual(*args, **kwargs) -> None: ...
@staticmethod
def Virtual(*args, **kwargs) -> None: ...
@staticmethod
def Virtual2(*args, **kwargs) -> None: ...
@staticmethod
def Virtual3(*args, **kwargs) -> None: ...
@staticmethod
def Virtual4(*args, **kwargs) -> None: ...
@property
def expired(self) -> None:
"""
True if this object has expired, False otherwise.
:type: None
"""
pass
class _TestEnum(Tf_PyEnumWrapper, Enum, Boost.Python.instance):
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = ''
allValues: tuple # value = (Tf._Alpha, Tf._Bravo, Tf._Charlie, Tf._Delta)
pass
class _TestScopedEnum(Tf_PyEnumWrapper, Enum, Boost.Python.instance):
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
Beryllium: pxr.Tf._TestScopedEnum # value = Tf._TestScopedEnum.Beryllium
Boron: pxr.Tf._TestScopedEnum # value = Tf._TestScopedEnum.Boron
Hydrogen: pxr.Tf._TestScopedEnum # value = Tf._TestScopedEnum.Hydrogen
Lithium: pxr.Tf._TestScopedEnum # value = Tf._TestScopedEnum.Lithium
_baseName = '_TestScopedEnum'
allValues: tuple # value = (Tf._TestScopedEnum.Hydrogen, Tf._TestScopedEnum.Lithium, Tf._TestScopedEnum.Beryllium, Tf._TestScopedEnum.Boron)
pass
class _TestStaticMethodError(Boost.Python.instance):
@staticmethod
def Error(*args, **kwargs) -> None: ...
pass
class _TestStaticTokens(Boost.Python.instance):
Fuji = 'Fuji'
McIntosh = 'McIntosh'
Pippin = 'Pippin'
orange = 'orange'
pear = "d'Anjou"
pass
class _testStaticTokens(Boost.Python.instance):
Fuji = 'Fuji'
McIntosh = 'McIntosh'
Pippin = 'Pippin'
orange = 'orange'
pear = "d'Anjou"
pass
def DictionaryStrcmp(*args, **kwargs) -> None:
pass
def DumpTokenStats(*args, **kwargs) -> None:
pass
def FindLongestAccessiblePrefix(*args, **kwargs) -> None:
pass
def GetAppLaunchTime() -> int :
"""
Return the time (in seconds since the epoch) at which the application was started.
"""
def GetCurrentScopeDescriptionStack(*args, **kwargs) -> None:
pass
def GetEnvSetting(*args, **kwargs) -> None:
pass
def GetStackTrace(*args, **kwargs) -> None:
"""
Return both the C++ and the python stack as a string.
"""
def InstallTerminateAndCrashHandlers() -> None:
"""
InstallTerminateAndCrashHandlers() -> None
(Re)install Tf's crash handler.
This should not generally need to be called since Tf does this itself
when loaded. However, when run in 3rd party environments that install
their own signal handlers, possibly overriding Tf's, this provides a
way to reinstall them, in hopes that they'll stick.
This calls std::set_terminate() and installs signal handlers for
SIGSEGV, SIGBUS, SIGFPE, and SIGABRT.
"""
def InvokeWithErrorHandling(*args, **kwargs) -> None:
pass
def IsValidIdentifier(identifier) -> bool:
"""
IsValidIdentifier(identifier) -> bool
Test whether *identifier* is valid.
An identifier is valid if it follows the C/Python identifier
convention; that is, it must be at least one character long, must
start with a letter or underscore, and must contain only letters,
underscores, and numerals.
Parameters
----------
identifier : str
"""
def LogStackTrace(*args, **kwargs) -> None:
pass
def MakeValidIdentifier(*args, **kwargs) -> typing.Any:
"""
MakeValidIdentifier(in) -> str
Produce a valid identifier (see TfIsValidIdentifier) from ``in`` by
replacing invalid characters with'_'.
If ``in`` is empty, return"_".
Parameters
----------
in : str
"""
def PrintStackTrace(*args, **kwargs) -> None:
"""
Prints both the C++ and the python stack to the file provided.
"""
def RealPath(*args, **kwargs) -> None:
pass
def ReportActiveErrorMarks() -> None:
"""
ReportActiveErrorMarks() -> None
Report current TfErrorMark instances and the stack traces that created
them to stdout for debugging purposes.
To call this function, set _enableTfErrorMarkStackTraces in
errorMark.cpp and enable the TF_ERROR_MARK_TRACKING TfDebug code.
"""
def RepostErrors(*args, **kwargs) -> None:
pass
def SetPythonExceptionDebugTracingEnabled(*args, **kwargs) -> None:
pass
def StringSplit(src, separator) -> list[str]:
"""
StringSplit(src, separator) -> list[str]
Breaks the given string apart, returning a vector of strings.
The string ``source`` is broken apart into individual words, where a
word is delimited by the string ``separator`` . This function behaves
like pythons string split method.
Parameters
----------
src : str
separator : str
"""
@typing.overload
def StringToDouble(txt) -> float:
"""
StringToDouble(txt) -> float
Converts text string to double.
This method converts strings to floating point numbers. It is similar
to libc's atof(), but performs the conversion much more quickly.
It expects somewhat valid input: it will continue parsing the input
until it hits an unrecognized character, as described by the regexp
below, and at that point will return the results up to that point.
(-?[0-9]+(.[0-9]\*)?|-?.[0-9]+)([eE][-+]?[0-9]+)?
It will not check to see if there is any input at all, or whitespace
after the digits. Ie: TfStringToDouble("") == 0.0
TfStringToDouble("blah") == 0.0 TfStringToDouble("-") == -0.0
TfStringToDouble("1.2foo") == 1.2
``TfStringToDouble`` is a wrapper around the extern-c TfStringToDouble
Parameters
----------
txt : str
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
text : str
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
text : str
len : int
"""
@typing.overload
def StringToDouble(text) -> float:
pass
@typing.overload
def StringToDouble(text, len) -> float:
pass
def StringToLong(txt, outOfRange) -> long:
"""
StringToLong(txt, outOfRange) -> long
Convert a sequence of digits in ``txt`` to a long int value.
Caller is responsible for ensuring that ``txt`` has content matching:
.. code-block:: text
-?[0-9]+
If the digit sequence's value is out of range, set ``\*outOfRange``
to true (if ``outOfRange`` is not None) and return either
std::numeric_limits<long>::min() or max(), whichever is closest to the
true value.
Parameters
----------
txt : str
outOfRange : bool
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
txt : str
outOfRange : bool
"""
def StringToULong(txt, outOfRange) -> int:
"""
StringToULong(txt, outOfRange) -> int
Convert a sequence of digits in ``txt`` to an unsigned long value.
Caller is responsible for ensuring that ``txt`` has content matching:
.. code-block:: text
[0-9]+
If the digit sequence's value is out of range, set ``\*outOfRange``
to true (if ``outOfRange`` is not None) and return
std::numeric_limits<unsignedlong>::max().
Parameters
----------
txt : str
outOfRange : bool
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
txt : str
outOfRange : bool
"""
def TouchFile(*args, **kwargs) -> None:
pass
def _CallThrowTest(*args, **kwargs) -> None:
pass
def _ConvertByteListToByteArray(*args, **kwargs) -> None:
pass
def _DerivedFactory(*args, **kwargs) -> None:
pass
def _DerivedNullFactory(*args, **kwargs) -> None:
pass
def _Fatal(*args, **kwargs) -> None:
pass
def _GetLongMax(*args, **kwargs) -> None:
pass
def _GetLongMin(*args, **kwargs) -> None:
pass
def _GetULongMax(*args, **kwargs) -> None:
pass
def _RaiseCodingError(*args, **kwargs) -> None:
pass
def _RaiseRuntimeError(*args, **kwargs) -> None:
pass
def _ReturnsBase(*args, **kwargs) -> None:
pass
def _ReturnsBaseRefPtr(*args, **kwargs) -> None:
pass
def _ReturnsConstBase(*args, **kwargs) -> None:
pass
def _RoundTripWrapperCallTest(*args, **kwargs) -> None:
pass
def _RoundTripWrapperIndexTest(*args, **kwargs) -> None:
pass
def _RoundTripWrapperTest(*args, **kwargs) -> None:
pass
def _Status(*args, **kwargs) -> None:
pass
def _TakesBase(*args, **kwargs) -> None:
pass
def _TakesConstBase(*args, **kwargs) -> None:
pass
def _TakesDerived(*args, **kwargs) -> None:
pass
def _TakesReference(*args, **kwargs) -> None:
pass
def _TakesVecVecString(*args, **kwargs) -> None:
pass
def _TestAnnotatedBoolResult(*args, **kwargs) -> None:
pass
def _ThrowCppException(*args, **kwargs) -> None:
pass
def _ThrowTest(*args, **kwargs) -> None:
pass
def _Warn(*args, **kwargs) -> None:
pass
def __SetErrorExceptionClass(*args, **kwargs) -> None:
pass
def _callUnboundInstance(*args, **kwargs) -> None:
pass
def _callback(*args, **kwargs) -> None:
pass
def _doErrors(*args, **kwargs) -> None:
pass
def _invokeTestCallback(*args, **kwargs) -> None:
pass
def _mightRaise(*args, **kwargs) -> None:
pass
def _registerInvalidEnum(*args, **kwargs) -> None:
pass
def _returnsTfEnum(*args, **kwargs) -> None:
pass
def _sendTfNoticeWithSender(*args, **kwargs) -> None:
pass
def _setTestCallback(*args, **kwargs) -> None:
pass
def _stringCallback(*args, **kwargs) -> None:
pass
def _stringStringCallback(*args, **kwargs) -> None:
pass
def _takesTestEnum(*args, **kwargs) -> None:
pass
def _takesTestEnum2(*args, **kwargs) -> None:
pass
def _takesTfEnum(*args, **kwargs) -> None:
pass
TF_APPLICATION_EXIT_TYPE: pxr.Tf.DiagnosticType # value = Tf.TF_APPLICATION_EXIT_TYPE
TF_DIAGNOSTIC_CODING_ERROR_TYPE: pxr.Tf.DiagnosticType # value = Tf.TF_DIAGNOSTIC_CODING_ERROR_TYPE
TF_DIAGNOSTIC_FATAL_CODING_ERROR_TYPE: pxr.Tf.DiagnosticType # value = Tf.TF_DIAGNOSTIC_FATAL_CODING_ERROR_TYPE
TF_DIAGNOSTIC_FATAL_ERROR_TYPE: pxr.Tf.DiagnosticType # value = Tf.TF_DIAGNOSTIC_FATAL_ERROR_TYPE
TF_DIAGNOSTIC_NONFATAL_ERROR_TYPE: pxr.Tf.DiagnosticType # value = Tf.TF_DIAGNOSTIC_NONFATAL_ERROR_TYPE
TF_DIAGNOSTIC_RUNTIME_ERROR_TYPE: pxr.Tf.DiagnosticType # value = Tf.TF_DIAGNOSTIC_RUNTIME_ERROR_TYPE
TF_DIAGNOSTIC_STATUS_TYPE: pxr.Tf.DiagnosticType # value = Tf.TF_DIAGNOSTIC_STATUS_TYPE
TF_DIAGNOSTIC_WARNING_TYPE: pxr.Tf.DiagnosticType # value = Tf.TF_DIAGNOSTIC_WARNING_TYPE
_Alpha: pxr.Tf._TestEnum # value = Tf._Alpha
_Bravo: pxr.Tf._TestEnum # value = Tf._Bravo
_Charlie: pxr.Tf._TestEnum # value = Tf._Charlie
_Delta: pxr.Tf._TestEnum # value = Tf._Delta
__MFB_FULL_PACKAGE_NAME = 'tf'
| 55,998 | unknown | 27.80607 | 472 | 0.604772 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Ndr/__init__.py | #
# Copyright 2018 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
"""Python bindings for libNdr"""
from pxr import Tf
Tf.PreparePythonModule()
del Tf
| 1,145 | Python | 37.199999 | 74 | 0.763319 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Ndr/__DOC.py | def Execute(result):
result["DiscoveryPlugin"].__doc__ = """
Interface for discovery plugins.
Discovery plugins, like the name implies, find nodes. Where the plugin
searches is up to the plugin that implements this interface. Examples
of discovery plugins could include plugins that look for nodes on the
filesystem, another that finds nodes in a cloud service, and another
that searches a local database. Multiple discovery plugins that search
the filesystem in specific locations/ways could also be created. All
discovery plugins are executed as soon as the registry is
instantiated.
These plugins simply report back to the registry what nodes they found
in a generic way. The registry doesn't know much about the innards of
the nodes yet, just that the nodes exist. Understanding the nodes is
the responsibility of another set of plugins defined by the
``NdrParserPlugin`` interface.
Discovery plugins report back to the registry via
``NdrNodeDiscoveryResult`` s. These are small, lightweight classes
that contain the information for a single node that was found during
discovery. The discovery result only includes node information that
can be gleaned pre-parse, so the data is fairly limited; to see
exactly what's included, and what is expected to be populated, see the
documentation for ``NdrNodeDiscoveryResult`` .
How to Create a Discovery Plugin
================================
There are three steps to creating a discovery plugin:
- Implement the discovery plugin interface, ``NdrDiscoveryPlugin``
- Register your new plugin with the registry. The registration
macro must be called in your plugin's implementation file:
.. code-block:: text
NDR_REGISTER_DISCOVERY_PLUGIN(YOUR_DISCOVERY_PLUGIN_CLASS_NAME)
This macro is available in discoveryPlugin.h.
- In the same folder as your plugin, create a ``plugInfo.json``
file. This file must be formatted like so, substituting
``YOUR_LIBRARY_NAME`` , ``YOUR_CLASS_NAME`` , and
``YOUR_DISPLAY_NAME`` :
.. code-block:: text
{
"Plugins": [{
"Type": "module",
"Name": "YOUR_LIBRARY_NAME",
"Root": "@PLUG_INFO_ROOT@",
"LibraryPath": "@PLUG_INFO_LIBRARY_PATH@",
"ResourcePath": "@PLUG_INFO_RESOURCE_PATH@",
"Info": {
"Types": {
"YOUR_CLASS_NAME" : {
"bases": ["NdrDiscoveryPlugin"],
"displayName": "YOUR_DISPLAY_NAME"
}
}
}
}]
}
The NDR ships with one discovery plugin, the
``_NdrFilesystemDiscoveryPlugin`` . Take a look at NDR's plugInfo.json
file for example values for ``YOUR_LIBRARY_NAME`` ,
``YOUR_CLASS_NAME`` , and ``YOUR_DISPLAY_NAME`` . If multiple
discovery plugins exist in the same folder, you can continue adding
additional plugins under the ``Types`` key in the JSON. More detailed
information about the plugInfo.json format can be found in the
documentation for the ``plug`` module (in pxr/base).
"""
result["DiscoveryPlugin"].DiscoverNodes.func_doc = """DiscoverNodes(arg1) -> NdrNodeDiscoveryResultVec
Finds and returns all nodes that the implementing plugin should be
aware of.
Parameters
----------
arg1 : Context
"""
result["DiscoveryPlugin"].GetSearchURIs.func_doc = """GetSearchURIs() -> NdrStringVec
Gets the URIs that this plugin is searching for nodes in.
"""
result["DiscoveryPluginContext"].__doc__ = """
A context for discovery.
Discovery plugins can use this to get a limited set of non-local
information without direct coupling between plugins.
"""
result["DiscoveryPluginContext"].GetSourceType.func_doc = """GetSourceType(discoveryType) -> str
Returns the source type associated with the discovery type.
This may return an empty token if there is no such association.
Parameters
----------
discoveryType : str
"""
result["DiscoveryUri"].__doc__ = """
Struct for holding a URI and its resolved URI for a file discovered by
NdrFsHelpersDiscoverFiles.
"""
result["Node"].__doc__ = """
Represents an abstract node. Describes information like the name of
the node, what its inputs and outputs are, and any associated
metadata.
In almost all cases, this class will not be used directly. More
specialized nodes can be created that derive from ``NdrNode`` ; those
specialized nodes can add their own domain-specific data and methods.
"""
result["Node"].GetIdentifier.func_doc = """GetIdentifier() -> NdrIdentifier
Return the identifier of the node.
"""
result["Node"].GetVersion.func_doc = """GetVersion() -> Version
Return the version of the node.
"""
result["Node"].GetName.func_doc = """GetName() -> str
Gets the name of the node.
"""
result["Node"].GetFamily.func_doc = """GetFamily() -> str
Gets the name of the family that the node belongs to.
An empty token will be returned if the node does not belong to a
family.
"""
result["Node"].GetContext.func_doc = """GetContext() -> str
Gets the context of the node.
The context is the context that the node declares itself as having
(or, if a particular node does not declare a context, it will be
assigned a default context by the parser).
As a concrete example from the ``Sdr`` module, a shader with a
specific source type may perform different duties vs. another shader
with the same source type. For example, one shader with a source type
of ``SdrArgsParser::SourceType`` may declare itself as having a
context of'pattern', while another shader of the same source type may
say it is used for lighting, and thus has a context of'light'.
"""
result["Node"].GetSourceType.func_doc = """GetSourceType() -> str
Gets the type of source that this node originated from.
Note that this is distinct from ``GetContext()`` , which is the type
that the node declares itself as having.
As a concrete example from the ``Sdr`` module, several shader parsers
exist and operate on different types of shaders. In this scenario,
each distinct type of shader (OSL, Args, etc) is considered a
different *source*, even though they are all shaders. In addition, the
shaders under each source type may declare themselves as having a
specific context (shaders can serve different roles). See
``GetContext()`` for more information on this.
"""
result["Node"].GetResolvedDefinitionURI.func_doc = """GetResolvedDefinitionURI() -> str
Gets the URI to the resource that provided this node's definition.
Could be a path to a file, or some other resource identifier. This URI
should be fully resolved.
NdrNode::GetResolvedImplementationURI()
"""
result["Node"].GetResolvedImplementationURI.func_doc = """GetResolvedImplementationURI() -> str
Gets the URI to the resource that provides this node's implementation.
Could be a path to a file, or some other resource identifier. This URI
should be fully resolved.
NdrNode::GetResolvedDefinitionURI()
"""
result["Node"].GetSourceCode.func_doc = """GetSourceCode() -> str
Returns the source code for this node.
This will be empty for most nodes. It will be non-empty only for the
nodes that are constructed using NdrRegistry::GetNodeFromSourceCode()
, in which case, the source code has not been parsed (or even
compiled) yet.
An unparsed node with non-empty source-code but no properties is
considered to be invalid. Once the node is parsed and the relevant
properties and metadata are extracted from the source code, the node
becomes valid.
NdrNode::IsValid
"""
result["Node"].IsValid.func_doc = """IsValid() -> bool
Whether or not this node is valid.
A node that is valid indicates that the parser plugin was able to
successfully parse the contents of this node.
Note that if a node is not valid, some data like its name, URI, source
code etc. could still be available (data that was obtained during the
discovery process). However, other data that must be gathered from the
parsing process will NOT be available (eg, inputs and outputs).
"""
result["Node"].GetInfoString.func_doc = """GetInfoString() -> str
Gets a string with basic information about this node.
Helpful for things like adding this node to a log.
"""
result["Node"].GetInputNames.func_doc = """GetInputNames() -> NdrTokenVec
Get an ordered list of all the input names on this node.
"""
result["Node"].GetOutputNames.func_doc = """GetOutputNames() -> NdrTokenVec
Get an ordered list of all the output names on this node.
"""
result["Node"].GetInput.func_doc = """GetInput(inputName) -> Property
Get an input property by name.
``nullptr`` is returned if an input with the given name does not
exist.
Parameters
----------
inputName : str
"""
result["Node"].GetOutput.func_doc = """GetOutput(outputName) -> Property
Get an output property by name.
``nullptr`` is returned if an output with the given name does not
exist.
Parameters
----------
outputName : str
"""
result["Node"].GetMetadata.func_doc = """GetMetadata() -> NdrTokenMap
All metadata that came from the parse process.
Specialized nodes may isolate values in the metadata (with possible
manipulations and/or additional parsing) and expose those values in
their API.
"""
result["NodeDiscoveryResult"].__doc__ = """
Represents the raw data of a node, and some other bits of metadata,
that were determined via a ``NdrDiscoveryPlugin`` .
"""
result["NodeDiscoveryResult"].__init__.func_doc = """__init__(identifier, version, name, family, discoveryType, sourceType, uri, resolvedUri, sourceCode, metadata, blindData, subIdentifier)
Constructor.
Parameters
----------
identifier : NdrIdentifier
version : Version
name : str
family : str
discoveryType : str
sourceType : str
uri : str
resolvedUri : str
sourceCode : str
metadata : NdrTokenMap
blindData : str
subIdentifier : str
"""
result["Property"].__doc__ = """
Represents a property (input or output) that is part of a ``NdrNode``
instance.
A property must have a name and type, but may also specify a host of
additional metadata. Instances can also be queried to determine if
another ``NdrProperty`` instance can be connected to it.
In almost all cases, this class will not be used directly. More
specialized properties can be created that derive from ``NdrProperty``
; those specialized properties can add their own domain-specific data
and methods.
"""
result["Property"].GetName.func_doc = """GetName() -> str
Gets the name of the property.
"""
result["Property"].GetType.func_doc = """GetType() -> str
Gets the type of the property.
"""
result["Property"].GetDefaultValue.func_doc = """GetDefaultValue() -> VtValue
Gets this property's default value associated with the type of the
property.
GetType()
"""
result["Property"].IsOutput.func_doc = """IsOutput() -> bool
Whether this property is an output.
"""
result["Property"].IsArray.func_doc = """IsArray() -> bool
Whether this property's type is an array type.
"""
result["Property"].IsDynamicArray.func_doc = """IsDynamicArray() -> bool
Whether this property's array type is dynamically-sized.
"""
result["Property"].GetArraySize.func_doc = """GetArraySize() -> int
Gets this property's array size.
If this property is a fixed-size array type, the array size is
returned. In the case of a dynamically-sized array, this method
returns the array size that the parser reports, and should not be
relied upon to be accurate. A parser may report -1 for the array size,
for example, to indicate a dynamically-sized array. For types that are
not a fixed-size array or dynamic array, this returns 0.
"""
result["Property"].GetInfoString.func_doc = """GetInfoString() -> str
Gets a string with basic information about this property.
Helpful for things like adding this property to a log.
"""
result["Property"].GetMetadata.func_doc = """GetMetadata() -> NdrTokenMap
All of the metadata that came from the parse process.
"""
result["Property"].IsConnectable.func_doc = """IsConnectable() -> bool
Whether this property can be connected to other properties.
"""
result["Property"].CanConnectTo.func_doc = """CanConnectTo(other) -> bool
Determines if this property can be connected to the specified
property.
Parameters
----------
other : Property
"""
result["Property"].GetTypeAsSdfType.func_doc = """GetTypeAsSdfType() -> NdrSdfTypeIndicator
Converts the property's type from ``GetType()`` into a
``SdfValueTypeName`` .
Two scenarios can result: an exact mapping from property type to Sdf
type, and an inexact mapping. In the first scenario, the first element
in the pair will be the cleanly-mapped Sdf type, and the second
element, a TfToken, will be empty. In the second scenario, the Sdf
type will be set to ``Token`` to indicate an unclean mapping, and the
second element will be set to the original type returned by
``GetType()`` .
This base property class is generic and cannot know ahead of time how
to perform this mapping reliably, thus it will always fall into the
second scenario. It is up to specialized properties to perform the
mapping.
GetDefaultValueAsSdfType()
"""
result["Registry"].__doc__ = """
The registry provides access to node information."Discovery
Plugins"are responsible for finding the nodes that should be included
in the registry.
Discovery plugins are found through the plugin system. If additional
discovery plugins need to be specified, a client can pass them to
``SetExtraDiscoveryPlugins()`` .
When the registry is first told about the discovery plugins, the
plugins will be asked to discover nodes. These plugins will generate
``NdrNodeDiscoveryResult`` instances, which only contain basic
metadata. Once the client asks for information that would require the
node's contents to be parsed (eg, what its inputs and outputs are),
the registry will begin the parsing process on an as-needed basis. See
``NdrNodeDiscoveryResult`` for the information that can be retrieved
without triggering a parse.
Some methods in this module may allow for a"family"to be provided. A
family is simply a generic grouping which is optional.
"""
result["Registry"].SetExtraDiscoveryPlugins.func_doc = """SetExtraDiscoveryPlugins(plugins) -> None
Allows the client to set any additional discovery plugins that would
otherwise NOT be found through the plugin system.
Runs the discovery process for the specified plugins immediately.
Note that this method cannot be called after any nodes in the registry
have been parsed (eg, through GetNode\\*()), otherwise an error will
result.
Parameters
----------
plugins : DiscoveryPluginRefPtrVec
----------------------------------------------------------------------
SetExtraDiscoveryPlugins(pluginTypes) -> None
Allows the client to set any additional discovery plugins that would
otherwise NOT be found through the plugin system.
Runs the discovery process for the specified plugins immediately.
Note that this method cannot be called after any nodes in the registry
have been parsed (eg, through GetNode\\*()), otherwise an error will
result.
Parameters
----------
pluginTypes : list[Type]
"""
result["Registry"].SetExtraParserPlugins.func_doc = """SetExtraParserPlugins(pluginTypes) -> None
Allows the client to set any additional parser plugins that would
otherwise NOT be found through the plugin system.
Note that this method cannot be called after any nodes in the registry
have been parsed (eg, through GetNode\\*()), otherwise an error will
result.
Parameters
----------
pluginTypes : list[Type]
"""
result["Registry"].GetNodeFromAsset.func_doc = """GetNodeFromAsset(asset, metadata, subIdentifier, sourceType) -> Node
Parses the given ``asset`` , constructs a NdrNode from it and adds it
to the registry.
Nodes created from an asset using this API can be looked up by the
unique identifier and sourceType of the returned node, or by URI,
which will be set to the unresolved asset path value.
``metadata`` contains additional metadata needed for parsing and
compiling the source code in the file pointed to by ``asset``
correctly. This metadata supplements the metadata available in the
asset and overrides it in cases where there are key collisions.
``subidentifier`` is optional, and it would be used to indicate a
particular definition in the asset file if the asset contains multiple
node definitions.
``sourceType`` is optional, and it is only needed to indicate a
particular type if the asset file is capable of representing a node
definition of multiple source types.
Returns a valid node if the asset is parsed successfully using one of
the registered parser plugins.
Parameters
----------
asset : AssetPath
metadata : NdrTokenMap
subIdentifier : str
sourceType : str
"""
result["Registry"].GetNodeFromSourceCode.func_doc = """GetNodeFromSourceCode(sourceCode, sourceType, metadata) -> Node
Parses the given ``sourceCode`` string, constructs a NdrNode from it
and adds it to the registry.
The parser to be used is determined by the specified ``sourceType`` .
Nodes created from source code using this API can be looked up by the
unique identifier and sourceType of the returned node.
``metadata`` contains additional metadata needed for parsing and
compiling the source code correctly. This metadata supplements the
metadata available in ``sourceCode`` and overrides it cases where
there are key collisions.
Returns a valid node if the given source code is parsed successfully
using the parser plugins that is registered for the specified
``sourceType`` .
Parameters
----------
sourceCode : str
sourceType : str
metadata : NdrTokenMap
"""
result["Registry"].GetSearchURIs.func_doc = """GetSearchURIs() -> NdrStringVec
Get the locations where the registry is searching for nodes.
Depending on which discovery plugins were used, this may include non-
filesystem paths.
"""
result["Registry"].GetNodeIdentifiers.func_doc = """GetNodeIdentifiers(family, filter) -> NdrIdentifierVec
Get the identifiers of all the nodes that the registry is aware of.
This will not run the parsing plugins on the nodes that have been
discovered, so this method is relatively quick. Optionally,
a"family"name can be specified to only get the identifiers of nodes
that belong to that family and a filter can be specified to get just
the default version (the default) or all versions of the node.
Parameters
----------
family : str
filter : VersionFilter
"""
result["Registry"].GetNodeNames.func_doc = """GetNodeNames(family) -> NdrStringVec
Get the names of all the nodes that the registry is aware of.
This will not run the parsing plugins on the nodes that have been
discovered, so this method is relatively quick. Optionally,
a"family"name can be specified to only get the names of nodes that
belong to that family.
Parameters
----------
family : str
"""
result["Registry"].GetNodeByIdentifier.func_doc = """GetNodeByIdentifier(identifier, sourceTypePriority) -> Node
Get the node with the specified ``identifier`` , and an optional
``sourceTypePriority`` list specifying the set of node SOURCE types
(see ``NdrNode::GetSourceType()`` ) that should be searched.
If no sourceTypePriority is specified, the first encountered node with
the specified identifier will be returned (first is arbitrary) if
found.
If a sourceTypePriority list is specified, then this will iterate
through each source type and try to find a node matching by
identifier. This is equivalent to calling
NdrRegistry::GetNodeByIdentifierAndType for each source type until a
node is found.
Nodes of the same identifier but different source type can exist in
the registry. If a node'Foo'with source types'abc'and'xyz'exist in the
registry, and you want to make sure the'abc'version is fetched before
the'xyz'version, the priority list would be specified as
['abc','xyz']. If the'abc'version did not exist in the registry, then
the'xyz'version would be returned.
Returns ``nullptr`` if a node matching the arguments can't be found.
Parameters
----------
identifier : NdrIdentifier
sourceTypePriority : NdrTokenVec
"""
result["Registry"].GetNodeByIdentifierAndType.func_doc = """GetNodeByIdentifierAndType(identifier, sourceType) -> Node
Get the node with the specified ``identifier`` and ``sourceType`` .
If there is no matching node for the sourceType, nullptr is returned.
Parameters
----------
identifier : NdrIdentifier
sourceType : str
"""
result["Registry"].GetNodeByName.func_doc = """GetNodeByName(name, sourceTypePriority, filter) -> Node
Get the node with the specified name.
An optional priority list specifies the set of node SOURCE types (
NdrNode::GetSourceType() ) that should be searched and in what order.
Optionally, a filter can be specified to consider just the default
versions of nodes matching ``name`` (the default) or all versions of
the nodes.
GetNodeByIdentifier() .
Parameters
----------
name : str
sourceTypePriority : NdrTokenVec
filter : VersionFilter
"""
result["Registry"].GetNodeByNameAndType.func_doc = """GetNodeByNameAndType(name, sourceType, filter) -> Node
A convenience wrapper around ``GetNodeByName()`` .
Instead of providing a priority list, an exact type is specified, and
``nullptr`` is returned if a node with the exact identifier and type
does not exist.
Optionally, a filter can be specified to consider just the default
versions of nodes matching ``name`` (the default) or all versions of
the nodes.
Parameters
----------
name : str
sourceType : str
filter : VersionFilter
"""
result["Registry"].GetNodesByIdentifier.func_doc = """GetNodesByIdentifier(identifier) -> NdrNodeConstPtrVec
Get all nodes matching the specified identifier (multiple nodes of the
same identifier, but different source types, may exist).
If no nodes match the identifier, an empty vector is returned.
Parameters
----------
identifier : NdrIdentifier
"""
result["Registry"].GetNodesByName.func_doc = """GetNodesByName(name, filter) -> NdrNodeConstPtrVec
Get all nodes matching the specified name.
Only nodes matching the specified name will be parsed. Optionally, a
filter can be specified to get just the default version (the default)
or all versions of the node. If no nodes match an empty vector is
returned.
Parameters
----------
name : str
filter : VersionFilter
"""
result["Registry"].GetNodesByFamily.func_doc = """GetNodesByFamily(family, filter) -> NdrNodeConstPtrVec
Get all nodes from the registry, optionally restricted to the nodes
that fall under a specified family and/or the default version.
Note that this will parse *all* nodes that the registry is aware of
(unless a family is specified), so this may take some time to run the
first time it is called.
Parameters
----------
family : str
filter : VersionFilter
"""
result["Registry"].GetAllNodeSourceTypes.func_doc = """GetAllNodeSourceTypes() -> NdrTokenVec
Get a sorted list of all node source types that may be present on the
nodes in the registry.
Source types originate from the discovery process, but there is no
guarantee that the discovered source types will also have a registered
parser plugin. The actual supported source types here depend on the
parsers that are available. Also note that some parser plugins may not
advertise a source type.
See the documentation for ``NdrParserPlugin`` and
``NdrNode::GetSourceType()`` for more information.
"""
result["Version"].__doc__ = """"""
result["Version"].__init__.func_doc = """__init__()
Create an invalid version.
----------------------------------------------------------------------
__init__(major, minor)
Create a version with the given major and minor numbers.
Numbers must be non-negative, and at least one must be non-zero. On
failure generates an error and yields an invalid version.
Parameters
----------
major : int
minor : int
----------------------------------------------------------------------
__init__(x)
Create a version from a string.
On failure generates an error and yields an invalid version.
Parameters
----------
x : str
----------------------------------------------------------------------
__init__(x, arg2)
Parameters
----------
x : Version
arg2 : bool
"""
result["Version"].GetAsDefault.func_doc = """GetAsDefault() -> Version
Return an equal version marked as default.
It's permitted to mark an invalid version as the default.
"""
result["Version"].GetMajor.func_doc = """GetMajor() -> int
Return the major version number or zero for an invalid version.
"""
result["Version"].GetMinor.func_doc = """GetMinor() -> int
Return the minor version number or zero for an invalid version.
"""
result["Version"].IsDefault.func_doc = """IsDefault() -> bool
Return true iff this version is marked as default.
"""
result["Version"].GetStringSuffix.func_doc = """GetStringSuffix() -> str
Return the version as a identifier suffix.
""" | 24,958 | Python | 23.350244 | 192 | 0.728504 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Ndr/__init__.pyi | from __future__ import annotations
import pxr.Ndr._ndr
import typing
import Boost.Python
import pxr.Ndr
import pxr.Tf
__all__ = [
"DiscoveryPlugin",
"DiscoveryPluginContext",
"DiscoveryPluginList",
"DiscoveryUri",
"FsHelpersDiscoverFiles",
"FsHelpersDiscoverNodes",
"FsHelpersSplitShaderIdentifier",
"Node",
"NodeDiscoveryResult",
"NodeList",
"Property",
"Registry",
"Version",
"VersionFilter",
"VersionFilterAllVersions",
"VersionFilterDefaultOnly"
]
class DiscoveryPlugin(Boost.Python.instance):
"""
Interface for discovery plugins.
Discovery plugins, like the name implies, find nodes. Where the plugin
searches is up to the plugin that implements this interface. Examples
of discovery plugins could include plugins that look for nodes on the
filesystem, another that finds nodes in a cloud service, and another
that searches a local database. Multiple discovery plugins that search
the filesystem in specific locations/ways could also be created. All
discovery plugins are executed as soon as the registry is
instantiated.
These plugins simply report back to the registry what nodes they found
in a generic way. The registry doesn't know much about the innards of
the nodes yet, just that the nodes exist. Understanding the nodes is
the responsibility of another set of plugins defined by the
``NdrParserPlugin`` interface.
Discovery plugins report back to the registry via
``NdrNodeDiscoveryResult`` s. These are small, lightweight classes
that contain the information for a single node that was found during
discovery. The discovery result only includes node information that
can be gleaned pre-parse, so the data is fairly limited; to see
exactly what's included, and what is expected to be populated, see the
documentation for ``NdrNodeDiscoveryResult`` .
How to Create a Discovery Plugin
================================
There are three steps to creating a discovery plugin:
- Implement the discovery plugin interface, ``NdrDiscoveryPlugin``
- Register your new plugin with the registry. The registration
macro must be called in your plugin's implementation file:
.. code-block:: text
NDR_REGISTER_DISCOVERY_PLUGIN(YOUR_DISCOVERY_PLUGIN_CLASS_NAME)
This macro is available in discoveryPlugin.h.
- In the same folder as your plugin, create a ``plugInfo.json``
file. This file must be formatted like so, substituting
``YOUR_LIBRARY_NAME`` , ``YOUR_CLASS_NAME`` , and
``YOUR_DISPLAY_NAME`` :
.. code-block:: text
{
"Plugins": [{
"Type": "module",
"Name": "YOUR_LIBRARY_NAME",
"Root": "@PLUG_INFO_ROOT@",
"LibraryPath": "@PLUG_INFO_LIBRARY_PATH@",
"ResourcePath": "@PLUG_INFO_RESOURCE_PATH@",
"Info": {
"Types": {
"YOUR_CLASS_NAME" : {
"bases": ["NdrDiscoveryPlugin"],
"displayName": "YOUR_DISPLAY_NAME"
}
}
}
}]
}
The NDR ships with one discovery plugin, the
``_NdrFilesystemDiscoveryPlugin`` . Take a look at NDR's plugInfo.json
file for example values for ``YOUR_LIBRARY_NAME`` ,
``YOUR_CLASS_NAME`` , and ``YOUR_DISPLAY_NAME`` . If multiple
discovery plugins exist in the same folder, you can continue adding
additional plugins under the ``Types`` key in the JSON. More detailed
information about the plugInfo.json format can be found in the
documentation for the ``plug`` module (in pxr/base).
"""
@staticmethod
def DiscoverNodes(arg1) -> NdrNodeDiscoveryResultVec:
"""
DiscoverNodes(arg1) -> NdrNodeDiscoveryResultVec
Finds and returns all nodes that the implementing plugin should be
aware of.
Parameters
----------
arg1 : Context
"""
@staticmethod
def GetSearchURIs() -> NdrStringVec:
"""
GetSearchURIs() -> NdrStringVec
Gets the URIs that this plugin is searching for nodes in.
"""
@property
def expired(self) -> None:
"""
True if this object has expired, False otherwise.
:type: None
"""
pass
class DiscoveryPluginContext(Boost.Python.instance):
"""
A context for discovery.
Discovery plugins can use this to get a limited set of non-local
information without direct coupling between plugins.
"""
@staticmethod
def GetSourceType(discoveryType) -> str:
"""
GetSourceType(discoveryType) -> str
Returns the source type associated with the discovery type.
This may return an empty token if there is no such association.
Parameters
----------
discoveryType : str
"""
@property
def expired(self) -> None:
"""
True if this object has expired, False otherwise.
:type: None
"""
pass
class DiscoveryPluginList(Boost.Python.instance):
@staticmethod
def append(*args, **kwargs) -> None: ...
@staticmethod
def extend(*args, **kwargs) -> None: ...
__instance_size__ = 40
pass
class DiscoveryUri(Boost.Python.instance):
"""
Struct for holding a URI and its resolved URI for a file discovered by
NdrFsHelpersDiscoverFiles.
"""
@property
def resolvedUri(self) -> None:
"""
:type: None
"""
@property
def uri(self) -> None:
"""
:type: None
"""
__instance_size__ = 80
pass
class Node(Boost.Python.instance):
"""
Represents an abstract node. Describes information like the name of
the node, what its inputs and outputs are, and any associated
metadata.
In almost all cases, this class will not be used directly. More
specialized nodes can be created that derive from ``NdrNode`` ; those
specialized nodes can add their own domain-specific data and methods.
"""
@staticmethod
def GetContext() -> str:
"""
GetContext() -> str
Gets the context of the node.
The context is the context that the node declares itself as having
(or, if a particular node does not declare a context, it will be
assigned a default context by the parser).
As a concrete example from the ``Sdr`` module, a shader with a
specific source type may perform different duties vs. another shader
with the same source type. For example, one shader with a source type
of ``SdrArgsParser::SourceType`` may declare itself as having a
context of'pattern', while another shader of the same source type may
say it is used for lighting, and thus has a context of'light'.
"""
@staticmethod
def GetFamily() -> str:
"""
GetFamily() -> str
Gets the name of the family that the node belongs to.
An empty token will be returned if the node does not belong to a
family.
"""
@staticmethod
def GetIdentifier() -> NdrIdentifier:
"""
GetIdentifier() -> NdrIdentifier
Return the identifier of the node.
"""
@staticmethod
def GetInfoString() -> str:
"""
GetInfoString() -> str
Gets a string with basic information about this node.
Helpful for things like adding this node to a log.
"""
@staticmethod
def GetInput(inputName) -> Property:
"""
GetInput(inputName) -> Property
Get an input property by name.
``nullptr`` is returned if an input with the given name does not
exist.
Parameters
----------
inputName : str
"""
@staticmethod
def GetInputNames() -> NdrTokenVec:
"""
GetInputNames() -> NdrTokenVec
Get an ordered list of all the input names on this node.
"""
@staticmethod
def GetMetadata() -> NdrTokenMap:
"""
GetMetadata() -> NdrTokenMap
All metadata that came from the parse process.
Specialized nodes may isolate values in the metadata (with possible
manipulations and/or additional parsing) and expose those values in
their API.
"""
@staticmethod
def GetName() -> str:
"""
GetName() -> str
Gets the name of the node.
"""
@staticmethod
def GetOutput(outputName) -> Property:
"""
GetOutput(outputName) -> Property
Get an output property by name.
``nullptr`` is returned if an output with the given name does not
exist.
Parameters
----------
outputName : str
"""
@staticmethod
def GetOutputNames() -> NdrTokenVec:
"""
GetOutputNames() -> NdrTokenVec
Get an ordered list of all the output names on this node.
"""
@staticmethod
def GetResolvedDefinitionURI() -> str:
"""
GetResolvedDefinitionURI() -> str
Gets the URI to the resource that provided this node's definition.
Could be a path to a file, or some other resource identifier. This URI
should be fully resolved.
NdrNode::GetResolvedImplementationURI()
"""
@staticmethod
def GetResolvedImplementationURI() -> str:
"""
GetResolvedImplementationURI() -> str
Gets the URI to the resource that provides this node's implementation.
Could be a path to a file, or some other resource identifier. This URI
should be fully resolved.
NdrNode::GetResolvedDefinitionURI()
"""
@staticmethod
def GetSourceCode() -> str:
"""
GetSourceCode() -> str
Returns the source code for this node.
This will be empty for most nodes. It will be non-empty only for the
nodes that are constructed using NdrRegistry::GetNodeFromSourceCode()
, in which case, the source code has not been parsed (or even
compiled) yet.
An unparsed node with non-empty source-code but no properties is
considered to be invalid. Once the node is parsed and the relevant
properties and metadata are extracted from the source code, the node
becomes valid.
NdrNode::IsValid
"""
@staticmethod
def GetSourceType() -> str:
"""
GetSourceType() -> str
Gets the type of source that this node originated from.
Note that this is distinct from ``GetContext()`` , which is the type
that the node declares itself as having.
As a concrete example from the ``Sdr`` module, several shader parsers
exist and operate on different types of shaders. In this scenario,
each distinct type of shader (OSL, Args, etc) is considered a
different *source*, even though they are all shaders. In addition, the
shaders under each source type may declare themselves as having a
specific context (shaders can serve different roles). See
``GetContext()`` for more information on this.
"""
@staticmethod
def GetVersion() -> Version:
"""
GetVersion() -> Version
Return the version of the node.
"""
@staticmethod
def IsValid() -> bool:
"""
IsValid() -> bool
Whether or not this node is valid.
A node that is valid indicates that the parser plugin was able to
successfully parse the contents of this node.
Note that if a node is not valid, some data like its name, URI, source
code etc. could still be available (data that was obtained during the
discovery process). However, other data that must be gathered from the
parsing process will NOT be available (eg, inputs and outputs).
"""
pass
class NodeDiscoveryResult(Boost.Python.instance):
"""
Represents the raw data of a node, and some other bits of metadata,
that were determined via a ``NdrDiscoveryPlugin`` .
"""
@property
def blindData(self) -> None:
"""
:type: None
"""
@property
def discoveryType(self) -> None:
"""
:type: None
"""
@property
def family(self) -> None:
"""
:type: None
"""
@property
def identifier(self) -> None:
"""
:type: None
"""
@property
def metadata(self) -> None:
"""
:type: None
"""
@property
def name(self) -> None:
"""
:type: None
"""
@property
def resolvedUri(self) -> None:
"""
:type: None
"""
@property
def sourceCode(self) -> None:
"""
:type: None
"""
@property
def sourceType(self) -> None:
"""
:type: None
"""
@property
def subIdentifier(self) -> None:
"""
:type: None
"""
@property
def uri(self) -> None:
"""
:type: None
"""
@property
def version(self) -> None:
"""
:type: None
"""
pass
class NodeList(Boost.Python.instance):
@staticmethod
def append(*args, **kwargs) -> None: ...
@staticmethod
def extend(*args, **kwargs) -> None: ...
__instance_size__ = 40
pass
class Property(Boost.Python.instance):
"""
Represents a property (input or output) that is part of a ``NdrNode``
instance.
A property must have a name and type, but may also specify a host of
additional metadata. Instances can also be queried to determine if
another ``NdrProperty`` instance can be connected to it.
In almost all cases, this class will not be used directly. More
specialized properties can be created that derive from ``NdrProperty``
; those specialized properties can add their own domain-specific data
and methods.
"""
@staticmethod
def CanConnectTo(other) -> bool:
"""
CanConnectTo(other) -> bool
Determines if this property can be connected to the specified
property.
Parameters
----------
other : Property
"""
@staticmethod
def GetArraySize() -> int:
"""
GetArraySize() -> int
Gets this property's array size.
If this property is a fixed-size array type, the array size is
returned. In the case of a dynamically-sized array, this method
returns the array size that the parser reports, and should not be
relied upon to be accurate. A parser may report -1 for the array size,
for example, to indicate a dynamically-sized array. For types that are
not a fixed-size array or dynamic array, this returns 0.
"""
@staticmethod
def GetDefaultValue() -> VtValue:
"""
GetDefaultValue() -> VtValue
Gets this property's default value associated with the type of the
property.
"""
@staticmethod
def GetInfoString() -> str:
"""
GetInfoString() -> str
Gets a string with basic information about this property.
Helpful for things like adding this property to a log.
"""
@staticmethod
def GetMetadata() -> NdrTokenMap:
"""
GetMetadata() -> NdrTokenMap
All of the metadata that came from the parse process.
"""
@staticmethod
def GetName() -> str:
"""
GetName() -> str
Gets the name of the property.
"""
@staticmethod
def GetType() -> str:
"""
GetType() -> str
Gets the type of the property.
"""
@staticmethod
def GetTypeAsSdfType() -> NdrSdfTypeIndicator:
"""
GetTypeAsSdfType() -> NdrSdfTypeIndicator
Converts the property's type from ``GetType()`` into a
``SdfValueTypeName`` .
Two scenarios can result: an exact mapping from property type to Sdf
type, and an inexact mapping. In the first scenario, the first element
in the pair will be the cleanly-mapped Sdf type, and the second
element, a TfToken, will be empty. In the second scenario, the Sdf
type will be set to ``Token`` to indicate an unclean mapping, and the
second element will be set to the original type returned by
``GetType()`` .
GetDefaultValueAsSdfType
"""
@staticmethod
def IsArray() -> bool:
"""
IsArray() -> bool
Whether this property's type is an array type.
"""
@staticmethod
def IsConnectable() -> bool:
"""
IsConnectable() -> bool
Whether this property can be connected to other properties.
If this returns ``true`` , connectability to a specific property can
be tested via ``CanConnectTo()`` .
"""
@staticmethod
def IsDynamicArray() -> bool:
"""
IsDynamicArray() -> bool
Whether this property's array type is dynamically-sized.
"""
@staticmethod
def IsOutput() -> bool:
"""
IsOutput() -> bool
Whether this property is an output.
"""
pass
class Registry(Boost.Python.instance):
"""
The registry provides access to node information."Discovery
Plugins"are responsible for finding the nodes that should be included
in the registry.
Discovery plugins are found through the plugin system. If additional
discovery plugins need to be specified, a client can pass them to
``SetExtraDiscoveryPlugins()`` .
When the registry is first told about the discovery plugins, the
plugins will be asked to discover nodes. These plugins will generate
``NdrNodeDiscoveryResult`` instances, which only contain basic
metadata. Once the client asks for information that would require the
node's contents to be parsed (eg, what its inputs and outputs are),
the registry will begin the parsing process on an as-needed basis. See
``NdrNodeDiscoveryResult`` for the information that can be retrieved
without triggering a parse.
Some methods in this module may allow for a"family"to be provided. A
family is simply a generic grouping which is optional.
"""
@staticmethod
def GetAllNodeSourceTypes() -> NdrTokenVec:
"""
GetAllNodeSourceTypes() -> NdrTokenVec
Get a sorted list of all node source types that may be present on the
nodes in the registry.
Source types originate from the discovery process, but there is no
guarantee that the discovered source types will also have a registered
parser plugin. The actual supported source types here depend on the
parsers that are available. Also note that some parser plugins may not
advertise a source type.
See the documentation for ``NdrParserPlugin`` and
``NdrNode::GetSourceType()`` for more information.
"""
@staticmethod
def GetNodeByIdentifier(identifier, sourceTypePriority) -> Node:
"""
GetNodeByIdentifier(identifier, sourceTypePriority) -> Node
Get the node with the specified ``identifier`` , and an optional
``sourceTypePriority`` list specifying the set of node SOURCE types
(see ``NdrNode::GetSourceType()`` ) that should be searched.
If no sourceTypePriority is specified, the first encountered node with
the specified identifier will be returned (first is arbitrary) if
found.
If a sourceTypePriority list is specified, then this will iterate
through each source type and try to find a node matching by
identifier. This is equivalent to calling
NdrRegistry::GetNodeByIdentifierAndType for each source type until a
node is found.
Nodes of the same identifier but different source type can exist in
the registry. If a node'Foo'with source types'abc'and'xyz'exist in the
registry, and you want to make sure the'abc'version is fetched before
the'xyz'version, the priority list would be specified as
['abc','xyz']. If the'abc'version did not exist in the registry, then
the'xyz'version would be returned.
Returns ``nullptr`` if a node matching the arguments can't be found.
Parameters
----------
identifier : NdrIdentifier
sourceTypePriority : NdrTokenVec
"""
@staticmethod
def GetNodeByIdentifierAndType(identifier, sourceType) -> Node:
"""
GetNodeByIdentifierAndType(identifier, sourceType) -> Node
Get the node with the specified ``identifier`` and ``sourceType`` .
If there is no matching node for the sourceType, nullptr is returned.
Parameters
----------
identifier : NdrIdentifier
sourceType : str
"""
@staticmethod
def GetNodeByName(name, sourceTypePriority, filter) -> Node:
"""
GetNodeByName(name, sourceTypePriority, filter) -> Node
Get the node with the specified name.
An optional priority list specifies the set of node SOURCE types (
NdrNode::GetSourceType() ) that should be searched and in what order.
Optionally, a filter can be specified to consider just the default
versions of nodes matching ``name`` (the default) or all versions of
the nodes.
Parameters
----------
name : str
sourceTypePriority : NdrTokenVec
filter : VersionFilter
"""
@staticmethod
def GetNodeByNameAndType(name, sourceType, filter) -> Node:
"""
GetNodeByNameAndType(name, sourceType, filter) -> Node
A convenience wrapper around ``GetNodeByName()`` .
Instead of providing a priority list, an exact type is specified, and
``nullptr`` is returned if a node with the exact identifier and type
does not exist.
Optionally, a filter can be specified to consider just the default
versions of nodes matching ``name`` (the default) or all versions of
the nodes.
Parameters
----------
name : str
sourceType : str
filter : VersionFilter
"""
@staticmethod
def GetNodeFromAsset(asset, metadata, subIdentifier, sourceType) -> Node:
"""
GetNodeFromAsset(asset, metadata, subIdentifier, sourceType) -> Node
Parses the given ``asset`` , constructs a NdrNode from it and adds it
to the registry.
Nodes created from an asset using this API can be looked up by the
unique identifier and sourceType of the returned node, or by URI,
which will be set to the unresolved asset path value.
``metadata`` contains additional metadata needed for parsing and
compiling the source code in the file pointed to by ``asset``
correctly. This metadata supplements the metadata available in the
asset and overrides it in cases where there are key collisions.
``subidentifier`` is optional, and it would be used to indicate a
particular definition in the asset file if the asset contains multiple
node definitions.
``sourceType`` is optional, and it is only needed to indicate a
particular type if the asset file is capable of representing a node
definition of multiple source types.
Returns a valid node if the asset is parsed successfully using one of
the registered parser plugins.
Parameters
----------
asset : AssetPath
metadata : NdrTokenMap
subIdentifier : str
sourceType : str
"""
@staticmethod
def GetNodeFromSourceCode(sourceCode, sourceType, metadata) -> Node:
"""
GetNodeFromSourceCode(sourceCode, sourceType, metadata) -> Node
Parses the given ``sourceCode`` string, constructs a NdrNode from it
and adds it to the registry.
The parser to be used is determined by the specified ``sourceType`` .
Nodes created from source code using this API can be looked up by the
unique identifier and sourceType of the returned node.
``metadata`` contains additional metadata needed for parsing and
compiling the source code correctly. This metadata supplements the
metadata available in ``sourceCode`` and overrides it cases where
there are key collisions.
Returns a valid node if the given source code is parsed successfully
using the parser plugins that is registered for the specified
``sourceType`` .
Parameters
----------
sourceCode : str
sourceType : str
metadata : NdrTokenMap
"""
@staticmethod
def GetNodeIdentifiers(family, filter) -> NdrIdentifierVec:
"""
GetNodeIdentifiers(family, filter) -> NdrIdentifierVec
Get the identifiers of all the nodes that the registry is aware of.
This will not run the parsing plugins on the nodes that have been
discovered, so this method is relatively quick. Optionally,
a"family"name can be specified to only get the identifiers of nodes
that belong to that family and a filter can be specified to get just
the default version (the default) or all versions of the node.
Parameters
----------
family : str
filter : VersionFilter
"""
@staticmethod
def GetNodeNames(family) -> NdrStringVec:
"""
GetNodeNames(family) -> NdrStringVec
Get the names of all the nodes that the registry is aware of.
This will not run the parsing plugins on the nodes that have been
discovered, so this method is relatively quick. Optionally,
a"family"name can be specified to only get the names of nodes that
belong to that family.
Parameters
----------
family : str
"""
@staticmethod
def GetNodesByFamily(family, filter) -> NdrNodeConstPtrVec:
"""
GetNodesByFamily(family, filter) -> NdrNodeConstPtrVec
Get all nodes from the registry, optionally restricted to the nodes
that fall under a specified family and/or the default version.
Note that this will parse *all* nodes that the registry is aware of
(unless a family is specified), so this may take some time to run the
first time it is called.
Parameters
----------
family : str
filter : VersionFilter
"""
@staticmethod
def GetNodesByIdentifier(identifier) -> NdrNodeConstPtrVec:
"""
GetNodesByIdentifier(identifier) -> NdrNodeConstPtrVec
Get all nodes matching the specified identifier (multiple nodes of the
same identifier, but different source types, may exist).
If no nodes match the identifier, an empty vector is returned.
Parameters
----------
identifier : NdrIdentifier
"""
@staticmethod
def GetNodesByName(name, filter) -> NdrNodeConstPtrVec:
"""
GetNodesByName(name, filter) -> NdrNodeConstPtrVec
Get all nodes matching the specified name.
Only nodes matching the specified name will be parsed. Optionally, a
filter can be specified to get just the default version (the default)
or all versions of the node. If no nodes match an empty vector is
returned.
Parameters
----------
name : str
filter : VersionFilter
"""
@staticmethod
def GetSearchURIs() -> NdrStringVec:
"""
GetSearchURIs() -> NdrStringVec
Get the locations where the registry is searching for nodes.
Depending on which discovery plugins were used, this may include non-
filesystem paths.
"""
@staticmethod
@typing.overload
def SetExtraDiscoveryPlugins(plugins) -> None:
"""
SetExtraDiscoveryPlugins(plugins) -> None
Allows the client to set any additional discovery plugins that would
otherwise NOT be found through the plugin system.
Runs the discovery process for the specified plugins immediately.
Note that this method cannot be called after any nodes in the registry
have been parsed (eg, through GetNode\*()), otherwise an error will
result.
Parameters
----------
plugins : DiscoveryPluginRefPtrVec
----------------------------------------------------------------------
Allows the client to set any additional discovery plugins that would
otherwise NOT be found through the plugin system.
Runs the discovery process for the specified plugins immediately.
Note that this method cannot be called after any nodes in the registry
have been parsed (eg, through GetNode\*()), otherwise an error will
result.
Parameters
----------
pluginTypes : list[Type]
"""
@staticmethod
@typing.overload
def SetExtraDiscoveryPlugins(pluginTypes) -> None: ...
@staticmethod
def SetExtraParserPlugins(pluginTypes) -> None:
"""
SetExtraParserPlugins(pluginTypes) -> None
Allows the client to set any additional parser plugins that would
otherwise NOT be found through the plugin system.
Note that this method cannot be called after any nodes in the registry
have been parsed (eg, through GetNode\*()), otherwise an error will
result.
Parameters
----------
pluginTypes : list[Type]
"""
pass
class Version(Boost.Python.instance):
@staticmethod
def GetAsDefault() -> Version:
"""
GetAsDefault() -> Version
Return an equal version marked as default.
It's permitted to mark an invalid version as the default.
"""
@staticmethod
def GetMajor() -> int:
"""
GetMajor() -> int
Return the major version number or zero for an invalid version.
"""
@staticmethod
def GetMinor() -> int:
"""
GetMinor() -> int
Return the minor version number or zero for an invalid version.
"""
@staticmethod
def GetStringSuffix() -> str:
"""
GetStringSuffix() -> str
Return the version as a identifier suffix.
"""
@staticmethod
def IsDefault() -> bool:
"""
IsDefault() -> bool
Return true iff this version is marked as default.
"""
pass
class VersionFilter(pxr.Tf.Tf_PyEnumWrapper, pxr.Tf.Enum, Boost.Python.instance):
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = ''
allValues: tuple # value = (Ndr.VersionFilterDefaultOnly, Ndr.VersionFilterAllVersions)
pass
class _AnnotatedBool(Boost.Python.instance):
@property
def message(self) -> None:
"""
:type: None
"""
__instance_size__ = 56
pass
class _FilesystemDiscoveryPlugin(DiscoveryPlugin, Boost.Python.instance):
class Context(DiscoveryPluginContext, Boost.Python.instance):
@property
def expired(self) -> None:
"""
True if this object has expired, False otherwise.
:type: None
"""
pass
@staticmethod
def DiscoverNodes(*args, **kwargs) -> None: ...
@staticmethod
def GetSearchURIs(*args, **kwargs) -> None: ...
@property
def expired(self) -> None:
"""
True if this object has expired, False otherwise.
:type: None
"""
pass
def FsHelpersDiscoverFiles(*args, **kwargs) -> None:
pass
def FsHelpersDiscoverNodes(*args, **kwargs) -> None:
pass
def FsHelpersSplitShaderIdentifier(*args, **kwargs) -> None:
pass
def _ValidateProperty(*args, **kwargs) -> None:
pass
VersionFilterAllVersions: pxr.Ndr.VersionFilter # value = Ndr.VersionFilterAllVersions
VersionFilterDefaultOnly: pxr.Ndr.VersionFilter # value = Ndr.VersionFilterDefaultOnly
__MFB_FULL_PACKAGE_NAME = 'ndr'
| 32,473 | unknown | 27.840142 | 91 | 0.620885 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdRender/__init__.py | #
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
from pxr import Tf
Tf.PreparePythonModule()
del Tf
| 1,110 | Python | 40.148147 | 74 | 0.766667 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdRender/__DOC.py | def Execute(result):
result["DenoisePass"].__doc__ = """
A RenderDenoisePass generates renders via a denoising process. This
may be the same renderer that a pipeline uses for UsdRender, or may be
a separate one. Notably, a RenderDenoisePass requires another Pass to
be present for it to operate. The denoising process itself is not
generative, and requires images inputs to operate.
As denoising integration varies so widely across pipelines, all
implementation details are left to pipeline-specific prims that
inherit from RenderDenoisePass.
"""
result["DenoisePass"].__init__.func_doc = """__init__(prim)
Construct a UsdRenderDenoisePass on UsdPrim ``prim`` .
Equivalent to UsdRenderDenoisePass::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdRenderDenoisePass on the prim held by ``schemaObj`` .
Should be preferred over UsdRenderDenoisePass (schemaObj.GetPrim()),
as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["DenoisePass"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["DenoisePass"].Get.func_doc = """**classmethod** Get(stage, path) -> DenoisePass
Return a UsdRenderDenoisePass holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdRenderDenoisePass(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["DenoisePass"].Define.func_doc = """**classmethod** Define(stage, path) -> DenoisePass
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["DenoisePass"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["Pass"].__doc__ = """
A RenderPass prim encapsulates the necessary information to generate
multipass renders. It houses properties for generating dependencies
and the necessary commands to run to generate renders, as well as
visibility controls for the scene. While RenderSettings describes the
information needed to generate images from a single invocation of a
renderer, RenderPass describes the additional information needed to
generate a time varying set of images.
There are two consumers of RenderPass prims - a runtime executable
that generates images from usdRender prims, and pipeline specific code
that translates between usdRender prims and the pipeline's resource
scheduling software. We'll refer to the latter as'job submission
code'.
The name of the prim is used as the pass's name.
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdRenderTokens. So to set an attribute to the value"rightHanded",
use UsdRenderTokens->rightHanded as the value.
"""
result["Pass"].__init__.func_doc = """__init__(prim)
Construct a UsdRenderPass on UsdPrim ``prim`` .
Equivalent to UsdRenderPass::Get (prim.GetStage(), prim.GetPath()) for
a *valid* ``prim`` , but will not immediately throw an error for an
invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdRenderPass on the prim held by ``schemaObj`` .
Should be preferred over UsdRenderPass (schemaObj.GetPrim()), as it
preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["Pass"].GetPassTypeAttr.func_doc = """GetPassTypeAttr() -> Attribute
A string used to categorize differently structured or executed types
of passes within a customized pipeline.
For example, when multiple DCC's (e.g. Houdini, Katana, Nuke) each
compute and contribute different Products to a final result, it may be
clearest and most flexible to create a separate RenderPass for each.
Declaration
``uniform token passType``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
"""
result["Pass"].CreatePassTypeAttr.func_doc = """CreatePassTypeAttr(defaultValue, writeSparsely) -> Attribute
See GetPassTypeAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Pass"].GetCommandAttr.func_doc = """GetCommandAttr() -> Attribute
The command to run in order to generate renders for this pass.
The job submission code can use this to properly send tasks to the job
scheduling software that will generate products.
The command can contain variables that will be substituted
appropriately during submission, as seen in the example below with
{fileName}.
For example: command[0] ="prman"command[1] ="-progress"command[2]
="-pixelvariance"command[3] ="-0.15"command[4] ="{fileName}"# the
fileName property will be substituted
Declaration
``uniform string[] command``
C++ Type
VtArray<std::string>
Usd Type
SdfValueTypeNames->StringArray
Variability
SdfVariabilityUniform
"""
result["Pass"].CreateCommandAttr.func_doc = """CreateCommandAttr(defaultValue, writeSparsely) -> Attribute
See GetCommandAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Pass"].GetFileNameAttr.func_doc = """GetFileNameAttr() -> Attribute
The asset that contains the rendering prims or other information
needed to render this pass.
Declaration
``uniform asset fileName``
C++ Type
SdfAssetPath
Usd Type
SdfValueTypeNames->Asset
Variability
SdfVariabilityUniform
"""
result["Pass"].CreateFileNameAttr.func_doc = """CreateFileNameAttr(defaultValue, writeSparsely) -> Attribute
See GetFileNameAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Pass"].GetDenoiseEnableAttr.func_doc = """GetDenoiseEnableAttr() -> Attribute
When True, this Pass pass should be denoised.
Declaration
``uniform bool denoise:enable = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
Variability
SdfVariabilityUniform
"""
result["Pass"].CreateDenoiseEnableAttr.func_doc = """CreateDenoiseEnableAttr(defaultValue, writeSparsely) -> Attribute
See GetDenoiseEnableAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Pass"].GetRenderSourceRel.func_doc = """GetRenderSourceRel() -> Relationship
The source prim to render from.
If *fileName* is not present, the source is assumed to be a
RenderSettings prim present in the current Usd stage. If fileName is
present, the source should be found in the file there. This
relationship might target a string attribute on this or another prim
that identifies the appropriate object in the external container.
For example, for a Usd-backed pass, this would point to a
RenderSettings prim. Houdini passes would point to a Rop. Nuke passes
would point to a write node.
"""
result["Pass"].CreateRenderSourceRel.func_doc = """CreateRenderSourceRel() -> Relationship
See GetRenderSourceRel() , and also Create vs Get Property Methods for
when to use Get vs Create.
"""
result["Pass"].GetInputPassesRel.func_doc = """GetInputPassesRel() -> Relationship
The set of other Passes that this Pass depends on in order to be
constructed properly.
For example, a Pass A may generate a texture, which is then used as an
input to Pass B.
By default, usdRender makes some assumptions about the relationship
between this prim and the prims listed in inputPasses. Namely, when
per-frame tasks are generated from these pass prims, usdRender will
assume a one-to-one relationship between tasks that share their frame
number. Consider a pass named'composite'whose *inputPasses* targets a
Pass prim named'beauty`. By default, each frame for'composite'will
depend on the same frame from'beauty': beauty.1 ->composite.1 beauty.2
\\->composite.2 etc
The consumer of this RenderPass graph of inputs will need to resolve
the transitive dependencies.
"""
result["Pass"].CreateInputPassesRel.func_doc = """CreateInputPassesRel() -> Relationship
See GetInputPassesRel() , and also Create vs Get Property Methods for
when to use Get vs Create.
"""
result["Pass"].GetDenoisePassRel.func_doc = """GetDenoisePassRel() -> Relationship
The The UsdRenderDenoisePass prim from which to source denoise
settings.
"""
result["Pass"].CreateDenoisePassRel.func_doc = """CreateDenoisePassRel() -> Relationship
See GetDenoisePassRel() , and also Create vs Get Property Methods for
when to use Get vs Create.
"""
result["Pass"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["Pass"].Get.func_doc = """**classmethod** Get(stage, path) -> Pass
Return a UsdRenderPass holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdRenderPass(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["Pass"].Define.func_doc = """**classmethod** Define(stage, path) -> Pass
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["Pass"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["Product"].__doc__ = """
A UsdRenderProduct describes an image or other file-like artifact
produced by a render. A RenderProduct combines one or more RenderVars
into a file or interactive buffer. It also provides all the controls
established in UsdRenderSettingsBase as optional overrides to whatever
the owning UsdRenderSettings prim dictates.
Specific renderers may support additional settings, such as a way to
configure compression settings, filetype metadata, and so forth. Such
settings can be encoded using renderer-specific API schemas applied to
the product prim.
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdRenderTokens. So to set an attribute to the value"rightHanded",
use UsdRenderTokens->rightHanded as the value.
"""
result["Product"].__init__.func_doc = """__init__(prim)
Construct a UsdRenderProduct on UsdPrim ``prim`` .
Equivalent to UsdRenderProduct::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdRenderProduct on the prim held by ``schemaObj`` .
Should be preferred over UsdRenderProduct (schemaObj.GetPrim()), as it
preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["Product"].GetProductTypeAttr.func_doc = """GetProductTypeAttr() -> Attribute
The type of output to produce.
The default,"raster", indicates a 2D image.
In the future, UsdRender may define additional product types.
Declaration
``uniform token productType ="raster"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
"""
result["Product"].CreateProductTypeAttr.func_doc = """CreateProductTypeAttr(defaultValue, writeSparsely) -> Attribute
See GetProductTypeAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Product"].GetProductNameAttr.func_doc = """GetProductNameAttr() -> Attribute
Specifies the name that the output/display driver should give the
product.
This is provided as-authored to the driver, whose responsibility it is
to situate the product on a filesystem or other storage, in the
desired location.
Declaration
``token productName =""``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
"""
result["Product"].CreateProductNameAttr.func_doc = """CreateProductNameAttr(defaultValue, writeSparsely) -> Attribute
See GetProductNameAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Product"].GetOrderedVarsRel.func_doc = """GetOrderedVarsRel() -> Relationship
Specifies the RenderVars that should be consumed and combined into the
final product.
If ordering is relevant to the output driver, then the ordering of
targets in this relationship provides the order to use.
"""
result["Product"].CreateOrderedVarsRel.func_doc = """CreateOrderedVarsRel() -> Relationship
See GetOrderedVarsRel() , and also Create vs Get Property Methods for
when to use Get vs Create.
"""
result["Product"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["Product"].Get.func_doc = """**classmethod** Get(stage, path) -> Product
Return a UsdRenderProduct holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdRenderProduct(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["Product"].Define.func_doc = """**classmethod** Define(stage, path) -> Product
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["Product"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["Settings"].__doc__ = """
A UsdRenderSettings prim specifies global settings for a render
process, including an enumeration of the RenderProducts that should
result, and the UsdGeomImageable purposes that should be rendered. How
settings affect rendering
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdRenderTokens. So to set an attribute to the value"rightHanded",
use UsdRenderTokens->rightHanded as the value.
"""
result["Settings"].__init__.func_doc = """__init__(prim)
Construct a UsdRenderSettings on UsdPrim ``prim`` .
Equivalent to UsdRenderSettings::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdRenderSettings on the prim held by ``schemaObj`` .
Should be preferred over UsdRenderSettings (schemaObj.GetPrim()), as
it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["Settings"].GetIncludedPurposesAttr.func_doc = """GetIncludedPurposesAttr() -> Attribute
The list of UsdGeomImageable *purpose* values that should be included
in the render.
Note this cannot be specified per-RenderProduct because it is a
statement of which geometry is present.
Declaration
``uniform token[] includedPurposes = ["default","render"]``
C++ Type
VtArray<TfToken>
Usd Type
SdfValueTypeNames->TokenArray
Variability
SdfVariabilityUniform
"""
result["Settings"].CreateIncludedPurposesAttr.func_doc = """CreateIncludedPurposesAttr(defaultValue, writeSparsely) -> Attribute
See GetIncludedPurposesAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Settings"].GetMaterialBindingPurposesAttr.func_doc = """GetMaterialBindingPurposesAttr() -> Attribute
Ordered list of material purposes to consider when resolving material
bindings in the scene.
The empty string indicates the"allPurpose"binding.
Declaration
``uniform token[] materialBindingPurposes = ["full",""]``
C++ Type
VtArray<TfToken>
Usd Type
SdfValueTypeNames->TokenArray
Variability
SdfVariabilityUniform
Allowed Values
full, preview,""
"""
result["Settings"].CreateMaterialBindingPurposesAttr.func_doc = """CreateMaterialBindingPurposesAttr(defaultValue, writeSparsely) -> Attribute
See GetMaterialBindingPurposesAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Settings"].GetRenderingColorSpaceAttr.func_doc = """GetRenderingColorSpaceAttr() -> Attribute
Describes a renderer's working (linear) colorSpace where all the
renderer/shader math is expected to happen.
When no renderingColorSpace is provided, renderer should use its own
default.
Declaration
``uniform token renderingColorSpace``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
"""
result["Settings"].CreateRenderingColorSpaceAttr.func_doc = """CreateRenderingColorSpaceAttr(defaultValue, writeSparsely) -> Attribute
See GetRenderingColorSpaceAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Settings"].GetProductsRel.func_doc = """GetProductsRel() -> Relationship
The set of RenderProducts the render should produce.
This relationship should target UsdRenderProduct prims. If no
*products* are specified, an application should produce an rgb image
according to the RenderSettings configuration, to a default display or
image name.
"""
result["Settings"].CreateProductsRel.func_doc = """CreateProductsRel() -> Relationship
See GetProductsRel() , and also Create vs Get Property Methods for
when to use Get vs Create.
"""
result["Settings"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["Settings"].Get.func_doc = """**classmethod** Get(stage, path) -> Settings
Return a UsdRenderSettings holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdRenderSettings(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["Settings"].Define.func_doc = """**classmethod** Define(stage, path) -> Settings
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["Settings"].GetStageRenderSettings.func_doc = """**classmethod** GetStageRenderSettings(stage) -> Settings
Fetch and return ``stage`` 's render settings, as indicated by root
layer metadata.
If unauthored, or the metadata does not refer to a valid
UsdRenderSettings prim, this will return an invalid UsdRenderSettings
prim.
Parameters
----------
stage : UsdStageWeak
"""
result["Settings"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["SettingsBase"].__doc__ = """
Abstract base class that defines render settings that can be specified
on either a RenderSettings prim or a RenderProduct prim.
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdRenderTokens. So to set an attribute to the value"rightHanded",
use UsdRenderTokens->rightHanded as the value.
"""
result["SettingsBase"].__init__.func_doc = """__init__(prim)
Construct a UsdRenderSettingsBase on UsdPrim ``prim`` .
Equivalent to UsdRenderSettingsBase::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdRenderSettingsBase on the prim held by ``schemaObj`` .
Should be preferred over UsdRenderSettingsBase (schemaObj.GetPrim()),
as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["SettingsBase"].GetResolutionAttr.func_doc = """GetResolutionAttr() -> Attribute
The image pixel resolution, corresponding to the camera's screen
window.
Declaration
``uniform int2 resolution = (2048, 1080)``
C++ Type
GfVec2i
Usd Type
SdfValueTypeNames->Int2
Variability
SdfVariabilityUniform
"""
result["SettingsBase"].CreateResolutionAttr.func_doc = """CreateResolutionAttr(defaultValue, writeSparsely) -> Attribute
See GetResolutionAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["SettingsBase"].GetPixelAspectRatioAttr.func_doc = """GetPixelAspectRatioAttr() -> Attribute
The aspect ratio (width/height) of image pixels.
The default ratio 1.0 indicates square pixels.
Declaration
``uniform float pixelAspectRatio = 1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
Variability
SdfVariabilityUniform
"""
result["SettingsBase"].CreatePixelAspectRatioAttr.func_doc = """CreatePixelAspectRatioAttr(defaultValue, writeSparsely) -> Attribute
See GetPixelAspectRatioAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["SettingsBase"].GetAspectRatioConformPolicyAttr.func_doc = """GetAspectRatioConformPolicyAttr() -> Attribute
Indicates the policy to use to resolve an aspect ratio mismatch
between the camera aperture and image settings.
This policy allows a standard render setting to do something
reasonable given varying camera inputs.
The camera aperture aspect ratio is determined by the aperture
atributes on the UsdGeomCamera.
The image aspect ratio is determined by the resolution and
pixelAspectRatio attributes in the render settings.
- "expandAperture": if necessary, expand the aperture to fit the
image, exposing additional scene content
- "cropAperture": if necessary, crop the aperture to fit the image,
cropping scene content
- "adjustApertureWidth": if necessary, adjust aperture width to
make its aspect ratio match the image
- "adjustApertureHeight": if necessary, adjust aperture height to
make its aspect ratio match the image
- "adjustPixelAspectRatio": compute pixelAspectRatio to make the
image exactly cover the aperture; disregards existing attribute value
of pixelAspectRatio
Declaration
``uniform token aspectRatioConformPolicy ="expandAperture"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
expandAperture, cropAperture, adjustApertureWidth,
adjustApertureHeight, adjustPixelAspectRatio
"""
result["SettingsBase"].CreateAspectRatioConformPolicyAttr.func_doc = """CreateAspectRatioConformPolicyAttr(defaultValue, writeSparsely) -> Attribute
See GetAspectRatioConformPolicyAttr() , and also Create vs Get
Property Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["SettingsBase"].GetDataWindowNDCAttr.func_doc = """GetDataWindowNDCAttr() -> Attribute
dataWindowNDC specifies the axis-aligned rectangular region in the
adjusted aperture window within which the renderer should produce
data.
It is specified as (xmin, ymin, xmax, ymax) in normalized device
coordinates, where the range 0 to 1 corresponds to the aperture. (0,0)
corresponds to the bottom-left corner and (1,1) corresponds to the
upper-right corner.
Specifying a window outside the unit square will produce overscan
data. Specifying a window that does not cover the unit square will
produce a cropped render.
A pixel is included in the rendered result if the pixel center is
contained by the data window. This is consistent with standard rules
used by polygon rasterization engines. UsdRenderRasterization
The data window is expressed in NDC so that cropping and overscan may
be resolution independent. In interactive workflows, incremental
cropping and resolution adjustment may be intermixed to isolate and
examine parts of the scene. In compositing workflows, overscan may be
used to support image post-processing kernels, and reduced-resolution
proxy renders may be used for faster iteration.
The dataWindow:ndc coordinate system references the aperture after any
adjustments required by aspectRatioConformPolicy.
Declaration
``uniform float4 dataWindowNDC = (0, 0, 1, 1)``
C++ Type
GfVec4f
Usd Type
SdfValueTypeNames->Float4
Variability
SdfVariabilityUniform
"""
result["SettingsBase"].CreateDataWindowNDCAttr.func_doc = """CreateDataWindowNDCAttr(defaultValue, writeSparsely) -> Attribute
See GetDataWindowNDCAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["SettingsBase"].GetInstantaneousShutterAttr.func_doc = """GetInstantaneousShutterAttr() -> Attribute
Deprecated - use disableMotionBlur instead.
Override the targeted *camera* 's *shutterClose* to be equal to the
value of its *shutterOpen*, to produce a zero-width shutter interval.
This gives us a convenient way to disable motion blur.
Declaration
``uniform bool instantaneousShutter = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
Variability
SdfVariabilityUniform
"""
result["SettingsBase"].CreateInstantaneousShutterAttr.func_doc = """CreateInstantaneousShutterAttr(defaultValue, writeSparsely) -> Attribute
See GetInstantaneousShutterAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["SettingsBase"].GetDisableMotionBlurAttr.func_doc = """GetDisableMotionBlurAttr() -> Attribute
Disable all motion blur by setting the shutter interval of the
targeted camera to [0,0] - that is, take only one sample, namely at
the current time code.
Declaration
``uniform bool disableMotionBlur = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
Variability
SdfVariabilityUniform
"""
result["SettingsBase"].CreateDisableMotionBlurAttr.func_doc = """CreateDisableMotionBlurAttr(defaultValue, writeSparsely) -> Attribute
See GetDisableMotionBlurAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["SettingsBase"].GetCameraRel.func_doc = """GetCameraRel() -> Relationship
The *camera* relationship specifies the primary camera to use in a
render.
It must target a UsdGeomCamera.
"""
result["SettingsBase"].CreateCameraRel.func_doc = """CreateCameraRel() -> Relationship
See GetCameraRel() , and also Create vs Get Property Methods for when
to use Get vs Create.
"""
result["SettingsBase"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["SettingsBase"].Get.func_doc = """**classmethod** Get(stage, path) -> SettingsBase
Return a UsdRenderSettingsBase holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdRenderSettingsBase(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["SettingsBase"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["Var"].__doc__ = """
A UsdRenderVar describes a custom data variable for a render to
produce. The prim describes the source of the data, which can be a
shader output or an LPE (Light Path Expression), and also allows
encoding of (generally renderer-specific) parameters that configure
the renderer for computing the variable.
The name of the RenderVar prim drives the name of the data variable
that the renderer will produce.
In the future, UsdRender may standardize RenderVar representation for
well-known variables under the sourceType ``intrinsic`` , such as *r*,
*g*, *b*, *a*, *z*, or *id*. For any described attribute *Fallback*
*Value* or *Allowed* *Values* below that are text/tokens, the actual
token is published and defined in UsdRenderTokens. So to set an
attribute to the value"rightHanded", use UsdRenderTokens->rightHanded
as the value.
"""
result["Var"].__init__.func_doc = """__init__(prim)
Construct a UsdRenderVar on UsdPrim ``prim`` .
Equivalent to UsdRenderVar::Get (prim.GetStage(), prim.GetPath()) for
a *valid* ``prim`` , but will not immediately throw an error for an
invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdRenderVar on the prim held by ``schemaObj`` .
Should be preferred over UsdRenderVar (schemaObj.GetPrim()), as it
preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["Var"].GetDataTypeAttr.func_doc = """GetDataTypeAttr() -> Attribute
The type of this channel, as a USD attribute type.
Declaration
``uniform token dataType ="color3f"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
"""
result["Var"].CreateDataTypeAttr.func_doc = """CreateDataTypeAttr(defaultValue, writeSparsely) -> Attribute
See GetDataTypeAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Var"].GetSourceNameAttr.func_doc = """GetSourceNameAttr() -> Attribute
The renderer should look for an output of this name as the computed
value for the RenderVar.
Declaration
``uniform string sourceName =""``
C++ Type
std::string
Usd Type
SdfValueTypeNames->String
Variability
SdfVariabilityUniform
"""
result["Var"].CreateSourceNameAttr.func_doc = """CreateSourceNameAttr(defaultValue, writeSparsely) -> Attribute
See GetSourceNameAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Var"].GetSourceTypeAttr.func_doc = """GetSourceTypeAttr() -> Attribute
Indicates the type of the source.
- "raw": The name should be passed directly to the renderer. This
is the default behavior.
- "primvar": This source represents the name of a primvar. Some
renderers may use this to ensure that the primvar is provided; other
renderers may require that a suitable material network be provided, in
which case this is simply an advisory setting.
- "lpe": Specifies a Light Path Expression in the OSL Light Path
Expressions language as the source for this RenderVar. Some renderers
may use extensions to that syntax, which will necessarily be non-
portable.
- "intrinsic": This setting is currently unimplemented, but
represents a future namespace for UsdRender to provide portable
baseline RenderVars, such as camera depth, that may have varying
implementations for each renderer.
Declaration
``uniform token sourceType ="raw"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
raw, primvar, lpe, intrinsic
"""
result["Var"].CreateSourceTypeAttr.func_doc = """CreateSourceTypeAttr(defaultValue, writeSparsely) -> Attribute
See GetSourceTypeAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Var"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["Var"].Get.func_doc = """**classmethod** Get(stage, path) -> Var
Return a UsdRenderVar holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdRenderVar(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["Var"].Define.func_doc = """**classmethod** Define(stage, path) -> Var
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["Var"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
""" | 43,289 | Python | 22.174518 | 151 | 0.737878 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdBakeMtlx/__init__.py | #
# Copyright 2022 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
from pxr import Tf
Tf.PreparePythonModule()
del Tf
| 1,110 | Python | 40.148147 | 74 | 0.766667 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdBakeMtlx/__DOC.py | def Execute(result):
pass | 29 | Python | 13.999993 | 20 | 0.689655 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdRi/__init__.py | #
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
from pxr import Tf
Tf.PreparePythonModule()
del Tf
| 1,110 | Python | 40.148147 | 74 | 0.766667 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdRi/__DOC.py | def Execute(result):
result["MaterialAPI"].__doc__ = """
Deprecated
Materials should use UsdShadeMaterial instead. This schema will be
removed in a future release.
This API provides outputs that connect a material prim to prman
shaders and RIS objects.
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdRiTokens. So to set an attribute to the value"rightHanded", use
UsdRiTokens->rightHanded as the value.
"""
result["MaterialAPI"].GetSurfaceOutput.func_doc = """GetSurfaceOutput() -> Output
Returns the"surface"output associated with the material.
"""
result["MaterialAPI"].GetDisplacementOutput.func_doc = """GetDisplacementOutput() -> Output
Returns the"displacement"output associated with the material.
"""
result["MaterialAPI"].GetVolumeOutput.func_doc = """GetVolumeOutput() -> Output
Returns the"volume"output associated with the material.
"""
result["MaterialAPI"].SetSurfaceSource.func_doc = """SetSurfaceSource(surfacePath) -> bool
Parameters
----------
surfacePath : Path
"""
result["MaterialAPI"].SetDisplacementSource.func_doc = """SetDisplacementSource(displacementPath) -> bool
Parameters
----------
displacementPath : Path
"""
result["MaterialAPI"].SetVolumeSource.func_doc = """SetVolumeSource(volumePath) -> bool
Parameters
----------
volumePath : Path
"""
result["MaterialAPI"].GetSurface.func_doc = """GetSurface(ignoreBaseMaterial) -> Shader
Returns a valid shader object if the"surface"output on the material is
connected to one.
If ``ignoreBaseMaterial`` is true and if the"surface"shader source is
specified in the base-material of this material, then this returns an
invalid shader object.
Parameters
----------
ignoreBaseMaterial : bool
"""
result["MaterialAPI"].GetDisplacement.func_doc = """GetDisplacement(ignoreBaseMaterial) -> Shader
Returns a valid shader object if the"displacement"output on the
material is connected to one.
If ``ignoreBaseMaterial`` is true and if the"displacement"shader
source is specified in the base-material of this material, then this
returns an invalid shader object.
Parameters
----------
ignoreBaseMaterial : bool
"""
result["MaterialAPI"].GetVolume.func_doc = """GetVolume(ignoreBaseMaterial) -> Shader
Returns a valid shader object if the"volume"output on the material is
connected to one.
If ``ignoreBaseMaterial`` is true and if the"volume"shader source is
specified in the base-material of this material, then this returns an
invalid shader object.
Parameters
----------
ignoreBaseMaterial : bool
"""
result["MaterialAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdRiMaterialAPI on UsdPrim ``prim`` .
Equivalent to UsdRiMaterialAPI::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdRiMaterialAPI on the prim held by ``schemaObj`` .
Should be preferred over UsdRiMaterialAPI (schemaObj.GetPrim()), as it
preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
----------------------------------------------------------------------
__init__(material)
A constructor for creating a MaterialAPI object from a material prim.
Parameters
----------
material : Material
"""
result["MaterialAPI"].GetSurfaceAttr.func_doc = """GetSurfaceAttr() -> Attribute
Declaration
``token outputs:ri:surface``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
"""
result["MaterialAPI"].CreateSurfaceAttr.func_doc = """CreateSurfaceAttr(defaultValue, writeSparsely) -> Attribute
See GetSurfaceAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["MaterialAPI"].GetDisplacementAttr.func_doc = """GetDisplacementAttr() -> Attribute
Declaration
``token outputs:ri:displacement``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
"""
result["MaterialAPI"].CreateDisplacementAttr.func_doc = """CreateDisplacementAttr(defaultValue, writeSparsely) -> Attribute
See GetDisplacementAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["MaterialAPI"].GetVolumeAttr.func_doc = """GetVolumeAttr() -> Attribute
Declaration
``token outputs:ri:volume``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
"""
result["MaterialAPI"].CreateVolumeAttr.func_doc = """CreateVolumeAttr(defaultValue, writeSparsely) -> Attribute
See GetVolumeAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["MaterialAPI"].ComputeInterfaceInputConsumersMap.func_doc = """ComputeInterfaceInputConsumersMap(computeTransitiveConsumers) -> NodeGraph.InterfaceInputConsumersMap
Walks the namespace subtree below the material and computes a map
containing the list of all inputs on the material and the associated
vector of consumers of their values.
The consumers can be inputs on shaders within the material or on node-
graphs under it.
Parameters
----------
computeTransitiveConsumers : bool
"""
result["MaterialAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["MaterialAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> MaterialAPI
Return a UsdRiMaterialAPI holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdRiMaterialAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["MaterialAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["MaterialAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> MaterialAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"RiMaterialAPI"to the token-
valued, listOp metadata *apiSchemas* on the prim.
A valid UsdRiMaterialAPI object is returned upon success. An invalid
(or empty) UsdRiMaterialAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["MaterialAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["SplineAPI"].__doc__ = """
Deprecated
This API schema will be removed in a future release.
RiSplineAPI is a general purpose API schema used to describe a named
spline stored as a set of attributes on a prim.
It is an add-on schema that can be applied many times to a prim with
different spline names. All the attributes authored by the schema are
namespaced under"$NAME:spline:", with the name of the spline providing
a namespace for the attributes.
The spline describes a 2D piecewise cubic curve with a position and
value for each knot. This is chosen to give straightforward artistic
control over the shape. The supported basis types are:
- linear (UsdRiTokens->linear)
- bspline (UsdRiTokens->bspline)
- Catmull-Rom (UsdRiTokens->catmullRom)
"""
result["SplineAPI"].Validate.func_doc = """Validate(reason) -> bool
Validates the attribute values belonging to the spline.
Returns true if the spline has all valid attribute values. Returns
false and populates the ``reason`` output argument if the spline has
invalid attribute values.
Here's the list of validations performed by this method:
- the SplineAPI must be fully initialized
- interpolation attribute must exist and use an allowed value
- the positions array must be a float array
- the positions array must be sorted by increasing value
- the values array must use the correct value type
- the positions and values array must have the same size
Parameters
----------
reason : str
"""
result["SplineAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdRiSplineAPI on UsdPrim ``prim`` .
Equivalent to UsdRiSplineAPI::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdRiSplineAPI on the prim held by ``schemaObj`` .
Should be preferred over UsdRiSplineAPI (schemaObj.GetPrim()), as it
preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
----------------------------------------------------------------------
__init__(prim, splineName, valuesTypeName, doesDuplicateBSplineEndpoints)
Construct a UsdRiSplineAPI with the given ``splineName`` on the
UsdPrim ``prim`` .
Parameters
----------
prim : Prim
splineName : str
valuesTypeName : ValueTypeName
doesDuplicateBSplineEndpoints : bool
----------------------------------------------------------------------
__init__(schemaObj, splineName, valuesTypeName, doesDuplicateBSplineEndpoints)
Construct a UsdRiSplineAPI with the given ``splineName`` on the prim
held by ``schemaObj`` .
Parameters
----------
schemaObj : SchemaBase
splineName : str
valuesTypeName : ValueTypeName
doesDuplicateBSplineEndpoints : bool
"""
result["SplineAPI"].GetValuesTypeName.func_doc = """GetValuesTypeName() -> ValueTypeName
Returns the intended typename of the values attribute of the spline.
"""
result["SplineAPI"].GetInterpolationAttr.func_doc = """GetInterpolationAttr() -> Attribute
Interpolation method for the spline.
C++ Type: TfToken Usd Type: SdfValueTypeNames->Token Variability:
SdfVariabilityUniform Fallback Value: linear Allowed Values :
[linear, constant, bspline, catmullRom]
"""
result["SplineAPI"].CreateInterpolationAttr.func_doc = """CreateInterpolationAttr(defaultValue, writeSparsely) -> Attribute
See GetInterpolationAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["SplineAPI"].GetPositionsAttr.func_doc = """GetPositionsAttr() -> Attribute
Positions of the knots.
C++ Type: VtArray<float> Usd Type: SdfValueTypeNames->FloatArray
Variability: SdfVariabilityUniform Fallback Value: No Fallback
"""
result["SplineAPI"].CreatePositionsAttr.func_doc = """CreatePositionsAttr(defaultValue, writeSparsely) -> Attribute
See GetPositionsAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["SplineAPI"].GetValuesAttr.func_doc = """GetValuesAttr() -> Attribute
Values of the knots.
C++ Type: See GetValuesTypeName() Usd Type: See GetValuesTypeName()
Variability: SdfVariabilityUniform Fallback Value: No Fallback
"""
result["SplineAPI"].CreateValuesAttr.func_doc = """CreateValuesAttr(defaultValue, writeSparsely) -> Attribute
See GetValuesAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["SplineAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["SplineAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> SplineAPI
Return a UsdRiSplineAPI holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdRiSplineAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["SplineAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["SplineAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> SplineAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"RiSplineAPI"to the token-valued,
listOp metadata *apiSchemas* on the prim.
A valid UsdRiSplineAPI object is returned upon success. An invalid (or
empty) UsdRiSplineAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["SplineAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["StatementsAPI"].__doc__ = """
Container namespace schema for all renderman statements.
The longer term goal is for clients to go directly to primvar or
render-attribute API's, instead of using UsdRi StatementsAPI for
inherited attributes. Anticpating this, StatementsAPI can smooth the
way via a few environment variables:
- USDRI_STATEMENTS_READ_OLD_ENCODING: Causes StatementsAPI to read
old-style attributes instead of primvars in the"ri:"namespace.
"""
result["StatementsAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdRiStatementsAPI on UsdPrim ``prim`` .
Equivalent to UsdRiStatementsAPI::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdRiStatementsAPI on the prim held by ``schemaObj`` .
Should be preferred over UsdRiStatementsAPI (schemaObj.GetPrim()), as
it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["StatementsAPI"].CreateRiAttribute.func_doc = """CreateRiAttribute(name, riType, nameSpace) -> Attribute
Create a rib attribute on the prim to which this schema is attached.
A rib attribute consists of an attribute *"nameSpace"* and an
attribute *"name"*. For example, the namespace"cull"may define
attributes"backfacing"and"hidden", and user-defined attributes belong
to the namespace"user".
This method makes no attempt to validate that the given ``nameSpace``
and *name* are actually meaningful to prman or any other renderer.
riType
should be a known RenderMan type definition, which can be array-
valued. For instance, both"color"and"float[3]"are valid values for
``riType`` .
Parameters
----------
name : str
riType : str
nameSpace : str
----------------------------------------------------------------------
CreateRiAttribute(name, tfType, nameSpace) -> Attribute
Creates an attribute of the given ``tfType`` .
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
name : str
tfType : Type
nameSpace : str
"""
result["StatementsAPI"].GetRiAttribute.func_doc = """GetRiAttribute(name, nameSpace) -> Attribute
Return a UsdAttribute representing the Ri attribute with the name
*name*, in the namespace *nameSpace*.
The attribute returned may or may not **actually** exist so it must be
checked for validity.
Parameters
----------
name : str
nameSpace : str
"""
result["StatementsAPI"].GetRiAttributes.func_doc = """GetRiAttributes(nameSpace) -> list[Property]
Return all rib attributes on this prim, or under a specific namespace
(e.g."user").
As noted above, rib attributes can be either UsdAttribute or
UsdRelationship, and like all UsdProperties, need not have a defined
value.
Parameters
----------
nameSpace : str
"""
result["StatementsAPI"].SetCoordinateSystem.func_doc = """SetCoordinateSystem(coordSysName) -> None
Sets the"ri:coordinateSystem"attribute to the given string value,
creating the attribute if needed.
That identifies this prim as providing a coordinate system, which can
be retrieved via UsdGeomXformable::GetTransformAttr(). Also adds the
owning prim to the ri:modelCoordinateSystems relationship targets on
its parent leaf model prim, if it exists. If this prim is not under a
leaf model, no relationship targets will be authored.
Parameters
----------
coordSysName : str
"""
result["StatementsAPI"].GetCoordinateSystem.func_doc = """GetCoordinateSystem() -> str
Returns the value in the"ri:coordinateSystem"attribute if it exists.
"""
result["StatementsAPI"].HasCoordinateSystem.func_doc = """HasCoordinateSystem() -> bool
Returns true if the underlying prim has a ri:coordinateSystem opinion.
"""
result["StatementsAPI"].SetScopedCoordinateSystem.func_doc = """SetScopedCoordinateSystem(coordSysName) -> None
Sets the"ri:scopedCoordinateSystem"attribute to the given string
value, creating the attribute if needed.
That identifies this prim as providing a coordinate system, which can
be retrieved via UsdGeomXformable::GetTransformAttr(). Such coordinate
systems are local to the RI attribute stack state, but does get
updated properly for instances when defined inside an object master.
Also adds the owning prim to the ri:modelScopedCoordinateSystems
relationship targets on its parent leaf model prim, if it exists. If
this prim is not under a leaf model, no relationship targets will be
authored.
Parameters
----------
coordSysName : str
"""
result["StatementsAPI"].GetScopedCoordinateSystem.func_doc = """GetScopedCoordinateSystem() -> str
Returns the value in the"ri:scopedCoordinateSystem"attribute if it
exists.
"""
result["StatementsAPI"].HasScopedCoordinateSystem.func_doc = """HasScopedCoordinateSystem() -> bool
Returns true if the underlying prim has a ri:scopedCoordinateSystem
opinion.
"""
result["StatementsAPI"].GetModelCoordinateSystems.func_doc = """GetModelCoordinateSystems(targets) -> bool
Populates the output ``targets`` with the authored
ri:modelCoordinateSystems, if any.
Returns true if the query was successful.
Parameters
----------
targets : list[SdfPath]
"""
result["StatementsAPI"].GetModelScopedCoordinateSystems.func_doc = """GetModelScopedCoordinateSystems(targets) -> bool
Populates the output ``targets`` with the authored
ri:modelScopedCoordinateSystems, if any.
Returns true if the query was successful.
Parameters
----------
targets : list[SdfPath]
"""
result["StatementsAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["StatementsAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> StatementsAPI
Return a UsdRiStatementsAPI holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdRiStatementsAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["StatementsAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["StatementsAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> StatementsAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"StatementsAPI"to the token-
valued, listOp metadata *apiSchemas* on the prim.
A valid UsdRiStatementsAPI object is returned upon success. An invalid
(or empty) UsdRiStatementsAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["StatementsAPI"].GetRiAttributeName.func_doc = """**classmethod** GetRiAttributeName(prop) -> str
Return the base, most-specific name of the rib attribute.
For example, the *name* of the rib
attribute"cull:backfacing"is"backfacing"
Parameters
----------
prop : Property
"""
result["StatementsAPI"].GetRiAttributeNameSpace.func_doc = """**classmethod** GetRiAttributeNameSpace(prop) -> str
Return the containing namespace of the rib attribute (e.g."user").
Parameters
----------
prop : Property
"""
result["StatementsAPI"].IsRiAttribute.func_doc = """**classmethod** IsRiAttribute(prop) -> bool
Return true if the property is in the"ri:attributes"namespace.
Parameters
----------
prop : Property
"""
result["StatementsAPI"].MakeRiAttributePropertyName.func_doc = """**classmethod** MakeRiAttributePropertyName(attrName) -> str
Returns the given ``attrName`` prefixed with the full Ri attribute
namespace, creating a name suitable for an RiAttribute UsdProperty.
This handles conversion of common separator characters used in other
packages, such as periods and underscores.
Will return empty string if attrName is not a valid property
identifier; otherwise, will return a valid property name that
identifies the property as an RiAttribute, according to the following
rules:
- If ``attrName`` is already a properly constructed RiAttribute
property name, return it unchanged.
- If ``attrName`` contains two or more tokens separated by a
*colon*, consider the first to be the namespace, and the rest the
name, joined by underscores
- If ``attrName`` contains two or more tokens separated by a
*period*, consider the first to be the namespace, and the rest the
name, joined by underscores
- If ``attrName`` contains two or more tokens separated by an,
*underscore* consider the first to be the namespace, and the rest the
name, joined by underscores
- else, assume ``attrName`` is the name, and"user"is the namespace
Parameters
----------
attrName : str
"""
result["StatementsAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["TextureAPI"].__doc__ = """
Deprecated
This API schema will be removed in a future release.
RiTextureAPI is an API schema that provides an interface to add
Renderman-specific attributes to adjust textures.
"""
result["TextureAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdRiTextureAPI on UsdPrim ``prim`` .
Equivalent to UsdRiTextureAPI::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdRiTextureAPI on the prim held by ``schemaObj`` .
Should be preferred over UsdRiTextureAPI (schemaObj.GetPrim()), as it
preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["TextureAPI"].GetRiTextureGammaAttr.func_doc = """GetRiTextureGammaAttr() -> Attribute
Gamma-correct the texture.
Declaration
``float ri:texture:gamma``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["TextureAPI"].CreateRiTextureGammaAttr.func_doc = """CreateRiTextureGammaAttr(defaultValue, writeSparsely) -> Attribute
See GetRiTextureGammaAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["TextureAPI"].GetRiTextureSaturationAttr.func_doc = """GetRiTextureSaturationAttr() -> Attribute
Adjust the texture's saturation.
Declaration
``float ri:texture:saturation``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["TextureAPI"].CreateRiTextureSaturationAttr.func_doc = """CreateRiTextureSaturationAttr(defaultValue, writeSparsely) -> Attribute
See GetRiTextureSaturationAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["TextureAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["TextureAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> TextureAPI
Return a UsdRiTextureAPI holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdRiTextureAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["TextureAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["TextureAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> TextureAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"RiTextureAPI"to the token-valued,
listOp metadata *apiSchemas* on the prim.
A valid UsdRiTextureAPI object is returned upon success. An invalid
(or empty) UsdRiTextureAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["TextureAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
""" | 30,791 | Python | 20.279889 | 174 | 0.719821 |
omniverse-code/kit/exts/omni.usd.libs/pxr/SdrGlslfx/__init__.py | #
# Copyright 2019 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
# This file makes this module importable from python, which avoids a warning
# when initializing the SdrRegistry.
| 1,176 | Python | 41.035713 | 77 | 0.767007 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdProc/__init__.py | #
# Copyright 2022 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
from pxr import Tf
Tf.PreparePythonModule()
del Tf
| 1,110 | Python | 40.148147 | 74 | 0.766667 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdProc/__DOC.py | def Execute(result):
result["GenerativeProcedural"].__doc__ = """
Represents an abstract generative procedural prim which delivers its
input parameters via properties (including relationships) within
the"primvars:"namespace.
It does not itself have any awareness or participation in the
execution of the procedural but rather serves as a means of delivering
a procedural's definition and input parameters.
The value of its"proceduralSystem"property (either authored or
provided by API schema fallback) indicates to which system the
procedural definition is meaningful.
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdProcTokens. So to set an attribute to the value"rightHanded",
use UsdProcTokens->rightHanded as the value.
"""
result["GenerativeProcedural"].__init__.func_doc = """__init__(prim)
Construct a UsdProcGenerativeProcedural on UsdPrim ``prim`` .
Equivalent to UsdProcGenerativeProcedural::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdProcGenerativeProcedural on the prim held by
``schemaObj`` .
Should be preferred over UsdProcGenerativeProcedural
(schemaObj.GetPrim()), as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["GenerativeProcedural"].GetProceduralSystemAttr.func_doc = """GetProceduralSystemAttr() -> Attribute
The name or convention of the system responsible for evaluating the
procedural.
NOTE: A fallback value for this is typically set via an API schema.
Declaration
``token proceduralSystem``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
"""
result["GenerativeProcedural"].CreateProceduralSystemAttr.func_doc = """CreateProceduralSystemAttr(defaultValue, writeSparsely) -> Attribute
See GetProceduralSystemAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["GenerativeProcedural"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["GenerativeProcedural"].Get.func_doc = """**classmethod** Get(stage, path) -> GenerativeProcedural
Return a UsdProcGenerativeProcedural holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdProcGenerativeProcedural(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["GenerativeProcedural"].Define.func_doc = """**classmethod** Define(stage, path) -> GenerativeProcedural
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["GenerativeProcedural"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
""" | 4,660 | Python | 24.60989 | 146 | 0.741631 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdLux/__init__.py | #
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
from pxr import Tf
Tf.PreparePythonModule()
del Tf
| 1,111 | Python | 38.714284 | 74 | 0.765977 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdLux/__DOC.py | def Execute(result):
result["BoundableLightBase"].__doc__ = """
Base class for intrinsic lights that are boundable.
The primary purpose of this class is to provide a direct API to the
functions provided by LightAPI for concrete derived light types.
"""
result["BoundableLightBase"].LightAPI.func_doc = """LightAPI() -> LightAPI
Contructs and returns a UsdLuxLightAPI object for this light.
"""
result["BoundableLightBase"].GetIntensityAttr.func_doc = """GetIntensityAttr() -> Attribute
See UsdLuxLightAPI::GetIntensityAttr() .
"""
result["BoundableLightBase"].CreateIntensityAttr.func_doc = """CreateIntensityAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateIntensityAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["BoundableLightBase"].GetExposureAttr.func_doc = """GetExposureAttr() -> Attribute
See UsdLuxLightAPI::GetExposureAttr() .
"""
result["BoundableLightBase"].CreateExposureAttr.func_doc = """CreateExposureAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateExposureAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["BoundableLightBase"].GetDiffuseAttr.func_doc = """GetDiffuseAttr() -> Attribute
See UsdLuxLightAPI::GetDiffuseAttr() .
"""
result["BoundableLightBase"].CreateDiffuseAttr.func_doc = """CreateDiffuseAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateDiffuseAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["BoundableLightBase"].GetSpecularAttr.func_doc = """GetSpecularAttr() -> Attribute
See UsdLuxLightAPI::GetSpecularAttr() .
"""
result["BoundableLightBase"].CreateSpecularAttr.func_doc = """CreateSpecularAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateSpecularAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["BoundableLightBase"].GetNormalizeAttr.func_doc = """GetNormalizeAttr() -> Attribute
See UsdLuxLightAPI::GetNormalizeAttr() .
"""
result["BoundableLightBase"].CreateNormalizeAttr.func_doc = """CreateNormalizeAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateNormalizeAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["BoundableLightBase"].GetColorAttr.func_doc = """GetColorAttr() -> Attribute
See UsdLuxLightAPI::GetColorAttr() .
"""
result["BoundableLightBase"].CreateColorAttr.func_doc = """CreateColorAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateColorAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["BoundableLightBase"].GetEnableColorTemperatureAttr.func_doc = """GetEnableColorTemperatureAttr() -> Attribute
See UsdLuxLightAPI::GetEnableColorTemperatureAttr() .
"""
result["BoundableLightBase"].CreateEnableColorTemperatureAttr.func_doc = """CreateEnableColorTemperatureAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateEnableColorTemperatureAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["BoundableLightBase"].GetColorTemperatureAttr.func_doc = """GetColorTemperatureAttr() -> Attribute
See UsdLuxLightAPI::GetColorTemperatureAttr() .
"""
result["BoundableLightBase"].CreateColorTemperatureAttr.func_doc = """CreateColorTemperatureAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateColorTemperatureAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["BoundableLightBase"].GetFiltersRel.func_doc = """GetFiltersRel() -> Relationship
See UsdLuxLightAPI::GetFiltersRel() .
"""
result["BoundableLightBase"].CreateFiltersRel.func_doc = """CreateFiltersRel() -> Relationship
See UsdLuxLightAPI::CreateFiltersRel() .
"""
result["BoundableLightBase"].__init__.func_doc = """__init__(prim)
Construct a UsdLuxBoundableLightBase on UsdPrim ``prim`` .
Equivalent to UsdLuxBoundableLightBase::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdLuxBoundableLightBase on the prim held by ``schemaObj``
.
Should be preferred over UsdLuxBoundableLightBase
(schemaObj.GetPrim()), as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["BoundableLightBase"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["BoundableLightBase"].Get.func_doc = """**classmethod** Get(stage, path) -> BoundableLightBase
Return a UsdLuxBoundableLightBase holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxBoundableLightBase(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["BoundableLightBase"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["CylinderLight"].__doc__ = """
Light emitted outward from a cylinder. The cylinder is centered at the
origin and has its major axis on the X axis. The cylinder does not
emit light from the flat end-caps.
"""
result["CylinderLight"].__init__.func_doc = """__init__(prim)
Construct a UsdLuxCylinderLight on UsdPrim ``prim`` .
Equivalent to UsdLuxCylinderLight::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdLuxCylinderLight on the prim held by ``schemaObj`` .
Should be preferred over UsdLuxCylinderLight (schemaObj.GetPrim()), as
it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["CylinderLight"].GetLengthAttr.func_doc = """GetLengthAttr() -> Attribute
Width of the rectangle, in the local X axis.
Declaration
``float inputs:length = 1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["CylinderLight"].CreateLengthAttr.func_doc = """CreateLengthAttr(defaultValue, writeSparsely) -> Attribute
See GetLengthAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["CylinderLight"].GetRadiusAttr.func_doc = """GetRadiusAttr() -> Attribute
Radius of the cylinder.
Declaration
``float inputs:radius = 0.5``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["CylinderLight"].CreateRadiusAttr.func_doc = """CreateRadiusAttr(defaultValue, writeSparsely) -> Attribute
See GetRadiusAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["CylinderLight"].GetTreatAsLineAttr.func_doc = """GetTreatAsLineAttr() -> Attribute
A hint that this light can be treated as a'line'light (effectively, a
zero-radius cylinder) by renderers that benefit from non-area
lighting.
Renderers that only support area lights can disregard this.
Declaration
``bool treatAsLine = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
result["CylinderLight"].CreateTreatAsLineAttr.func_doc = """CreateTreatAsLineAttr(defaultValue, writeSparsely) -> Attribute
See GetTreatAsLineAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["CylinderLight"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["CylinderLight"].Get.func_doc = """**classmethod** Get(stage, path) -> CylinderLight
Return a UsdLuxCylinderLight holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxCylinderLight(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["CylinderLight"].Define.func_doc = """**classmethod** Define(stage, path) -> CylinderLight
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["CylinderLight"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["DiskLight"].__doc__ = """
Light emitted from one side of a circular disk. The disk is centered
in the XY plane and emits light along the -Z axis.
"""
result["DiskLight"].__init__.func_doc = """__init__(prim)
Construct a UsdLuxDiskLight on UsdPrim ``prim`` .
Equivalent to UsdLuxDiskLight::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdLuxDiskLight on the prim held by ``schemaObj`` .
Should be preferred over UsdLuxDiskLight (schemaObj.GetPrim()), as it
preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["DiskLight"].GetRadiusAttr.func_doc = """GetRadiusAttr() -> Attribute
Radius of the disk.
Declaration
``float inputs:radius = 0.5``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["DiskLight"].CreateRadiusAttr.func_doc = """CreateRadiusAttr(defaultValue, writeSparsely) -> Attribute
See GetRadiusAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["DiskLight"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["DiskLight"].Get.func_doc = """**classmethod** Get(stage, path) -> DiskLight
Return a UsdLuxDiskLight holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxDiskLight(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["DiskLight"].Define.func_doc = """**classmethod** Define(stage, path) -> DiskLight
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["DiskLight"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["DistantLight"].__doc__ = """
Light emitted from a distant source along the -Z axis. Also known as a
directional light.
"""
result["DistantLight"].__init__.func_doc = """__init__(prim)
Construct a UsdLuxDistantLight on UsdPrim ``prim`` .
Equivalent to UsdLuxDistantLight::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdLuxDistantLight on the prim held by ``schemaObj`` .
Should be preferred over UsdLuxDistantLight (schemaObj.GetPrim()), as
it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["DistantLight"].GetAngleAttr.func_doc = """GetAngleAttr() -> Attribute
Angular size of the light in degrees.
As an example, the Sun is approximately 0.53 degrees as seen from
Earth. Higher values broaden the light and therefore soften shadow
edges.
Declaration
``float inputs:angle = 0.53``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["DistantLight"].CreateAngleAttr.func_doc = """CreateAngleAttr(defaultValue, writeSparsely) -> Attribute
See GetAngleAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["DistantLight"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["DistantLight"].Get.func_doc = """**classmethod** Get(stage, path) -> DistantLight
Return a UsdLuxDistantLight holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxDistantLight(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["DistantLight"].Define.func_doc = """**classmethod** Define(stage, path) -> DistantLight
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["DistantLight"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["DomeLight"].__doc__ = """
Light emitted inward from a distant external environment, such as a
sky or IBL light probe. The orientation of a dome light with a latlong
texture is expected to match the OpenEXR specification for latlong
environment maps. From the OpenEXR documentation:
Latitude-Longitude Map:
The environment is projected onto the image using polar coordinates
(latitude and longitude). A pixel's x coordinate corresponds to its
longitude, and the y coordinate corresponds to its latitude. Pixel
(dataWindow.min.x, dataWindow.min.y) has latitude +pi/2 and longitude
+pi; pixel (dataWindow.max.x, dataWindow.max.y) has latitude -pi/2 and
longitude -pi.
In 3D space, latitudes -pi/2 and +pi/2 correspond to the negative and
positive y direction. Latitude 0, longitude 0 points into positive z
direction; and latitude 0, longitude pi/2 points into positive x
direction.
The size of the data window should be 2\\*N by N pixels (width by
height),
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdLuxTokens. So to set an attribute to the value"rightHanded", use
UsdLuxTokens->rightHanded as the value.
"""
result["DomeLight"].__init__.func_doc = """__init__(prim)
Construct a UsdLuxDomeLight on UsdPrim ``prim`` .
Equivalent to UsdLuxDomeLight::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdLuxDomeLight on the prim held by ``schemaObj`` .
Should be preferred over UsdLuxDomeLight (schemaObj.GetPrim()), as it
preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["DomeLight"].GetTextureFileAttr.func_doc = """GetTextureFileAttr() -> Attribute
A color texture to use on the dome, such as an HDR (high dynamic
range) texture intended for IBL (image based lighting).
Declaration
``asset inputs:texture:file``
C++ Type
SdfAssetPath
Usd Type
SdfValueTypeNames->Asset
"""
result["DomeLight"].CreateTextureFileAttr.func_doc = """CreateTextureFileAttr(defaultValue, writeSparsely) -> Attribute
See GetTextureFileAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["DomeLight"].GetTextureFormatAttr.func_doc = """GetTextureFormatAttr() -> Attribute
Specifies the parameterization of the color map file.
Valid values are:
- automatic: Tries to determine the layout from the file itself.
For example, Renderman texture files embed an explicit
parameterization.
- latlong: Latitude as X, longitude as Y.
- mirroredBall: An image of the environment reflected in a sphere,
using an implicitly orthogonal projection.
- angular: Similar to mirroredBall but the radial dimension is
mapped linearly to the angle, providing better sampling at the edges.
- cubeMapVerticalCross: A cube map with faces laid out as a
vertical cross.
Declaration
``token inputs:texture:format ="automatic"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Allowed Values
automatic, latlong, mirroredBall, angular, cubeMapVerticalCross
"""
result["DomeLight"].CreateTextureFormatAttr.func_doc = """CreateTextureFormatAttr(defaultValue, writeSparsely) -> Attribute
See GetTextureFormatAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["DomeLight"].GetGuideRadiusAttr.func_doc = """GetGuideRadiusAttr() -> Attribute
The radius of guide geometry to use to visualize the dome light.
The default is 1 km for scenes whose metersPerUnit is the USD default
of 0.01 (i.e., 1 world unit is 1 cm).
Declaration
``float guideRadius = 100000``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["DomeLight"].CreateGuideRadiusAttr.func_doc = """CreateGuideRadiusAttr(defaultValue, writeSparsely) -> Attribute
See GetGuideRadiusAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["DomeLight"].GetPortalsRel.func_doc = """GetPortalsRel() -> Relationship
Optional portals to guide light sampling.
"""
result["DomeLight"].CreatePortalsRel.func_doc = """CreatePortalsRel() -> Relationship
See GetPortalsRel() , and also Create vs Get Property Methods for when
to use Get vs Create.
"""
result["DomeLight"].OrientToStageUpAxis.func_doc = """OrientToStageUpAxis() -> None
Adds a transformation op, if neeeded, to orient the dome to align with
the stage's up axis.
Uses UsdLuxTokens->orientToStageUpAxis as the op suffix. If an op with
this suffix already exists, this method assumes it is already applying
the proper correction and does nothing further. If no op is required
to match the stage's up axis, no op will be created.
UsdGeomXformOp
UsdGeomGetStageUpAxis
"""
result["DomeLight"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["DomeLight"].Get.func_doc = """**classmethod** Get(stage, path) -> DomeLight
Return a UsdLuxDomeLight holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxDomeLight(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["DomeLight"].Define.func_doc = """**classmethod** Define(stage, path) -> DomeLight
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["DomeLight"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["GeometryLight"].__doc__ = """
Deprecated
Light emitted outward from a geometric prim (UsdGeomGprim), which is
typically a mesh.
"""
result["GeometryLight"].__init__.func_doc = """__init__(prim)
Construct a UsdLuxGeometryLight on UsdPrim ``prim`` .
Equivalent to UsdLuxGeometryLight::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdLuxGeometryLight on the prim held by ``schemaObj`` .
Should be preferred over UsdLuxGeometryLight (schemaObj.GetPrim()), as
it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["GeometryLight"].GetGeometryRel.func_doc = """GetGeometryRel() -> Relationship
Relationship to the geometry to use as the light source.
"""
result["GeometryLight"].CreateGeometryRel.func_doc = """CreateGeometryRel() -> Relationship
See GetGeometryRel() , and also Create vs Get Property Methods for
when to use Get vs Create.
"""
result["GeometryLight"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["GeometryLight"].Get.func_doc = """**classmethod** Get(stage, path) -> GeometryLight
Return a UsdLuxGeometryLight holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxGeometryLight(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["GeometryLight"].Define.func_doc = """**classmethod** Define(stage, path) -> GeometryLight
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["GeometryLight"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["LightAPI"].__doc__ = """
API schema that imparts the quality of being a light onto a prim.
A light is any prim that has this schema applied to it. This is true
regardless of whether LightAPI is included as a built-in API of the
prim type (e.g. RectLight or DistantLight) or is applied directly to a
Gprim that should be treated as a light.
**Linking**
Lights can be linked to geometry. Linking controls which geometry a
light illuminates, and which geometry casts shadows from the light.
Linking is specified as collections (UsdCollectionAPI) which can be
accessed via GetLightLinkCollection() and GetShadowLinkCollection().
Note that these collections have their includeRoot set to true, so
that lights will illuminate and cast shadows from all objects by
default. To illuminate only a specific set of objects, there are two
options. One option is to modify the collection paths to explicitly
exclude everything else, assuming it is known; the other option is to
set includeRoot to false and explicitly include the desired objects.
These are complementary approaches that may each be preferable
depending on the scenario and how to best express the intent of the
light setup.
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdLuxTokens. So to set an attribute to the value"rightHanded", use
UsdLuxTokens->rightHanded as the value.
"""
result["LightAPI"].__init__.func_doc = """__init__(connectable)
Constructor that takes a ConnectableAPI object.
Allow implicit conversion of a UsdShadeConnectableAPI to
UsdLuxLightAPI
Parameters
----------
connectable : ConnectableAPI
----------------------------------------------------------------------
__init__(prim)
Construct a UsdLuxLightAPI on UsdPrim ``prim`` .
Equivalent to UsdLuxLightAPI::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdLuxLightAPI on the prim held by ``schemaObj`` .
Should be preferred over UsdLuxLightAPI (schemaObj.GetPrim()), as it
preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["LightAPI"].ConnectableAPI.func_doc = """ConnectableAPI() -> ConnectableAPI
Contructs and returns a UsdShadeConnectableAPI object with this light.
Note that most tasks can be accomplished without explicitly
constructing a UsdShadeConnectable API, since connection-related API
such as UsdShadeConnectableAPI::ConnectToSource() are static methods,
and UsdLuxLightAPI will auto-convert to a UsdShadeConnectableAPI when
passed to functions that want to act generically on a connectable
UsdShadeConnectableAPI object.
"""
result["LightAPI"].CreateOutput.func_doc = """CreateOutput(name, typeName) -> Output
Create an output which can either have a value or can be connected.
The attribute representing the output is created in
the"outputs:"namespace. Outputs on a light cannot be connected, as
their value is assumed to be computed externally.
Parameters
----------
name : str
typeName : ValueTypeName
"""
result["LightAPI"].GetOutput.func_doc = """GetOutput(name) -> Output
Return the requested output if it exists.
Parameters
----------
name : str
"""
result["LightAPI"].GetOutputs.func_doc = """GetOutputs(onlyAuthored) -> list[Output]
Outputs are represented by attributes in the"outputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
result["LightAPI"].CreateInput.func_doc = """CreateInput(name, typeName) -> Input
Create an input which can either have a value or can be connected.
The attribute representing the input is created in
the"inputs:"namespace. Inputs on lights are connectable.
Parameters
----------
name : str
typeName : ValueTypeName
"""
result["LightAPI"].GetInput.func_doc = """GetInput(name) -> Input
Return the requested input if it exists.
Parameters
----------
name : str
"""
result["LightAPI"].GetInputs.func_doc = """GetInputs(onlyAuthored) -> list[Input]
Inputs are represented by attributes in the"inputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
result["LightAPI"].GetShaderIdAttr.func_doc = """GetShaderIdAttr() -> Attribute
Default ID for the light's shader.
This defines the shader ID for this light when a render context
specific shader ID is not available.
The default shaderId for the intrinsic UsdLux lights (RectLight,
DistantLight, etc.) are set to default to the light's type name. For
each intrinsic UsdLux light, we will always register an SdrShaderNode
in the SdrRegistry, with the identifier matching the type name and the
source type"USD", that corresponds to the light's inputs.
GetShaderId
GetShaderIdAttrForRenderContext
SdrRegistry::GetShaderNodeByIdentifier
SdrRegistry::GetShaderNodeByIdentifierAndType
Declaration
``uniform token light:shaderId =""``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
"""
result["LightAPI"].CreateShaderIdAttr.func_doc = """CreateShaderIdAttr(defaultValue, writeSparsely) -> Attribute
See GetShaderIdAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["LightAPI"].GetMaterialSyncModeAttr.func_doc = """GetMaterialSyncModeAttr() -> Attribute
For a LightAPI applied to geometry that has a bound Material, which is
entirely or partly emissive, this specifies the relationship of the
Material response to the lighting response.
Valid values are:
- materialGlowTintsLight: All primary and secondary rays see the
emissive/glow response as dictated by the bound Material while the
base color seen by light rays (which is then modulated by all of the
other LightAPI controls) is the multiplication of the color feeding
the emission/glow input of the Material (i.e. its surface or volume
shader) with the scalar or pattern input to *inputs:color*. This
allows the light's color to tint the geometry's glow color while
preserving access to intensity and other light controls as ways to
further modulate the illumination.
- independent: All primary and secondary rays see the emissive/glow
response as dictated by the bound Material, while the base color seen
by light rays is determined solely by *inputs:color*. Note that for
partially emissive geometry (in which some parts are reflective rather
than emissive), a suitable pattern must be connected to the light's
color input, or else the light will radiate uniformly from the
geometry.
- noMaterialResponse: The geometry behaves as if there is no
Material bound at all, i.e. there is no diffuse, specular, or
transmissive response. The base color of light rays is entirely
controlled by the *inputs:color*. This is the standard mode
for"canonical"lights in UsdLux and indicates to renderers that a
Material will either never be bound or can always be ignored.
Declaration
``uniform token light:materialSyncMode ="noMaterialResponse"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
materialGlowTintsLight, independent, noMaterialResponse
"""
result["LightAPI"].CreateMaterialSyncModeAttr.func_doc = """CreateMaterialSyncModeAttr(defaultValue, writeSparsely) -> Attribute
See GetMaterialSyncModeAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["LightAPI"].GetIntensityAttr.func_doc = """GetIntensityAttr() -> Attribute
Scales the power of the light linearly.
Declaration
``float inputs:intensity = 1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["LightAPI"].CreateIntensityAttr.func_doc = """CreateIntensityAttr(defaultValue, writeSparsely) -> Attribute
See GetIntensityAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["LightAPI"].GetExposureAttr.func_doc = """GetExposureAttr() -> Attribute
Scales the power of the light exponentially as a power of 2 (similar
to an F-stop control over exposure).
The result is multiplied against the intensity.
Declaration
``float inputs:exposure = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["LightAPI"].CreateExposureAttr.func_doc = """CreateExposureAttr(defaultValue, writeSparsely) -> Attribute
See GetExposureAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["LightAPI"].GetDiffuseAttr.func_doc = """GetDiffuseAttr() -> Attribute
A multiplier for the effect of this light on the diffuse response of
materials.
This is a non-physical control.
Declaration
``float inputs:diffuse = 1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["LightAPI"].CreateDiffuseAttr.func_doc = """CreateDiffuseAttr(defaultValue, writeSparsely) -> Attribute
See GetDiffuseAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["LightAPI"].GetSpecularAttr.func_doc = """GetSpecularAttr() -> Attribute
A multiplier for the effect of this light on the specular response of
materials.
This is a non-physical control.
Declaration
``float inputs:specular = 1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["LightAPI"].CreateSpecularAttr.func_doc = """CreateSpecularAttr(defaultValue, writeSparsely) -> Attribute
See GetSpecularAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["LightAPI"].GetNormalizeAttr.func_doc = """GetNormalizeAttr() -> Attribute
Normalizes power by the surface area of the light.
This makes it easier to independently adjust the power and shape of
the light, by causing the power to not vary with the area or angular
size of the light.
Declaration
``bool inputs:normalize = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
result["LightAPI"].CreateNormalizeAttr.func_doc = """CreateNormalizeAttr(defaultValue, writeSparsely) -> Attribute
See GetNormalizeAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["LightAPI"].GetColorAttr.func_doc = """GetColorAttr() -> Attribute
The color of emitted light, in energy-linear terms.
Declaration
``color3f inputs:color = (1, 1, 1)``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Color3f
"""
result["LightAPI"].CreateColorAttr.func_doc = """CreateColorAttr(defaultValue, writeSparsely) -> Attribute
See GetColorAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["LightAPI"].GetEnableColorTemperatureAttr.func_doc = """GetEnableColorTemperatureAttr() -> Attribute
Enables using colorTemperature.
Declaration
``bool inputs:enableColorTemperature = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
result["LightAPI"].CreateEnableColorTemperatureAttr.func_doc = """CreateEnableColorTemperatureAttr(defaultValue, writeSparsely) -> Attribute
See GetEnableColorTemperatureAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["LightAPI"].GetColorTemperatureAttr.func_doc = """GetColorTemperatureAttr() -> Attribute
Color temperature, in degrees Kelvin, representing the white point.
The default is a common white point, D65. Lower values are warmer and
higher values are cooler. The valid range is from 1000 to 10000. Only
takes effect when enableColorTemperature is set to true. When active,
the computed result multiplies against the color attribute. See
UsdLuxBlackbodyTemperatureAsRgb() .
Declaration
``float inputs:colorTemperature = 6500``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["LightAPI"].CreateColorTemperatureAttr.func_doc = """CreateColorTemperatureAttr(defaultValue, writeSparsely) -> Attribute
See GetColorTemperatureAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["LightAPI"].GetFiltersRel.func_doc = """GetFiltersRel() -> Relationship
Relationship to the light filters that apply to this light.
"""
result["LightAPI"].CreateFiltersRel.func_doc = """CreateFiltersRel() -> Relationship
See GetFiltersRel() , and also Create vs Get Property Methods for when
to use Get vs Create.
"""
result["LightAPI"].GetLightLinkCollectionAPI.func_doc = """GetLightLinkCollectionAPI() -> CollectionAPI
Return the UsdCollectionAPI interface used for examining and modifying
the light-linking of this light.
Light-linking controls which geometry this light illuminates.
"""
result["LightAPI"].GetShadowLinkCollectionAPI.func_doc = """GetShadowLinkCollectionAPI() -> CollectionAPI
Return the UsdCollectionAPI interface used for examining and modifying
the shadow-linking of this light.
Shadow-linking controls which geometry casts shadows from this light.
"""
result["LightAPI"].GetShaderIdAttrForRenderContext.func_doc = """GetShaderIdAttrForRenderContext(renderContext) -> Attribute
Returns the shader ID attribute for the given ``renderContext`` .
If ``renderContext`` is non-empty, this will try to return an
attribute named *light:shaderId* with the namespace prefix
``renderContext`` . For example, if the passed in render context
is"ri"then the attribute returned by this function would have the
following signature:
Declaration
``token ri:light:shaderId``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
If the render context is empty, this will return the default shader ID
attribute as returned by GetShaderIdAttr() .
Parameters
----------
renderContext : str
"""
result["LightAPI"].CreateShaderIdAttrForRenderContext.func_doc = """CreateShaderIdAttrForRenderContext(renderContext, defaultValue, writeSparsely) -> Attribute
Creates the shader ID attribute for the given ``renderContext`` .
See GetShaderIdAttrForRenderContext() , and also Create vs Get
Property Methods for when to use Get vs Create. If specified, author
``defaultValue`` as the attribute's default, sparsely (when it makes
sense to do so) if ``writeSparsely`` is ``true`` - the default for
``writeSparsely`` is ``false`` .
Parameters
----------
renderContext : str
defaultValue : VtValue
writeSparsely : bool
"""
result["LightAPI"].GetShaderId.func_doc = """GetShaderId(renderContexts) -> str
Return the light's shader ID for the given list of available
``renderContexts`` .
The shader ID returned by this function is the identifier to use when
looking up the shader definition for this light in the shader
registry.
The render contexts are expected to be listed in priority order, so
for each render context provided, this will try to find the shader ID
attribute specific to that render context (see
GetShaderIdAttrForRenderContext() ) and will return the value of the
first one found that has a non-empty value. If no shader ID value can
be found for any of the given render contexts or ``renderContexts`` is
empty, then this will return the value of the default shader ID
attribute (see GetShaderIdAttr() ).
Parameters
----------
renderContexts : list[TfToken]
"""
result["LightAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["LightAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> LightAPI
Return a UsdLuxLightAPI holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxLightAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["LightAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["LightAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> LightAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"LightAPI"to the token-valued,
listOp metadata *apiSchemas* on the prim.
A valid UsdLuxLightAPI object is returned upon success. An invalid (or
empty) UsdLuxLightAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["LightAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["LightFilter"].__doc__ = """
A light filter modifies the effect of a light. Lights refer to filters
via relationships so that filters may be shared.
**Linking**
Filters can be linked to geometry. Linking controls which geometry a
light-filter affects, when considering the light filters attached to a
light illuminating the geometry.
Linking is specified as a collection (UsdCollectionAPI) which can be
accessed via GetFilterLinkCollection().
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdLuxTokens. So to set an attribute to the value"rightHanded", use
UsdLuxTokens->rightHanded as the value.
"""
result["LightFilter"].__init__.func_doc = """__init__(connectable)
Constructor that takes a ConnectableAPI object.
Allow implicit conversion of UsdShadeConnectableAPI to
UsdLuxLightFilter.
Parameters
----------
connectable : ConnectableAPI
----------------------------------------------------------------------
__init__(prim)
Construct a UsdLuxLightFilter on UsdPrim ``prim`` .
Equivalent to UsdLuxLightFilter::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdLuxLightFilter on the prim held by ``schemaObj`` .
Should be preferred over UsdLuxLightFilter (schemaObj.GetPrim()), as
it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["LightFilter"].ConnectableAPI.func_doc = """ConnectableAPI() -> ConnectableAPI
Contructs and returns a UsdShadeConnectableAPI object with this light
filter.
Note that most tasks can be accomplished without explicitly
constructing a UsdShadeConnectable API, since connection-related API
such as UsdShadeConnectableAPI::ConnectToSource() are static methods,
and UsdLuxLightFilter will auto-convert to a UsdShadeConnectableAPI
when passed to functions that want to act generically on a connectable
UsdShadeConnectableAPI object.
"""
result["LightFilter"].CreateOutput.func_doc = """CreateOutput(name, typeName) -> Output
Create an output which can either have a value or can be connected.
The attribute representing the output is created in
the"outputs:"namespace. Outputs on a light filter cannot be connected,
as their value is assumed to be computed externally.
Parameters
----------
name : str
typeName : ValueTypeName
"""
result["LightFilter"].GetOutput.func_doc = """GetOutput(name) -> Output
Return the requested output if it exists.
Parameters
----------
name : str
"""
result["LightFilter"].GetOutputs.func_doc = """GetOutputs(onlyAuthored) -> list[Output]
Outputs are represented by attributes in the"outputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
result["LightFilter"].CreateInput.func_doc = """CreateInput(name, typeName) -> Input
Create an input which can either have a value or can be connected.
The attribute representing the input is created in
the"inputs:"namespace. Inputs on light filters are connectable.
Parameters
----------
name : str
typeName : ValueTypeName
"""
result["LightFilter"].GetInput.func_doc = """GetInput(name) -> Input
Return the requested input if it exists.
Parameters
----------
name : str
"""
result["LightFilter"].GetInputs.func_doc = """GetInputs(onlyAuthored) -> list[Input]
Inputs are represented by attributes in the"inputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
result["LightFilter"].GetShaderIdAttr.func_doc = """GetShaderIdAttr() -> Attribute
Default ID for the light filter's shader.
This defines the shader ID for this light filter when a render context
specific shader ID is not available.
GetShaderId
GetShaderIdAttrForRenderContext
SdrRegistry::GetShaderNodeByIdentifier
SdrRegistry::GetShaderNodeByIdentifierAndType
Declaration
``uniform token lightFilter:shaderId =""``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
"""
result["LightFilter"].CreateShaderIdAttr.func_doc = """CreateShaderIdAttr(defaultValue, writeSparsely) -> Attribute
See GetShaderIdAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["LightFilter"].GetFilterLinkCollectionAPI.func_doc = """GetFilterLinkCollectionAPI() -> CollectionAPI
Return the UsdCollectionAPI interface used for examining and modifying
the filter-linking of this light filter.
Linking controls which geometry this light filter affects.
"""
result["LightFilter"].GetShaderIdAttrForRenderContext.func_doc = """GetShaderIdAttrForRenderContext(renderContext) -> Attribute
Returns the shader ID attribute for the given ``renderContext`` .
If ``renderContext`` is non-empty, this will try to return an
attribute named *lightFilter:shaderId* with the namespace prefix
``renderContext`` . For example, if the passed in render context
is"ri"then the attribute returned by this function would have the
following signature:
Declaration
``token ri:lightFilter:shaderId``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
If the render context is empty, this will return the default shader ID
attribute as returned by GetShaderIdAttr() .
Parameters
----------
renderContext : str
"""
result["LightFilter"].CreateShaderIdAttrForRenderContext.func_doc = """CreateShaderIdAttrForRenderContext(renderContext, defaultValue, writeSparsely) -> Attribute
Creates the shader ID attribute for the given ``renderContext`` .
See GetShaderIdAttrForRenderContext() , and also Create vs Get
Property Methods for when to use Get vs Create. If specified, author
``defaultValue`` as the attribute's default, sparsely (when it makes
sense to do so) if ``writeSparsely`` is ``true`` - the default for
``writeSparsely`` is ``false`` .
Parameters
----------
renderContext : str
defaultValue : VtValue
writeSparsely : bool
"""
result["LightFilter"].GetShaderId.func_doc = """GetShaderId(renderContexts) -> str
Return the light filter's shader ID for the given list of available
``renderContexts`` .
The shader ID returned by this function is the identifier to use when
looking up the shader definition for this light filter in the shader
registry.
The render contexts are expected to be listed in priority order, so
for each render context provided, this will try to find the shader ID
attribute specific to that render context (see
GetShaderIdAttrForRenderContext() ) and will return the value of the
first one found that has a non-empty value. If no shader ID value can
be found for any of the given render contexts or ``renderContexts`` is
empty, then this will return the value of the default shader ID
attribute (see GetShaderIdAttr() ).
Parameters
----------
renderContexts : list[TfToken]
"""
result["LightFilter"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["LightFilter"].Get.func_doc = """**classmethod** Get(stage, path) -> LightFilter
Return a UsdLuxLightFilter holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxLightFilter(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["LightFilter"].Define.func_doc = """**classmethod** Define(stage, path) -> LightFilter
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["LightFilter"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["LightListAPI"].__doc__ = """
API schema to support discovery and publishing of lights in a scene.
Discovering Lights via Traversal
================================
To motivate this API, consider what is required to discover all lights
in a scene. We must load all payloads and traverse all prims:
.. code-block:: text
01 // Load everything on the stage so we can find all lights,
02 // including those inside payloads
03 stage->Load();
04
05 // Traverse all prims, checking if they have an applied UsdLuxLightAPI
06 // (Note: ignoring instancing and a few other things for simplicity)
07 SdfPathVector lights;
08 for (UsdPrim prim: stage->Traverse()) {
09 if (prim.HasAPI<UsdLuxLightAPI>()) {
10 lights.push_back(i->GetPath());
11 }
12 }
This traversal suitably elaborated to handle certain details is the
first and simplest thing UsdLuxLightListAPI provides.
UsdLuxLightListAPI::ComputeLightList() performs this traversal and
returns all lights in the scene:
.. code-block:: text
01 UsdLuxLightListAPI listAPI(stage->GetPseudoRoot());
02 SdfPathVector lights = listAPI.ComputeLightList();
Publishing a Cached Light List
==============================
Consider a USD client that needs to quickly discover lights but wants
to defer loading payloads and traversing the entire scene where
possible, and is willing to do up-front computation and caching to
achieve that.
UsdLuxLightListAPI provides a way to cache the computed light list, by
publishing the list of lights onto prims in the model hierarchy.
Consider a big set that contains lights:
.. code-block:: text
01 def Xform "BigSetWithLights" (
02 kind = "assembly"
03 payload = @BigSetWithLights.usd@ // Heavy payload
04 ) {
05 // Pre-computed, cached list of lights inside payload
06 rel lightList = [
07 <./Lights/light_1>,
08 <./Lights/light_2>,
09 \\.\\.\\.
10 ]
11 token lightList:cacheBehavior = "consumeAndContinue";
12 }
The lightList relationship encodes a set of lights, and the
lightList:cacheBehavior property provides fine-grained control over
how to use that cache. (See details below.)
The cache can be created by first invoking
ComputeLightList(ComputeModeIgnoreCache) to pre-compute the list and
then storing the result with UsdLuxLightListAPI::StoreLightList() .
To enable efficient retrieval of the cache, it should be stored on a
model hierarchy prim. Furthermore, note that while you can use a
UsdLuxLightListAPI bound to the pseudo-root prim to query the lights
(as in the example above) because it will perform a traversal over
descendants, you cannot store the cache back to the pseduo-root prim.
To consult the cached list, we invoke
ComputeLightList(ComputeModeConsultModelHierarchyCache):
.. code-block:: text
01 // Find and load all lights, using lightList cache where available
02 UsdLuxLightListAPI list(stage->GetPseudoRoot());
03 SdfPathSet lights = list.ComputeLightList(
04 UsdLuxLightListAPI::ComputeModeConsultModelHierarchyCache);
05 stage.LoadAndUnload(lights, SdfPathSet());
In this mode, ComputeLightList() will traverse the model hierarchy,
accumulating cached light lists.
Controlling Cache Behavior
==========================
The lightList:cacheBehavior property gives additional fine-grained
control over cache behavior:
- The fallback value,"ignore", indicates that the lightList should
be disregarded. This provides a way to invalidate cache entries. Note
that unless"ignore"is specified, a lightList with an empty list of
targets is considered a cache indicating that no lights are present.
- The value"consumeAndContinue"indicates that the cache should be
consulted to contribute lights to the scene, and that recursion should
continue down the model hierarchy in case additional lights are added
as descedants. This is the default value established when
StoreLightList() is invoked. This behavior allows the lights within a
large model, such as the BigSetWithLights example above, to be
published outside the payload, while also allowing referencing and
layering to add additional lights over that set.
- The value"consumeAndHalt"provides a way to terminate recursive
traversal of the scene for light discovery. The cache will be
consulted but no descendant prims will be examined.
Instancing
==========
Where instances are present, UsdLuxLightListAPI::ComputeLightList()
will return the instance-unique paths to any lights discovered within
those instances. Lights within a UsdGeomPointInstancer will not be
returned, however, since they cannot be referred to solely via paths.
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdLuxTokens. So to set an attribute to the value"rightHanded", use
UsdLuxTokens->rightHanded as the value.
"""
result["LightListAPI"].ComputeMode.__doc__ = """
Runtime control over whether to consult stored lightList caches.
"""
result["LightListAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdLuxLightListAPI on UsdPrim ``prim`` .
Equivalent to UsdLuxLightListAPI::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdLuxLightListAPI on the prim held by ``schemaObj`` .
Should be preferred over UsdLuxLightListAPI (schemaObj.GetPrim()), as
it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["LightListAPI"].GetLightListCacheBehaviorAttr.func_doc = """GetLightListCacheBehaviorAttr() -> Attribute
Controls how the lightList should be interpreted.
Valid values are:
- consumeAndHalt: The lightList should be consulted, and if it
exists, treated as a final authoritative statement of any lights that
exist at or below this prim, halting recursive discovery of lights.
- consumeAndContinue: The lightList should be consulted, but
recursive traversal over nameChildren should continue in case
additional lights are added by descendants.
- ignore: The lightList should be entirely ignored. This provides a
simple way to temporarily invalidate an existing cache. This is the
fallback behavior.
Declaration
``token lightList:cacheBehavior``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Allowed Values
consumeAndHalt, consumeAndContinue, ignore
"""
result["LightListAPI"].CreateLightListCacheBehaviorAttr.func_doc = """CreateLightListCacheBehaviorAttr(defaultValue, writeSparsely) -> Attribute
See GetLightListCacheBehaviorAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["LightListAPI"].GetLightListRel.func_doc = """GetLightListRel() -> Relationship
Relationship to lights in the scene.
"""
result["LightListAPI"].CreateLightListRel.func_doc = """CreateLightListRel() -> Relationship
See GetLightListRel() , and also Create vs Get Property Methods for
when to use Get vs Create.
"""
result["LightListAPI"].ComputeLightList.func_doc = """ComputeLightList(mode) -> SdfPathSet
Computes and returns the list of lights and light filters in the
stage, optionally consulting a cached result.
In ComputeModeIgnoreCache mode, caching is ignored, and this does a
prim traversal looking for prims that have a UsdLuxLightAPI or are of
type UsdLuxLightFilter.
In ComputeModeConsultModelHierarchyCache, this does a traversal only
of the model hierarchy. In this traversal, any lights that live as
model hierarchy prims are accumulated, as well as any paths stored in
lightList caches. The lightList:cacheBehavior attribute gives further
control over the cache behavior; see the class overview for details.
When instances are present, ComputeLightList(ComputeModeIgnoreCache)
will return the instance-uniqiue paths to any lights discovered within
those instances. Lights within a UsdGeomPointInstancer will not be
returned, however, since they cannot be referred to solely via paths.
Parameters
----------
mode : ComputeMode
"""
result["LightListAPI"].StoreLightList.func_doc = """StoreLightList(arg1) -> None
Store the given paths as the lightlist for this prim.
Paths that do not have this prim's path as a prefix will be silently
ignored. This will set the listList:cacheBehavior
to"consumeAndContinue".
Parameters
----------
arg1 : SdfPathSet
"""
result["LightListAPI"].InvalidateLightList.func_doc = """InvalidateLightList() -> None
Mark any stored lightlist as invalid, by setting the
lightList:cacheBehavior attribute to ignore.
"""
result["LightListAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["LightListAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> LightListAPI
Return a UsdLuxLightListAPI holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxLightListAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["LightListAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["LightListAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> LightListAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"LightListAPI"to the token-valued,
listOp metadata *apiSchemas* on the prim.
A valid UsdLuxLightListAPI object is returned upon success. An invalid
(or empty) UsdLuxLightListAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["LightListAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["ListAPI"].__doc__ = """
Deprecated
Use LightListAPI instead
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdLuxTokens. So to set an attribute to the value"rightHanded", use
UsdLuxTokens->rightHanded as the value.
"""
result["ListAPI"].ComputeMode.__doc__ = """
Runtime control over whether to consult stored lightList caches.
"""
result["ListAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdLuxListAPI on UsdPrim ``prim`` .
Equivalent to UsdLuxListAPI::Get (prim.GetStage(), prim.GetPath()) for
a *valid* ``prim`` , but will not immediately throw an error for an
invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdLuxListAPI on the prim held by ``schemaObj`` .
Should be preferred over UsdLuxListAPI (schemaObj.GetPrim()), as it
preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["ListAPI"].GetLightListCacheBehaviorAttr.func_doc = """GetLightListCacheBehaviorAttr() -> Attribute
Controls how the lightList should be interpreted.
Valid values are:
- consumeAndHalt: The lightList should be consulted, and if it
exists, treated as a final authoritative statement of any lights that
exist at or below this prim, halting recursive discovery of lights.
- consumeAndContinue: The lightList should be consulted, but
recursive traversal over nameChildren should continue in case
additional lights are added by descendants.
- ignore: The lightList should be entirely ignored. This provides a
simple way to temporarily invalidate an existing cache. This is the
fallback behavior.
Declaration
``token lightList:cacheBehavior``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Allowed Values
consumeAndHalt, consumeAndContinue, ignore
"""
result["ListAPI"].CreateLightListCacheBehaviorAttr.func_doc = """CreateLightListCacheBehaviorAttr(defaultValue, writeSparsely) -> Attribute
See GetLightListCacheBehaviorAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["ListAPI"].GetLightListRel.func_doc = """GetLightListRel() -> Relationship
Relationship to lights in the scene.
"""
result["ListAPI"].CreateLightListRel.func_doc = """CreateLightListRel() -> Relationship
See GetLightListRel() , and also Create vs Get Property Methods for
when to use Get vs Create.
"""
result["ListAPI"].ComputeLightList.func_doc = """ComputeLightList(mode) -> SdfPathSet
Computes and returns the list of lights and light filters in the
stage, optionally consulting a cached result.
In ComputeModeIgnoreCache mode, caching is ignored, and this does a
prim traversal looking for prims that have a UsdLuxLightAPI or are of
type UsdLuxLightFilter.
In ComputeModeConsultModelHierarchyCache, this does a traversal only
of the model hierarchy. In this traversal, any lights that live as
model hierarchy prims are accumulated, as well as any paths stored in
lightList caches. The lightList:cacheBehavior attribute gives further
control over the cache behavior; see the class overview for details.
When instances are present, ComputeLightList(ComputeModeIgnoreCache)
will return the instance-uniqiue paths to any lights discovered within
those instances. Lights within a UsdGeomPointInstancer will not be
returned, however, since they cannot be referred to solely via paths.
Parameters
----------
mode : ComputeMode
"""
result["ListAPI"].StoreLightList.func_doc = """StoreLightList(arg1) -> None
Store the given paths as the lightlist for this prim.
Paths that do not have this prim's path as a prefix will be silently
ignored. This will set the listList:cacheBehavior
to"consumeAndContinue".
Parameters
----------
arg1 : SdfPathSet
"""
result["ListAPI"].InvalidateLightList.func_doc = """InvalidateLightList() -> None
Mark any stored lightlist as invalid, by setting the
lightList:cacheBehavior attribute to ignore.
"""
result["ListAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["ListAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> ListAPI
Return a UsdLuxListAPI holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxListAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["ListAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["ListAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> ListAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"ListAPI"to the token-valued,
listOp metadata *apiSchemas* on the prim.
A valid UsdLuxListAPI object is returned upon success. An invalid (or
empty) UsdLuxListAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["ListAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["MeshLightAPI"].__doc__ = """
This is the preferred API schema to apply to Mesh type prims when
adding light behaviors to a mesh. At its base, this API schema has the
built-in behavior of applying LightAPI to the mesh and overriding the
default materialSyncMode to allow the emission/glow of the bound
material to affect the color of the light. But, it additionally serves
as a hook for plugins to attach additional properties to"mesh
lights"through the creation of API schemas which are authored to auto-
apply to MeshLightAPI.
Auto applied API schemas
"""
result["MeshLightAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdLuxMeshLightAPI on UsdPrim ``prim`` .
Equivalent to UsdLuxMeshLightAPI::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdLuxMeshLightAPI on the prim held by ``schemaObj`` .
Should be preferred over UsdLuxMeshLightAPI (schemaObj.GetPrim()), as
it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["MeshLightAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["MeshLightAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> MeshLightAPI
Return a UsdLuxMeshLightAPI holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxMeshLightAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["MeshLightAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["MeshLightAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> MeshLightAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"MeshLightAPI"to the token-valued,
listOp metadata *apiSchemas* on the prim.
A valid UsdLuxMeshLightAPI object is returned upon success. An invalid
(or empty) UsdLuxMeshLightAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["MeshLightAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["NonboundableLightBase"].__doc__ = """
Base class for intrinsic lights that are not boundable.
The primary purpose of this class is to provide a direct API to the
functions provided by LightAPI for concrete derived light types.
"""
result["NonboundableLightBase"].LightAPI.func_doc = """LightAPI() -> LightAPI
Contructs and returns a UsdLuxLightAPI object for this light.
"""
result["NonboundableLightBase"].GetIntensityAttr.func_doc = """GetIntensityAttr() -> Attribute
See UsdLuxLightAPI::GetIntensityAttr() .
"""
result["NonboundableLightBase"].CreateIntensityAttr.func_doc = """CreateIntensityAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateIntensityAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["NonboundableLightBase"].GetExposureAttr.func_doc = """GetExposureAttr() -> Attribute
See UsdLuxLightAPI::GetExposureAttr() .
"""
result["NonboundableLightBase"].CreateExposureAttr.func_doc = """CreateExposureAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateExposureAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["NonboundableLightBase"].GetDiffuseAttr.func_doc = """GetDiffuseAttr() -> Attribute
See UsdLuxLightAPI::GetDiffuseAttr() .
"""
result["NonboundableLightBase"].CreateDiffuseAttr.func_doc = """CreateDiffuseAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateDiffuseAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["NonboundableLightBase"].GetSpecularAttr.func_doc = """GetSpecularAttr() -> Attribute
See UsdLuxLightAPI::GetSpecularAttr() .
"""
result["NonboundableLightBase"].CreateSpecularAttr.func_doc = """CreateSpecularAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateSpecularAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["NonboundableLightBase"].GetNormalizeAttr.func_doc = """GetNormalizeAttr() -> Attribute
See UsdLuxLightAPI::GetNormalizeAttr() .
"""
result["NonboundableLightBase"].CreateNormalizeAttr.func_doc = """CreateNormalizeAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateNormalizeAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["NonboundableLightBase"].GetColorAttr.func_doc = """GetColorAttr() -> Attribute
See UsdLuxLightAPI::GetColorAttr() .
"""
result["NonboundableLightBase"].CreateColorAttr.func_doc = """CreateColorAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateColorAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["NonboundableLightBase"].GetEnableColorTemperatureAttr.func_doc = """GetEnableColorTemperatureAttr() -> Attribute
See UsdLuxLightAPI::GetEnableColorTemperatureAttr() .
"""
result["NonboundableLightBase"].CreateEnableColorTemperatureAttr.func_doc = """CreateEnableColorTemperatureAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateEnableColorTemperatureAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["NonboundableLightBase"].GetColorTemperatureAttr.func_doc = """GetColorTemperatureAttr() -> Attribute
See UsdLuxLightAPI::GetColorTemperatureAttr() .
"""
result["NonboundableLightBase"].CreateColorTemperatureAttr.func_doc = """CreateColorTemperatureAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateColorTemperatureAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["NonboundableLightBase"].GetFiltersRel.func_doc = """GetFiltersRel() -> Relationship
See UsdLuxLightAPI::GetFiltersRel() .
"""
result["NonboundableLightBase"].CreateFiltersRel.func_doc = """CreateFiltersRel() -> Relationship
See UsdLuxLightAPI::CreateFiltersRel() .
"""
result["NonboundableLightBase"].__init__.func_doc = """__init__(prim)
Construct a UsdLuxNonboundableLightBase on UsdPrim ``prim`` .
Equivalent to UsdLuxNonboundableLightBase::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdLuxNonboundableLightBase on the prim held by
``schemaObj`` .
Should be preferred over UsdLuxNonboundableLightBase
(schemaObj.GetPrim()), as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["NonboundableLightBase"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["NonboundableLightBase"].Get.func_doc = """**classmethod** Get(stage, path) -> NonboundableLightBase
Return a UsdLuxNonboundableLightBase holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxNonboundableLightBase(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["NonboundableLightBase"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["PluginLight"].__doc__ = """
Light that provides properties that allow it to identify an external
SdrShadingNode definition, through UsdShadeNodeDefAPI, that can be
provided to render delegates without the need to provide a schema
definition for the light's type.
Plugin Lights and Light Filters
"""
result["PluginLight"].__init__.func_doc = """__init__(prim)
Construct a UsdLuxPluginLight on UsdPrim ``prim`` .
Equivalent to UsdLuxPluginLight::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdLuxPluginLight on the prim held by ``schemaObj`` .
Should be preferred over UsdLuxPluginLight (schemaObj.GetPrim()), as
it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["PluginLight"].GetNodeDefAPI.func_doc = """GetNodeDefAPI() -> NodeDefAPI
Convenience method for accessing the UsdShadeNodeDefAPI functionality
for this prim.
One can also construct a UsdShadeNodeDefAPI directly from a UsdPrim.
"""
result["PluginLight"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["PluginLight"].Get.func_doc = """**classmethod** Get(stage, path) -> PluginLight
Return a UsdLuxPluginLight holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxPluginLight(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["PluginLight"].Define.func_doc = """**classmethod** Define(stage, path) -> PluginLight
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["PluginLight"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["PluginLightFilter"].__doc__ = """
Light filter that provides properties that allow it to identify an
external SdrShadingNode definition, through UsdShadeNodeDefAPI, that
can be provided to render delegates without the need to provide a
schema definition for the light filter's type.
Plugin Lights and Light Filters
"""
result["PluginLightFilter"].__init__.func_doc = """__init__(prim)
Construct a UsdLuxPluginLightFilter on UsdPrim ``prim`` .
Equivalent to UsdLuxPluginLightFilter::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdLuxPluginLightFilter on the prim held by ``schemaObj``
.
Should be preferred over UsdLuxPluginLightFilter
(schemaObj.GetPrim()), as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["PluginLightFilter"].GetNodeDefAPI.func_doc = """GetNodeDefAPI() -> NodeDefAPI
Convenience method for accessing the UsdShadeNodeDefAPI functionality
for this prim.
One can also construct a UsdShadeNodeDefAPI directly from a UsdPrim.
"""
result["PluginLightFilter"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["PluginLightFilter"].Get.func_doc = """**classmethod** Get(stage, path) -> PluginLightFilter
Return a UsdLuxPluginLightFilter holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxPluginLightFilter(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["PluginLightFilter"].Define.func_doc = """**classmethod** Define(stage, path) -> PluginLightFilter
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["PluginLightFilter"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["PortalLight"].__doc__ = """
A rectangular portal in the local XY plane that guides sampling of a
dome light. Transmits light in the -Z direction. The rectangle is 1
unit in length.
"""
result["PortalLight"].__init__.func_doc = """__init__(prim)
Construct a UsdLuxPortalLight on UsdPrim ``prim`` .
Equivalent to UsdLuxPortalLight::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdLuxPortalLight on the prim held by ``schemaObj`` .
Should be preferred over UsdLuxPortalLight (schemaObj.GetPrim()), as
it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["PortalLight"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["PortalLight"].Get.func_doc = """**classmethod** Get(stage, path) -> PortalLight
Return a UsdLuxPortalLight holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxPortalLight(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["PortalLight"].Define.func_doc = """**classmethod** Define(stage, path) -> PortalLight
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["PortalLight"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["RectLight"].__doc__ = """
Light emitted from one side of a rectangle. The rectangle is centered
in the XY plane and emits light along the -Z axis. The rectangle is 1
unit in length in the X and Y axis. In the default position, a texture
file's min coordinates should be at (+X, +Y) and max coordinates at
(-X, -Y).
"""
result["RectLight"].__init__.func_doc = """__init__(prim)
Construct a UsdLuxRectLight on UsdPrim ``prim`` .
Equivalent to UsdLuxRectLight::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdLuxRectLight on the prim held by ``schemaObj`` .
Should be preferred over UsdLuxRectLight (schemaObj.GetPrim()), as it
preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["RectLight"].GetWidthAttr.func_doc = """GetWidthAttr() -> Attribute
Width of the rectangle, in the local X axis.
Declaration
``float inputs:width = 1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["RectLight"].CreateWidthAttr.func_doc = """CreateWidthAttr(defaultValue, writeSparsely) -> Attribute
See GetWidthAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["RectLight"].GetHeightAttr.func_doc = """GetHeightAttr() -> Attribute
Height of the rectangle, in the local Y axis.
Declaration
``float inputs:height = 1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["RectLight"].CreateHeightAttr.func_doc = """CreateHeightAttr(defaultValue, writeSparsely) -> Attribute
See GetHeightAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["RectLight"].GetTextureFileAttr.func_doc = """GetTextureFileAttr() -> Attribute
A color texture to use on the rectangle.
Declaration
``asset inputs:texture:file``
C++ Type
SdfAssetPath
Usd Type
SdfValueTypeNames->Asset
"""
result["RectLight"].CreateTextureFileAttr.func_doc = """CreateTextureFileAttr(defaultValue, writeSparsely) -> Attribute
See GetTextureFileAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["RectLight"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["RectLight"].Get.func_doc = """**classmethod** Get(stage, path) -> RectLight
Return a UsdLuxRectLight holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxRectLight(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["RectLight"].Define.func_doc = """**classmethod** Define(stage, path) -> RectLight
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["RectLight"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["ShadowAPI"].__doc__ = """
Controls to refine a light's shadow behavior. These are non-physical
controls that are valuable for visual lighting work.
"""
result["ShadowAPI"].__init__.func_doc = """__init__(connectable)
Constructor that takes a ConnectableAPI object.
Allow implicit conversion of UsdShadeConnectableAPI to
UsdLuxShadowAPI.
Parameters
----------
connectable : ConnectableAPI
----------------------------------------------------------------------
__init__(prim)
Construct a UsdLuxShadowAPI on UsdPrim ``prim`` .
Equivalent to UsdLuxShadowAPI::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdLuxShadowAPI on the prim held by ``schemaObj`` .
Should be preferred over UsdLuxShadowAPI (schemaObj.GetPrim()), as it
preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["ShadowAPI"].ConnectableAPI.func_doc = """ConnectableAPI() -> ConnectableAPI
Contructs and returns a UsdShadeConnectableAPI object with this shadow
API prim.
Note that a valid UsdLuxShadowAPI will only return a valid
UsdShadeConnectableAPI if the its prim's Typed schema type is actually
connectable.
"""
result["ShadowAPI"].CreateOutput.func_doc = """CreateOutput(name, typeName) -> Output
Create an output which can either have a value or can be connected.
The attribute representing the output is created in
the"outputs:"namespace. Outputs on a shadow API cannot be connected,
as their value is assumed to be computed externally.
Parameters
----------
name : str
typeName : ValueTypeName
"""
result["ShadowAPI"].GetOutput.func_doc = """GetOutput(name) -> Output
Return the requested output if it exists.
Parameters
----------
name : str
"""
result["ShadowAPI"].GetOutputs.func_doc = """GetOutputs(onlyAuthored) -> list[Output]
Outputs are represented by attributes in the"outputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
result["ShadowAPI"].CreateInput.func_doc = """CreateInput(name, typeName) -> Input
Create an input which can either have a value or can be connected.
The attribute representing the input is created in
the"inputs:"namespace. Inputs on shadow API are connectable.
Parameters
----------
name : str
typeName : ValueTypeName
"""
result["ShadowAPI"].GetInput.func_doc = """GetInput(name) -> Input
Return the requested input if it exists.
Parameters
----------
name : str
"""
result["ShadowAPI"].GetInputs.func_doc = """GetInputs(onlyAuthored) -> list[Input]
Inputs are represented by attributes in the"inputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
result["ShadowAPI"].GetShadowEnableAttr.func_doc = """GetShadowEnableAttr() -> Attribute
Enables shadows to be cast by this light.
Declaration
``bool inputs:shadow:enable = 1``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
result["ShadowAPI"].CreateShadowEnableAttr.func_doc = """CreateShadowEnableAttr(defaultValue, writeSparsely) -> Attribute
See GetShadowEnableAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["ShadowAPI"].GetShadowColorAttr.func_doc = """GetShadowColorAttr() -> Attribute
The color of shadows cast by the light.
This is a non-physical control. The default is to cast black shadows.
Declaration
``color3f inputs:shadow:color = (0, 0, 0)``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Color3f
"""
result["ShadowAPI"].CreateShadowColorAttr.func_doc = """CreateShadowColorAttr(defaultValue, writeSparsely) -> Attribute
See GetShadowColorAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["ShadowAPI"].GetShadowDistanceAttr.func_doc = """GetShadowDistanceAttr() -> Attribute
The maximum distance shadows are cast.
The default value (-1) indicates no limit.
Declaration
``float inputs:shadow:distance = -1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["ShadowAPI"].CreateShadowDistanceAttr.func_doc = """CreateShadowDistanceAttr(defaultValue, writeSparsely) -> Attribute
See GetShadowDistanceAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["ShadowAPI"].GetShadowFalloffAttr.func_doc = """GetShadowFalloffAttr() -> Attribute
The near distance at which shadow falloff begins.
The default value (-1) indicates no falloff.
Declaration
``float inputs:shadow:falloff = -1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["ShadowAPI"].CreateShadowFalloffAttr.func_doc = """CreateShadowFalloffAttr(defaultValue, writeSparsely) -> Attribute
See GetShadowFalloffAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["ShadowAPI"].GetShadowFalloffGammaAttr.func_doc = """GetShadowFalloffGammaAttr() -> Attribute
A gamma (i.e., exponential) control over shadow strength with linear
distance within the falloff zone.
This requires the use of shadowDistance and shadowFalloff.
Declaration
``float inputs:shadow:falloffGamma = 1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["ShadowAPI"].CreateShadowFalloffGammaAttr.func_doc = """CreateShadowFalloffGammaAttr(defaultValue, writeSparsely) -> Attribute
See GetShadowFalloffGammaAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["ShadowAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["ShadowAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> ShadowAPI
Return a UsdLuxShadowAPI holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxShadowAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["ShadowAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["ShadowAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> ShadowAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"ShadowAPI"to the token-valued,
listOp metadata *apiSchemas* on the prim.
A valid UsdLuxShadowAPI object is returned upon success. An invalid
(or empty) UsdLuxShadowAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["ShadowAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["ShapingAPI"].__doc__ = """
Controls for shaping a light's emission.
"""
result["ShapingAPI"].__init__.func_doc = """__init__(connectable)
Constructor that takes a ConnectableAPI object.
Allow implicit conversion of UsdShadeConnectableAPI to
UsdLuxShapingAPI.
Parameters
----------
connectable : ConnectableAPI
----------------------------------------------------------------------
__init__(prim)
Construct a UsdLuxShapingAPI on UsdPrim ``prim`` .
Equivalent to UsdLuxShapingAPI::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdLuxShapingAPI on the prim held by ``schemaObj`` .
Should be preferred over UsdLuxShapingAPI (schemaObj.GetPrim()), as it
preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["ShapingAPI"].ConnectableAPI.func_doc = """ConnectableAPI() -> ConnectableAPI
Contructs and returns a UsdShadeConnectableAPI object with this
shaping API prim.
Note that a valid UsdLuxShapingAPI will only return a valid
UsdShadeConnectableAPI if the its prim's Typed schema type is actually
connectable.
"""
result["ShapingAPI"].CreateOutput.func_doc = """CreateOutput(name, typeName) -> Output
Create an output which can either have a value or can be connected.
The attribute representing the output is created in
the"outputs:"namespace. Outputs on a shaping API cannot be connected,
as their value is assumed to be computed externally.
Parameters
----------
name : str
typeName : ValueTypeName
"""
result["ShapingAPI"].GetOutput.func_doc = """GetOutput(name) -> Output
Return the requested output if it exists.
Parameters
----------
name : str
"""
result["ShapingAPI"].GetOutputs.func_doc = """GetOutputs(onlyAuthored) -> list[Output]
Outputs are represented by attributes in the"outputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
result["ShapingAPI"].CreateInput.func_doc = """CreateInput(name, typeName) -> Input
Create an input which can either have a value or can be connected.
The attribute representing the input is created in
the"inputs:"namespace. Inputs on shaping API are connectable.
Parameters
----------
name : str
typeName : ValueTypeName
"""
result["ShapingAPI"].GetInput.func_doc = """GetInput(name) -> Input
Return the requested input if it exists.
Parameters
----------
name : str
"""
result["ShapingAPI"].GetInputs.func_doc = """GetInputs(onlyAuthored) -> list[Input]
Inputs are represented by attributes in the"inputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
result["ShapingAPI"].GetShapingFocusAttr.func_doc = """GetShapingFocusAttr() -> Attribute
A control to shape the spread of light.
Higher focus values pull light towards the center and narrow the
spread. Implemented as an off-axis cosine power exponent. TODO:
clarify semantics
Declaration
``float inputs:shaping:focus = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["ShapingAPI"].CreateShapingFocusAttr.func_doc = """CreateShapingFocusAttr(defaultValue, writeSparsely) -> Attribute
See GetShapingFocusAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["ShapingAPI"].GetShapingFocusTintAttr.func_doc = """GetShapingFocusTintAttr() -> Attribute
Off-axis color tint.
This tints the emission in the falloff region. The default tint is
black. TODO: clarify semantics
Declaration
``color3f inputs:shaping:focusTint = (0, 0, 0)``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Color3f
"""
result["ShapingAPI"].CreateShapingFocusTintAttr.func_doc = """CreateShapingFocusTintAttr(defaultValue, writeSparsely) -> Attribute
See GetShapingFocusTintAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["ShapingAPI"].GetShapingConeAngleAttr.func_doc = """GetShapingConeAngleAttr() -> Attribute
Angular limit off the primary axis to restrict the light spread.
Declaration
``float inputs:shaping:cone:angle = 90``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["ShapingAPI"].CreateShapingConeAngleAttr.func_doc = """CreateShapingConeAngleAttr(defaultValue, writeSparsely) -> Attribute
See GetShapingConeAngleAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["ShapingAPI"].GetShapingConeSoftnessAttr.func_doc = """GetShapingConeSoftnessAttr() -> Attribute
Controls the cutoff softness for cone angle.
TODO: clarify semantics
Declaration
``float inputs:shaping:cone:softness = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["ShapingAPI"].CreateShapingConeSoftnessAttr.func_doc = """CreateShapingConeSoftnessAttr(defaultValue, writeSparsely) -> Attribute
See GetShapingConeSoftnessAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["ShapingAPI"].GetShapingIesFileAttr.func_doc = """GetShapingIesFileAttr() -> Attribute
An IES (Illumination Engineering Society) light profile describing the
angular distribution of light.
Declaration
``asset inputs:shaping:ies:file``
C++ Type
SdfAssetPath
Usd Type
SdfValueTypeNames->Asset
"""
result["ShapingAPI"].CreateShapingIesFileAttr.func_doc = """CreateShapingIesFileAttr(defaultValue, writeSparsely) -> Attribute
See GetShapingIesFileAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["ShapingAPI"].GetShapingIesAngleScaleAttr.func_doc = """GetShapingIesAngleScaleAttr() -> Attribute
Rescales the angular distribution of the IES profile.
TODO: clarify semantics
Declaration
``float inputs:shaping:ies:angleScale = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["ShapingAPI"].CreateShapingIesAngleScaleAttr.func_doc = """CreateShapingIesAngleScaleAttr(defaultValue, writeSparsely) -> Attribute
See GetShapingIesAngleScaleAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["ShapingAPI"].GetShapingIesNormalizeAttr.func_doc = """GetShapingIesNormalizeAttr() -> Attribute
Normalizes the IES profile so that it affects the shaping of the light
while preserving the overall energy output.
Declaration
``bool inputs:shaping:ies:normalize = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
result["ShapingAPI"].CreateShapingIesNormalizeAttr.func_doc = """CreateShapingIesNormalizeAttr(defaultValue, writeSparsely) -> Attribute
See GetShapingIesNormalizeAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["ShapingAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["ShapingAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> ShapingAPI
Return a UsdLuxShapingAPI holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxShapingAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["ShapingAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["ShapingAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> ShapingAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"ShapingAPI"to the token-valued,
listOp metadata *apiSchemas* on the prim.
A valid UsdLuxShapingAPI object is returned upon success. An invalid
(or empty) UsdLuxShapingAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["ShapingAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["SphereLight"].__doc__ = """
Light emitted outward from a sphere.
"""
result["SphereLight"].__init__.func_doc = """__init__(prim)
Construct a UsdLuxSphereLight on UsdPrim ``prim`` .
Equivalent to UsdLuxSphereLight::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdLuxSphereLight on the prim held by ``schemaObj`` .
Should be preferred over UsdLuxSphereLight (schemaObj.GetPrim()), as
it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["SphereLight"].GetRadiusAttr.func_doc = """GetRadiusAttr() -> Attribute
Radius of the sphere.
Declaration
``float inputs:radius = 0.5``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
result["SphereLight"].CreateRadiusAttr.func_doc = """CreateRadiusAttr(defaultValue, writeSparsely) -> Attribute
See GetRadiusAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["SphereLight"].GetTreatAsPointAttr.func_doc = """GetTreatAsPointAttr() -> Attribute
A hint that this light can be treated as a'point'light (effectively, a
zero-radius sphere) by renderers that benefit from non-area lighting.
Renderers that only support area lights can disregard this.
Declaration
``bool treatAsPoint = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
result["SphereLight"].CreateTreatAsPointAttr.func_doc = """CreateTreatAsPointAttr(defaultValue, writeSparsely) -> Attribute
See GetTreatAsPointAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["SphereLight"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["SphereLight"].Get.func_doc = """**classmethod** Get(stage, path) -> SphereLight
Return a UsdLuxSphereLight holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxSphereLight(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["SphereLight"].Define.func_doc = """**classmethod** Define(stage, path) -> SphereLight
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["SphereLight"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["VolumeLightAPI"].__doc__ = """
This is the preferred API schema to apply to Volume type prims when
adding light behaviors to a volume. At its base, this API schema has
the built-in behavior of applying LightAPI to the volume and
overriding the default materialSyncMode to allow the emission/glow of
the bound material to affect the color of the light. But, it
additionally serves as a hook for plugins to attach additional
properties to"volume lights"through the creation of API schemas which
are authored to auto-apply to VolumeLightAPI.
Auto applied API schemas
"""
result["VolumeLightAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdLuxVolumeLightAPI on UsdPrim ``prim`` .
Equivalent to UsdLuxVolumeLightAPI::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdLuxVolumeLightAPI on the prim held by ``schemaObj`` .
Should be preferred over UsdLuxVolumeLightAPI (schemaObj.GetPrim()),
as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["VolumeLightAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["VolumeLightAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> VolumeLightAPI
Return a UsdLuxVolumeLightAPI holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxVolumeLightAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["VolumeLightAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["VolumeLightAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> VolumeLightAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"VolumeLightAPI"to the token-
valued, listOp metadata *apiSchemas* on the prim.
A valid UsdLuxVolumeLightAPI object is returned upon success. An
invalid (or empty) UsdLuxVolumeLightAPI object is returned upon
failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["VolumeLightAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
""" | 131,321 | Python | 21.171535 | 165 | 0.726403 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdLux/__init__.pyi | from __future__ import annotations
import pxr.UsdLux._usdLux
import typing
import Boost.Python
import pxr.Usd
import pxr.UsdGeom
import pxr.UsdLux
__all__ = [
"BlackbodyTemperatureAsRgb",
"BoundableLightBase",
"CylinderLight",
"DiskLight",
"DistantLight",
"DomeLight",
"GeometryLight",
"LightAPI",
"LightFilter",
"LightListAPI",
"ListAPI",
"MeshLightAPI",
"NonboundableLightBase",
"PluginLight",
"PluginLightFilter",
"PortalLight",
"RectLight",
"ShadowAPI",
"ShapingAPI",
"SphereLight",
"Tokens",
"VolumeLightAPI"
]
class CylinderLight(BoundableLightBase, pxr.UsdGeom.Boundable, pxr.UsdGeom.Xformable, pxr.UsdGeom.Imageable, pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Light emitted outward from a cylinder. The cylinder is centered at the
origin and has its major axis on the X axis. The cylinder does not
emit light from the flat end-caps.
"""
@staticmethod
def CreateLengthAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateLengthAttr(defaultValue, writeSparsely) -> Attribute
See GetLengthAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateRadiusAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateRadiusAttr(defaultValue, writeSparsely) -> Attribute
See GetRadiusAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateTreatAsLineAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateTreatAsLineAttr(defaultValue, writeSparsely) -> Attribute
See GetTreatAsLineAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> CylinderLight
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> CylinderLight
Return a UsdLuxCylinderLight holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxCylinderLight(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetLengthAttr() -> Attribute:
"""
GetLengthAttr() -> Attribute
Width of the rectangle, in the local X axis.
Declaration
``float inputs:length = 1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetRadiusAttr() -> Attribute:
"""
GetRadiusAttr() -> Attribute
Radius of the cylinder.
Declaration
``float inputs:radius = 0.5``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def GetTreatAsLineAttr() -> Attribute:
"""
GetTreatAsLineAttr() -> Attribute
A hint that this light can be treated as a'line'light (effectively, a
zero-radius cylinder) by renderers that benefit from non-area
lighting.
Renderers that only support area lights can disregard this.
Declaration
``bool treatAsLine = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class DiskLight(BoundableLightBase, pxr.UsdGeom.Boundable, pxr.UsdGeom.Xformable, pxr.UsdGeom.Imageable, pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Light emitted from one side of a circular disk. The disk is centered
in the XY plane and emits light along the -Z axis.
"""
@staticmethod
def CreateRadiusAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateRadiusAttr(defaultValue, writeSparsely) -> Attribute
See GetRadiusAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> DiskLight
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> DiskLight
Return a UsdLuxDiskLight holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxDiskLight(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetRadiusAttr() -> Attribute:
"""
GetRadiusAttr() -> Attribute
Radius of the disk.
Declaration
``float inputs:radius = 0.5``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class BoundableLightBase(pxr.UsdGeom.Boundable, pxr.UsdGeom.Xformable, pxr.UsdGeom.Imageable, pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Base class for intrinsic lights that are boundable.
The primary purpose of this class is to provide a direct API to the
functions provided by LightAPI for concrete derived light types.
"""
@staticmethod
def CreateColorAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateColorAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateColorAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateColorTemperatureAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateColorTemperatureAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateColorTemperatureAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateDiffuseAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateDiffuseAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateDiffuseAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateEnableColorTemperatureAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateEnableColorTemperatureAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateEnableColorTemperatureAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateExposureAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateExposureAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateExposureAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateFiltersRel() -> Relationship:
"""
CreateFiltersRel() -> Relationship
See UsdLuxLightAPI::CreateFiltersRel() .
"""
@staticmethod
def CreateIntensityAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateIntensityAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateIntensityAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateNormalizeAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateNormalizeAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateNormalizeAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateSpecularAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateSpecularAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateSpecularAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> BoundableLightBase
Return a UsdLuxBoundableLightBase holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxBoundableLightBase(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetColorAttr() -> Attribute:
"""
GetColorAttr() -> Attribute
See UsdLuxLightAPI::GetColorAttr() .
"""
@staticmethod
def GetColorTemperatureAttr() -> Attribute:
"""
GetColorTemperatureAttr() -> Attribute
See UsdLuxLightAPI::GetColorTemperatureAttr() .
"""
@staticmethod
def GetDiffuseAttr() -> Attribute:
"""
GetDiffuseAttr() -> Attribute
See UsdLuxLightAPI::GetDiffuseAttr() .
"""
@staticmethod
def GetEnableColorTemperatureAttr() -> Attribute:
"""
GetEnableColorTemperatureAttr() -> Attribute
See UsdLuxLightAPI::GetEnableColorTemperatureAttr() .
"""
@staticmethod
def GetExposureAttr() -> Attribute:
"""
GetExposureAttr() -> Attribute
See UsdLuxLightAPI::GetExposureAttr() .
"""
@staticmethod
def GetFiltersRel() -> Relationship:
"""
GetFiltersRel() -> Relationship
See UsdLuxLightAPI::GetFiltersRel() .
"""
@staticmethod
def GetIntensityAttr() -> Attribute:
"""
GetIntensityAttr() -> Attribute
See UsdLuxLightAPI::GetIntensityAttr() .
"""
@staticmethod
def GetNormalizeAttr() -> Attribute:
"""
GetNormalizeAttr() -> Attribute
See UsdLuxLightAPI::GetNormalizeAttr() .
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def GetSpecularAttr() -> Attribute:
"""
GetSpecularAttr() -> Attribute
See UsdLuxLightAPI::GetSpecularAttr() .
"""
@staticmethod
def LightAPI() -> LightAPI:
"""
LightAPI() -> LightAPI
Contructs and returns a UsdLuxLightAPI object for this light.
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class DistantLight(NonboundableLightBase, pxr.UsdGeom.Xformable, pxr.UsdGeom.Imageable, pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Light emitted from a distant source along the -Z axis. Also known as a
directional light.
"""
@staticmethod
def CreateAngleAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateAngleAttr(defaultValue, writeSparsely) -> Attribute
See GetAngleAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> DistantLight
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> DistantLight
Return a UsdLuxDistantLight holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxDistantLight(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetAngleAttr() -> Attribute:
"""
GetAngleAttr() -> Attribute
Angular size of the light in degrees.
As an example, the Sun is approximately 0.53 degrees as seen from
Earth. Higher values broaden the light and therefore soften shadow
edges.
Declaration
``float inputs:angle = 0.53``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class DomeLight(NonboundableLightBase, pxr.UsdGeom.Xformable, pxr.UsdGeom.Imageable, pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Light emitted inward from a distant external environment, such as a
sky or IBL light probe. The orientation of a dome light with a latlong
texture is expected to match the OpenEXR specification for latlong
environment maps. From the OpenEXR documentation:
Latitude-Longitude Map:
The environment is projected onto the image using polar coordinates
(latitude and longitude). A pixel's x coordinate corresponds to its
longitude, and the y coordinate corresponds to its latitude. Pixel
(dataWindow.min.x, dataWindow.min.y) has latitude +pi/2 and longitude
+pi; pixel (dataWindow.max.x, dataWindow.max.y) has latitude -pi/2 and
longitude -pi.
In 3D space, latitudes -pi/2 and +pi/2 correspond to the negative and
positive y direction. Latitude 0, longitude 0 points into positive z
direction; and latitude 0, longitude pi/2 points into positive x
direction.
The size of the data window should be 2\*N by N pixels (width by
height),
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdLuxTokens. So to set an attribute to the value"rightHanded", use
UsdLuxTokens->rightHanded as the value.
"""
@staticmethod
def CreateGuideRadiusAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateGuideRadiusAttr(defaultValue, writeSparsely) -> Attribute
See GetGuideRadiusAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreatePortalsRel() -> Relationship:
"""
CreatePortalsRel() -> Relationship
See GetPortalsRel() , and also Create vs Get Property Methods for when
to use Get vs Create.
"""
@staticmethod
def CreateTextureFileAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateTextureFileAttr(defaultValue, writeSparsely) -> Attribute
See GetTextureFileAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateTextureFormatAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateTextureFormatAttr(defaultValue, writeSparsely) -> Attribute
See GetTextureFormatAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> DomeLight
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> DomeLight
Return a UsdLuxDomeLight holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxDomeLight(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetGuideRadiusAttr() -> Attribute:
"""
GetGuideRadiusAttr() -> Attribute
The radius of guide geometry to use to visualize the dome light.
The default is 1 km for scenes whose metersPerUnit is the USD default
of 0.01 (i.e., 1 world unit is 1 cm).
Declaration
``float guideRadius = 100000``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetPortalsRel() -> Relationship:
"""
GetPortalsRel() -> Relationship
Optional portals to guide light sampling.
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def GetTextureFileAttr() -> Attribute:
"""
GetTextureFileAttr() -> Attribute
A color texture to use on the dome, such as an HDR (high dynamic
range) texture intended for IBL (image based lighting).
Declaration
``asset inputs:texture:file``
C++ Type
SdfAssetPath
Usd Type
SdfValueTypeNames->Asset
"""
@staticmethod
def GetTextureFormatAttr() -> Attribute:
"""
GetTextureFormatAttr() -> Attribute
Specifies the parameterization of the color map file.
Valid values are:
- automatic: Tries to determine the layout from the file itself.
For example, Renderman texture files embed an explicit
parameterization.
- latlong: Latitude as X, longitude as Y.
- mirroredBall: An image of the environment reflected in a sphere,
using an implicitly orthogonal projection.
- angular: Similar to mirroredBall but the radial dimension is
mapped linearly to the angle, providing better sampling at the edges.
- cubeMapVerticalCross: A cube map with faces laid out as a
vertical cross.
Declaration
``token inputs:texture:format ="automatic"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Allowed Values
automatic, latlong, mirroredBall, angular, cubeMapVerticalCross
"""
@staticmethod
def OrientToStageUpAxis() -> None:
"""
OrientToStageUpAxis() -> None
Adds a transformation op, if neeeded, to orient the dome to align with
the stage's up axis.
Uses UsdLuxTokens->orientToStageUpAxis as the op suffix. If an op with
this suffix already exists, this method assumes it is already applying
the proper correction and does nothing further. If no op is required
to match the stage's up axis, no op will be created.
UsdGeomXformOp
UsdGeomGetStageUpAxis
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class GeometryLight(NonboundableLightBase, pxr.UsdGeom.Xformable, pxr.UsdGeom.Imageable, pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Deprecated
Light emitted outward from a geometric prim (UsdGeomGprim), which is
typically a mesh.
"""
@staticmethod
def CreateGeometryRel() -> Relationship:
"""
CreateGeometryRel() -> Relationship
See GetGeometryRel() , and also Create vs Get Property Methods for
when to use Get vs Create.
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> GeometryLight
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> GeometryLight
Return a UsdLuxGeometryLight holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxGeometryLight(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetGeometryRel() -> Relationship:
"""
GetGeometryRel() -> Relationship
Relationship to the geometry to use as the light source.
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class LightAPI(pxr.Usd.APISchemaBase, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
API schema that imparts the quality of being a light onto a prim.
A light is any prim that has this schema applied to it. This is true
regardless of whether LightAPI is included as a built-in API of the
prim type (e.g. RectLight or DistantLight) or is applied directly to a
Gprim that should be treated as a light.
**Linking**
Lights can be linked to geometry. Linking controls which geometry a
light illuminates, and which geometry casts shadows from the light.
Linking is specified as collections (UsdCollectionAPI) which can be
accessed via GetLightLinkCollection() and GetShadowLinkCollection().
Note that these collections have their includeRoot set to true, so
that lights will illuminate and cast shadows from all objects by
default. To illuminate only a specific set of objects, there are two
options. One option is to modify the collection paths to explicitly
exclude everything else, assuming it is known; the other option is to
set includeRoot to false and explicitly include the desired objects.
These are complementary approaches that may each be preferable
depending on the scenario and how to best express the intent of the
light setup.
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdLuxTokens. So to set an attribute to the value"rightHanded", use
UsdLuxTokens->rightHanded as the value.
"""
@staticmethod
def Apply(*args, **kwargs) -> None:
"""
**classmethod** Apply(prim) -> LightAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"LightAPI"to the token-valued,
listOp metadata *apiSchemas* on the prim.
A valid UsdLuxLightAPI object is returned upon success. An invalid (or
empty) UsdLuxLightAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
@staticmethod
def CanApply(*args, **kwargs) -> None:
"""
**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
@staticmethod
def ConnectableAPI() -> ConnectableAPI:
"""
ConnectableAPI() -> ConnectableAPI
Contructs and returns a UsdShadeConnectableAPI object with this light.
Note that most tasks can be accomplished without explicitly
constructing a UsdShadeConnectable API, since connection-related API
such as UsdShadeConnectableAPI::ConnectToSource() are static methods,
and UsdLuxLightAPI will auto-convert to a UsdShadeConnectableAPI when
passed to functions that want to act generically on a connectable
UsdShadeConnectableAPI object.
"""
@staticmethod
def CreateColorAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateColorAttr(defaultValue, writeSparsely) -> Attribute
See GetColorAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateColorTemperatureAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateColorTemperatureAttr(defaultValue, writeSparsely) -> Attribute
See GetColorTemperatureAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateDiffuseAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateDiffuseAttr(defaultValue, writeSparsely) -> Attribute
See GetDiffuseAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateEnableColorTemperatureAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateEnableColorTemperatureAttr(defaultValue, writeSparsely) -> Attribute
See GetEnableColorTemperatureAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateExposureAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateExposureAttr(defaultValue, writeSparsely) -> Attribute
See GetExposureAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateFiltersRel() -> Relationship:
"""
CreateFiltersRel() -> Relationship
See GetFiltersRel() , and also Create vs Get Property Methods for when
to use Get vs Create.
"""
@staticmethod
def CreateInput(name, typeName) -> Input:
"""
CreateInput(name, typeName) -> Input
Create an input which can either have a value or can be connected.
The attribute representing the input is created in
the"inputs:"namespace. Inputs on lights are connectable.
Parameters
----------
name : str
typeName : ValueTypeName
"""
@staticmethod
def CreateIntensityAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateIntensityAttr(defaultValue, writeSparsely) -> Attribute
See GetIntensityAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateMaterialSyncModeAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateMaterialSyncModeAttr(defaultValue, writeSparsely) -> Attribute
See GetMaterialSyncModeAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateNormalizeAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateNormalizeAttr(defaultValue, writeSparsely) -> Attribute
See GetNormalizeAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateOutput(name, typeName) -> Output:
"""
CreateOutput(name, typeName) -> Output
Create an output which can either have a value or can be connected.
The attribute representing the output is created in
the"outputs:"namespace. Outputs on a light cannot be connected, as
their value is assumed to be computed externally.
Parameters
----------
name : str
typeName : ValueTypeName
"""
@staticmethod
def CreateShaderIdAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateShaderIdAttr(defaultValue, writeSparsely) -> Attribute
See GetShaderIdAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateShaderIdAttrForRenderContext(renderContext, defaultValue, writeSparsely) -> Attribute:
"""
CreateShaderIdAttrForRenderContext(renderContext, defaultValue, writeSparsely) -> Attribute
Creates the shader ID attribute for the given ``renderContext`` .
See GetShaderIdAttrForRenderContext() , and also Create vs Get
Property Methods for when to use Get vs Create. If specified, author
``defaultValue`` as the attribute's default, sparsely (when it makes
sense to do so) if ``writeSparsely`` is ``true`` - the default for
``writeSparsely`` is ``false`` .
Parameters
----------
renderContext : str
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateSpecularAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateSpecularAttr(defaultValue, writeSparsely) -> Attribute
See GetSpecularAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> LightAPI
Return a UsdLuxLightAPI holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxLightAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetColorAttr() -> Attribute:
"""
GetColorAttr() -> Attribute
The color of emitted light, in energy-linear terms.
Declaration
``color3f inputs:color = (1, 1, 1)``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Color3f
"""
@staticmethod
def GetColorTemperatureAttr() -> Attribute:
"""
GetColorTemperatureAttr() -> Attribute
Color temperature, in degrees Kelvin, representing the white point.
The default is a common white point, D65. Lower values are warmer and
higher values are cooler. The valid range is from 1000 to 10000. Only
takes effect when enableColorTemperature is set to true. When active,
the computed result multiplies against the color attribute. See
UsdLuxBlackbodyTemperatureAsRgb() .
Declaration
``float inputs:colorTemperature = 6500``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetDiffuseAttr() -> Attribute:
"""
GetDiffuseAttr() -> Attribute
A multiplier for the effect of this light on the diffuse response of
materials.
This is a non-physical control.
Declaration
``float inputs:diffuse = 1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetEnableColorTemperatureAttr() -> Attribute:
"""
GetEnableColorTemperatureAttr() -> Attribute
Enables using colorTemperature.
Declaration
``bool inputs:enableColorTemperature = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
@staticmethod
def GetExposureAttr() -> Attribute:
"""
GetExposureAttr() -> Attribute
Scales the power of the light exponentially as a power of 2 (similar
to an F-stop control over exposure).
The result is multiplied against the intensity.
Declaration
``float inputs:exposure = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetFiltersRel() -> Relationship:
"""
GetFiltersRel() -> Relationship
Relationship to the light filters that apply to this light.
"""
@staticmethod
def GetInput(name) -> Input:
"""
GetInput(name) -> Input
Return the requested input if it exists.
Parameters
----------
name : str
"""
@staticmethod
def GetInputs(onlyAuthored) -> list[Input]:
"""
GetInputs(onlyAuthored) -> list[Input]
Inputs are represented by attributes in the"inputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
@staticmethod
def GetIntensityAttr() -> Attribute:
"""
GetIntensityAttr() -> Attribute
Scales the power of the light linearly.
Declaration
``float inputs:intensity = 1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetLightLinkCollectionAPI() -> CollectionAPI:
"""
GetLightLinkCollectionAPI() -> CollectionAPI
Return the UsdCollectionAPI interface used for examining and modifying
the light-linking of this light.
Light-linking controls which geometry this light illuminates.
"""
@staticmethod
def GetMaterialSyncModeAttr() -> Attribute:
"""
GetMaterialSyncModeAttr() -> Attribute
For a LightAPI applied to geometry that has a bound Material, which is
entirely or partly emissive, this specifies the relationship of the
Material response to the lighting response.
Valid values are:
- materialGlowTintsLight: All primary and secondary rays see the
emissive/glow response as dictated by the bound Material while the
base color seen by light rays (which is then modulated by all of the
other LightAPI controls) is the multiplication of the color feeding
the emission/glow input of the Material (i.e. its surface or volume
shader) with the scalar or pattern input to *inputs:color*. This
allows the light's color to tint the geometry's glow color while
preserving access to intensity and other light controls as ways to
further modulate the illumination.
- independent: All primary and secondary rays see the emissive/glow
response as dictated by the bound Material, while the base color seen
by light rays is determined solely by *inputs:color*. Note that for
partially emissive geometry (in which some parts are reflective rather
than emissive), a suitable pattern must be connected to the light's
color input, or else the light will radiate uniformly from the
geometry.
- noMaterialResponse: The geometry behaves as if there is no
Material bound at all, i.e. there is no diffuse, specular, or
transmissive response. The base color of light rays is entirely
controlled by the *inputs:color*. This is the standard mode
for"canonical"lights in UsdLux and indicates to renderers that a
Material will either never be bound or can always be ignored.
Declaration
``uniform token light:materialSyncMode ="noMaterialResponse"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
materialGlowTintsLight, independent, noMaterialResponse
"""
@staticmethod
def GetNormalizeAttr() -> Attribute:
"""
GetNormalizeAttr() -> Attribute
Normalizes power by the surface area of the light.
This makes it easier to independently adjust the power and shape of
the light, by causing the power to not vary with the area or angular
size of the light.
Declaration
``bool inputs:normalize = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
@staticmethod
def GetOutput(name) -> Output:
"""
GetOutput(name) -> Output
Return the requested output if it exists.
Parameters
----------
name : str
"""
@staticmethod
def GetOutputs(onlyAuthored) -> list[Output]:
"""
GetOutputs(onlyAuthored) -> list[Output]
Outputs are represented by attributes in the"outputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def GetShaderId(renderContexts) -> str:
"""
GetShaderId(renderContexts) -> str
Return the light's shader ID for the given list of available
``renderContexts`` .
The shader ID returned by this function is the identifier to use when
looking up the shader definition for this light in the shader
registry.
The render contexts are expected to be listed in priority order, so
for each render context provided, this will try to find the shader ID
attribute specific to that render context (see
GetShaderIdAttrForRenderContext() ) and will return the value of the
first one found that has a non-empty value. If no shader ID value can
be found for any of the given render contexts or ``renderContexts`` is
empty, then this will return the value of the default shader ID
attribute (see GetShaderIdAttr() ).
Parameters
----------
renderContexts : list[TfToken]
"""
@staticmethod
def GetShaderIdAttr() -> Attribute:
"""
GetShaderIdAttr() -> Attribute
Default ID for the light's shader.
This defines the shader ID for this light when a render context
specific shader ID is not available.
The default shaderId for the intrinsic UsdLux lights (RectLight,
DistantLight, etc.) are set to default to the light's type name. For
each intrinsic UsdLux light, we will always register an SdrShaderNode
in the SdrRegistry, with the identifier matching the type name and the
source type"USD", that corresponds to the light's inputs.
GetShaderId
GetShaderIdAttrForRenderContext
SdrRegistry::GetShaderNodeByIdentifier
SdrRegistry::GetShaderNodeByIdentifierAndType
Declaration
``uniform token light:shaderId =""``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
"""
@staticmethod
def GetShaderIdAttrForRenderContext(renderContext) -> Attribute:
"""
GetShaderIdAttrForRenderContext(renderContext) -> Attribute
Returns the shader ID attribute for the given ``renderContext`` .
If ``renderContext`` is non-empty, this will try to return an
attribute named *light:shaderId* with the namespace prefix
``renderContext`` . For example, if the passed in render context
is"ri"then the attribute returned by this function would have the
following signature:
Declaration
``token ri:light:shaderId``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
If the render context is empty, this will return the default shader ID
attribute as returned by GetShaderIdAttr() .
Parameters
----------
renderContext : str
"""
@staticmethod
def GetShadowLinkCollectionAPI() -> CollectionAPI:
"""
GetShadowLinkCollectionAPI() -> CollectionAPI
Return the UsdCollectionAPI interface used for examining and modifying
the shadow-linking of this light.
Shadow-linking controls which geometry casts shadows from this light.
"""
@staticmethod
def GetSpecularAttr() -> Attribute:
"""
GetSpecularAttr() -> Attribute
A multiplier for the effect of this light on the specular response of
materials.
This is a non-physical control.
Declaration
``float inputs:specular = 1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 48
pass
class LightFilter(pxr.UsdGeom.Xformable, pxr.UsdGeom.Imageable, pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
A light filter modifies the effect of a light. Lights refer to filters
via relationships so that filters may be shared.
**Linking**
Filters can be linked to geometry. Linking controls which geometry a
light-filter affects, when considering the light filters attached to a
light illuminating the geometry.
Linking is specified as a collection (UsdCollectionAPI) which can be
accessed via GetFilterLinkCollection().
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdLuxTokens. So to set an attribute to the value"rightHanded", use
UsdLuxTokens->rightHanded as the value.
"""
@staticmethod
def ConnectableAPI() -> ConnectableAPI:
"""
ConnectableAPI() -> ConnectableAPI
Contructs and returns a UsdShadeConnectableAPI object with this light
filter.
Note that most tasks can be accomplished without explicitly
constructing a UsdShadeConnectable API, since connection-related API
such as UsdShadeConnectableAPI::ConnectToSource() are static methods,
and UsdLuxLightFilter will auto-convert to a UsdShadeConnectableAPI
when passed to functions that want to act generically on a connectable
UsdShadeConnectableAPI object.
"""
@staticmethod
def CreateInput(name, typeName) -> Input:
"""
CreateInput(name, typeName) -> Input
Create an input which can either have a value or can be connected.
The attribute representing the input is created in
the"inputs:"namespace. Inputs on light filters are connectable.
Parameters
----------
name : str
typeName : ValueTypeName
"""
@staticmethod
def CreateOutput(name, typeName) -> Output:
"""
CreateOutput(name, typeName) -> Output
Create an output which can either have a value or can be connected.
The attribute representing the output is created in
the"outputs:"namespace. Outputs on a light filter cannot be connected,
as their value is assumed to be computed externally.
Parameters
----------
name : str
typeName : ValueTypeName
"""
@staticmethod
def CreateShaderIdAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateShaderIdAttr(defaultValue, writeSparsely) -> Attribute
See GetShaderIdAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateShaderIdAttrForRenderContext(renderContext, defaultValue, writeSparsely) -> Attribute:
"""
CreateShaderIdAttrForRenderContext(renderContext, defaultValue, writeSparsely) -> Attribute
Creates the shader ID attribute for the given ``renderContext`` .
See GetShaderIdAttrForRenderContext() , and also Create vs Get
Property Methods for when to use Get vs Create. If specified, author
``defaultValue`` as the attribute's default, sparsely (when it makes
sense to do so) if ``writeSparsely`` is ``true`` - the default for
``writeSparsely`` is ``false`` .
Parameters
----------
renderContext : str
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> LightFilter
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> LightFilter
Return a UsdLuxLightFilter holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxLightFilter(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetFilterLinkCollectionAPI() -> CollectionAPI:
"""
GetFilterLinkCollectionAPI() -> CollectionAPI
Return the UsdCollectionAPI interface used for examining and modifying
the filter-linking of this light filter.
Linking controls which geometry this light filter affects.
"""
@staticmethod
def GetInput(name) -> Input:
"""
GetInput(name) -> Input
Return the requested input if it exists.
Parameters
----------
name : str
"""
@staticmethod
def GetInputs(onlyAuthored) -> list[Input]:
"""
GetInputs(onlyAuthored) -> list[Input]
Inputs are represented by attributes in the"inputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
@staticmethod
def GetOutput(name) -> Output:
"""
GetOutput(name) -> Output
Return the requested output if it exists.
Parameters
----------
name : str
"""
@staticmethod
def GetOutputs(onlyAuthored) -> list[Output]:
"""
GetOutputs(onlyAuthored) -> list[Output]
Outputs are represented by attributes in the"outputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def GetShaderId(renderContexts) -> str:
"""
GetShaderId(renderContexts) -> str
Return the light filter's shader ID for the given list of available
``renderContexts`` .
The shader ID returned by this function is the identifier to use when
looking up the shader definition for this light filter in the shader
registry.
The render contexts are expected to be listed in priority order, so
for each render context provided, this will try to find the shader ID
attribute specific to that render context (see
GetShaderIdAttrForRenderContext() ) and will return the value of the
first one found that has a non-empty value. If no shader ID value can
be found for any of the given render contexts or ``renderContexts`` is
empty, then this will return the value of the default shader ID
attribute (see GetShaderIdAttr() ).
Parameters
----------
renderContexts : list[TfToken]
"""
@staticmethod
def GetShaderIdAttr() -> Attribute:
"""
GetShaderIdAttr() -> Attribute
Default ID for the light filter's shader.
This defines the shader ID for this light filter when a render context
specific shader ID is not available.
GetShaderId
GetShaderIdAttrForRenderContext
SdrRegistry::GetShaderNodeByIdentifier
SdrRegistry::GetShaderNodeByIdentifierAndType
Declaration
``uniform token lightFilter:shaderId =""``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
"""
@staticmethod
def GetShaderIdAttrForRenderContext(renderContext) -> Attribute:
"""
GetShaderIdAttrForRenderContext(renderContext) -> Attribute
Returns the shader ID attribute for the given ``renderContext`` .
If ``renderContext`` is non-empty, this will try to return an
attribute named *lightFilter:shaderId* with the namespace prefix
``renderContext`` . For example, if the passed in render context
is"ri"then the attribute returned by this function would have the
following signature:
Declaration
``token ri:lightFilter:shaderId``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
If the render context is empty, this will return the default shader ID
attribute as returned by GetShaderIdAttr() .
Parameters
----------
renderContext : str
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class LightListAPI(pxr.Usd.APISchemaBase, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
API schema to support discovery and publishing of lights in a scene.
Discovering Lights via Traversal
================================
To motivate this API, consider what is required to discover all lights
in a scene. We must load all payloads and traverse all prims:
.. code-block:: text
01 // Load everything on the stage so we can find all lights,
02 // including those inside payloads
03 stage->Load();
04
05 // Traverse all prims, checking if they have an applied UsdLuxLightAPI
06 // (Note: ignoring instancing and a few other things for simplicity)
07 SdfPathVector lights;
08 for (UsdPrim prim: stage->Traverse()) {
09 if (prim.HasAPI<UsdLuxLightAPI>()) {
10 lights.push_back(i->GetPath());
11 }
12 }
This traversal suitably elaborated to handle certain details is the
first and simplest thing UsdLuxLightListAPI provides.
UsdLuxLightListAPI::ComputeLightList() performs this traversal and
returns all lights in the scene:
.. code-block:: text
01 UsdLuxLightListAPI listAPI(stage->GetPseudoRoot());
02 SdfPathVector lights = listAPI.ComputeLightList();
Publishing a Cached Light List
==============================
Consider a USD client that needs to quickly discover lights but wants
to defer loading payloads and traversing the entire scene where
possible, and is willing to do up-front computation and caching to
achieve that.
UsdLuxLightListAPI provides a way to cache the computed light list, by
publishing the list of lights onto prims in the model hierarchy.
Consider a big set that contains lights:
.. code-block:: text
01 def Xform "BigSetWithLights" (
02 kind = "assembly"
03 payload = @BigSetWithLights.usd@ // Heavy payload
04 ) {
05 // Pre-computed, cached list of lights inside payload
06 rel lightList = [
07 <./Lights/light_1>,
08 <./Lights/light_2>,
09 \.\.\.
10 ]
11 token lightList:cacheBehavior = "consumeAndContinue";
12 }
The lightList relationship encodes a set of lights, and the
lightList:cacheBehavior property provides fine-grained control over
how to use that cache. (See details below.)
The cache can be created by first invoking
ComputeLightList(ComputeModeIgnoreCache) to pre-compute the list and
then storing the result with UsdLuxLightListAPI::StoreLightList() .
To enable efficient retrieval of the cache, it should be stored on a
model hierarchy prim. Furthermore, note that while you can use a
UsdLuxLightListAPI bound to the pseudo-root prim to query the lights
(as in the example above) because it will perform a traversal over
descendants, you cannot store the cache back to the pseduo-root prim.
To consult the cached list, we invoke
ComputeLightList(ComputeModeConsultModelHierarchyCache):
.. code-block:: text
01 // Find and load all lights, using lightList cache where available
02 UsdLuxLightListAPI list(stage->GetPseudoRoot());
03 SdfPathSet lights = list.ComputeLightList(
04 UsdLuxLightListAPI::ComputeModeConsultModelHierarchyCache);
05 stage.LoadAndUnload(lights, SdfPathSet());
In this mode, ComputeLightList() will traverse the model hierarchy,
accumulating cached light lists.
Controlling Cache Behavior
==========================
The lightList:cacheBehavior property gives additional fine-grained
control over cache behavior:
- The fallback value,"ignore", indicates that the lightList should
be disregarded. This provides a way to invalidate cache entries. Note
that unless"ignore"is specified, a lightList with an empty list of
targets is considered a cache indicating that no lights are present.
- The value"consumeAndContinue"indicates that the cache should be
consulted to contribute lights to the scene, and that recursion should
continue down the model hierarchy in case additional lights are added
as descedants. This is the default value established when
StoreLightList() is invoked. This behavior allows the lights within a
large model, such as the BigSetWithLights example above, to be
published outside the payload, while also allowing referencing and
layering to add additional lights over that set.
- The value"consumeAndHalt"provides a way to terminate recursive
traversal of the scene for light discovery. The cache will be
consulted but no descendant prims will be examined.
Instancing
==========
Where instances are present, UsdLuxLightListAPI::ComputeLightList()
will return the instance-unique paths to any lights discovered within
those instances. Lights within a UsdGeomPointInstancer will not be
returned, however, since they cannot be referred to solely via paths.
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdLuxTokens. So to set an attribute to the value"rightHanded", use
UsdLuxTokens->rightHanded as the value.
"""
class ComputeMode(pxr.Tf.Tf_PyEnumWrapper, pxr.Tf.Enum, Boost.Python.instance):
"""
Runtime control over whether to consult stored lightList caches.
"""
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = 'LightListAPI'
allValues: tuple # value = (UsdLux.LightListAPI.ComputeModeConsultModelHierarchyCache, UsdLux.LightListAPI.ComputeModeIgnoreCache)
pass
@staticmethod
def Apply(*args, **kwargs) -> None:
"""
**classmethod** Apply(prim) -> LightListAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"LightListAPI"to the token-valued,
listOp metadata *apiSchemas* on the prim.
A valid UsdLuxLightListAPI object is returned upon success. An invalid
(or empty) UsdLuxLightListAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
@staticmethod
def CanApply(*args, **kwargs) -> None:
"""
**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
@staticmethod
def ComputeLightList(mode) -> SdfPathSet:
"""
ComputeLightList(mode) -> SdfPathSet
Computes and returns the list of lights and light filters in the
stage, optionally consulting a cached result.
In ComputeModeIgnoreCache mode, caching is ignored, and this does a
prim traversal looking for prims that have a UsdLuxLightAPI or are of
type UsdLuxLightFilter.
In ComputeModeConsultModelHierarchyCache, this does a traversal only
of the model hierarchy. In this traversal, any lights that live as
model hierarchy prims are accumulated, as well as any paths stored in
lightList caches. The lightList:cacheBehavior attribute gives further
control over the cache behavior; see the class overview for details.
When instances are present, ComputeLightList(ComputeModeIgnoreCache)
will return the instance-uniqiue paths to any lights discovered within
those instances. Lights within a UsdGeomPointInstancer will not be
returned, however, since they cannot be referred to solely via paths.
Parameters
----------
mode : ComputeMode
"""
@staticmethod
def CreateLightListCacheBehaviorAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateLightListCacheBehaviorAttr(defaultValue, writeSparsely) -> Attribute
See GetLightListCacheBehaviorAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateLightListRel() -> Relationship:
"""
CreateLightListRel() -> Relationship
See GetLightListRel() , and also Create vs Get Property Methods for
when to use Get vs Create.
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> LightListAPI
Return a UsdLuxLightListAPI holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxLightListAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetLightListCacheBehaviorAttr() -> Attribute:
"""
GetLightListCacheBehaviorAttr() -> Attribute
Controls how the lightList should be interpreted.
Valid values are:
- consumeAndHalt: The lightList should be consulted, and if it
exists, treated as a final authoritative statement of any lights that
exist at or below this prim, halting recursive discovery of lights.
- consumeAndContinue: The lightList should be consulted, but
recursive traversal over nameChildren should continue in case
additional lights are added by descendants.
- ignore: The lightList should be entirely ignored. This provides a
simple way to temporarily invalidate an existing cache. This is the
fallback behavior.
Declaration
``token lightList:cacheBehavior``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Allowed Values
consumeAndHalt, consumeAndContinue, ignore
"""
@staticmethod
def GetLightListRel() -> Relationship:
"""
GetLightListRel() -> Relationship
Relationship to lights in the scene.
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def InvalidateLightList() -> None:
"""
InvalidateLightList() -> None
Mark any stored lightlist as invalid, by setting the
lightList:cacheBehavior attribute to ignore.
"""
@staticmethod
def StoreLightList(arg1) -> None:
"""
StoreLightList(arg1) -> None
Store the given paths as the lightlist for this prim.
Paths that do not have this prim's path as a prefix will be silently
ignored. This will set the listList:cacheBehavior
to"consumeAndContinue".
Parameters
----------
arg1 : SdfPathSet
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
ComputeModeConsultModelHierarchyCache: pxr.UsdLux.ComputeMode # value = UsdLux.LightListAPI.ComputeModeConsultModelHierarchyCache
ComputeModeIgnoreCache: pxr.UsdLux.ComputeMode # value = UsdLux.LightListAPI.ComputeModeIgnoreCache
__instance_size__ = 48
pass
class ListAPI(pxr.Usd.APISchemaBase, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Deprecated
Use LightListAPI instead
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdLuxTokens. So to set an attribute to the value"rightHanded", use
UsdLuxTokens->rightHanded as the value.
"""
class ComputeMode(pxr.Tf.Tf_PyEnumWrapper, pxr.Tf.Enum, Boost.Python.instance):
"""
Runtime control over whether to consult stored lightList caches.
"""
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = 'ListAPI'
allValues: tuple # value = (UsdLux.ListAPI.ComputeModeConsultModelHierarchyCache, UsdLux.ListAPI.ComputeModeIgnoreCache)
pass
@staticmethod
def Apply(*args, **kwargs) -> None:
"""
**classmethod** Apply(prim) -> ListAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"ListAPI"to the token-valued,
listOp metadata *apiSchemas* on the prim.
A valid UsdLuxListAPI object is returned upon success. An invalid (or
empty) UsdLuxListAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
@staticmethod
def CanApply(*args, **kwargs) -> None:
"""
**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
@staticmethod
def ComputeLightList(mode) -> SdfPathSet:
"""
ComputeLightList(mode) -> SdfPathSet
Computes and returns the list of lights and light filters in the
stage, optionally consulting a cached result.
In ComputeModeIgnoreCache mode, caching is ignored, and this does a
prim traversal looking for prims that have a UsdLuxLightAPI or are of
type UsdLuxLightFilter.
In ComputeModeConsultModelHierarchyCache, this does a traversal only
of the model hierarchy. In this traversal, any lights that live as
model hierarchy prims are accumulated, as well as any paths stored in
lightList caches. The lightList:cacheBehavior attribute gives further
control over the cache behavior; see the class overview for details.
When instances are present, ComputeLightList(ComputeModeIgnoreCache)
will return the instance-uniqiue paths to any lights discovered within
those instances. Lights within a UsdGeomPointInstancer will not be
returned, however, since they cannot be referred to solely via paths.
Parameters
----------
mode : ComputeMode
"""
@staticmethod
def CreateLightListCacheBehaviorAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateLightListCacheBehaviorAttr(defaultValue, writeSparsely) -> Attribute
See GetLightListCacheBehaviorAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateLightListRel() -> Relationship:
"""
CreateLightListRel() -> Relationship
See GetLightListRel() , and also Create vs Get Property Methods for
when to use Get vs Create.
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> ListAPI
Return a UsdLuxListAPI holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxListAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetLightListCacheBehaviorAttr() -> Attribute:
"""
GetLightListCacheBehaviorAttr() -> Attribute
Controls how the lightList should be interpreted.
Valid values are:
- consumeAndHalt: The lightList should be consulted, and if it
exists, treated as a final authoritative statement of any lights that
exist at or below this prim, halting recursive discovery of lights.
- consumeAndContinue: The lightList should be consulted, but
recursive traversal over nameChildren should continue in case
additional lights are added by descendants.
- ignore: The lightList should be entirely ignored. This provides a
simple way to temporarily invalidate an existing cache. This is the
fallback behavior.
Declaration
``token lightList:cacheBehavior``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Allowed Values
consumeAndHalt, consumeAndContinue, ignore
"""
@staticmethod
def GetLightListRel() -> Relationship:
"""
GetLightListRel() -> Relationship
Relationship to lights in the scene.
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def InvalidateLightList() -> None:
"""
InvalidateLightList() -> None
Mark any stored lightlist as invalid, by setting the
lightList:cacheBehavior attribute to ignore.
"""
@staticmethod
def StoreLightList(arg1) -> None:
"""
StoreLightList(arg1) -> None
Store the given paths as the lightlist for this prim.
Paths that do not have this prim's path as a prefix will be silently
ignored. This will set the listList:cacheBehavior
to"consumeAndContinue".
Parameters
----------
arg1 : SdfPathSet
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
ComputeModeConsultModelHierarchyCache: pxr.UsdLux.ComputeMode # value = UsdLux.ListAPI.ComputeModeConsultModelHierarchyCache
ComputeModeIgnoreCache: pxr.UsdLux.ComputeMode # value = UsdLux.ListAPI.ComputeModeIgnoreCache
__instance_size__ = 48
pass
class MeshLightAPI(pxr.Usd.APISchemaBase, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
This is the preferred API schema to apply to Mesh type prims when
adding light behaviors to a mesh. At its base, this API schema has the
built-in behavior of applying LightAPI to the mesh and overriding the
default materialSyncMode to allow the emission/glow of the bound
material to affect the color of the light. But, it additionally serves
as a hook for plugins to attach additional properties to"mesh
lights"through the creation of API schemas which are authored to auto-
apply to MeshLightAPI.
Auto applied API schemas
"""
@staticmethod
def Apply(*args, **kwargs) -> None:
"""
**classmethod** Apply(prim) -> MeshLightAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"MeshLightAPI"to the token-valued,
listOp metadata *apiSchemas* on the prim.
A valid UsdLuxMeshLightAPI object is returned upon success. An invalid
(or empty) UsdLuxMeshLightAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
@staticmethod
def CanApply(*args, **kwargs) -> None:
"""
**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> MeshLightAPI
Return a UsdLuxMeshLightAPI holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxMeshLightAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 48
pass
class NonboundableLightBase(pxr.UsdGeom.Xformable, pxr.UsdGeom.Imageable, pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Base class for intrinsic lights that are not boundable.
The primary purpose of this class is to provide a direct API to the
functions provided by LightAPI for concrete derived light types.
"""
@staticmethod
def CreateColorAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateColorAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateColorAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateColorTemperatureAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateColorTemperatureAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateColorTemperatureAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateDiffuseAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateDiffuseAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateDiffuseAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateEnableColorTemperatureAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateEnableColorTemperatureAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateEnableColorTemperatureAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateExposureAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateExposureAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateExposureAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateFiltersRel() -> Relationship:
"""
CreateFiltersRel() -> Relationship
See UsdLuxLightAPI::CreateFiltersRel() .
"""
@staticmethod
def CreateIntensityAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateIntensityAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateIntensityAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateNormalizeAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateNormalizeAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateNormalizeAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateSpecularAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateSpecularAttr(defaultValue, writeSparsely) -> Attribute
See UsdLuxLightAPI::CreateSpecularAttr() .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> NonboundableLightBase
Return a UsdLuxNonboundableLightBase holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxNonboundableLightBase(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetColorAttr() -> Attribute:
"""
GetColorAttr() -> Attribute
See UsdLuxLightAPI::GetColorAttr() .
"""
@staticmethod
def GetColorTemperatureAttr() -> Attribute:
"""
GetColorTemperatureAttr() -> Attribute
See UsdLuxLightAPI::GetColorTemperatureAttr() .
"""
@staticmethod
def GetDiffuseAttr() -> Attribute:
"""
GetDiffuseAttr() -> Attribute
See UsdLuxLightAPI::GetDiffuseAttr() .
"""
@staticmethod
def GetEnableColorTemperatureAttr() -> Attribute:
"""
GetEnableColorTemperatureAttr() -> Attribute
See UsdLuxLightAPI::GetEnableColorTemperatureAttr() .
"""
@staticmethod
def GetExposureAttr() -> Attribute:
"""
GetExposureAttr() -> Attribute
See UsdLuxLightAPI::GetExposureAttr() .
"""
@staticmethod
def GetFiltersRel() -> Relationship:
"""
GetFiltersRel() -> Relationship
See UsdLuxLightAPI::GetFiltersRel() .
"""
@staticmethod
def GetIntensityAttr() -> Attribute:
"""
GetIntensityAttr() -> Attribute
See UsdLuxLightAPI::GetIntensityAttr() .
"""
@staticmethod
def GetNormalizeAttr() -> Attribute:
"""
GetNormalizeAttr() -> Attribute
See UsdLuxLightAPI::GetNormalizeAttr() .
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def GetSpecularAttr() -> Attribute:
"""
GetSpecularAttr() -> Attribute
See UsdLuxLightAPI::GetSpecularAttr() .
"""
@staticmethod
def LightAPI() -> LightAPI:
"""
LightAPI() -> LightAPI
Contructs and returns a UsdLuxLightAPI object for this light.
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class PluginLight(pxr.UsdGeom.Xformable, pxr.UsdGeom.Imageable, pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Light that provides properties that allow it to identify an external
SdrShadingNode definition, through UsdShadeNodeDefAPI, that can be
provided to render delegates without the need to provide a schema
definition for the light's type.
Plugin Lights and Light Filters
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> PluginLight
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> PluginLight
Return a UsdLuxPluginLight holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxPluginLight(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetNodeDefAPI() -> NodeDefAPI:
"""
GetNodeDefAPI() -> NodeDefAPI
Convenience method for accessing the UsdShadeNodeDefAPI functionality
for this prim.
One can also construct a UsdShadeNodeDefAPI directly from a UsdPrim.
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class PluginLightFilter(LightFilter, pxr.UsdGeom.Xformable, pxr.UsdGeom.Imageable, pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Light filter that provides properties that allow it to identify an
external SdrShadingNode definition, through UsdShadeNodeDefAPI, that
can be provided to render delegates without the need to provide a
schema definition for the light filter's type.
Plugin Lights and Light Filters
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> PluginLightFilter
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> PluginLightFilter
Return a UsdLuxPluginLightFilter holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxPluginLightFilter(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetNodeDefAPI() -> NodeDefAPI:
"""
GetNodeDefAPI() -> NodeDefAPI
Convenience method for accessing the UsdShadeNodeDefAPI functionality
for this prim.
One can also construct a UsdShadeNodeDefAPI directly from a UsdPrim.
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class PortalLight(BoundableLightBase, pxr.UsdGeom.Boundable, pxr.UsdGeom.Xformable, pxr.UsdGeom.Imageable, pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
A rectangular portal in the local XY plane that guides sampling of a
dome light. Transmits light in the -Z direction. The rectangle is 1
unit in length.
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> PortalLight
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> PortalLight
Return a UsdLuxPortalLight holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxPortalLight(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class RectLight(BoundableLightBase, pxr.UsdGeom.Boundable, pxr.UsdGeom.Xformable, pxr.UsdGeom.Imageable, pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Light emitted from one side of a rectangle. The rectangle is centered
in the XY plane and emits light along the -Z axis. The rectangle is 1
unit in length in the X and Y axis. In the default position, a texture
file's min coordinates should be at (+X, +Y) and max coordinates at
(-X, -Y).
"""
@staticmethod
def CreateHeightAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateHeightAttr(defaultValue, writeSparsely) -> Attribute
See GetHeightAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateTextureFileAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateTextureFileAttr(defaultValue, writeSparsely) -> Attribute
See GetTextureFileAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateWidthAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateWidthAttr(defaultValue, writeSparsely) -> Attribute
See GetWidthAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> RectLight
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> RectLight
Return a UsdLuxRectLight holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxRectLight(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetHeightAttr() -> Attribute:
"""
GetHeightAttr() -> Attribute
Height of the rectangle, in the local Y axis.
Declaration
``float inputs:height = 1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def GetTextureFileAttr() -> Attribute:
"""
GetTextureFileAttr() -> Attribute
A color texture to use on the rectangle.
Declaration
``asset inputs:texture:file``
C++ Type
SdfAssetPath
Usd Type
SdfValueTypeNames->Asset
"""
@staticmethod
def GetWidthAttr() -> Attribute:
"""
GetWidthAttr() -> Attribute
Width of the rectangle, in the local X axis.
Declaration
``float inputs:width = 1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class ShadowAPI(pxr.Usd.APISchemaBase, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Controls to refine a light's shadow behavior. These are non-physical
controls that are valuable for visual lighting work.
"""
@staticmethod
def Apply(*args, **kwargs) -> None:
"""
**classmethod** Apply(prim) -> ShadowAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"ShadowAPI"to the token-valued,
listOp metadata *apiSchemas* on the prim.
A valid UsdLuxShadowAPI object is returned upon success. An invalid
(or empty) UsdLuxShadowAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
@staticmethod
def CanApply(*args, **kwargs) -> None:
"""
**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
@staticmethod
def ConnectableAPI() -> ConnectableAPI:
"""
ConnectableAPI() -> ConnectableAPI
Contructs and returns a UsdShadeConnectableAPI object with this shadow
API prim.
Note that a valid UsdLuxShadowAPI will only return a valid
UsdShadeConnectableAPI if the its prim's Typed schema type is actually
connectable.
"""
@staticmethod
def CreateInput(name, typeName) -> Input:
"""
CreateInput(name, typeName) -> Input
Create an input which can either have a value or can be connected.
The attribute representing the input is created in
the"inputs:"namespace. Inputs on shadow API are connectable.
Parameters
----------
name : str
typeName : ValueTypeName
"""
@staticmethod
def CreateOutput(name, typeName) -> Output:
"""
CreateOutput(name, typeName) -> Output
Create an output which can either have a value or can be connected.
The attribute representing the output is created in
the"outputs:"namespace. Outputs on a shadow API cannot be connected,
as their value is assumed to be computed externally.
Parameters
----------
name : str
typeName : ValueTypeName
"""
@staticmethod
def CreateShadowColorAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateShadowColorAttr(defaultValue, writeSparsely) -> Attribute
See GetShadowColorAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateShadowDistanceAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateShadowDistanceAttr(defaultValue, writeSparsely) -> Attribute
See GetShadowDistanceAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateShadowEnableAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateShadowEnableAttr(defaultValue, writeSparsely) -> Attribute
See GetShadowEnableAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateShadowFalloffAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateShadowFalloffAttr(defaultValue, writeSparsely) -> Attribute
See GetShadowFalloffAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateShadowFalloffGammaAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateShadowFalloffGammaAttr(defaultValue, writeSparsely) -> Attribute
See GetShadowFalloffGammaAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> ShadowAPI
Return a UsdLuxShadowAPI holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxShadowAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetInput(name) -> Input:
"""
GetInput(name) -> Input
Return the requested input if it exists.
Parameters
----------
name : str
"""
@staticmethod
def GetInputs(onlyAuthored) -> list[Input]:
"""
GetInputs(onlyAuthored) -> list[Input]
Inputs are represented by attributes in the"inputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
@staticmethod
def GetOutput(name) -> Output:
"""
GetOutput(name) -> Output
Return the requested output if it exists.
Parameters
----------
name : str
"""
@staticmethod
def GetOutputs(onlyAuthored) -> list[Output]:
"""
GetOutputs(onlyAuthored) -> list[Output]
Outputs are represented by attributes in the"outputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def GetShadowColorAttr() -> Attribute:
"""
GetShadowColorAttr() -> Attribute
The color of shadows cast by the light.
This is a non-physical control. The default is to cast black shadows.
Declaration
``color3f inputs:shadow:color = (0, 0, 0)``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Color3f
"""
@staticmethod
def GetShadowDistanceAttr() -> Attribute:
"""
GetShadowDistanceAttr() -> Attribute
The maximum distance shadows are cast.
The default value (-1) indicates no limit.
Declaration
``float inputs:shadow:distance = -1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetShadowEnableAttr() -> Attribute:
"""
GetShadowEnableAttr() -> Attribute
Enables shadows to be cast by this light.
Declaration
``bool inputs:shadow:enable = 1``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
@staticmethod
def GetShadowFalloffAttr() -> Attribute:
"""
GetShadowFalloffAttr() -> Attribute
The near distance at which shadow falloff begins.
The default value (-1) indicates no falloff.
Declaration
``float inputs:shadow:falloff = -1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetShadowFalloffGammaAttr() -> Attribute:
"""
GetShadowFalloffGammaAttr() -> Attribute
A gamma (i.e., exponential) control over shadow strength with linear
distance within the falloff zone.
This requires the use of shadowDistance and shadowFalloff.
Declaration
``float inputs:shadow:falloffGamma = 1``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 48
pass
class ShapingAPI(pxr.Usd.APISchemaBase, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Controls for shaping a light's emission.
"""
@staticmethod
def Apply(*args, **kwargs) -> None:
"""
**classmethod** Apply(prim) -> ShapingAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"ShapingAPI"to the token-valued,
listOp metadata *apiSchemas* on the prim.
A valid UsdLuxShapingAPI object is returned upon success. An invalid
(or empty) UsdLuxShapingAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
@staticmethod
def CanApply(*args, **kwargs) -> None:
"""
**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
@staticmethod
def ConnectableAPI() -> ConnectableAPI:
"""
ConnectableAPI() -> ConnectableAPI
Contructs and returns a UsdShadeConnectableAPI object with this
shaping API prim.
Note that a valid UsdLuxShapingAPI will only return a valid
UsdShadeConnectableAPI if the its prim's Typed schema type is actually
connectable.
"""
@staticmethod
def CreateInput(name, typeName) -> Input:
"""
CreateInput(name, typeName) -> Input
Create an input which can either have a value or can be connected.
The attribute representing the input is created in
the"inputs:"namespace. Inputs on shaping API are connectable.
Parameters
----------
name : str
typeName : ValueTypeName
"""
@staticmethod
def CreateOutput(name, typeName) -> Output:
"""
CreateOutput(name, typeName) -> Output
Create an output which can either have a value or can be connected.
The attribute representing the output is created in
the"outputs:"namespace. Outputs on a shaping API cannot be connected,
as their value is assumed to be computed externally.
Parameters
----------
name : str
typeName : ValueTypeName
"""
@staticmethod
def CreateShapingConeAngleAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateShapingConeAngleAttr(defaultValue, writeSparsely) -> Attribute
See GetShapingConeAngleAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateShapingConeSoftnessAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateShapingConeSoftnessAttr(defaultValue, writeSparsely) -> Attribute
See GetShapingConeSoftnessAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateShapingFocusAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateShapingFocusAttr(defaultValue, writeSparsely) -> Attribute
See GetShapingFocusAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateShapingFocusTintAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateShapingFocusTintAttr(defaultValue, writeSparsely) -> Attribute
See GetShapingFocusTintAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateShapingIesAngleScaleAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateShapingIesAngleScaleAttr(defaultValue, writeSparsely) -> Attribute
See GetShapingIesAngleScaleAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateShapingIesFileAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateShapingIesFileAttr(defaultValue, writeSparsely) -> Attribute
See GetShapingIesFileAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateShapingIesNormalizeAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateShapingIesNormalizeAttr(defaultValue, writeSparsely) -> Attribute
See GetShapingIesNormalizeAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> ShapingAPI
Return a UsdLuxShapingAPI holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxShapingAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetInput(name) -> Input:
"""
GetInput(name) -> Input
Return the requested input if it exists.
Parameters
----------
name : str
"""
@staticmethod
def GetInputs(onlyAuthored) -> list[Input]:
"""
GetInputs(onlyAuthored) -> list[Input]
Inputs are represented by attributes in the"inputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
@staticmethod
def GetOutput(name) -> Output:
"""
GetOutput(name) -> Output
Return the requested output if it exists.
Parameters
----------
name : str
"""
@staticmethod
def GetOutputs(onlyAuthored) -> list[Output]:
"""
GetOutputs(onlyAuthored) -> list[Output]
Outputs are represented by attributes in the"outputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def GetShapingConeAngleAttr() -> Attribute:
"""
GetShapingConeAngleAttr() -> Attribute
Angular limit off the primary axis to restrict the light spread.
Declaration
``float inputs:shaping:cone:angle = 90``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetShapingConeSoftnessAttr() -> Attribute:
"""
GetShapingConeSoftnessAttr() -> Attribute
Controls the cutoff softness for cone angle.
TODO: clarify semantics
Declaration
``float inputs:shaping:cone:softness = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetShapingFocusAttr() -> Attribute:
"""
GetShapingFocusAttr() -> Attribute
A control to shape the spread of light.
Higher focus values pull light towards the center and narrow the
spread. Implemented as an off-axis cosine power exponent. TODO:
clarify semantics
Declaration
``float inputs:shaping:focus = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetShapingFocusTintAttr() -> Attribute:
"""
GetShapingFocusTintAttr() -> Attribute
Off-axis color tint.
This tints the emission in the falloff region. The default tint is
black. TODO: clarify semantics
Declaration
``color3f inputs:shaping:focusTint = (0, 0, 0)``
C++ Type
GfVec3f
Usd Type
SdfValueTypeNames->Color3f
"""
@staticmethod
def GetShapingIesAngleScaleAttr() -> Attribute:
"""
GetShapingIesAngleScaleAttr() -> Attribute
Rescales the angular distribution of the IES profile.
TODO: clarify semantics
Declaration
``float inputs:shaping:ies:angleScale = 0``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetShapingIesFileAttr() -> Attribute:
"""
GetShapingIesFileAttr() -> Attribute
An IES (Illumination Engineering Society) light profile describing the
angular distribution of light.
Declaration
``asset inputs:shaping:ies:file``
C++ Type
SdfAssetPath
Usd Type
SdfValueTypeNames->Asset
"""
@staticmethod
def GetShapingIesNormalizeAttr() -> Attribute:
"""
GetShapingIesNormalizeAttr() -> Attribute
Normalizes the IES profile so that it affects the shaping of the light
while preserving the overall energy output.
Declaration
``bool inputs:shaping:ies:normalize = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 48
pass
class SphereLight(BoundableLightBase, pxr.UsdGeom.Boundable, pxr.UsdGeom.Xformable, pxr.UsdGeom.Imageable, pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Light emitted outward from a sphere.
"""
@staticmethod
def CreateRadiusAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateRadiusAttr(defaultValue, writeSparsely) -> Attribute
See GetRadiusAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateTreatAsPointAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateTreatAsPointAttr(defaultValue, writeSparsely) -> Attribute
See GetTreatAsPointAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> SphereLight
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> SphereLight
Return a UsdLuxSphereLight holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxSphereLight(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetRadiusAttr() -> Attribute:
"""
GetRadiusAttr() -> Attribute
Radius of the sphere.
Declaration
``float inputs:radius = 0.5``
C++ Type
float
Usd Type
SdfValueTypeNames->Float
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def GetTreatAsPointAttr() -> Attribute:
"""
GetTreatAsPointAttr() -> Attribute
A hint that this light can be treated as a'point'light (effectively, a
zero-radius sphere) by renderers that benefit from non-area lighting.
Renderers that only support area lights can disregard this.
Declaration
``bool treatAsPoint = 0``
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class Tokens(Boost.Python.instance):
angular = 'angular'
automatic = 'automatic'
collectionFilterLinkIncludeRoot = 'collection:filterLink:includeRoot'
collectionLightLinkIncludeRoot = 'collection:lightLink:includeRoot'
collectionShadowLinkIncludeRoot = 'collection:shadowLink:includeRoot'
consumeAndContinue = 'consumeAndContinue'
consumeAndHalt = 'consumeAndHalt'
cubeMapVerticalCross = 'cubeMapVerticalCross'
cylinderLight = 'CylinderLight'
diskLight = 'DiskLight'
distantLight = 'DistantLight'
domeLight = 'DomeLight'
extent = 'extent'
filterLink = 'filterLink'
geometry = 'geometry'
geometryLight = 'GeometryLight'
guideRadius = 'guideRadius'
ignore = 'ignore'
independent = 'independent'
inputsAngle = 'inputs:angle'
inputsColor = 'inputs:color'
inputsColorTemperature = 'inputs:colorTemperature'
inputsDiffuse = 'inputs:diffuse'
inputsEnableColorTemperature = 'inputs:enableColorTemperature'
inputsExposure = 'inputs:exposure'
inputsHeight = 'inputs:height'
inputsIntensity = 'inputs:intensity'
inputsLength = 'inputs:length'
inputsNormalize = 'inputs:normalize'
inputsRadius = 'inputs:radius'
inputsShadowColor = 'inputs:shadow:color'
inputsShadowDistance = 'inputs:shadow:distance'
inputsShadowEnable = 'inputs:shadow:enable'
inputsShadowFalloff = 'inputs:shadow:falloff'
inputsShadowFalloffGamma = 'inputs:shadow:falloffGamma'
inputsShapingConeAngle = 'inputs:shaping:cone:angle'
inputsShapingConeSoftness = 'inputs:shaping:cone:softness'
inputsShapingFocus = 'inputs:shaping:focus'
inputsShapingFocusTint = 'inputs:shaping:focusTint'
inputsShapingIesAngleScale = 'inputs:shaping:ies:angleScale'
inputsShapingIesFile = 'inputs:shaping:ies:file'
inputsShapingIesNormalize = 'inputs:shaping:ies:normalize'
inputsSpecular = 'inputs:specular'
inputsTextureFile = 'inputs:texture:file'
inputsTextureFormat = 'inputs:texture:format'
inputsWidth = 'inputs:width'
latlong = 'latlong'
lightFilterShaderId = 'lightFilter:shaderId'
lightFilters = 'light:filters'
lightLink = 'lightLink'
lightList = 'lightList'
lightListCacheBehavior = 'lightList:cacheBehavior'
lightMaterialSyncMode = 'light:materialSyncMode'
lightShaderId = 'light:shaderId'
materialGlowTintsLight = 'materialGlowTintsLight'
meshLight = 'MeshLight'
mirroredBall = 'mirroredBall'
noMaterialResponse = 'noMaterialResponse'
orientToStageUpAxis = 'orientToStageUpAxis'
portalLight = 'PortalLight'
portals = 'portals'
rectLight = 'RectLight'
shadowLink = 'shadowLink'
sphereLight = 'SphereLight'
treatAsLine = 'treatAsLine'
treatAsPoint = 'treatAsPoint'
volumeLight = 'VolumeLight'
pass
class VolumeLightAPI(pxr.Usd.APISchemaBase, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
This is the preferred API schema to apply to Volume type prims when
adding light behaviors to a volume. At its base, this API schema has
the built-in behavior of applying LightAPI to the volume and
overriding the default materialSyncMode to allow the emission/glow of
the bound material to affect the color of the light. But, it
additionally serves as a hook for plugins to attach additional
properties to"volume lights"through the creation of API schemas which
are authored to auto-apply to VolumeLightAPI.
Auto applied API schemas
"""
@staticmethod
def Apply(*args, **kwargs) -> None:
"""
**classmethod** Apply(prim) -> VolumeLightAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"VolumeLightAPI"to the token-
valued, listOp metadata *apiSchemas* on the prim.
A valid UsdLuxVolumeLightAPI object is returned upon success. An
invalid (or empty) UsdLuxVolumeLightAPI object is returned upon
failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
@staticmethod
def CanApply(*args, **kwargs) -> None:
"""
**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> VolumeLightAPI
Return a UsdLuxVolumeLightAPI holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdLuxVolumeLightAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 48
pass
class _CanApplyResult(Boost.Python.instance):
@property
def whyNot(self) -> None:
"""
:type: None
"""
__instance_size__ = 56
pass
def BlackbodyTemperatureAsRgb(*args, **kwargs) -> None:
pass
__MFB_FULL_PACKAGE_NAME = 'usdLux'
| 151,819 | unknown | 26.760102 | 167 | 0.621642 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Gf/__init__.py | #
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
"""
Graphics Foundation
This package defines classes for fundamental graphics types and operations.
"""
from pxr import Tf
Tf.PreparePythonModule()
del Tf
| 1,215 | Python | 36.999999 | 75 | 0.768724 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Gf/__DOC.py | def Execute(result):
result["BBox3d"].__init__.func_doc = """__init__()
The default constructor leaves the box empty, the transformation
matrix identity, and the zero-area primitives flag" ``false`` .
----------------------------------------------------------------------
__init__(rhs)
Copy constructor.
Parameters
----------
rhs : BBox3d
----------------------------------------------------------------------
__init__(box)
This constructor takes a box and sets the matrix to identity.
Parameters
----------
box : Range3d
----------------------------------------------------------------------
__init__(box, matrix)
This constructor takes a box and a transformation matrix.
Parameters
----------
box : Range3d
matrix : Matrix4d
"""
result["BBox3d"].Set.func_doc = """Set(box, matrix) -> None
Sets the axis-aligned box and transformation matrix.
Parameters
----------
box : Range3d
matrix : Matrix4d
"""
result["BBox3d"].SetMatrix.func_doc = """SetMatrix(matrix) -> None
Sets the transformation matrix only.
The axis-aligned box is not modified.
Parameters
----------
matrix : Matrix4d
"""
result["BBox3d"].SetRange.func_doc = """SetRange(box) -> None
Sets the range of the axis-aligned box only.
The transformation matrix is not modified.
Parameters
----------
box : Range3d
"""
result["BBox3d"].GetRange.func_doc = """GetRange() -> Range3d
Returns the range of the axis-aligned untransformed box.
"""
result["BBox3d"].GetBox.func_doc = """GetBox() -> Range3d
Returns the range of the axis-aligned untransformed box.
This synonym of ``GetRange`` exists for compatibility purposes.
"""
result["BBox3d"].GetMatrix.func_doc = """GetMatrix() -> Matrix4d
Returns the transformation matrix.
"""
result["BBox3d"].GetInverseMatrix.func_doc = """GetInverseMatrix() -> Matrix4d
Returns the inverse of the transformation matrix.
This will be the identity matrix if the transformation matrix is not
invertible.
"""
result["BBox3d"].SetHasZeroAreaPrimitives.func_doc = """SetHasZeroAreaPrimitives(hasThem) -> None
Sets the zero-area primitives flag to the given value.
Parameters
----------
hasThem : bool
"""
result["BBox3d"].HasZeroAreaPrimitives.func_doc = """HasZeroAreaPrimitives() -> bool
Returns the current state of the zero-area primitives flag".
"""
result["BBox3d"].GetVolume.func_doc = """GetVolume() -> float
Returns the volume of the box (0 for an empty box).
"""
result["BBox3d"].Transform.func_doc = """Transform(matrix) -> None
Transforms the bounding box by the given matrix, which is assumed to
be a global transformation to apply to the box.
Therefore, this just post-multiplies the box's matrix by ``matrix`` .
Parameters
----------
matrix : Matrix4d
"""
result["BBox3d"].ComputeAlignedRange.func_doc = """ComputeAlignedRange() -> Range3d
Returns the axis-aligned range (as a ``GfRange3d`` ) that results from
applying the transformation matrix to the wxis-aligned box and
aligning the result.
"""
result["BBox3d"].ComputeAlignedBox.func_doc = """ComputeAlignedBox() -> Range3d
Returns the axis-aligned range (as a ``GfRange3d`` ) that results from
applying the transformation matrix to the axis-aligned box and
aligning the result.
This synonym for ``ComputeAlignedRange`` exists for compatibility
purposes.
"""
result["BBox3d"].ComputeCentroid.func_doc = """ComputeCentroid() -> Vec3d
Returns the centroid of the bounding box.
The centroid is computed as the transformed centroid of the range.
"""
result["BBox3d"].Combine.func_doc = """**classmethod** Combine(b1, b2) -> BBox3d
Combines two bboxes, returning a new bbox that contains both.
This uses the coordinate space of one of the two original boxes as the
space of the result; it uses the one that produces whe smaller of the
two resulting boxes.
Parameters
----------
b1 : BBox3d
b2 : BBox3d
"""
result["Camera"].__doc__ = """
Object-based representation of a camera.
This class provides a thin wrapper on the camera data model, with a
small number of computations.
"""
result["Camera"].SetPerspectiveFromAspectRatioAndFieldOfView.func_doc = """SetPerspectiveFromAspectRatioAndFieldOfView(aspectRatio, fieldOfView, direction, horizontalAperture) -> None
Sets the frustum to be projective with the given ``aspectRatio`` and
horizontal, respectively, vertical field of view ``fieldOfView``
(similar to gluPerspective when direction = FOVVertical).
Do not pass values for ``horionztalAperture`` unless you care about
DepthOfField.
Parameters
----------
aspectRatio : float
fieldOfView : float
direction : FOVDirection
horizontalAperture : float
"""
result["Camera"].SetOrthographicFromAspectRatioAndSize.func_doc = """SetOrthographicFromAspectRatioAndSize(aspectRatio, orthographicSize, direction) -> None
Sets the frustum to be orthographic such that it has the given
``aspectRatio`` and such that the orthographic width, respectively,
orthographic height (in cm) is equal to ``orthographicSize``
(depending on direction).
Parameters
----------
aspectRatio : float
orthographicSize : float
direction : FOVDirection
"""
result["Camera"].SetFromViewAndProjectionMatrix.func_doc = """SetFromViewAndProjectionMatrix(viewMatrix, projMatix, focalLength) -> None
Sets the camera from a view and projection matrix.
Note that the projection matrix does only determine the ratio of
aperture to focal length, so there is a choice which defaults to 50mm
(or more accurately, 50 tenths of a world unit).
Parameters
----------
viewMatrix : Matrix4d
projMatix : Matrix4d
focalLength : float
"""
result["Camera"].Projection.__doc__ = """
Projection type.
"""
result["Camera"].FOVDirection.__doc__ = """
Direction used for Field of View or orthographic size.
"""
result["Camera"].__init__.func_doc = """__init__(transform, projection, horizontalAperture, verticalAperture, horizontalApertureOffset, verticalApertureOffset, focalLength, clippingRange, clippingPlanes, fStop, focusDistance)
Parameters
----------
transform : Matrix4d
projection : Projection
horizontalAperture : float
verticalAperture : float
horizontalApertureOffset : float
verticalApertureOffset : float
focalLength : float
clippingRange : Range1f
clippingPlanes : list[Vec4f]
fStop : float
focusDistance : float
"""
result["Camera"].GetFieldOfView.func_doc = """GetFieldOfView(direction) -> float
Returns the horizontal or vertical field of view in degrees.
Parameters
----------
direction : FOVDirection
"""
result["DualQuatd"].__doc__ = """
Basic type: a real part quaternion and a dual part quaternion.
This class represents a generalized dual quaternion that has a real
part and a dual part quaternions. Dual quaternions are used to
represent a combination of rotation and translation.
References:
https://www.cs.utah.edu/~ladislav/kavan06dual/kavan06dual.pdf
http://web.cs.iastate.edu/~cs577/handouts/dual-quaternion.pdf
"""
result["DualQuatd"].__init__.func_doc = """__init__()
The default constructor leaves the dual quaternion undefined.
----------------------------------------------------------------------
__init__(realVal)
Initialize the real part to ``realVal`` and the imaginary part to zero
quaternion.
Since quaternions typically must be normalized, reasonable values for
``realVal`` are -1, 0, or 1. Other values are legal but are likely to
be meaningless.
Parameters
----------
realVal : float
----------------------------------------------------------------------
__init__(real)
Initialize the real part to ``real`` quaternion and the imaginary part
to zero quaternion.
Parameters
----------
real : Quatd
----------------------------------------------------------------------
__init__(real, dual)
This constructor initializes the real and dual parts.
Parameters
----------
real : Quatd
dual : Quatd
----------------------------------------------------------------------
__init__(rotation, translation)
This constructor initializes from a rotation and a translation
components.
Parameters
----------
rotation : Quatd
translation : Vec3d
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfDualQuatf.
Parameters
----------
other : DualQuatf
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfDualQuath.
Parameters
----------
other : DualQuath
"""
result["DualQuatd"].SetReal.func_doc = """SetReal(real) -> None
Sets the real part of the dual quaternion.
Parameters
----------
real : Quatd
"""
result["DualQuatd"].SetDual.func_doc = """SetDual(dual) -> None
Sets the dual part of the dual quaternion.
Parameters
----------
dual : Quatd
"""
result["DualQuatd"].GetReal.func_doc = """GetReal() -> Quatd
Returns the real part of the dual quaternion.
"""
result["DualQuatd"].GetDual.func_doc = """GetDual() -> Quatd
Returns the dual part of the dual quaternion.
"""
result["DualQuatd"].GetLength.func_doc = """GetLength() -> tuple[float, float]
Returns geometric length of this dual quaternion.
"""
result["DualQuatd"].GetNormalized.func_doc = """GetNormalized(eps) -> DualQuatd
Returns a normalized (unit-length) version of this dual quaternion.
If the length of this dual quaternion is smaller than ``eps`` , this
returns the identity dual quaternion.
Parameters
----------
eps : float
"""
result["DualQuatd"].Normalize.func_doc = """Normalize(eps) -> tuple[float, float]
Normalizes this dual quaternion in place.
Normalizes this dual quaternion in place to unit length, returning the
length before normalization. If the length of this dual quaternion is
smaller than ``eps`` , this sets the dual quaternion to identity.
Parameters
----------
eps : float
"""
result["DualQuatd"].GetConjugate.func_doc = """GetConjugate() -> DualQuatd
Returns the conjugate of this dual quaternion.
"""
result["DualQuatd"].GetInverse.func_doc = """GetInverse() -> DualQuatd
Returns the inverse of this dual quaternion.
"""
result["DualQuatd"].SetTranslation.func_doc = """SetTranslation(translation) -> None
Set the translation component of this dual quaternion.
Parameters
----------
translation : Vec3d
"""
result["DualQuatd"].GetTranslation.func_doc = """GetTranslation() -> Vec3d
Get the translation component of this dual quaternion.
"""
result["DualQuatd"].Transform.func_doc = """Transform(vec) -> Vec3d
Transforms the row vector *vec* by the dual quaternion.
Parameters
----------
vec : Vec3d
"""
result["DualQuatd"].GetZero.func_doc = """**classmethod** GetZero() -> DualQuatd
Returns the zero dual quaternion, which has a real part of (0,0,0,0)
and a dual part of (0,0,0,0).
"""
result["DualQuatd"].GetIdentity.func_doc = """**classmethod** GetIdentity() -> DualQuatd
Returns the identity dual quaternion, which has a real part of
(1,0,0,0) and a dual part of (0,0,0,0).
"""
result["DualQuatf"].__doc__ = """
Basic type: a real part quaternion and a dual part quaternion.
This class represents a generalized dual quaternion that has a real
part and a dual part quaternions. Dual quaternions are used to
represent a combination of rotation and translation.
References:
https://www.cs.utah.edu/~ladislav/kavan06dual/kavan06dual.pdf
http://web.cs.iastate.edu/~cs577/handouts/dual-quaternion.pdf
"""
result["DualQuatf"].__init__.func_doc = """__init__()
The default constructor leaves the dual quaternion undefined.
----------------------------------------------------------------------
__init__(realVal)
Initialize the real part to ``realVal`` and the imaginary part to zero
quaternion.
Since quaternions typically must be normalized, reasonable values for
``realVal`` are -1, 0, or 1. Other values are legal but are likely to
be meaningless.
Parameters
----------
realVal : float
----------------------------------------------------------------------
__init__(real)
Initialize the real part to ``real`` quaternion and the imaginary part
to zero quaternion.
Parameters
----------
real : Quatf
----------------------------------------------------------------------
__init__(real, dual)
This constructor initializes the real and dual parts.
Parameters
----------
real : Quatf
dual : Quatf
----------------------------------------------------------------------
__init__(rotation, translation)
This constructor initializes from a rotation and a translation
components.
Parameters
----------
rotation : Quatf
translation : Vec3f
----------------------------------------------------------------------
__init__(other)
Construct from GfDualQuatd.
Parameters
----------
other : DualQuatd
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfDualQuath.
Parameters
----------
other : DualQuath
"""
result["DualQuatf"].SetReal.func_doc = """SetReal(real) -> None
Sets the real part of the dual quaternion.
Parameters
----------
real : Quatf
"""
result["DualQuatf"].SetDual.func_doc = """SetDual(dual) -> None
Sets the dual part of the dual quaternion.
Parameters
----------
dual : Quatf
"""
result["DualQuatf"].GetReal.func_doc = """GetReal() -> Quatf
Returns the real part of the dual quaternion.
"""
result["DualQuatf"].GetDual.func_doc = """GetDual() -> Quatf
Returns the dual part of the dual quaternion.
"""
result["DualQuatf"].GetLength.func_doc = """GetLength() -> tuple[float, float]
Returns geometric length of this dual quaternion.
"""
result["DualQuatf"].GetNormalized.func_doc = """GetNormalized(eps) -> DualQuatf
Returns a normalized (unit-length) version of this dual quaternion.
If the length of this dual quaternion is smaller than ``eps`` , this
returns the identity dual quaternion.
Parameters
----------
eps : float
"""
result["DualQuatf"].Normalize.func_doc = """Normalize(eps) -> tuple[float, float]
Normalizes this dual quaternion in place.
Normalizes this dual quaternion in place to unit length, returning the
length before normalization. If the length of this dual quaternion is
smaller than ``eps`` , this sets the dual quaternion to identity.
Parameters
----------
eps : float
"""
result["DualQuatf"].GetConjugate.func_doc = """GetConjugate() -> DualQuatf
Returns the conjugate of this dual quaternion.
"""
result["DualQuatf"].GetInverse.func_doc = """GetInverse() -> DualQuatf
Returns the inverse of this dual quaternion.
"""
result["DualQuatf"].SetTranslation.func_doc = """SetTranslation(translation) -> None
Set the translation component of this dual quaternion.
Parameters
----------
translation : Vec3f
"""
result["DualQuatf"].GetTranslation.func_doc = """GetTranslation() -> Vec3f
Get the translation component of this dual quaternion.
"""
result["DualQuatf"].Transform.func_doc = """Transform(vec) -> Vec3f
Transforms the row vector *vec* by the dual quaternion.
Parameters
----------
vec : Vec3f
"""
result["DualQuatf"].GetZero.func_doc = """**classmethod** GetZero() -> DualQuatf
Returns the zero dual quaternion, which has a real part of (0,0,0,0)
and a dual part of (0,0,0,0).
"""
result["DualQuatf"].GetIdentity.func_doc = """**classmethod** GetIdentity() -> DualQuatf
Returns the identity dual quaternion, which has a real part of
(1,0,0,0) and a dual part of (0,0,0,0).
"""
result["DualQuath"].__doc__ = """
Basic type: a real part quaternion and a dual part quaternion.
This class represents a generalized dual quaternion that has a real
part and a dual part quaternions. Dual quaternions are used to
represent a combination of rotation and translation.
References:
https://www.cs.utah.edu/~ladislav/kavan06dual/kavan06dual.pdf
http://web.cs.iastate.edu/~cs577/handouts/dual-quaternion.pdf
"""
result["DualQuath"].__init__.func_doc = """__init__()
The default constructor leaves the dual quaternion undefined.
----------------------------------------------------------------------
__init__(realVal)
Initialize the real part to ``realVal`` and the imaginary part to zero
quaternion.
Since quaternions typically must be normalized, reasonable values for
``realVal`` are -1, 0, or 1. Other values are legal but are likely to
be meaningless.
Parameters
----------
realVal : GfHalf
----------------------------------------------------------------------
__init__(real)
Initialize the real part to ``real`` quaternion and the imaginary part
to zero quaternion.
Parameters
----------
real : Quath
----------------------------------------------------------------------
__init__(real, dual)
This constructor initializes the real and dual parts.
Parameters
----------
real : Quath
dual : Quath
----------------------------------------------------------------------
__init__(rotation, translation)
This constructor initializes from a rotation and a translation
components.
Parameters
----------
rotation : Quath
translation : Vec3h
----------------------------------------------------------------------
__init__(other)
Construct from GfDualQuatd.
Parameters
----------
other : DualQuatd
----------------------------------------------------------------------
__init__(other)
Construct from GfDualQuatf.
Parameters
----------
other : DualQuatf
"""
result["DualQuath"].SetReal.func_doc = """SetReal(real) -> None
Sets the real part of the dual quaternion.
Parameters
----------
real : Quath
"""
result["DualQuath"].SetDual.func_doc = """SetDual(dual) -> None
Sets the dual part of the dual quaternion.
Parameters
----------
dual : Quath
"""
result["DualQuath"].GetReal.func_doc = """GetReal() -> Quath
Returns the real part of the dual quaternion.
"""
result["DualQuath"].GetDual.func_doc = """GetDual() -> Quath
Returns the dual part of the dual quaternion.
"""
result["DualQuath"].GetLength.func_doc = """GetLength() -> tuple[GfHalf, GfHalf]
Returns geometric length of this dual quaternion.
"""
result["DualQuath"].GetNormalized.func_doc = """GetNormalized(eps) -> DualQuath
Returns a normalized (unit-length) version of this dual quaternion.
If the length of this dual quaternion is smaller than ``eps`` , this
returns the identity dual quaternion.
Parameters
----------
eps : GfHalf
"""
result["DualQuath"].Normalize.func_doc = """Normalize(eps) -> tuple[GfHalf, GfHalf]
Normalizes this dual quaternion in place.
Normalizes this dual quaternion in place to unit length, returning the
length before normalization. If the length of this dual quaternion is
smaller than ``eps`` , this sets the dual quaternion to identity.
Parameters
----------
eps : GfHalf
"""
result["DualQuath"].GetConjugate.func_doc = """GetConjugate() -> DualQuath
Returns the conjugate of this dual quaternion.
"""
result["DualQuath"].GetInverse.func_doc = """GetInverse() -> DualQuath
Returns the inverse of this dual quaternion.
"""
result["DualQuath"].SetTranslation.func_doc = """SetTranslation(translation) -> None
Set the translation component of this dual quaternion.
Parameters
----------
translation : Vec3h
"""
result["DualQuath"].GetTranslation.func_doc = """GetTranslation() -> Vec3h
Get the translation component of this dual quaternion.
"""
result["DualQuath"].Transform.func_doc = """Transform(vec) -> Vec3h
Transforms the row vector *vec* by the dual quaternion.
Parameters
----------
vec : Vec3h
"""
result["DualQuath"].GetZero.func_doc = """**classmethod** GetZero() -> DualQuath
Returns the zero dual quaternion, which has a real part of (0,0,0,0)
and a dual part of (0,0,0,0).
"""
result["DualQuath"].GetIdentity.func_doc = """**classmethod** GetIdentity() -> DualQuath
Returns the identity dual quaternion, which has a real part of
(1,0,0,0) and a dual part of (0,0,0,0).
"""
result["Frustum"].SetPosition.func_doc = """SetPosition(position) -> None
Sets the position of the frustum in world space.
Parameters
----------
position : Vec3d
"""
result["Frustum"].GetPosition.func_doc = """GetPosition() -> Vec3d
Returns the position of the frustum in world space.
"""
result["Frustum"].SetRotation.func_doc = """SetRotation(rotation) -> None
Sets the orientation of the frustum in world space as a rotation to
apply to the default frame: looking along the -z axis with the +y axis
as"up".
Parameters
----------
rotation : Rotation
"""
result["Frustum"].GetRotation.func_doc = """GetRotation() -> Rotation
Returns the orientation of the frustum in world space as a rotation to
apply to the -z axis.
"""
result["Frustum"].SetPositionAndRotationFromMatrix.func_doc = """SetPositionAndRotationFromMatrix(camToWorldXf) -> None
Sets the position and rotation of the frustum from a camera matrix
(always from a y-Up camera).
The resulting frustum's transform will always represent a right-handed
and orthonormal coordinate sytem (scale, shear, and projection are
removed from the given ``camToWorldXf`` ).
Parameters
----------
camToWorldXf : Matrix4d
"""
result["Frustum"].SetWindow.func_doc = """SetWindow(window) -> None
Sets the window rectangle in the reference plane that defines the
left, right, top, and bottom planes of the frustum.
Parameters
----------
window : Range2d
"""
result["Frustum"].GetWindow.func_doc = """GetWindow() -> Range2d
Returns the window rectangle in the reference plane.
"""
result["Frustum"].SetNearFar.func_doc = """SetNearFar(nearFar) -> None
Sets the near/far interval.
Parameters
----------
nearFar : Range1d
"""
result["Frustum"].GetNearFar.func_doc = """GetNearFar() -> Range1d
Returns the near/far interval.
"""
result["Frustum"].SetViewDistance.func_doc = """SetViewDistance(viewDistance) -> None
Sets the view distance.
Parameters
----------
viewDistance : float
"""
result["Frustum"].GetViewDistance.func_doc = """GetViewDistance() -> float
Returns the view distance.
"""
result["Frustum"].SetProjectionType.func_doc = """SetProjectionType(projectionType) -> None
Sets the projection type.
Parameters
----------
projectionType : Frustum.ProjectionType
"""
result["Frustum"].GetProjectionType.func_doc = """GetProjectionType() -> Frustum.ProjectionType
Returns the projection type.
"""
result["Frustum"].GetReferencePlaneDepth.func_doc = """**classmethod** GetReferencePlaneDepth() -> float
Returns the depth of the reference plane.
"""
result["Frustum"].SetPerspective.func_doc = """SetPerspective(fieldOfViewHeight, aspectRatio, nearDistance, farDistance) -> None
Sets up the frustum in a manner similar to ``gluPerspective()`` .
It sets the projection type to ``GfFrustum::Perspective`` and sets the
window specification so that the resulting symmetric frustum encloses
an angle of ``fieldOfViewHeight`` degrees in the vertical direction,
with ``aspectRatio`` used to figure the angle in the horizontal
direction. The near and far distances are specified as well. The
window coordinates are computed as:
.. code-block:: text
top = tan(fieldOfViewHeight / 2)
bottom = -top
right = top \\* aspectRatio
left = -right
near = nearDistance
far = farDistance
Parameters
----------
fieldOfViewHeight : float
aspectRatio : float
nearDistance : float
farDistance : float
----------------------------------------------------------------------
SetPerspective(fieldOfView, isFovVertical, aspectRatio, nearDistance, farDistance) -> None
Sets up the frustum in a manner similar to gluPerspective().
It sets the projection type to ``GfFrustum::Perspective`` and sets the
window specification so that:
If *isFovVertical* is true, the resulting symmetric frustum encloses
an angle of ``fieldOfView`` degrees in the vertical direction, with
``aspectRatio`` used to figure the angle in the horizontal direction.
If *isFovVertical* is false, the resulting symmetric frustum encloses
an angle of ``fieldOfView`` degrees in the horizontal direction, with
``aspectRatio`` used to figure the angle in the vertical direction.
The near and far distances are specified as well. The window
coordinates are computed as follows:
- if isFovVertical:
- top = tan(fieldOfView / 2)
- right = top \\* aspectRatio
- if NOT isFovVertical:
- right = tan(fieldOfView / 2)
- top = right / aspectRation
- bottom = -top
- left = -right
- near = nearDistance
- far = farDistance
Parameters
----------
fieldOfView : float
isFovVertical : bool
aspectRatio : float
nearDistance : float
farDistance : float
"""
result["Frustum"].SetOrthographic.func_doc = """SetOrthographic(left, right, bottom, top, nearPlane, farPlane) -> None
Sets up the frustum in a manner similar to ``glOrtho()`` .
Sets the projection to ``GfFrustum::Orthographic`` and sets the window
and near/far specifications based on the given values.
Parameters
----------
left : float
right : float
bottom : float
top : float
nearPlane : float
farPlane : float
"""
result["Frustum"].GetOrthographic.func_doc = """GetOrthographic(left, right, bottom, top, nearPlane, farPlane) -> bool
Returns the current frustum in the format used by
``SetOrthographic()`` .
If the current frustum is not an orthographic projection, this returns
``false`` and leaves the parameters untouched.
Parameters
----------
left : float
right : float
bottom : float
top : float
nearPlane : float
farPlane : float
"""
result["Frustum"].FitToSphere.func_doc = """FitToSphere(center, radius, slack) -> None
Modifies the frustum to tightly enclose a sphere with the given center
and radius, using the current view direction.
The planes of the frustum are adjusted as necessary. The given amount
of slack is added to the sphere's radius is used around the sphere to
avoid boundary problems.
Parameters
----------
center : Vec3d
radius : float
slack : float
"""
result["Frustum"].Transform.func_doc = """Transform(matrix) -> Frustum
Transforms the frustum by the given matrix.
The transformation matrix is applied as follows: the position and the
direction vector are transformed with the given matrix. Then the
length of the new direction vector is used to rescale the near and far
plane and the view distance. Finally, the points that define the
reference plane are transformed by the matrix. This method assures
that the frustum will not be sheared or perspective-projected.
Note that this definition means that the transformed frustum does not
preserve scales very well. Do *not* use this function to transform a
frustum that is to be used for precise operations such as intersection
testing.
Parameters
----------
matrix : Matrix4d
"""
result["Frustum"].ComputeViewDirection.func_doc = """ComputeViewDirection() -> Vec3d
Returns the normalized world-space view direction vector, which is
computed by rotating the -z axis by the frustum's rotation.
"""
result["Frustum"].ComputeUpVector.func_doc = """ComputeUpVector() -> Vec3d
Returns the normalized world-space up vector, which is computed by
rotating the y axis by the frustum's rotation.
"""
result["Frustum"].ComputeViewFrame.func_doc = """ComputeViewFrame(side, up, view) -> None
Computes the view frame defined by this frustum.
The frame consists of the view direction, up vector and side vector,
as shown in this diagram.
.. code-block:: text
up
^ ^
| /
| / view
|/
+- - - - > side
Parameters
----------
side : Vec3d
up : Vec3d
view : Vec3d
"""
result["Frustum"].ComputeLookAtPoint.func_doc = """ComputeLookAtPoint() -> Vec3d
Computes and returns the world-space look-at point from the eye point
(position), view direction (rotation), and view distance.
"""
result["Frustum"].ComputeViewMatrix.func_doc = """ComputeViewMatrix() -> Matrix4d
Returns a matrix that represents the viewing transformation for this
frustum.
That is, it returns the matrix that converts points from world space
to eye (frustum) space.
"""
result["Frustum"].ComputeViewInverse.func_doc = """ComputeViewInverse() -> Matrix4d
Returns a matrix that represents the inverse viewing transformation
for this frustum.
That is, it returns the matrix that converts points from eye (frustum)
space to world space.
"""
result["Frustum"].ComputeProjectionMatrix.func_doc = """ComputeProjectionMatrix() -> Matrix4d
Returns a GL-style projection matrix corresponding to the frustum's
projection.
"""
result["Frustum"].ComputeAspectRatio.func_doc = """ComputeAspectRatio() -> float
Returns the aspect ratio of the frustum, defined as the width of the
window divided by the height.
If the height is zero or negative, this returns 0.
"""
result["Frustum"].ComputeCorners.func_doc = """ComputeCorners() -> list[Vec3d]
Returns the world-space corners of the frustum as a vector of 8
points, ordered as:
- Left bottom near
- Right bottom near
- Left top near
- Right top near
- Left bottom far
- Right bottom far
- Left top far
- Right top far
"""
result["Frustum"].ComputeCornersAtDistance.func_doc = """ComputeCornersAtDistance(d) -> list[Vec3d]
Returns the world-space corners of the intersection of the frustum
with a plane parallel to the near/far plane at distance d from the
apex, ordered as:
- Left bottom
- Right bottom
- Left top
- Right top In particular, it gives the partial result of
ComputeCorners when given near or far distance.
Parameters
----------
d : float
"""
result["Frustum"].ComputeNarrowedFrustum.func_doc = """ComputeNarrowedFrustum(windowPos, size) -> Frustum
Returns a frustum that is a narrowed-down version of this frustum.
The new frustum has the same near and far planes, but the other planes
are adjusted to be centered on ``windowPos`` with the new width and
height obtained from the existing width and height by multiplying by
``size`` [0] and ``size`` [1], respectively. Finally, the new frustum
is clipped against this frustum so that it is completely contained in
the existing frustum.
``windowPos`` is given in normalized coords (-1 to +1 in both
dimensions). ``size`` is given as a scalar (0 to 1 in both
dimensions).
If the ``windowPos`` or ``size`` given is outside these ranges, it may
result in returning a collapsed frustum.
This method is useful for computing a volume to use for interactive
picking.
Parameters
----------
windowPos : Vec2d
size : Vec2d
----------------------------------------------------------------------
ComputeNarrowedFrustum(worldPoint, size) -> Frustum
Returns a frustum that is a narrowed-down version of this frustum.
The new frustum has the same near and far planes, but the other planes
are adjusted to be centered on ``worldPoint`` with the new width and
height obtained from the existing width and height by multiplying by
``size`` [0] and ``size`` [1], respectively. Finally, the new frustum
is clipped against this frustum so that it is completely contained in
the existing frustum.
``worldPoint`` is given in world space coordinates. ``size`` is given
as a scalar (0 to 1 in both dimensions).
If the ``size`` given is outside this range, it may result in
returning a collapsed frustum.
If the ``worldPoint`` is at or behind the eye of the frustum, it will
return a frustum equal to this frustum.
This method is useful for computing a volume to use for interactive
picking.
Parameters
----------
worldPoint : Vec3d
size : Vec2d
"""
result["Frustum"].ComputePickRay.func_doc = """ComputePickRay(windowPos) -> Ray
Builds and returns a ``GfRay`` that can be used for picking at the
given normalized (-1 to +1 in both dimensions) window position.
Contrasted with ComputeRay() , that method returns a ray whose origin
is the eyepoint, while this method returns a ray whose origin is on
the near plane.
Parameters
----------
windowPos : Vec2d
----------------------------------------------------------------------
ComputePickRay(worldSpacePos) -> Ray
Builds and returns a ``GfRay`` that can be used for picking that
connects the viewpoint to the given 3d point in worldspace.
Parameters
----------
worldSpacePos : Vec3d
"""
result["Frustum"].Intersects.func_doc = """Intersects(bbox) -> bool
Returns true if the given axis-aligned bbox is inside or intersecting
the frustum.
Otherwise, it returns false. Useful when doing picking or frustum
culling.
Parameters
----------
bbox : BBox3d
----------------------------------------------------------------------
Intersects(point) -> bool
Returns true if the given point is inside or intersecting the frustum.
Otherwise, it returns false.
Parameters
----------
point : Vec3d
----------------------------------------------------------------------
Intersects(p0, p1) -> bool
Returns ``true`` if the line segment formed by the given points is
inside or intersecting the frustum.
Otherwise, it returns false.
Parameters
----------
p0 : Vec3d
p1 : Vec3d
----------------------------------------------------------------------
Intersects(p0, p1, p2) -> bool
Returns ``true`` if the triangle formed by the given points is inside
or intersecting the frustum.
Otherwise, it returns false.
Parameters
----------
p0 : Vec3d
p1 : Vec3d
p2 : Vec3d
"""
result["Frustum"].IntersectsViewVolume.func_doc = """**classmethod** IntersectsViewVolume(bbox, vpMat) -> bool
Returns ``true`` if the bbox volume intersects the view volume given
by the view-projection matrix, erring on the side of false positives
for efficiency.
This method is intended for cases where a GfFrustum is not available
or when the view-projection matrix yields a view volume that is not
expressable as a GfFrustum.
Because it errs on the side of false positives, it is suitable for
early-out tests such as draw or intersection culling.
Parameters
----------
bbox : BBox3d
vpMat : Matrix4d
"""
result["Frustum"].ProjectionType.__doc__ = """
This enum is used to determine the type of projection represented by a
frustum.
"""
result["Frustum"].__init__.func_doc = """__init__()
This constructor creates an instance with default viewing parameters:
- The position is the origin.
- The rotation is the identity rotation. (The view is along the -z
axis, with the +y axis as"up").
- The window is -1 to +1 in both dimensions.
- The near/far interval is (1, 10).
- The view distance is 5.0.
- The projection type is ``GfFrustum::Perspective`` .
----------------------------------------------------------------------
__init__(o)
Copy constructor.
Parameters
----------
o : Frustum
----------------------------------------------------------------------
__init__(o)
Move constructor.
Parameters
----------
o : Frustum
----------------------------------------------------------------------
__init__(position, rotation, window, nearFar, projectionType, viewDistance)
This constructor creates an instance with the given viewing
parameters.
Parameters
----------
position : Vec3d
rotation : Rotation
window : Range2d
nearFar : Range1d
projectionType : Frustum.ProjectionType
viewDistance : float
----------------------------------------------------------------------
__init__(camToWorldXf, window, nearFar, projectionType, viewDistance)
This constructor creates an instance from a camera matrix (always of a
y-Up camera, also see SetPositionAndRotationFromMatrix) and the given
viewing parameters.
Parameters
----------
camToWorldXf : Matrix4d
window : Range2d
nearFar : Range1d
projectionType : Frustum.ProjectionType
viewDistance : float
"""
result["Interval"].IsMinClosed.func_doc = """IsMinClosed() -> bool
Minimum boundary condition.
"""
result["Interval"].IsMaxClosed.func_doc = """IsMaxClosed() -> bool
Maximum boundary condition.
"""
result["Interval"].IsMinOpen.func_doc = """IsMinOpen() -> bool
Minimum boundary condition.
"""
result["Interval"].IsMaxOpen.func_doc = """IsMaxOpen() -> bool
Maximum boundary condition.
"""
result["Interval"].IsMaxFinite.func_doc = """IsMaxFinite() -> bool
Returns true if the maximum value is finite.
"""
result["Interval"].IsMinFinite.func_doc = """IsMinFinite() -> bool
Returns true if the minimum value is finite.
"""
result["Interval"].IsFinite.func_doc = """IsFinite() -> bool
Returns true if both the maximum and minimum value are finite.
"""
result["Interval"].Intersects.func_doc = """Intersects(i) -> bool
Return true iff the given interval i intersects this interval.
Parameters
----------
i : Interval
"""
result["Interval"].GetFullInterval.func_doc = """**classmethod** GetFullInterval() -> Interval
Returns the full interval (-inf, inf).
"""
result["Line"].__init__.func_doc = """__init__()
The default constructor leaves line parameters undefined.
----------------------------------------------------------------------
__init__(p0, dir)
Construct a line from a point and a direction.
Parameters
----------
p0 : Vec3d
dir : Vec3d
"""
result["Line"].Set.func_doc = """Set(p0, dir) -> float
Parameters
----------
p0 : Vec3d
dir : Vec3d
"""
result["Line"].GetPoint.func_doc = """GetPoint(t) -> Vec3d
Return the point on the line at ```` ( p0 + t \\* dir).
Remember dir has been normalized so t represents a unit distance.
Parameters
----------
t : float
"""
result["Line"].GetDirection.func_doc = """GetDirection() -> Vec3d
Return the normalized direction of the line.
"""
result["Line"].FindClosestPoint.func_doc = """FindClosestPoint(point, t) -> Vec3d
Returns the point on the line that is closest to ``point`` .
If ``t`` is not ``None`` , it will be set to the parametric distance
along the line of the returned point.
Parameters
----------
point : Vec3d
t : float
"""
result["LineSeg"].__init__.func_doc = """__init__()
The default constructor leaves line parameters undefined.
----------------------------------------------------------------------
__init__(p0, p1)
Construct a line segment that spans two points.
Parameters
----------
p0 : Vec3d
p1 : Vec3d
"""
result["LineSeg"].GetPoint.func_doc = """GetPoint(t) -> Vec3d
Return the point on the segment specified by the parameter t.
p = p0 + t \\* (p1 - p0)
Parameters
----------
t : float
"""
result["LineSeg"].GetDirection.func_doc = """GetDirection() -> Vec3d
Return the normalized direction of the line.
"""
result["LineSeg"].GetLength.func_doc = """GetLength() -> float
Return the length of the line.
"""
result["LineSeg"].FindClosestPoint.func_doc = """FindClosestPoint(point, t) -> Vec3d
Returns the point on the line that is closest to ``point`` .
If ``t`` is not ``None`` , it will be set to the parametric distance
along the line of the closest point.
Parameters
----------
point : Vec3d
t : float
"""
result["Matrix2d"].__doc__ = """
Stores a 2x2 matrix of ``double`` elements. A basic type.
Matrices are defined to be in row-major order, so ``matrix[i][j]``
indexes the element in the *i* th row and the *j* th column.
"""
result["Matrix2d"].__init__.func_doc = """__init__()
Default constructor. Leaves the matrix component values undefined.
----------------------------------------------------------------------
__init__(m00, m01, m10, m11)
Constructor.
Initializes the matrix from 4 independent ``double`` values, specified
in row-major order. For example, parameter *m10* specifies the value
in row 1 and column 0.
Parameters
----------
m00 : float
m01 : float
m10 : float
m11 : float
----------------------------------------------------------------------
__init__(m)
Constructor.
Initializes the matrix from a 2x2 array of ``double`` values,
specified in row-major order.
Parameters
----------
m : float
----------------------------------------------------------------------
__init__(s)
Constructor.
Explicitly initializes the matrix to *s* times the identity matrix.
Parameters
----------
s : float
----------------------------------------------------------------------
__init__(s)
This explicit constructor initializes the matrix to ``s`` times the
identity matrix.
Parameters
----------
s : int
----------------------------------------------------------------------
__init__(v)
Constructor.
Explicitly initializes the matrix to diagonal form, with the *i* th
element on the diagonal set to ``v[i]`` .
Parameters
----------
v : Vec2d
----------------------------------------------------------------------
__init__(v)
Constructor.
Initialize the matrix from a vector of vectors of double. The vector
is expected to be 2x2. If it is too big, only the first 2 rows and/or
columns will be used. If it is too small, uninitialized elements will
be filled in with the corresponding elements from an identity matrix.
Parameters
----------
v : list[list[float]]
----------------------------------------------------------------------
__init__(v)
Constructor.
Initialize the matrix from a vector of vectors of float. The vector is
expected to be 2x2. If it is too big, only the first 2 rows and/or
columns will be used. If it is too small, uninitialized elements will
be filled in with the corresponding elements from an identity matrix.
Parameters
----------
v : list[list[float]]
----------------------------------------------------------------------
__init__(m)
This explicit constructor converts a"float"matrix to a"double"matrix.
Parameters
----------
m : Matrix2f
"""
result["Matrix2d"].SetRow.func_doc = """SetRow(i, v) -> None
Sets a row of the matrix from a Vec2.
Parameters
----------
i : int
v : Vec2d
"""
result["Matrix2d"].SetColumn.func_doc = """SetColumn(i, v) -> None
Sets a column of the matrix from a Vec2.
Parameters
----------
i : int
v : Vec2d
"""
result["Matrix2d"].GetRow.func_doc = """GetRow(i) -> Vec2d
Gets a row of the matrix as a Vec2.
Parameters
----------
i : int
"""
result["Matrix2d"].GetColumn.func_doc = """GetColumn(i) -> Vec2d
Gets a column of the matrix as a Vec2.
Parameters
----------
i : int
"""
result["Matrix2d"].Set.func_doc = """Set(m00, m01, m10, m11) -> Matrix2d
Sets the matrix from 4 independent ``double`` values, specified in
row-major order.
For example, parameter *m10* specifies the value in row 1 and column
0.
Parameters
----------
m00 : float
m01 : float
m10 : float
m11 : float
----------------------------------------------------------------------
Set(m) -> Matrix2d
Sets the matrix from a 2x2 array of ``double`` values, specified in
row-major order.
Parameters
----------
m : float
"""
result["Matrix2d"].SetIdentity.func_doc = """SetIdentity() -> Matrix2d
Sets the matrix to the identity matrix.
"""
result["Matrix2d"].SetZero.func_doc = """SetZero() -> Matrix2d
Sets the matrix to zero.
"""
result["Matrix2d"].SetDiagonal.func_doc = """SetDiagonal(s) -> Matrix2d
Sets the matrix to *s* times the identity matrix.
Parameters
----------
s : float
----------------------------------------------------------------------
SetDiagonal(arg1) -> Matrix2d
Sets the matrix to have diagonal ( ``v[0], v[1]`` ).
Parameters
----------
arg1 : Vec2d
"""
result["Matrix2d"].GetTranspose.func_doc = """GetTranspose() -> Matrix2d
Returns the transpose of the matrix.
"""
result["Matrix2d"].GetInverse.func_doc = """GetInverse(det, eps) -> Matrix2d
Returns the inverse of the matrix, or FLT_MAX \\* SetIdentity() if the
matrix is singular.
(FLT_MAX is the largest value a ``float`` can have, as defined by the
system.) The matrix is considered singular if the determinant is less
than or equal to the optional parameter *eps*. If *det* is non-null,
``\\*det`` is set to the determinant.
Parameters
----------
det : float
eps : float
"""
result["Matrix2d"].GetDeterminant.func_doc = """GetDeterminant() -> float
Returns the determinant of the matrix.
"""
result["Matrix2f"].__doc__ = """
Stores a 2x2 matrix of ``float`` elements. A basic type.
Matrices are defined to be in row-major order, so ``matrix[i][j]``
indexes the element in the *i* th row and the *j* th column.
"""
result["Matrix2f"].__init__.func_doc = """__init__()
Default constructor. Leaves the matrix component values undefined.
----------------------------------------------------------------------
__init__(m00, m01, m10, m11)
Constructor.
Initializes the matrix from 4 independent ``float`` values, specified
in row-major order. For example, parameter *m10* specifies the value
in row 1 and column 0.
Parameters
----------
m00 : float
m01 : float
m10 : float
m11 : float
----------------------------------------------------------------------
__init__(m)
Constructor.
Initializes the matrix from a 2x2 array of ``float`` values, specified
in row-major order.
Parameters
----------
m : float
----------------------------------------------------------------------
__init__(s)
Constructor.
Explicitly initializes the matrix to *s* times the identity matrix.
Parameters
----------
s : float
----------------------------------------------------------------------
__init__(s)
This explicit constructor initializes the matrix to ``s`` times the
identity matrix.
Parameters
----------
s : int
----------------------------------------------------------------------
__init__(v)
Constructor.
Explicitly initializes the matrix to diagonal form, with the *i* th
element on the diagonal set to ``v[i]`` .
Parameters
----------
v : Vec2f
----------------------------------------------------------------------
__init__(v)
Constructor.
Initialize the matrix from a vector of vectors of double. The vector
is expected to be 2x2. If it is too big, only the first 2 rows and/or
columns will be used. If it is too small, uninitialized elements will
be filled in with the corresponding elements from an identity matrix.
Parameters
----------
v : list[list[float]]
----------------------------------------------------------------------
__init__(v)
Constructor.
Initialize the matrix from a vector of vectors of float. The vector is
expected to be 2x2. If it is too big, only the first 2 rows and/or
columns will be used. If it is too small, uninitialized elements will
be filled in with the corresponding elements from an identity matrix.
Parameters
----------
v : list[list[float]]
----------------------------------------------------------------------
__init__(m)
This explicit constructor converts a"double"matrix to a"float"matrix.
Parameters
----------
m : Matrix2d
"""
result["Matrix2f"].SetRow.func_doc = """SetRow(i, v) -> None
Sets a row of the matrix from a Vec2.
Parameters
----------
i : int
v : Vec2f
"""
result["Matrix2f"].SetColumn.func_doc = """SetColumn(i, v) -> None
Sets a column of the matrix from a Vec2.
Parameters
----------
i : int
v : Vec2f
"""
result["Matrix2f"].GetRow.func_doc = """GetRow(i) -> Vec2f
Gets a row of the matrix as a Vec2.
Parameters
----------
i : int
"""
result["Matrix2f"].GetColumn.func_doc = """GetColumn(i) -> Vec2f
Gets a column of the matrix as a Vec2.
Parameters
----------
i : int
"""
result["Matrix2f"].Set.func_doc = """Set(m00, m01, m10, m11) -> Matrix2f
Sets the matrix from 4 independent ``float`` values, specified in row-
major order.
For example, parameter *m10* specifies the value in row 1 and column
0.
Parameters
----------
m00 : float
m01 : float
m10 : float
m11 : float
----------------------------------------------------------------------
Set(m) -> Matrix2f
Sets the matrix from a 2x2 array of ``float`` values, specified in
row-major order.
Parameters
----------
m : float
"""
result["Matrix2f"].SetIdentity.func_doc = """SetIdentity() -> Matrix2f
Sets the matrix to the identity matrix.
"""
result["Matrix2f"].SetZero.func_doc = """SetZero() -> Matrix2f
Sets the matrix to zero.
"""
result["Matrix2f"].SetDiagonal.func_doc = """SetDiagonal(s) -> Matrix2f
Sets the matrix to *s* times the identity matrix.
Parameters
----------
s : float
----------------------------------------------------------------------
SetDiagonal(arg1) -> Matrix2f
Sets the matrix to have diagonal ( ``v[0], v[1]`` ).
Parameters
----------
arg1 : Vec2f
"""
result["Matrix2f"].GetTranspose.func_doc = """GetTranspose() -> Matrix2f
Returns the transpose of the matrix.
"""
result["Matrix2f"].GetInverse.func_doc = """GetInverse(det, eps) -> Matrix2f
Returns the inverse of the matrix, or FLT_MAX \\* SetIdentity() if the
matrix is singular.
(FLT_MAX is the largest value a ``float`` can have, as defined by the
system.) The matrix is considered singular if the determinant is less
than or equal to the optional parameter *eps*. If *det* is non-null,
``\\*det`` is set to the determinant.
Parameters
----------
det : float
eps : float
"""
result["Matrix2f"].GetDeterminant.func_doc = """GetDeterminant() -> float
Returns the determinant of the matrix.
"""
result["Matrix3d"].__doc__ = """
Stores a 3x3 matrix of ``double`` elements. A basic type.
Matrices are defined to be in row-major order, so ``matrix[i][j]``
indexes the element in the *i* th row and the *j* th column.
3D Transformations
==================
Three methods, SetRotate() , SetScale() , and ExtractRotation() ,
interpret a GfMatrix3d as a 3D transformation. By convention, vectors
are treated primarily as row vectors, implying the following:
- Transformation matrices are organized to deal with row vectors,
not column vectors.
- Each of the Set() methods in this class completely rewrites the
matrix; for example, SetRotate() yields a matrix which does nothing
but rotate.
- When multiplying two transformation matrices, the matrix on the
left applies a more local transformation to a row vector. For example,
if R represents a rotation matrix and S represents a scale matrix, the
product R\\*S will rotate a row vector, then scale it.
"""
result["Matrix3d"].SetRotate.func_doc = """SetRotate(rot) -> Matrix3d
Sets the matrix to specify a rotation equivalent to *rot*.
Parameters
----------
rot : Quatd
----------------------------------------------------------------------
SetRotate(rot) -> Matrix3d
Sets the matrix to specify a rotation equivalent to *rot*.
Parameters
----------
rot : Rotation
"""
result["Matrix3d"].SetScale.func_doc = """SetScale(scaleFactors) -> Matrix3d
Sets the matrix to specify a nonuniform scaling in x, y, and z by the
factors in vector *scaleFactors*.
Parameters
----------
scaleFactors : Vec3d
----------------------------------------------------------------------
SetScale(scaleFactor) -> Matrix3d
Sets matrix to specify a uniform scaling by *scaleFactor*.
Parameters
----------
scaleFactor : float
"""
result["Matrix3d"].ExtractRotation.func_doc = """ExtractRotation() -> Rotation
Returns the rotation corresponding to this matrix.
This works well only if the matrix represents a rotation.
For good results, consider calling Orthonormalize() before calling
this method.
"""
result["Matrix3d"].__init__.func_doc = """__init__()
Default constructor. Leaves the matrix component values undefined.
----------------------------------------------------------------------
__init__(m00, m01, m02, m10, m11, m12, m20, m21, m22)
Constructor.
Initializes the matrix from 9 independent ``double`` values, specified
in row-major order. For example, parameter *m10* specifies the value
in row 1 and column 0.
Parameters
----------
m00 : float
m01 : float
m02 : float
m10 : float
m11 : float
m12 : float
m20 : float
m21 : float
m22 : float
----------------------------------------------------------------------
__init__(m)
Constructor.
Initializes the matrix from a 3x3 array of ``double`` values,
specified in row-major order.
Parameters
----------
m : float
----------------------------------------------------------------------
__init__(s)
Constructor.
Explicitly initializes the matrix to *s* times the identity matrix.
Parameters
----------
s : float
----------------------------------------------------------------------
__init__(s)
This explicit constructor initializes the matrix to ``s`` times the
identity matrix.
Parameters
----------
s : int
----------------------------------------------------------------------
__init__(v)
Constructor.
Explicitly initializes the matrix to diagonal form, with the *i* th
element on the diagonal set to ``v[i]`` .
Parameters
----------
v : Vec3d
----------------------------------------------------------------------
__init__(v)
Constructor.
Initialize the matrix from a vector of vectors of double. The vector
is expected to be 3x3. If it is too big, only the first 3 rows and/or
columns will be used. If it is too small, uninitialized elements will
be filled in with the corresponding elements from an identity matrix.
Parameters
----------
v : list[list[float]]
----------------------------------------------------------------------
__init__(v)
Constructor.
Initialize the matrix from a vector of vectors of float. The vector is
expected to be 3x3. If it is too big, only the first 3 rows and/or
columns will be used. If it is too small, uninitialized elements will
be filled in with the corresponding elements from an identity matrix.
Parameters
----------
v : list[list[float]]
----------------------------------------------------------------------
__init__(rot)
Constructor. Initialize matrix from rotation.
Parameters
----------
rot : Rotation
----------------------------------------------------------------------
__init__(rot)
Constructor. Initialize matrix from a quaternion.
Parameters
----------
rot : Quatd
----------------------------------------------------------------------
__init__(m)
This explicit constructor converts a"float"matrix to a"double"matrix.
Parameters
----------
m : Matrix3f
"""
result["Matrix3d"].SetRow.func_doc = """SetRow(i, v) -> None
Sets a row of the matrix from a Vec3.
Parameters
----------
i : int
v : Vec3d
"""
result["Matrix3d"].SetColumn.func_doc = """SetColumn(i, v) -> None
Sets a column of the matrix from a Vec3.
Parameters
----------
i : int
v : Vec3d
"""
result["Matrix3d"].GetRow.func_doc = """GetRow(i) -> Vec3d
Gets a row of the matrix as a Vec3.
Parameters
----------
i : int
"""
result["Matrix3d"].GetColumn.func_doc = """GetColumn(i) -> Vec3d
Gets a column of the matrix as a Vec3.
Parameters
----------
i : int
"""
result["Matrix3d"].Set.func_doc = """Set(m00, m01, m02, m10, m11, m12, m20, m21, m22) -> Matrix3d
Sets the matrix from 9 independent ``double`` values, specified in
row-major order.
For example, parameter *m10* specifies the value in row 1 and column
0.
Parameters
----------
m00 : float
m01 : float
m02 : float
m10 : float
m11 : float
m12 : float
m20 : float
m21 : float
m22 : float
----------------------------------------------------------------------
Set(m) -> Matrix3d
Sets the matrix from a 3x3 array of ``double`` values, specified in
row-major order.
Parameters
----------
m : float
"""
result["Matrix3d"].SetIdentity.func_doc = """SetIdentity() -> Matrix3d
Sets the matrix to the identity matrix.
"""
result["Matrix3d"].SetZero.func_doc = """SetZero() -> Matrix3d
Sets the matrix to zero.
"""
result["Matrix3d"].SetDiagonal.func_doc = """SetDiagonal(s) -> Matrix3d
Sets the matrix to *s* times the identity matrix.
Parameters
----------
s : float
----------------------------------------------------------------------
SetDiagonal(arg1) -> Matrix3d
Sets the matrix to have diagonal ( ``v[0], v[1], v[2]`` ).
Parameters
----------
arg1 : Vec3d
"""
result["Matrix3d"].GetTranspose.func_doc = """GetTranspose() -> Matrix3d
Returns the transpose of the matrix.
"""
result["Matrix3d"].GetInverse.func_doc = """GetInverse(det, eps) -> Matrix3d
Returns the inverse of the matrix, or FLT_MAX \\* SetIdentity() if the
matrix is singular.
(FLT_MAX is the largest value a ``float`` can have, as defined by the
system.) The matrix is considered singular if the determinant is less
than or equal to the optional parameter *eps*. If *det* is non-null,
``\\*det`` is set to the determinant.
Parameters
----------
det : float
eps : float
"""
result["Matrix3d"].GetDeterminant.func_doc = """GetDeterminant() -> float
Returns the determinant of the matrix.
"""
result["Matrix3d"].Orthonormalize.func_doc = """Orthonormalize(issueWarning) -> bool
Makes the matrix orthonormal in place.
This is an iterative method that is much more stable than the previous
cross/cross method. If the iterative method does not converge, a
warning is issued.
Returns true if the iteration converged, false otherwise. Leaves any
translation part of the matrix unchanged. If *issueWarning* is true,
this method will issue a warning if the iteration does not converge,
otherwise it will be silent.
Parameters
----------
issueWarning : bool
"""
result["Matrix3d"].GetOrthonormalized.func_doc = """GetOrthonormalized(issueWarning) -> Matrix3d
Returns an orthonormalized copy of the matrix.
Parameters
----------
issueWarning : bool
"""
result["Matrix3d"].GetHandedness.func_doc = """GetHandedness() -> float
Returns the sign of the determinant of the matrix, i.e.
1 for a right-handed matrix, -1 for a left-handed matrix, and 0 for a
singular matrix.
"""
result["Matrix3d"].IsRightHanded.func_doc = """IsRightHanded() -> bool
Returns true if the vectors in the matrix form a right-handed
coordinate system.
"""
result["Matrix3d"].IsLeftHanded.func_doc = """IsLeftHanded() -> bool
Returns true if the vectors in matrix form a left-handed coordinate
system.
"""
result["Matrix3f"].__doc__ = """
Stores a 3x3 matrix of ``float`` elements. A basic type.
Matrices are defined to be in row-major order, so ``matrix[i][j]``
indexes the element in the *i* th row and the *j* th column.
3D Transformations
==================
Three methods, SetRotate() , SetScale() , and ExtractRotation() ,
interpret a GfMatrix3f as a 3D transformation. By convention, vectors
are treated primarily as row vectors, implying the following:
- Transformation matrices are organized to deal with row vectors,
not column vectors.
- Each of the Set() methods in this class completely rewrites the
matrix; for example, SetRotate() yields a matrix which does nothing
but rotate.
- When multiplying two transformation matrices, the matrix on the
left applies a more local transformation to a row vector. For example,
if R represents a rotation matrix and S represents a scale matrix, the
product R\\*S will rotate a row vector, then scale it.
"""
result["Matrix3f"].SetRotate.func_doc = """SetRotate(rot) -> Matrix3f
Sets the matrix to specify a rotation equivalent to *rot*.
Parameters
----------
rot : Quatf
----------------------------------------------------------------------
SetRotate(rot) -> Matrix3f
Sets the matrix to specify a rotation equivalent to *rot*.
Parameters
----------
rot : Rotation
"""
result["Matrix3f"].SetScale.func_doc = """SetScale(scaleFactors) -> Matrix3f
Sets the matrix to specify a nonuniform scaling in x, y, and z by the
factors in vector *scaleFactors*.
Parameters
----------
scaleFactors : Vec3f
----------------------------------------------------------------------
SetScale(scaleFactor) -> Matrix3f
Sets matrix to specify a uniform scaling by *scaleFactor*.
Parameters
----------
scaleFactor : float
"""
result["Matrix3f"].ExtractRotation.func_doc = """ExtractRotation() -> Rotation
Returns the rotation corresponding to this matrix.
This works well only if the matrix represents a rotation.
For good results, consider calling Orthonormalize() before calling
this method.
"""
result["Matrix3f"].__init__.func_doc = """__init__()
Default constructor. Leaves the matrix component values undefined.
----------------------------------------------------------------------
__init__(m00, m01, m02, m10, m11, m12, m20, m21, m22)
Constructor.
Initializes the matrix from 9 independent ``float`` values, specified
in row-major order. For example, parameter *m10* specifies the value
in row 1 and column 0.
Parameters
----------
m00 : float
m01 : float
m02 : float
m10 : float
m11 : float
m12 : float
m20 : float
m21 : float
m22 : float
----------------------------------------------------------------------
__init__(m)
Constructor.
Initializes the matrix from a 3x3 array of ``float`` values, specified
in row-major order.
Parameters
----------
m : float
----------------------------------------------------------------------
__init__(s)
Constructor.
Explicitly initializes the matrix to *s* times the identity matrix.
Parameters
----------
s : float
----------------------------------------------------------------------
__init__(s)
This explicit constructor initializes the matrix to ``s`` times the
identity matrix.
Parameters
----------
s : int
----------------------------------------------------------------------
__init__(v)
Constructor.
Explicitly initializes the matrix to diagonal form, with the *i* th
element on the diagonal set to ``v[i]`` .
Parameters
----------
v : Vec3f
----------------------------------------------------------------------
__init__(v)
Constructor.
Initialize the matrix from a vector of vectors of double. The vector
is expected to be 3x3. If it is too big, only the first 3 rows and/or
columns will be used. If it is too small, uninitialized elements will
be filled in with the corresponding elements from an identity matrix.
Parameters
----------
v : list[list[float]]
----------------------------------------------------------------------
__init__(v)
Constructor.
Initialize the matrix from a vector of vectors of float. The vector is
expected to be 3x3. If it is too big, only the first 3 rows and/or
columns will be used. If it is too small, uninitialized elements will
be filled in with the corresponding elements from an identity matrix.
Parameters
----------
v : list[list[float]]
----------------------------------------------------------------------
__init__(rot)
Constructor. Initialize matrix from rotation.
Parameters
----------
rot : Rotation
----------------------------------------------------------------------
__init__(rot)
Constructor. Initialize matrix from a quaternion.
Parameters
----------
rot : Quatf
----------------------------------------------------------------------
__init__(m)
This explicit constructor converts a"double"matrix to a"float"matrix.
Parameters
----------
m : Matrix3d
"""
result["Matrix3f"].SetRow.func_doc = """SetRow(i, v) -> None
Sets a row of the matrix from a Vec3.
Parameters
----------
i : int
v : Vec3f
"""
result["Matrix3f"].SetColumn.func_doc = """SetColumn(i, v) -> None
Sets a column of the matrix from a Vec3.
Parameters
----------
i : int
v : Vec3f
"""
result["Matrix3f"].GetRow.func_doc = """GetRow(i) -> Vec3f
Gets a row of the matrix as a Vec3.
Parameters
----------
i : int
"""
result["Matrix3f"].GetColumn.func_doc = """GetColumn(i) -> Vec3f
Gets a column of the matrix as a Vec3.
Parameters
----------
i : int
"""
result["Matrix3f"].Set.func_doc = """Set(m00, m01, m02, m10, m11, m12, m20, m21, m22) -> Matrix3f
Sets the matrix from 9 independent ``float`` values, specified in row-
major order.
For example, parameter *m10* specifies the value in row 1 and column
0.
Parameters
----------
m00 : float
m01 : float
m02 : float
m10 : float
m11 : float
m12 : float
m20 : float
m21 : float
m22 : float
----------------------------------------------------------------------
Set(m) -> Matrix3f
Sets the matrix from a 3x3 array of ``float`` values, specified in
row-major order.
Parameters
----------
m : float
"""
result["Matrix3f"].SetIdentity.func_doc = """SetIdentity() -> Matrix3f
Sets the matrix to the identity matrix.
"""
result["Matrix3f"].SetZero.func_doc = """SetZero() -> Matrix3f
Sets the matrix to zero.
"""
result["Matrix3f"].SetDiagonal.func_doc = """SetDiagonal(s) -> Matrix3f
Sets the matrix to *s* times the identity matrix.
Parameters
----------
s : float
----------------------------------------------------------------------
SetDiagonal(arg1) -> Matrix3f
Sets the matrix to have diagonal ( ``v[0], v[1], v[2]`` ).
Parameters
----------
arg1 : Vec3f
"""
result["Matrix3f"].GetTranspose.func_doc = """GetTranspose() -> Matrix3f
Returns the transpose of the matrix.
"""
result["Matrix3f"].GetInverse.func_doc = """GetInverse(det, eps) -> Matrix3f
Returns the inverse of the matrix, or FLT_MAX \\* SetIdentity() if the
matrix is singular.
(FLT_MAX is the largest value a ``float`` can have, as defined by the
system.) The matrix is considered singular if the determinant is less
than or equal to the optional parameter *eps*. If *det* is non-null,
``\\*det`` is set to the determinant.
Parameters
----------
det : float
eps : float
"""
result["Matrix3f"].GetDeterminant.func_doc = """GetDeterminant() -> float
Returns the determinant of the matrix.
"""
result["Matrix3f"].Orthonormalize.func_doc = """Orthonormalize(issueWarning) -> bool
Makes the matrix orthonormal in place.
This is an iterative method that is much more stable than the previous
cross/cross method. If the iterative method does not converge, a
warning is issued.
Returns true if the iteration converged, false otherwise. Leaves any
translation part of the matrix unchanged. If *issueWarning* is true,
this method will issue a warning if the iteration does not converge,
otherwise it will be silent.
Parameters
----------
issueWarning : bool
"""
result["Matrix3f"].GetOrthonormalized.func_doc = """GetOrthonormalized(issueWarning) -> Matrix3f
Returns an orthonormalized copy of the matrix.
Parameters
----------
issueWarning : bool
"""
result["Matrix3f"].GetHandedness.func_doc = """GetHandedness() -> float
Returns the sign of the determinant of the matrix, i.e.
1 for a right-handed matrix, -1 for a left-handed matrix, and 0 for a
singular matrix.
"""
result["Matrix3f"].IsRightHanded.func_doc = """IsRightHanded() -> bool
Returns true if the vectors in the matrix form a right-handed
coordinate system.
"""
result["Matrix3f"].IsLeftHanded.func_doc = """IsLeftHanded() -> bool
Returns true if the vectors in matrix form a left-handed coordinate
system.
"""
result["Matrix4d"].__doc__ = """
Stores a 4x4 matrix of ``double`` elements. A basic type.
Matrices are defined to be in row-major order, so ``matrix[i][j]``
indexes the element in the *i* th row and the *j* th column.
3D Transformations
==================
The following methods interpret a GfMatrix4d as a 3D transformation:
SetRotate() , SetScale() , SetTranslate() , SetLookAt() , Factor() ,
ExtractTranslation() , ExtractRotation() , Transform() ,
TransformDir() . By convention, vectors are treated primarily as row
vectors, implying the following:
- Transformation matrices are organized to deal with row vectors,
not column vectors. For example, the last row of a matrix contains the
translation amounts.
- Each of the Set() methods below completely rewrites the matrix;
for example, SetTranslate() yields a matrix which does nothing but
translate.
- When multiplying two transformation matrices, the matrix on the
left applies a more local transformation to a row vector. For example,
if R represents a rotation matrix and T represents a translation
matrix, the product R\\*T will rotate a row vector, then translate it.
"""
result["Matrix4d"].SetRotate.func_doc = """SetRotate(rot) -> Matrix4d
Sets the matrix to specify a rotation equivalent to *rot*, and clears
the translation.
Parameters
----------
rot : Quatd
----------------------------------------------------------------------
SetRotate(rot) -> Matrix4d
Sets the matrix to specify a rotation equivalent to *rot*, and clears
the translation.
Parameters
----------
rot : Rotation
----------------------------------------------------------------------
SetRotate(mx) -> Matrix4d
Sets the matrix to specify a rotation equivalent to *mx*, and clears
the translation.
Parameters
----------
mx : Matrix3d
"""
result["Matrix4d"].SetRotateOnly.func_doc = """SetRotateOnly(rot) -> Matrix4d
Sets the matrix to specify a rotation equivalent to *rot*, without
clearing the translation.
Parameters
----------
rot : Quatd
----------------------------------------------------------------------
SetRotateOnly(rot) -> Matrix4d
Sets the matrix to specify a rotation equivalent to *rot*, without
clearing the translation.
Parameters
----------
rot : Rotation
----------------------------------------------------------------------
SetRotateOnly(mx) -> Matrix4d
Sets the matrix to specify a rotation equivalent to *mx*, without
clearing the translation.
Parameters
----------
mx : Matrix3d
"""
result["Matrix4d"].SetScale.func_doc = """SetScale(scaleFactors) -> Matrix4d
Sets the matrix to specify a nonuniform scaling in x, y, and z by the
factors in vector *scaleFactors*.
Parameters
----------
scaleFactors : Vec3d
----------------------------------------------------------------------
SetScale(scaleFactor) -> Matrix4d
Sets matrix to specify a uniform scaling by *scaleFactor*.
Parameters
----------
scaleFactor : float
"""
result["Matrix4d"].SetTranslate.func_doc = """SetTranslate(trans) -> Matrix4d
Sets matrix to specify a translation by the vector *trans*, and clears
the rotation.
Parameters
----------
trans : Vec3d
"""
result["Matrix4d"].SetTranslateOnly.func_doc = """SetTranslateOnly(t) -> Matrix4d
Sets matrix to specify a translation by the vector *trans*, without
clearing the rotation.
Parameters
----------
t : Vec3d
"""
result["Matrix4d"].SetTransform.func_doc = """SetTransform(rotate, translate) -> Matrix4d
Sets matrix to specify a rotation by *rotate* and a translation by
*translate*.
Parameters
----------
rotate : Rotation
translate : Vec3d
----------------------------------------------------------------------
SetTransform(rotmx, translate) -> Matrix4d
Sets matrix to specify a rotation by *rotmx* and a translation by
*translate*.
Parameters
----------
rotmx : Matrix3d
translate : Vec3d
"""
result["Matrix4d"].SetLookAt.func_doc = """SetLookAt(eyePoint, centerPoint, upDirection) -> Matrix4d
Sets the matrix to specify a viewing matrix from parameters similar to
those used by ``gluLookAt(3G)`` .
*eyePoint* represents the eye point in world space. *centerPoint*
represents the world-space center of attention. *upDirection* is a
vector indicating which way is up.
Parameters
----------
eyePoint : Vec3d
centerPoint : Vec3d
upDirection : Vec3d
----------------------------------------------------------------------
SetLookAt(eyePoint, orientation) -> Matrix4d
Sets the matrix to specify a viewing matrix from a world-space
*eyePoint* and a world-space rotation that rigidly rotates the
orientation from its canonical frame, which is defined to be looking
along the ``-z`` axis with the ``+y`` axis as the up direction.
Parameters
----------
eyePoint : Vec3d
orientation : Rotation
"""
result["Matrix4d"].Factor.func_doc = """Factor(r, s, u, t, p, eps) -> bool
Factors the matrix into 5 components:
- ``*M* = r \\* s \\* -r \\* u \\* t`` where
- *t* is a translation.
- *u* and *r* are rotations, and *-r* is the transpose (inverse) of
*r*. The *u* matrix may contain shear information.
- *s* is a scale. Any projection information could be returned in
matrix *p*, but currently p is never modified.
Returns ``false`` if the matrix is singular (as determined by *eps*).
In that case, any zero scales in *s* are clamped to *eps* to allow
computation of *u*.
Parameters
----------
r : Matrix4d
s : Vec3d
u : Matrix4d
t : Vec3d
p : Matrix4d
eps : float
"""
result["Matrix4d"].ExtractTranslation.func_doc = """ExtractTranslation() -> Vec3d
Returns the translation part of the matrix, defined as the first three
elements of the last row.
"""
result["Matrix4d"].ExtractRotation.func_doc = """ExtractRotation() -> Rotation
Returns the rotation corresponding to this matrix.
This works well only if the matrix represents a rotation.
For good results, consider calling Orthonormalize() before calling
this method.
"""
result["Matrix4d"].ExtractRotationQuat.func_doc = """ExtractRotationQuat() -> Quatd
Return the rotation corresponding to this matrix as a quaternion.
This works well only if the matrix represents a rotation.
For good results, consider calling Orthonormalize() before calling
this method.
"""
result["Matrix4d"].ExtractRotationMatrix.func_doc = """ExtractRotationMatrix() -> Matrix3d
Returns the rotation corresponding to this matrix.
This works well only if the matrix represents a rotation.
For good results, consider calling Orthonormalize() before calling
this method.
"""
result["Matrix4d"].Transform.func_doc = """Transform(vec) -> Vec3d
Transforms the row vector *vec* by the matrix, returning the result.
This treats the vector as a 4-component vector whose fourth component
is 1.
Parameters
----------
vec : Vec3d
----------------------------------------------------------------------
Transform(vec) -> Vec3f
Transforms the row vector *vec* by the matrix, returning the result.
This treats the vector as a 4-component vector whose fourth component
is 1. This is an overloaded method; it differs from the other version
in that it returns a different value type.
Parameters
----------
vec : Vec3f
"""
result["Matrix4d"].TransformDir.func_doc = """TransformDir(vec) -> Vec3d
Transforms row vector *vec* by the matrix, returning the result.
This treats the vector as a direction vector, so the translation
information in the matrix is ignored. That is, it treats the vector as
a 4-component vector whose fourth component is 0.
Parameters
----------
vec : Vec3d
----------------------------------------------------------------------
TransformDir(vec) -> Vec3f
Transforms row vector *vec* by the matrix, returning the result.
This treats the vector as a direction vector, so the translation
information in the matrix is ignored. That is, it treats the vector as
a 4-component vector whose fourth component is 0. This is an
overloaded method; it differs from the other version in that it
returns a different value type.
Parameters
----------
vec : Vec3f
"""
result["Matrix4d"].TransformAffine.func_doc = """TransformAffine(vec) -> Vec3d
Transforms the row vector *vec* by the matrix, returning the result.
This treats the vector as a 4-component vector whose fourth component
is 1 and ignores the fourth column of the matrix (i.e. assumes it is
(0, 0, 0, 1)).
Parameters
----------
vec : Vec3d
----------------------------------------------------------------------
TransformAffine(vec) -> Vec3f
Transforms the row vector *vec* by the matrix, returning the result.
This treats the vector as a 4-component vector whose fourth component
is 1 and ignores the fourth column of the matrix (i.e. assumes it is
(0, 0, 0, 1)).
Parameters
----------
vec : Vec3f
"""
result["Matrix4d"].__init__.func_doc = """__init__()
Default constructor. Leaves the matrix component values undefined.
----------------------------------------------------------------------
__init__(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33)
Constructor.
Initializes the matrix from 16 independent ``double`` values,
specified in row-major order. For example, parameter *m10* specifies
the value in row 1 and column 0.
Parameters
----------
m00 : float
m01 : float
m02 : float
m03 : float
m10 : float
m11 : float
m12 : float
m13 : float
m20 : float
m21 : float
m22 : float
m23 : float
m30 : float
m31 : float
m32 : float
m33 : float
----------------------------------------------------------------------
__init__(m)
Constructor.
Initializes the matrix from a 4x4 array of ``double`` values,
specified in row-major order.
Parameters
----------
m : float
----------------------------------------------------------------------
__init__(s)
Constructor.
Explicitly initializes the matrix to *s* times the identity matrix.
Parameters
----------
s : float
----------------------------------------------------------------------
__init__(v)
Constructor.
Explicitly initializes the matrix to diagonal form, with the *i* th
element on the diagonal set to ``v[i]`` .
Parameters
----------
v : Vec4d
----------------------------------------------------------------------
__init__(v)
Constructor.
Initialize the matrix from a vector of vectors of double. The vector
is expected to be 4x4. If it is too big, only the first 4 rows and/or
columns will be used. If it is too small, uninitialized elements will
be filled in with the corresponding elements from an identity matrix.
Parameters
----------
v : list[list[float]]
----------------------------------------------------------------------
__init__(v)
Constructor.
Initialize the matrix from a vector of vectors of float. The vector is
expected to be 4x4. If it is too big, only the first 4 rows and/or
columns will be used. If it is too small, uninitialized elements will
be filled in with the corresponding elements from an identity matrix.
Parameters
----------
v : list[list[float]]
----------------------------------------------------------------------
__init__(r0, r1, r2, r3)
Constructor.
Initialize the matrix from 4 row vectors of double. Each vector is
expected to length 4. If it is too big, only the first 4 items will be
used. If it is too small, uninitialized elements will be filled in
with the corresponding elements from an identity matrix.
Parameters
----------
r0 : list[float]
r1 : list[float]
r2 : list[float]
r3 : list[float]
----------------------------------------------------------------------
__init__(r0, r1, r2, r3)
Constructor.
Initialize the matrix from 4 row vectors of float. Each vector is
expected to length 4. If it is too big, only the first 4 items will be
used. If it is too small, uninitialized elements will be filled in
with the corresponding elements from an identity matrix.
Parameters
----------
r0 : list[float]
r1 : list[float]
r2 : list[float]
r3 : list[float]
----------------------------------------------------------------------
__init__(rotate, translate)
Constructor.
Initializes a transformation matrix to perform the indicated rotation
and translation.
Parameters
----------
rotate : Rotation
translate : Vec3d
----------------------------------------------------------------------
__init__(rotmx, translate)
Constructor.
Initializes a transformation matrix to perform the indicated rotation
and translation.
Parameters
----------
rotmx : Matrix3d
translate : Vec3d
----------------------------------------------------------------------
__init__(m)
This explicit constructor converts a"float"matrix to a"double"matrix.
Parameters
----------
m : Matrix4f
"""
result["Matrix4d"].SetRow.func_doc = """SetRow(i, v) -> None
Sets a row of the matrix from a Vec4.
Parameters
----------
i : int
v : Vec4d
"""
result["Matrix4d"].SetColumn.func_doc = """SetColumn(i, v) -> None
Sets a column of the matrix from a Vec4.
Parameters
----------
i : int
v : Vec4d
"""
result["Matrix4d"].GetRow.func_doc = """GetRow(i) -> Vec4d
Gets a row of the matrix as a Vec4.
Parameters
----------
i : int
"""
result["Matrix4d"].GetColumn.func_doc = """GetColumn(i) -> Vec4d
Gets a column of the matrix as a Vec4.
Parameters
----------
i : int
"""
result["Matrix4d"].Set.func_doc = """Set(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) -> Matrix4d
Sets the matrix from 16 independent ``double`` values, specified in
row-major order.
For example, parameter *m10* specifies the value in row 1 and column
0.
Parameters
----------
m00 : float
m01 : float
m02 : float
m03 : float
m10 : float
m11 : float
m12 : float
m13 : float
m20 : float
m21 : float
m22 : float
m23 : float
m30 : float
m31 : float
m32 : float
m33 : float
----------------------------------------------------------------------
Set(m) -> Matrix4d
Sets the matrix from a 4x4 array of ``double`` values, specified in
row-major order.
Parameters
----------
m : float
"""
result["Matrix4d"].SetIdentity.func_doc = """SetIdentity() -> Matrix4d
Sets the matrix to the identity matrix.
"""
result["Matrix4d"].SetZero.func_doc = """SetZero() -> Matrix4d
Sets the matrix to zero.
"""
result["Matrix4d"].SetDiagonal.func_doc = """SetDiagonal(s) -> Matrix4d
Sets the matrix to *s* times the identity matrix.
Parameters
----------
s : float
----------------------------------------------------------------------
SetDiagonal(arg1) -> Matrix4d
Sets the matrix to have diagonal ( ``v[0], v[1], v[2], v[3]`` ).
Parameters
----------
arg1 : Vec4d
"""
result["Matrix4d"].GetTranspose.func_doc = """GetTranspose() -> Matrix4d
Returns the transpose of the matrix.
"""
result["Matrix4d"].GetInverse.func_doc = """GetInverse(det, eps) -> Matrix4d
Returns the inverse of the matrix, or FLT_MAX \\* SetIdentity() if the
matrix is singular.
(FLT_MAX is the largest value a ``float`` can have, as defined by the
system.) The matrix is considered singular if the determinant is less
than or equal to the optional parameter *eps*. If *det* is non-null,
``\\*det`` is set to the determinant.
Parameters
----------
det : float
eps : float
"""
result["Matrix4d"].GetDeterminant.func_doc = """GetDeterminant() -> float
Returns the determinant of the matrix.
"""
result["Matrix4d"].SetRow3.func_doc = """SetRow3(i, v) -> None
Sets a row of the matrix from a Vec3.
The fourth element of the row is ignored.
Parameters
----------
i : int
v : Vec3d
"""
result["Matrix4d"].GetRow3.func_doc = """GetRow3(i) -> Vec3d
Gets a row of the matrix as a Vec3.
Parameters
----------
i : int
"""
result["Matrix4d"].GetDeterminant3.func_doc = """GetDeterminant3() -> float
Returns the determinant of the upper 3x3 matrix.
This method is useful when the matrix describes a linear
transformation such as a rotation or scale because the other values in
the 4x4 matrix are not important.
"""
result["Matrix4d"].HasOrthogonalRows3.func_doc = """HasOrthogonalRows3() -> bool
Returns true, if the row vectors of the upper 3x3 matrix form an
orthogonal basis.
Note they do not have to be unit length for this test to return true.
"""
result["Matrix4d"].Orthonormalize.func_doc = """Orthonormalize(issueWarning) -> bool
Makes the matrix orthonormal in place.
This is an iterative method that is much more stable than the previous
cross/cross method. If the iterative method does not converge, a
warning is issued.
Returns true if the iteration converged, false otherwise. Leaves any
translation part of the matrix unchanged. If *issueWarning* is true,
this method will issue a warning if the iteration does not converge,
otherwise it will be silent.
Parameters
----------
issueWarning : bool
"""
result["Matrix4d"].GetOrthonormalized.func_doc = """GetOrthonormalized(issueWarning) -> Matrix4d
Returns an orthonormalized copy of the matrix.
Parameters
----------
issueWarning : bool
"""
result["Matrix4d"].GetHandedness.func_doc = """GetHandedness() -> float
Returns the sign of the determinant of the upper 3x3 matrix, i.e.
1 for a right-handed matrix, -1 for a left-handed matrix, and 0 for a
singular matrix.
"""
result["Matrix4d"].IsRightHanded.func_doc = """IsRightHanded() -> bool
Returns true if the vectors in the upper 3x3 matrix form a right-
handed coordinate system.
"""
result["Matrix4d"].IsLeftHanded.func_doc = """IsLeftHanded() -> bool
Returns true if the vectors in the upper 3x3 matrix form a left-handed
coordinate system.
"""
result["Matrix4d"].RemoveScaleShear.func_doc = """RemoveScaleShear() -> Matrix4d
Returns the matrix with any scaling or shearing removed, leaving only
the rotation and translation.
If the matrix cannot be decomposed, returns the original matrix.
"""
result["Matrix4f"].__doc__ = """
Stores a 4x4 matrix of ``float`` elements. A basic type.
Matrices are defined to be in row-major order, so ``matrix[i][j]``
indexes the element in the *i* th row and the *j* th column.
3D Transformations
==================
The following methods interpret a GfMatrix4f as a 3D transformation:
SetRotate() , SetScale() , SetTranslate() , SetLookAt() , Factor() ,
ExtractTranslation() , ExtractRotation() , Transform() ,
TransformDir() . By convention, vectors are treated primarily as row
vectors, implying the following:
- Transformation matrices are organized to deal with row vectors,
not column vectors. For example, the last row of a matrix contains the
translation amounts.
- Each of the Set() methods below completely rewrites the matrix;
for example, SetTranslate() yields a matrix which does nothing but
translate.
- When multiplying two transformation matrices, the matrix on the
left applies a more local transformation to a row vector. For example,
if R represents a rotation matrix and T represents a translation
matrix, the product R\\*T will rotate a row vector, then translate it.
"""
result["Matrix4f"].SetRotate.func_doc = """SetRotate(rot) -> Matrix4f
Sets the matrix to specify a rotation equivalent to *rot*, and clears
the translation.
Parameters
----------
rot : Quatf
----------------------------------------------------------------------
SetRotate(rot) -> Matrix4f
Sets the matrix to specify a rotation equivalent to *rot*, and clears
the translation.
Parameters
----------
rot : Rotation
----------------------------------------------------------------------
SetRotate(mx) -> Matrix4f
Sets the matrix to specify a rotation equivalent to *mx*, and clears
the translation.
Parameters
----------
mx : Matrix3f
"""
result["Matrix4f"].SetRotateOnly.func_doc = """SetRotateOnly(rot) -> Matrix4f
Sets the matrix to specify a rotation equivalent to *rot*, without
clearing the translation.
Parameters
----------
rot : Quatf
----------------------------------------------------------------------
SetRotateOnly(rot) -> Matrix4f
Sets the matrix to specify a rotation equivalent to *rot*, without
clearing the translation.
Parameters
----------
rot : Rotation
----------------------------------------------------------------------
SetRotateOnly(mx) -> Matrix4f
Sets the matrix to specify a rotation equivalent to *mx*, without
clearing the translation.
Parameters
----------
mx : Matrix3f
"""
result["Matrix4f"].SetScale.func_doc = """SetScale(scaleFactors) -> Matrix4f
Sets the matrix to specify a nonuniform scaling in x, y, and z by the
factors in vector *scaleFactors*.
Parameters
----------
scaleFactors : Vec3f
----------------------------------------------------------------------
SetScale(scaleFactor) -> Matrix4f
Sets matrix to specify a uniform scaling by *scaleFactor*.
Parameters
----------
scaleFactor : float
"""
result["Matrix4f"].SetTranslate.func_doc = """SetTranslate(trans) -> Matrix4f
Sets matrix to specify a translation by the vector *trans*, and clears
the rotation.
Parameters
----------
trans : Vec3f
"""
result["Matrix4f"].SetTranslateOnly.func_doc = """SetTranslateOnly(t) -> Matrix4f
Sets matrix to specify a translation by the vector *trans*, without
clearing the rotation.
Parameters
----------
t : Vec3f
"""
result["Matrix4f"].SetTransform.func_doc = """SetTransform(rotate, translate) -> Matrix4f
Sets matrix to specify a rotation by *rotate* and a translation by
*translate*.
Parameters
----------
rotate : Rotation
translate : Vec3f
----------------------------------------------------------------------
SetTransform(rotmx, translate) -> Matrix4f
Sets matrix to specify a rotation by *rotmx* and a translation by
*translate*.
Parameters
----------
rotmx : Matrix3f
translate : Vec3f
"""
result["Matrix4f"].SetLookAt.func_doc = """SetLookAt(eyePoint, centerPoint, upDirection) -> Matrix4f
Sets the matrix to specify a viewing matrix from parameters similar to
those used by ``gluLookAt(3G)`` .
*eyePoint* represents the eye point in world space. *centerPoint*
represents the world-space center of attention. *upDirection* is a
vector indicating which way is up.
Parameters
----------
eyePoint : Vec3f
centerPoint : Vec3f
upDirection : Vec3f
----------------------------------------------------------------------
SetLookAt(eyePoint, orientation) -> Matrix4f
Sets the matrix to specify a viewing matrix from a world-space
*eyePoint* and a world-space rotation that rigidly rotates the
orientation from its canonical frame, which is defined to be looking
along the ``-z`` axis with the ``+y`` axis as the up direction.
Parameters
----------
eyePoint : Vec3f
orientation : Rotation
"""
result["Matrix4f"].Factor.func_doc = """Factor(r, s, u, t, p, eps) -> bool
Factors the matrix into 5 components:
- ``*M* = r \\* s \\* -r \\* u \\* t`` where
- *t* is a translation.
- *u* and *r* are rotations, and *-r* is the transpose (inverse) of
*r*. The *u* matrix may contain shear information.
- *s* is a scale. Any projection information could be returned in
matrix *p*, but currently p is never modified.
Returns ``false`` if the matrix is singular (as determined by *eps*).
In that case, any zero scales in *s* are clamped to *eps* to allow
computation of *u*.
Parameters
----------
r : Matrix4f
s : Vec3f
u : Matrix4f
t : Vec3f
p : Matrix4f
eps : float
"""
result["Matrix4f"].ExtractTranslation.func_doc = """ExtractTranslation() -> Vec3f
Returns the translation part of the matrix, defined as the first three
elements of the last row.
"""
result["Matrix4f"].ExtractRotation.func_doc = """ExtractRotation() -> Rotation
Returns the rotation corresponding to this matrix.
This works well only if the matrix represents a rotation.
For good results, consider calling Orthonormalize() before calling
this method.
"""
result["Matrix4f"].ExtractRotationQuat.func_doc = """ExtractRotationQuat() -> Quatf
Return the rotation corresponding to this matrix as a quaternion.
This works well only if the matrix represents a rotation.
For good results, consider calling Orthonormalize() before calling
this method.
"""
result["Matrix4f"].ExtractRotationMatrix.func_doc = """ExtractRotationMatrix() -> Matrix3f
Returns the rotation corresponding to this matrix.
This works well only if the matrix represents a rotation.
For good results, consider calling Orthonormalize() before calling
this method.
"""
result["Matrix4f"].Transform.func_doc = """Transform(vec) -> Vec3d
Transforms the row vector *vec* by the matrix, returning the result.
This treats the vector as a 4-component vector whose fourth component
is 1.
Parameters
----------
vec : Vec3d
----------------------------------------------------------------------
Transform(vec) -> Vec3f
Transforms the row vector *vec* by the matrix, returning the result.
This treats the vector as a 4-component vector whose fourth component
is 1. This is an overloaded method; it differs from the other version
in that it returns a different value type.
Parameters
----------
vec : Vec3f
"""
result["Matrix4f"].TransformDir.func_doc = """TransformDir(vec) -> Vec3d
Transforms row vector *vec* by the matrix, returning the result.
This treats the vector as a direction vector, so the translation
information in the matrix is ignored. That is, it treats the vector as
a 4-component vector whose fourth component is 0.
Parameters
----------
vec : Vec3d
----------------------------------------------------------------------
TransformDir(vec) -> Vec3f
Transforms row vector *vec* by the matrix, returning the result.
This treats the vector as a direction vector, so the translation
information in the matrix is ignored. That is, it treats the vector as
a 4-component vector whose fourth component is 0. This is an
overloaded method; it differs from the other version in that it
returns a different value type.
Parameters
----------
vec : Vec3f
"""
result["Matrix4f"].TransformAffine.func_doc = """TransformAffine(vec) -> Vec3d
Transforms the row vector *vec* by the matrix, returning the result.
This treats the vector as a 4-component vector whose fourth component
is 1 and ignores the fourth column of the matrix (i.e. assumes it is
(0, 0, 0, 1)).
Parameters
----------
vec : Vec3d
----------------------------------------------------------------------
TransformAffine(vec) -> Vec3f
Transforms the row vector *vec* by the matrix, returning the result.
This treats the vector as a 4-component vector whose fourth component
is 1 and ignores the fourth column of the matrix (i.e. assumes it is
(0, 0, 0, 1)).
Parameters
----------
vec : Vec3f
"""
result["Matrix4f"].__init__.func_doc = """__init__()
Default constructor. Leaves the matrix component values undefined.
----------------------------------------------------------------------
__init__(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33)
Constructor.
Initializes the matrix from 16 independent ``float`` values, specified
in row-major order. For example, parameter *m10* specifies the value
in row 1 and column 0.
Parameters
----------
m00 : float
m01 : float
m02 : float
m03 : float
m10 : float
m11 : float
m12 : float
m13 : float
m20 : float
m21 : float
m22 : float
m23 : float
m30 : float
m31 : float
m32 : float
m33 : float
----------------------------------------------------------------------
__init__(m)
Constructor.
Initializes the matrix from a 4x4 array of ``float`` values, specified
in row-major order.
Parameters
----------
m : float
----------------------------------------------------------------------
__init__(s)
Constructor.
Explicitly initializes the matrix to *s* times the identity matrix.
Parameters
----------
s : float
----------------------------------------------------------------------
__init__(v)
Constructor.
Explicitly initializes the matrix to diagonal form, with the *i* th
element on the diagonal set to ``v[i]`` .
Parameters
----------
v : Vec4f
----------------------------------------------------------------------
__init__(v)
Constructor.
Initialize the matrix from a vector of vectors of double. The vector
is expected to be 4x4. If it is too big, only the first 4 rows and/or
columns will be used. If it is too small, uninitialized elements will
be filled in with the corresponding elements from an identity matrix.
Parameters
----------
v : list[list[float]]
----------------------------------------------------------------------
__init__(v)
Constructor.
Initialize the matrix from a vector of vectors of float. The vector is
expected to be 4x4. If it is too big, only the first 4 rows and/or
columns will be used. If it is too small, uninitialized elements will
be filled in with the corresponding elements from an identity matrix.
Parameters
----------
v : list[list[float]]
----------------------------------------------------------------------
__init__(r0, r1, r2, r3)
Constructor.
Initialize the matrix from 4 row vectors of double. Each vector is
expected to length 4. If it is too big, only the first 4 items will be
used. If it is too small, uninitialized elements will be filled in
with the corresponding elements from an identity matrix.
Parameters
----------
r0 : list[float]
r1 : list[float]
r2 : list[float]
r3 : list[float]
----------------------------------------------------------------------
__init__(r0, r1, r2, r3)
Constructor.
Initialize the matrix from 4 row vectors of float. Each vector is
expected to length 4. If it is too big, only the first 4 items will be
used. If it is too small, uninitialized elements will be filled in
with the corresponding elements from an identity matrix.
Parameters
----------
r0 : list[float]
r1 : list[float]
r2 : list[float]
r3 : list[float]
----------------------------------------------------------------------
__init__(rotate, translate)
Constructor.
Initializes a transformation matrix to perform the indicated rotation
and translation.
Parameters
----------
rotate : Rotation
translate : Vec3f
----------------------------------------------------------------------
__init__(rotmx, translate)
Constructor.
Initializes a transformation matrix to perform the indicated rotation
and translation.
Parameters
----------
rotmx : Matrix3f
translate : Vec3f
----------------------------------------------------------------------
__init__(m)
This explicit constructor converts a"double"matrix to a"float"matrix.
Parameters
----------
m : Matrix4d
"""
result["Matrix4f"].SetRow.func_doc = """SetRow(i, v) -> None
Sets a row of the matrix from a Vec4.
Parameters
----------
i : int
v : Vec4f
"""
result["Matrix4f"].SetColumn.func_doc = """SetColumn(i, v) -> None
Sets a column of the matrix from a Vec4.
Parameters
----------
i : int
v : Vec4f
"""
result["Matrix4f"].GetRow.func_doc = """GetRow(i) -> Vec4f
Gets a row of the matrix as a Vec4.
Parameters
----------
i : int
"""
result["Matrix4f"].GetColumn.func_doc = """GetColumn(i) -> Vec4f
Gets a column of the matrix as a Vec4.
Parameters
----------
i : int
"""
result["Matrix4f"].Set.func_doc = """Set(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) -> Matrix4f
Sets the matrix from 16 independent ``float`` values, specified in
row-major order.
For example, parameter *m10* specifies the value in row1 and column 0.
Parameters
----------
m00 : float
m01 : float
m02 : float
m03 : float
m10 : float
m11 : float
m12 : float
m13 : float
m20 : float
m21 : float
m22 : float
m23 : float
m30 : float
m31 : float
m32 : float
m33 : float
----------------------------------------------------------------------
Set(m) -> Matrix4f
Sets the matrix from a 4x4 array of ``float`` values, specified in
row-major order.
Parameters
----------
m : float
"""
result["Matrix4f"].SetIdentity.func_doc = """SetIdentity() -> Matrix4f
Sets the matrix to the identity matrix.
"""
result["Matrix4f"].SetZero.func_doc = """SetZero() -> Matrix4f
Sets the matrix to zero.
"""
result["Matrix4f"].SetDiagonal.func_doc = """SetDiagonal(s) -> Matrix4f
Sets the matrix to *s* times the identity matrix.
Parameters
----------
s : float
----------------------------------------------------------------------
SetDiagonal(arg1) -> Matrix4f
Sets the matrix to have diagonal ( ``v[0], v[1], v[2], v[3]`` ).
Parameters
----------
arg1 : Vec4f
"""
result["Matrix4f"].GetTranspose.func_doc = """GetTranspose() -> Matrix4f
Returns the transpose of the matrix.
"""
result["Matrix4f"].GetInverse.func_doc = """GetInverse(det, eps) -> Matrix4f
Returns the inverse of the matrix, or FLT_MAX \\* SetIdentity() if the
matrix is singular.
(FLT_MAX is the largest value a ``float`` can have, as defined by the
system.) The matrix is considered singular if the determinant is less
than or equal to the optional parameter *eps*. If *det* is non-null,
``\\*det`` is set to the determinant.
Parameters
----------
det : float
eps : float
"""
result["Matrix4f"].GetDeterminant.func_doc = """GetDeterminant() -> float
Returns the determinant of the matrix.
"""
result["Matrix4f"].SetRow3.func_doc = """SetRow3(i, v) -> None
Sets a row of the matrix from a Vec3.
The fourth element of the row is ignored.
Parameters
----------
i : int
v : Vec3f
"""
result["Matrix4f"].GetRow3.func_doc = """GetRow3(i) -> Vec3f
Gets a row of the matrix as a Vec3.
Parameters
----------
i : int
"""
result["Matrix4f"].GetDeterminant3.func_doc = """GetDeterminant3() -> float
Returns the determinant of the upper 3x3 matrix.
This method is useful when the matrix describes a linear
transformation such as a rotation or scale because the other values in
the 4x4 matrix are not important.
"""
result["Matrix4f"].HasOrthogonalRows3.func_doc = """HasOrthogonalRows3() -> bool
Returns true, if the row vectors of the upper 3x3 matrix form an
orthogonal basis.
Note they do not have to be unit length for this test to return true.
"""
result["Matrix4f"].Orthonormalize.func_doc = """Orthonormalize(issueWarning) -> bool
Makes the matrix orthonormal in place.
This is an iterative method that is much more stable than the previous
cross/cross method. If the iterative method does not converge, a
warning is issued.
Returns true if the iteration converged, false otherwise. Leaves any
translation part of the matrix unchanged. If *issueWarning* is true,
this method will issue a warning if the iteration does not converge,
otherwise it will be silent.
Parameters
----------
issueWarning : bool
"""
result["Matrix4f"].GetOrthonormalized.func_doc = """GetOrthonormalized(issueWarning) -> Matrix4f
Returns an orthonormalized copy of the matrix.
Parameters
----------
issueWarning : bool
"""
result["Matrix4f"].GetHandedness.func_doc = """GetHandedness() -> float
Returns the sign of the determinant of the upper 3x3 matrix, i.e.
1 for a right-handed matrix, -1 for a left-handed matrix, and 0 for a
singular matrix.
"""
result["Matrix4f"].IsRightHanded.func_doc = """IsRightHanded() -> bool
Returns true if the vectors in the upper 3x3 matrix form a right-
handed coordinate system.
"""
result["Matrix4f"].IsLeftHanded.func_doc = """IsLeftHanded() -> bool
Returns true if the vectors in the upper 3x3 matrix form a left-handed
coordinate system.
"""
result["Matrix4f"].RemoveScaleShear.func_doc = """RemoveScaleShear() -> Matrix4f
Returns the matrix with any scaling or shearing removed, leaving only
the rotation and translation.
If the matrix cannot be decomposed, returns the original matrix.
"""
result["MultiInterval"].__doc__ = """
GfMultiInterval represents a subset of the real number line as an
ordered set of non-intersecting GfIntervals.
"""
result["MultiInterval"].__init__.func_doc = """__init__()
----------------------------------------------------------------------
__init__(i)
Constructs an multi-interval with the single given interval.
Parameters
----------
i : Interval
----------------------------------------------------------------------
__init__(intervals)
Constructs an multi-interval containing the given input intervals.
Parameters
----------
intervals : list[Interval]
"""
result["MultiInterval"].IsEmpty.func_doc = """IsEmpty() -> bool
Returns true if the multi-interval is empty.
"""
result["MultiInterval"].GetSize.func_doc = """GetSize() -> int
Returns the number of intervals in the set.
"""
result["MultiInterval"].GetBounds.func_doc = """GetBounds() -> Interval
Returns an interval bounding the entire multi-interval.
Returns an empty interval if the multi-interval is empty.
"""
result["MultiInterval"].Clear.func_doc = """Clear() -> None
Clear the multi-interval.
"""
result["MultiInterval"].Add.func_doc = """Add(i) -> None
Add the given interval to the multi-interval.
Parameters
----------
i : Interval
----------------------------------------------------------------------
Add(s) -> None
Add the given multi-interval to the multi-interval.
Sets this object to the union of the two sets.
Parameters
----------
s : MultiInterval
"""
result["MultiInterval"].ArithmeticAdd.func_doc = """ArithmeticAdd(i) -> None
Uses the given interval to extend the multi-interval in the interval
arithmetic sense.
Parameters
----------
i : Interval
"""
result["MultiInterval"].Remove.func_doc = """Remove(i) -> None
Remove the given interval from this multi-interval.
Parameters
----------
i : Interval
----------------------------------------------------------------------
Remove(s) -> None
Remove the given multi-interval from this multi-interval.
Parameters
----------
s : MultiInterval
"""
result["MultiInterval"].Intersect.func_doc = """Intersect(i) -> None
Parameters
----------
i : Interval
----------------------------------------------------------------------
Intersect(s) -> None
Parameters
----------
s : MultiInterval
"""
result["MultiInterval"].GetComplement.func_doc = """GetComplement() -> MultiInterval
Return the complement of this set.
"""
result["MultiInterval"].GetFullInterval.func_doc = """**classmethod** GetFullInterval() -> MultiInterval
Returns the full interval (-inf, inf).
"""
result["Plane"].__doc__ = """
Basic type: 3-dimensional plane
This class represents a three-dimensional plane as a normal vector and
the distance of the plane from the origin, measured along the normal.
The plane can also be used to represent a half-space: the side of the
plane in the direction of the normal.
"""
result["Plane"].__init__.func_doc = """__init__()
The default constructor leaves the plane parameters undefined.
----------------------------------------------------------------------
__init__(normal, distanceToOrigin)
This constructor sets this to the plane perpendicular to ``normal``
and at ``distance`` units from the origin.
The passed-in normal is normalized to unit length first.
Parameters
----------
normal : Vec3d
distanceToOrigin : float
----------------------------------------------------------------------
__init__(normal, point)
This constructor sets this to the plane perpendicular to ``normal``
and that passes through ``point`` .
The passed-in normal is normalized to unit length first.
Parameters
----------
normal : Vec3d
point : Vec3d
----------------------------------------------------------------------
__init__(p0, p1, p2)
This constructor sets this to the plane that contains the three given
points.
The normal is constructed from the cross product of ( ``p1`` - ``p0``
) ( ``p2`` - ``p0`` ). Results are undefined if the points are
collinear.
Parameters
----------
p0 : Vec3d
p1 : Vec3d
p2 : Vec3d
----------------------------------------------------------------------
__init__(eqn)
This constructor creates a plane given by the equation ``eqn`` [0] \\*
x + ``eqn`` [1] \\* y + ``eqn`` [2] \\* z + ``eqn`` [3] = 0.
Parameters
----------
eqn : Vec4d
"""
result["Plane"].Set.func_doc = """Set(normal, distanceToOrigin) -> None
Sets this to the plane perpendicular to ``normal`` and at ``distance``
units from the origin.
The passed-in normal is normalized to unit length first.
Parameters
----------
normal : Vec3d
distanceToOrigin : float
----------------------------------------------------------------------
Set(normal, point) -> None
This constructor sets this to the plane perpendicular to ``normal``
and that passes through ``point`` .
The passed-in normal is normalized to unit length first.
Parameters
----------
normal : Vec3d
point : Vec3d
----------------------------------------------------------------------
Set(p0, p1, p2) -> None
This constructor sets this to the plane that contains the three given
points.
The normal is constructed from the cross product of ( ``p1`` - ``p0``
) ( ``p2`` - ``p0`` ). Results are undefined if the points are
collinear.
Parameters
----------
p0 : Vec3d
p1 : Vec3d
p2 : Vec3d
----------------------------------------------------------------------
Set(eqn) -> None
This method sets this to the plane given by the equation ``eqn`` [0]
\\* x + ``eqn`` [1] \\* y + ``eqn`` [2] \\* z + ``eqn`` [3] = 0.
Parameters
----------
eqn : Vec4d
"""
result["Plane"].GetNormal.func_doc = """GetNormal() -> Vec3d
Returns the unit-length normal vector of the plane.
"""
result["Plane"].GetDistanceFromOrigin.func_doc = """GetDistanceFromOrigin() -> float
Returns the distance of the plane from the origin.
"""
result["Plane"].GetEquation.func_doc = """GetEquation() -> Vec4d
Give the coefficients of the equation of the plane.
Suitable to OpenGL calls to set the clipping plane.
"""
result["Plane"].GetDistance.func_doc = """GetDistance(p) -> float
Returns the distance of point ``from`` the plane.
This distance will be positive if the point is on the side of the
plane containing the normal.
Parameters
----------
p : Vec3d
"""
result["Plane"].Project.func_doc = """Project(p) -> Vec3d
Return the projection of ``p`` onto the plane.
Parameters
----------
p : Vec3d
"""
result["Plane"].Transform.func_doc = """Transform(matrix) -> Plane
Transforms the plane by the given matrix.
Parameters
----------
matrix : Matrix4d
"""
result["Plane"].Reorient.func_doc = """Reorient(p) -> None
Flip the plane normal (if necessary) so that ``p`` is in the positive
halfspace.
Parameters
----------
p : Vec3d
"""
result["Plane"].IntersectsPositiveHalfSpace.func_doc = """IntersectsPositiveHalfSpace(box) -> bool
Returns ``true`` if the given aligned bounding box is at least
partially on the positive side (the one the normal points into) of the
plane.
Parameters
----------
box : Range3d
----------------------------------------------------------------------
IntersectsPositiveHalfSpace(pt) -> bool
Returns true if the given point is on the plane or within its positive
half space.
Parameters
----------
pt : Vec3d
"""
result["Quatd"].__doc__ = """
Basic type: a quaternion, a complex number with a real coefficient and
three imaginary coefficients, stored as a 3-vector.
"""
result["Quatd"].__init__.func_doc = """__init__()
Default constructor leaves the quaternion undefined.
----------------------------------------------------------------------
__init__(realVal)
Initialize the real coefficient to ``realVal`` and the imaginary
coefficients to zero.
Since quaternions typically must be normalized, reasonable values for
``realVal`` are -1, 0, or 1. Other values are legal but are likely to
be meaningless.
Parameters
----------
realVal : float
----------------------------------------------------------------------
__init__(real, i, j, k)
Initialize the real and imaginary coefficients.
Parameters
----------
real : float
i : float
j : float
k : float
----------------------------------------------------------------------
__init__(real, imaginary)
Initialize the real and imaginary coefficients.
Parameters
----------
real : float
imaginary : Vec3d
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfQuatf.
Parameters
----------
other : Quatf
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfQuath.
Parameters
----------
other : Quath
"""
result["Quatd"].GetReal.func_doc = """GetReal() -> float
Return the real coefficient.
"""
result["Quatd"].SetReal.func_doc = """SetReal(real) -> None
Set the real coefficient.
Parameters
----------
real : float
"""
result["Quatd"].GetImaginary.func_doc = """GetImaginary() -> Vec3d
Return the imaginary coefficient.
"""
result["Quatd"].SetImaginary.func_doc = """SetImaginary(imaginary) -> None
Set the imaginary coefficients.
Parameters
----------
imaginary : Vec3d
----------------------------------------------------------------------
SetImaginary(i, j, k) -> None
Set the imaginary coefficients.
Parameters
----------
i : float
j : float
k : float
"""
result["Quatd"].GetLength.func_doc = """GetLength() -> float
Return geometric length of this quaternion.
"""
result["Quatd"].GetNormalized.func_doc = """GetNormalized(eps) -> Quatd
length of this quaternion is smaller than ``eps`` , return the
identity quaternion.
Parameters
----------
eps : float
"""
result["Quatd"].Normalize.func_doc = """Normalize(eps) -> float
Normalizes this quaternion in place to unit length, returning the
length before normalization.
If the length of this quaternion is smaller than ``eps`` , this sets
the quaternion to identity.
Parameters
----------
eps : float
"""
result["Quatd"].GetConjugate.func_doc = """GetConjugate() -> Quatd
Return this quaternion's conjugate, which is the quaternion with the
same real coefficient and negated imaginary coefficients.
"""
result["Quatd"].GetInverse.func_doc = """GetInverse() -> Quatd
Return this quaternion's inverse, or reciprocal.
This is the quaternion's conjugate divided by it's squared length.
"""
result["Quatd"].Transform.func_doc = """Transform(point) -> Vec3d
Transform the GfVec3d point.
If the quaternion is normalized, the transformation is a rotation.
Given a GfQuatd q, q.Transform(point) is equivalent to: (q \\*
GfQuatd(0, point) \\* q.GetInverse()).GetImaginary()
but is more efficient.
Parameters
----------
point : Vec3d
"""
result["Quatd"].GetZero.func_doc = """**classmethod** GetZero() -> Quatd
Return the zero quaternion, with real coefficient 0 and an imaginary
coefficients all zero.
"""
result["Quatd"].GetIdentity.func_doc = """**classmethod** GetIdentity() -> Quatd
Return the identity quaternion, with real coefficient 1 and an
imaginary coefficients all zero.
"""
result["Quaternion"].__init__.func_doc = """__init__()
The default constructor leaves the quaternion undefined.
----------------------------------------------------------------------
__init__(realVal)
This constructor initializes the real part to the argument and the
imaginary parts to zero.
Since quaternions typically need to be normalized, the only reasonable
values for ``realVal`` are -1, 0, or 1. Other values are legal but are
likely to be meaningless.
Parameters
----------
realVal : int
----------------------------------------------------------------------
__init__(real, imaginary)
This constructor initializes the real and imaginary parts.
Parameters
----------
real : float
imaginary : Vec3d
"""
result["Quaternion"].GetReal.func_doc = """GetReal() -> float
Returns the real part of the quaternion.
"""
result["Quaternion"].GetImaginary.func_doc = """GetImaginary() -> Vec3d
Returns the imaginary part of the quaternion.
"""
result["Quaternion"].GetLength.func_doc = """GetLength() -> float
Returns geometric length of this quaternion.
"""
result["Quaternion"].GetNormalized.func_doc = """GetNormalized(eps) -> Quaternion
Returns a normalized (unit-length) version of this quaternion.
direction as this. If the length of this quaternion is smaller than
``eps`` , this returns the identity quaternion.
Parameters
----------
eps : float
"""
result["Quaternion"].Normalize.func_doc = """Normalize(eps) -> float
Normalizes this quaternion in place to unit length, returning the
length before normalization.
If the length of this quaternion is smaller than ``eps`` , this sets
the quaternion to identity.
Parameters
----------
eps : float
"""
result["Quaternion"].GetInverse.func_doc = """GetInverse() -> Quaternion
Returns the inverse of this quaternion.
"""
result["Quaternion"].GetZero.func_doc = """**classmethod** GetZero() -> Quaternion
Returns the zero quaternion, which has a real part of 0 and an
imaginary part of (0,0,0).
"""
result["Quaternion"].GetIdentity.func_doc = """**classmethod** GetIdentity() -> Quaternion
Returns the identity quaternion, which has a real part of 1 and an
imaginary part of (0,0,0).
"""
result["Quatf"].__doc__ = """
Basic type: a quaternion, a complex number with a real coefficient and
three imaginary coefficients, stored as a 3-vector.
"""
result["Quatf"].__init__.func_doc = """__init__()
Default constructor leaves the quaternion undefined.
----------------------------------------------------------------------
__init__(realVal)
Initialize the real coefficient to ``realVal`` and the imaginary
coefficients to zero.
Since quaternions typically must be normalized, reasonable values for
``realVal`` are -1, 0, or 1. Other values are legal but are likely to
be meaningless.
Parameters
----------
realVal : float
----------------------------------------------------------------------
__init__(real, i, j, k)
Initialize the real and imaginary coefficients.
Parameters
----------
real : float
i : float
j : float
k : float
----------------------------------------------------------------------
__init__(real, imaginary)
Initialize the real and imaginary coefficients.
Parameters
----------
real : float
imaginary : Vec3f
----------------------------------------------------------------------
__init__(other)
Construct from GfQuatd.
Parameters
----------
other : Quatd
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfQuath.
Parameters
----------
other : Quath
"""
result["Quatf"].GetReal.func_doc = """GetReal() -> float
Return the real coefficient.
"""
result["Quatf"].SetReal.func_doc = """SetReal(real) -> None
Set the real coefficient.
Parameters
----------
real : float
"""
result["Quatf"].GetImaginary.func_doc = """GetImaginary() -> Vec3f
Return the imaginary coefficient.
"""
result["Quatf"].SetImaginary.func_doc = """SetImaginary(imaginary) -> None
Set the imaginary coefficients.
Parameters
----------
imaginary : Vec3f
----------------------------------------------------------------------
SetImaginary(i, j, k) -> None
Set the imaginary coefficients.
Parameters
----------
i : float
j : float
k : float
"""
result["Quatf"].GetLength.func_doc = """GetLength() -> float
Return geometric length of this quaternion.
"""
result["Quatf"].GetNormalized.func_doc = """GetNormalized(eps) -> Quatf
length of this quaternion is smaller than ``eps`` , return the
identity quaternion.
Parameters
----------
eps : float
"""
result["Quatf"].Normalize.func_doc = """Normalize(eps) -> float
Normalizes this quaternion in place to unit length, returning the
length before normalization.
If the length of this quaternion is smaller than ``eps`` , this sets
the quaternion to identity.
Parameters
----------
eps : float
"""
result["Quatf"].GetConjugate.func_doc = """GetConjugate() -> Quatf
Return this quaternion's conjugate, which is the quaternion with the
same real coefficient and negated imaginary coefficients.
"""
result["Quatf"].GetInverse.func_doc = """GetInverse() -> Quatf
Return this quaternion's inverse, or reciprocal.
This is the quaternion's conjugate divided by it's squared length.
"""
result["Quatf"].Transform.func_doc = """Transform(point) -> Vec3f
Transform the GfVec3f point.
If the quaternion is normalized, the transformation is a rotation.
Given a GfQuatf q, q.Transform(point) is equivalent to: (q \\*
GfQuatf(0, point) \\* q.GetInverse()).GetImaginary()
but is more efficient.
Parameters
----------
point : Vec3f
"""
result["Quatf"].GetZero.func_doc = """**classmethod** GetZero() -> Quatf
Return the zero quaternion, with real coefficient 0 and an imaginary
coefficients all zero.
"""
result["Quatf"].GetIdentity.func_doc = """**classmethod** GetIdentity() -> Quatf
Return the identity quaternion, with real coefficient 1 and an
imaginary coefficients all zero.
"""
result["Quath"].__doc__ = """
Basic type: a quaternion, a complex number with a real coefficient and
three imaginary coefficients, stored as a 3-vector.
"""
result["Quath"].__init__.func_doc = """__init__()
Default constructor leaves the quaternion undefined.
----------------------------------------------------------------------
__init__(realVal)
Initialize the real coefficient to ``realVal`` and the imaginary
coefficients to zero.
Since quaternions typically must be normalized, reasonable values for
``realVal`` are -1, 0, or 1. Other values are legal but are likely to
be meaningless.
Parameters
----------
realVal : GfHalf
----------------------------------------------------------------------
__init__(real, i, j, k)
Initialize the real and imaginary coefficients.
Parameters
----------
real : GfHalf
i : GfHalf
j : GfHalf
k : GfHalf
----------------------------------------------------------------------
__init__(real, imaginary)
Initialize the real and imaginary coefficients.
Parameters
----------
real : GfHalf
imaginary : Vec3h
----------------------------------------------------------------------
__init__(other)
Construct from GfQuatd.
Parameters
----------
other : Quatd
----------------------------------------------------------------------
__init__(other)
Construct from GfQuatf.
Parameters
----------
other : Quatf
"""
result["Quath"].GetReal.func_doc = """GetReal() -> GfHalf
Return the real coefficient.
"""
result["Quath"].SetReal.func_doc = """SetReal(real) -> None
Set the real coefficient.
Parameters
----------
real : GfHalf
"""
result["Quath"].GetImaginary.func_doc = """GetImaginary() -> Vec3h
Return the imaginary coefficient.
"""
result["Quath"].SetImaginary.func_doc = """SetImaginary(imaginary) -> None
Set the imaginary coefficients.
Parameters
----------
imaginary : Vec3h
----------------------------------------------------------------------
SetImaginary(i, j, k) -> None
Set the imaginary coefficients.
Parameters
----------
i : GfHalf
j : GfHalf
k : GfHalf
"""
result["Quath"].GetLength.func_doc = """GetLength() -> GfHalf
Return geometric length of this quaternion.
"""
result["Quath"].GetNormalized.func_doc = """GetNormalized(eps) -> Quath
length of this quaternion is smaller than ``eps`` , return the
identity quaternion.
Parameters
----------
eps : GfHalf
"""
result["Quath"].Normalize.func_doc = """Normalize(eps) -> GfHalf
Normalizes this quaternion in place to unit length, returning the
length before normalization.
If the length of this quaternion is smaller than ``eps`` , this sets
the quaternion to identity.
Parameters
----------
eps : GfHalf
"""
result["Quath"].GetConjugate.func_doc = """GetConjugate() -> Quath
Return this quaternion's conjugate, which is the quaternion with the
same real coefficient and negated imaginary coefficients.
"""
result["Quath"].GetInverse.func_doc = """GetInverse() -> Quath
Return this quaternion's inverse, or reciprocal.
This is the quaternion's conjugate divided by it's squared length.
"""
result["Quath"].Transform.func_doc = """Transform(point) -> Vec3h
Transform the GfVec3h point.
If the quaternion is normalized, the transformation is a rotation.
Given a GfQuath q, q.Transform(point) is equivalent to: (q \\*
GfQuath(0, point) \\* q.GetInverse()).GetImaginary()
but is more efficient.
Parameters
----------
point : Vec3h
"""
result["Quath"].GetZero.func_doc = """**classmethod** GetZero() -> Quath
Return the zero quaternion, with real coefficient 0 and an imaginary
coefficients all zero.
"""
result["Quath"].GetIdentity.func_doc = """**classmethod** GetIdentity() -> Quath
Return the identity quaternion, with real coefficient 1 and an
imaginary coefficients all zero.
"""
result["Range1d"].__doc__ = """
Basic type: 1-dimensional floating point range.
This class represents a 1-dimensional range (or interval) All
operations are component-wise and conform to interval mathematics. An
empty range is one where max<min. The default empty is
[FLT_MAX,-FLT_MAX]
"""
result["Range1d"].SetEmpty.func_doc = """SetEmpty() -> None
Sets the range to an empty interval.
"""
result["Range1d"].__init__.func_doc = """__init__()
The default constructor creates an empty range.
----------------------------------------------------------------------
__init__(min, max)
This constructor initializes the minimum and maximum points.
Parameters
----------
min : float
max : float
"""
result["Range1d"].GetMin.func_doc = """GetMin() -> float
Returns the minimum value of the range.
"""
result["Range1d"].GetMax.func_doc = """GetMax() -> float
Returns the maximum value of the range.
"""
result["Range1d"].GetSize.func_doc = """GetSize() -> float
Returns the size of the range.
"""
result["Range1d"].GetMidpoint.func_doc = """GetMidpoint() -> float
Returns the midpoint of the range, that is, 0.5\\*(min+max).
Note: this returns zero in the case of default-constructed ranges, or
ranges set via SetEmpty() .
"""
result["Range1d"].SetMin.func_doc = """SetMin(min) -> None
Sets the minimum value of the range.
Parameters
----------
min : float
"""
result["Range1d"].SetMax.func_doc = """SetMax(max) -> None
Sets the maximum value of the range.
Parameters
----------
max : float
"""
result["Range1d"].IsEmpty.func_doc = """IsEmpty() -> bool
Returns whether the range is empty (max<min).
"""
result["Range1d"].Contains.func_doc = """Contains(point) -> bool
Returns true if the ``point`` is located inside the range.
As with all operations of this type, the range is assumed to include
its extrema.
Parameters
----------
point : float
----------------------------------------------------------------------
Contains(range) -> bool
Returns true if the ``range`` is located entirely inside the range.
As with all operations of this type, the ranges are assumed to include
their extrema.
Parameters
----------
range : Range1d
"""
result["Range1d"].UnionWith.func_doc = """UnionWith(b) -> Range1d
Extend ``this`` to include ``b`` .
Parameters
----------
b : Range1d
----------------------------------------------------------------------
UnionWith(b) -> Range1d
Extend ``this`` to include ``b`` .
Parameters
----------
b : float
"""
result["Range1d"].IntersectWith.func_doc = """IntersectWith(b) -> Range1d
Modifies this range to hold its intersection with ``b`` and returns
the result.
Parameters
----------
b : Range1d
"""
result["Range1d"].GetDistanceSquared.func_doc = """GetDistanceSquared(p) -> float
Compute the squared distance from a point to the range.
Parameters
----------
p : float
"""
result["Range1d"].GetUnion.func_doc = """**classmethod** GetUnion(a, b) -> Range1d
Returns the smallest ``GfRange1d`` which contains both ``a`` and ``b``
.
Parameters
----------
a : Range1d
b : Range1d
"""
result["Range1d"].GetIntersection.func_doc = """**classmethod** GetIntersection(a, b) -> Range1d
Returns a ``GfRange1d`` that describes the intersection of ``a`` and
``b`` .
Parameters
----------
a : Range1d
b : Range1d
"""
result["Range1f"].__doc__ = """
Basic type: 1-dimensional floating point range.
This class represents a 1-dimensional range (or interval) All
operations are component-wise and conform to interval mathematics. An
empty range is one where max<min. The default empty is
[FLT_MAX,-FLT_MAX]
"""
result["Range1f"].SetEmpty.func_doc = """SetEmpty() -> None
Sets the range to an empty interval.
"""
result["Range1f"].__init__.func_doc = """__init__()
The default constructor creates an empty range.
----------------------------------------------------------------------
__init__(min, max)
This constructor initializes the minimum and maximum points.
Parameters
----------
min : float
max : float
"""
result["Range1f"].GetMin.func_doc = """GetMin() -> float
Returns the minimum value of the range.
"""
result["Range1f"].GetMax.func_doc = """GetMax() -> float
Returns the maximum value of the range.
"""
result["Range1f"].GetSize.func_doc = """GetSize() -> float
Returns the size of the range.
"""
result["Range1f"].GetMidpoint.func_doc = """GetMidpoint() -> float
Returns the midpoint of the range, that is, 0.5\\*(min+max).
Note: this returns zero in the case of default-constructed ranges, or
ranges set via SetEmpty() .
"""
result["Range1f"].SetMin.func_doc = """SetMin(min) -> None
Sets the minimum value of the range.
Parameters
----------
min : float
"""
result["Range1f"].SetMax.func_doc = """SetMax(max) -> None
Sets the maximum value of the range.
Parameters
----------
max : float
"""
result["Range1f"].IsEmpty.func_doc = """IsEmpty() -> bool
Returns whether the range is empty (max<min).
"""
result["Range1f"].Contains.func_doc = """Contains(point) -> bool
Returns true if the ``point`` is located inside the range.
As with all operations of this type, the range is assumed to include
its extrema.
Parameters
----------
point : float
----------------------------------------------------------------------
Contains(range) -> bool
Returns true if the ``range`` is located entirely inside the range.
As with all operations of this type, the ranges are assumed to include
their extrema.
Parameters
----------
range : Range1f
"""
result["Range1f"].UnionWith.func_doc = """UnionWith(b) -> Range1f
Extend ``this`` to include ``b`` .
Parameters
----------
b : Range1f
----------------------------------------------------------------------
UnionWith(b) -> Range1f
Extend ``this`` to include ``b`` .
Parameters
----------
b : float
"""
result["Range1f"].IntersectWith.func_doc = """IntersectWith(b) -> Range1f
Modifies this range to hold its intersection with ``b`` and returns
the result.
Parameters
----------
b : Range1f
"""
result["Range1f"].GetDistanceSquared.func_doc = """GetDistanceSquared(p) -> float
Compute the squared distance from a point to the range.
Parameters
----------
p : float
"""
result["Range1f"].GetUnion.func_doc = """**classmethod** GetUnion(a, b) -> Range1f
Returns the smallest ``GfRange1f`` which contains both ``a`` and ``b``
.
Parameters
----------
a : Range1f
b : Range1f
"""
result["Range1f"].GetIntersection.func_doc = """**classmethod** GetIntersection(a, b) -> Range1f
Returns a ``GfRange1f`` that describes the intersection of ``a`` and
``b`` .
Parameters
----------
a : Range1f
b : Range1f
"""
result["Range2d"].__doc__ = """
Basic type: 2-dimensional floating point range.
This class represents a 2-dimensional range (or interval) All
operations are component-wise and conform to interval mathematics. An
empty range is one where max<min. The default empty is
[FLT_MAX,-FLT_MAX]
"""
result["Range2d"].SetEmpty.func_doc = """SetEmpty() -> None
Sets the range to an empty interval.
"""
result["Range2d"].__init__.func_doc = """__init__()
The default constructor creates an empty range.
----------------------------------------------------------------------
__init__(min, max)
This constructor initializes the minimum and maximum points.
Parameters
----------
min : Vec2d
max : Vec2d
"""
result["Range2d"].GetMin.func_doc = """GetMin() -> Vec2d
Returns the minimum value of the range.
"""
result["Range2d"].GetMax.func_doc = """GetMax() -> Vec2d
Returns the maximum value of the range.
"""
result["Range2d"].GetSize.func_doc = """GetSize() -> Vec2d
Returns the size of the range.
"""
result["Range2d"].GetMidpoint.func_doc = """GetMidpoint() -> Vec2d
Returns the midpoint of the range, that is, 0.5\\*(min+max).
Note: this returns zero in the case of default-constructed ranges, or
ranges set via SetEmpty() .
"""
result["Range2d"].SetMin.func_doc = """SetMin(min) -> None
Sets the minimum value of the range.
Parameters
----------
min : Vec2d
"""
result["Range2d"].SetMax.func_doc = """SetMax(max) -> None
Sets the maximum value of the range.
Parameters
----------
max : Vec2d
"""
result["Range2d"].IsEmpty.func_doc = """IsEmpty() -> bool
Returns whether the range is empty (max<min).
"""
result["Range2d"].Contains.func_doc = """Contains(point) -> bool
Returns true if the ``point`` is located inside the range.
As with all operations of this type, the range is assumed to include
its extrema.
Parameters
----------
point : Vec2d
----------------------------------------------------------------------
Contains(range) -> bool
Returns true if the ``range`` is located entirely inside the range.
As with all operations of this type, the ranges are assumed to include
their extrema.
Parameters
----------
range : Range2d
"""
result["Range2d"].UnionWith.func_doc = """UnionWith(b) -> Range2d
Extend ``this`` to include ``b`` .
Parameters
----------
b : Range2d
----------------------------------------------------------------------
UnionWith(b) -> Range2d
Extend ``this`` to include ``b`` .
Parameters
----------
b : Vec2d
"""
result["Range2d"].IntersectWith.func_doc = """IntersectWith(b) -> Range2d
Modifies this range to hold its intersection with ``b`` and returns
the result.
Parameters
----------
b : Range2d
"""
result["Range2d"].GetDistanceSquared.func_doc = """GetDistanceSquared(p) -> float
Compute the squared distance from a point to the range.
Parameters
----------
p : Vec2d
"""
result["Range2d"].GetCorner.func_doc = """GetCorner(i) -> Vec2d
Returns the ith corner of the range, in the following order: SW, SE,
NW, NE.
Parameters
----------
i : int
"""
result["Range2d"].GetQuadrant.func_doc = """GetQuadrant(i) -> Range2d
Returns the ith quadrant of the range, in the following order: SW, SE,
NW, NE.
Parameters
----------
i : int
"""
result["Range2d"].GetUnion.func_doc = """**classmethod** GetUnion(a, b) -> Range2d
Returns the smallest ``GfRange2d`` which contains both ``a`` and ``b``
.
Parameters
----------
a : Range2d
b : Range2d
"""
result["Range2d"].GetIntersection.func_doc = """**classmethod** GetIntersection(a, b) -> Range2d
Returns a ``GfRange2d`` that describes the intersection of ``a`` and
``b`` .
Parameters
----------
a : Range2d
b : Range2d
"""
result["Range2f"].__doc__ = """
Basic type: 2-dimensional floating point range.
This class represents a 2-dimensional range (or interval) All
operations are component-wise and conform to interval mathematics. An
empty range is one where max<min. The default empty is
[FLT_MAX,-FLT_MAX]
"""
result["Range2f"].SetEmpty.func_doc = """SetEmpty() -> None
Sets the range to an empty interval.
"""
result["Range2f"].__init__.func_doc = """__init__()
The default constructor creates an empty range.
----------------------------------------------------------------------
__init__(min, max)
This constructor initializes the minimum and maximum points.
Parameters
----------
min : Vec2f
max : Vec2f
"""
result["Range2f"].GetMin.func_doc = """GetMin() -> Vec2f
Returns the minimum value of the range.
"""
result["Range2f"].GetMax.func_doc = """GetMax() -> Vec2f
Returns the maximum value of the range.
"""
result["Range2f"].GetSize.func_doc = """GetSize() -> Vec2f
Returns the size of the range.
"""
result["Range2f"].GetMidpoint.func_doc = """GetMidpoint() -> Vec2f
Returns the midpoint of the range, that is, 0.5\\*(min+max).
Note: this returns zero in the case of default-constructed ranges, or
ranges set via SetEmpty() .
"""
result["Range2f"].SetMin.func_doc = """SetMin(min) -> None
Sets the minimum value of the range.
Parameters
----------
min : Vec2f
"""
result["Range2f"].SetMax.func_doc = """SetMax(max) -> None
Sets the maximum value of the range.
Parameters
----------
max : Vec2f
"""
result["Range2f"].IsEmpty.func_doc = """IsEmpty() -> bool
Returns whether the range is empty (max<min).
"""
result["Range2f"].Contains.func_doc = """Contains(point) -> bool
Returns true if the ``point`` is located inside the range.
As with all operations of this type, the range is assumed to include
its extrema.
Parameters
----------
point : Vec2f
----------------------------------------------------------------------
Contains(range) -> bool
Returns true if the ``range`` is located entirely inside the range.
As with all operations of this type, the ranges are assumed to include
their extrema.
Parameters
----------
range : Range2f
"""
result["Range2f"].UnionWith.func_doc = """UnionWith(b) -> Range2f
Extend ``this`` to include ``b`` .
Parameters
----------
b : Range2f
----------------------------------------------------------------------
UnionWith(b) -> Range2f
Extend ``this`` to include ``b`` .
Parameters
----------
b : Vec2f
"""
result["Range2f"].IntersectWith.func_doc = """IntersectWith(b) -> Range2f
Modifies this range to hold its intersection with ``b`` and returns
the result.
Parameters
----------
b : Range2f
"""
result["Range2f"].GetDistanceSquared.func_doc = """GetDistanceSquared(p) -> float
Compute the squared distance from a point to the range.
Parameters
----------
p : Vec2f
"""
result["Range2f"].GetCorner.func_doc = """GetCorner(i) -> Vec2f
Returns the ith corner of the range, in the following order: SW, SE,
NW, NE.
Parameters
----------
i : int
"""
result["Range2f"].GetQuadrant.func_doc = """GetQuadrant(i) -> Range2f
Returns the ith quadrant of the range, in the following order: SW, SE,
NW, NE.
Parameters
----------
i : int
"""
result["Range2f"].GetUnion.func_doc = """**classmethod** GetUnion(a, b) -> Range2f
Returns the smallest ``GfRange2f`` which contains both ``a`` and ``b``
.
Parameters
----------
a : Range2f
b : Range2f
"""
result["Range2f"].GetIntersection.func_doc = """**classmethod** GetIntersection(a, b) -> Range2f
Returns a ``GfRange2f`` that describes the intersection of ``a`` and
``b`` .
Parameters
----------
a : Range2f
b : Range2f
"""
result["Range3d"].__doc__ = """
Basic type: 3-dimensional floating point range.
This class represents a 3-dimensional range (or interval) All
operations are component-wise and conform to interval mathematics. An
empty range is one where max<min. The default empty is
[FLT_MAX,-FLT_MAX]
"""
result["Range3d"].SetEmpty.func_doc = """SetEmpty() -> None
Sets the range to an empty interval.
"""
result["Range3d"].__init__.func_doc = """__init__()
The default constructor creates an empty range.
----------------------------------------------------------------------
__init__(min, max)
This constructor initializes the minimum and maximum points.
Parameters
----------
min : Vec3d
max : Vec3d
"""
result["Range3d"].GetMin.func_doc = """GetMin() -> Vec3d
Returns the minimum value of the range.
"""
result["Range3d"].GetMax.func_doc = """GetMax() -> Vec3d
Returns the maximum value of the range.
"""
result["Range3d"].GetSize.func_doc = """GetSize() -> Vec3d
Returns the size of the range.
"""
result["Range3d"].GetMidpoint.func_doc = """GetMidpoint() -> Vec3d
Returns the midpoint of the range, that is, 0.5\\*(min+max).
Note: this returns zero in the case of default-constructed ranges, or
ranges set via SetEmpty() .
"""
result["Range3d"].SetMin.func_doc = """SetMin(min) -> None
Sets the minimum value of the range.
Parameters
----------
min : Vec3d
"""
result["Range3d"].SetMax.func_doc = """SetMax(max) -> None
Sets the maximum value of the range.
Parameters
----------
max : Vec3d
"""
result["Range3d"].IsEmpty.func_doc = """IsEmpty() -> bool
Returns whether the range is empty (max<min).
"""
result["Range3d"].Contains.func_doc = """Contains(point) -> bool
Returns true if the ``point`` is located inside the range.
As with all operations of this type, the range is assumed to include
its extrema.
Parameters
----------
point : Vec3d
----------------------------------------------------------------------
Contains(range) -> bool
Returns true if the ``range`` is located entirely inside the range.
As with all operations of this type, the ranges are assumed to include
their extrema.
Parameters
----------
range : Range3d
"""
result["Range3d"].UnionWith.func_doc = """UnionWith(b) -> Range3d
Extend ``this`` to include ``b`` .
Parameters
----------
b : Range3d
----------------------------------------------------------------------
UnionWith(b) -> Range3d
Extend ``this`` to include ``b`` .
Parameters
----------
b : Vec3d
"""
result["Range3d"].IntersectWith.func_doc = """IntersectWith(b) -> Range3d
Modifies this range to hold its intersection with ``b`` and returns
the result.
Parameters
----------
b : Range3d
"""
result["Range3d"].GetDistanceSquared.func_doc = """GetDistanceSquared(p) -> float
Compute the squared distance from a point to the range.
Parameters
----------
p : Vec3d
"""
result["Range3d"].GetCorner.func_doc = """GetCorner(i) -> Vec3d
Returns the ith corner of the range, in the following order: LDB, RDB,
LUB, RUB, LDF, RDF, LUF, RUF.
Where L/R is left/right, D/U is down/up, and B/F is back/front.
Parameters
----------
i : int
"""
result["Range3d"].GetOctant.func_doc = """GetOctant(i) -> Range3d
Returns the ith octant of the range, in the following order: LDB, RDB,
LUB, RUB, LDF, RDF, LUF, RUF.
Where L/R is left/right, D/U is down/up, and B/F is back/front.
Parameters
----------
i : int
"""
result["Range3d"].GetUnion.func_doc = """**classmethod** GetUnion(a, b) -> Range3d
Returns the smallest ``GfRange3d`` which contains both ``a`` and ``b``
.
Parameters
----------
a : Range3d
b : Range3d
"""
result["Range3d"].GetIntersection.func_doc = """**classmethod** GetIntersection(a, b) -> Range3d
Returns a ``GfRange3d`` that describes the intersection of ``a`` and
``b`` .
Parameters
----------
a : Range3d
b : Range3d
"""
result["Range3f"].__doc__ = """
Basic type: 3-dimensional floating point range.
This class represents a 3-dimensional range (or interval) All
operations are component-wise and conform to interval mathematics. An
empty range is one where max<min. The default empty is
[FLT_MAX,-FLT_MAX]
"""
result["Range3f"].SetEmpty.func_doc = """SetEmpty() -> None
Sets the range to an empty interval.
"""
result["Range3f"].__init__.func_doc = """__init__()
The default constructor creates an empty range.
----------------------------------------------------------------------
__init__(min, max)
This constructor initializes the minimum and maximum points.
Parameters
----------
min : Vec3f
max : Vec3f
"""
result["Range3f"].GetMin.func_doc = """GetMin() -> Vec3f
Returns the minimum value of the range.
"""
result["Range3f"].GetMax.func_doc = """GetMax() -> Vec3f
Returns the maximum value of the range.
"""
result["Range3f"].GetSize.func_doc = """GetSize() -> Vec3f
Returns the size of the range.
"""
result["Range3f"].GetMidpoint.func_doc = """GetMidpoint() -> Vec3f
Returns the midpoint of the range, that is, 0.5\\*(min+max).
Note: this returns zero in the case of default-constructed ranges, or
ranges set via SetEmpty() .
"""
result["Range3f"].SetMin.func_doc = """SetMin(min) -> None
Sets the minimum value of the range.
Parameters
----------
min : Vec3f
"""
result["Range3f"].SetMax.func_doc = """SetMax(max) -> None
Sets the maximum value of the range.
Parameters
----------
max : Vec3f
"""
result["Range3f"].IsEmpty.func_doc = """IsEmpty() -> bool
Returns whether the range is empty (max<min).
"""
result["Range3f"].Contains.func_doc = """Contains(point) -> bool
Returns true if the ``point`` is located inside the range.
As with all operations of this type, the range is assumed to include
its extrema.
Parameters
----------
point : Vec3f
----------------------------------------------------------------------
Contains(range) -> bool
Returns true if the ``range`` is located entirely inside the range.
As with all operations of this type, the ranges are assumed to include
their extrema.
Parameters
----------
range : Range3f
"""
result["Range3f"].UnionWith.func_doc = """UnionWith(b) -> Range3f
Extend ``this`` to include ``b`` .
Parameters
----------
b : Range3f
----------------------------------------------------------------------
UnionWith(b) -> Range3f
Extend ``this`` to include ``b`` .
Parameters
----------
b : Vec3f
"""
result["Range3f"].IntersectWith.func_doc = """IntersectWith(b) -> Range3f
Modifies this range to hold its intersection with ``b`` and returns
the result.
Parameters
----------
b : Range3f
"""
result["Range3f"].GetDistanceSquared.func_doc = """GetDistanceSquared(p) -> float
Compute the squared distance from a point to the range.
Parameters
----------
p : Vec3f
"""
result["Range3f"].GetCorner.func_doc = """GetCorner(i) -> Vec3f
Returns the ith corner of the range, in the following order: LDB, RDB,
LUB, RUB, LDF, RDF, LUF, RUF.
Where L/R is left/right, D/U is down/up, and B/F is back/front.
Parameters
----------
i : int
"""
result["Range3f"].GetOctant.func_doc = """GetOctant(i) -> Range3f
Returns the ith octant of the range, in the following order: LDB, RDB,
LUB, RUB, LDF, RDF, LUF, RUF.
Where L/R is left/right, D/U is down/up, and B/F is back/front.
Parameters
----------
i : int
"""
result["Range3f"].GetUnion.func_doc = """**classmethod** GetUnion(a, b) -> Range3f
Returns the smallest ``GfRange3f`` which contains both ``a`` and ``b``
.
Parameters
----------
a : Range3f
b : Range3f
"""
result["Range3f"].GetIntersection.func_doc = """**classmethod** GetIntersection(a, b) -> Range3f
Returns a ``GfRange3f`` that describes the intersection of ``a`` and
``b`` .
Parameters
----------
a : Range3f
b : Range3f
"""
result["Ray"].__doc__ = """
Basic type: Ray used for intersection testing
This class represents a three-dimensional ray in space, typically used
for intersection testing. It consists of an origin and a direction.
Note that by default a ``GfRay`` does not normalize its direction
vector to unit length.
Note for ray intersections, the start point is included in the
computations, i.e., a distance of zero is defined to be intersecting.
"""
result["Ray"].__init__.func_doc = """__init__()
The default constructor leaves the ray parameters undefined.
----------------------------------------------------------------------
__init__(startPoint, direction)
This constructor takes a starting point and a direction.
Parameters
----------
startPoint : Vec3d
direction : Vec3d
"""
result["Ray"].SetPointAndDirection.func_doc = """SetPointAndDirection(startPoint, direction) -> None
Sets the ray by specifying a starting point and a direction.
Parameters
----------
startPoint : Vec3d
direction : Vec3d
"""
result["Ray"].SetEnds.func_doc = """SetEnds(startPoint, endPoint) -> None
Sets the ray by specifying a starting point and an ending point.
Parameters
----------
startPoint : Vec3d
endPoint : Vec3d
"""
result["Ray"].GetPoint.func_doc = """GetPoint(distance) -> Vec3d
Returns the point that is ``distance`` units from the starting point
along the direction vector, expressed in parametic distance.
Parameters
----------
distance : float
"""
result["Ray"].Transform.func_doc = """Transform(matrix) -> Ray
Transforms the ray by the given matrix.
Parameters
----------
matrix : Matrix4d
"""
result["Ray"].FindClosestPoint.func_doc = """FindClosestPoint(point, rayDistance) -> Vec3d
Returns the point on the ray that is closest to ``point`` .
If ``rayDistance`` is not ``None`` , it will be set to the parametric
distance along the ray of the closest point.
Parameters
----------
point : Vec3d
rayDistance : float
"""
result["Rect2i"].__doc__ = """
A 2D rectangle with integer coordinates.
A rectangle is internally represented as two corners. We refer to
these as the min and max corner where the min's x-coordinate and
y-coordinate are assumed to be less than or equal to the max's
corresponding coordinates. Normally, it is expressed as a min corner
and a size.
Note that the max corner is included when computing the size (width
and height) of a rectangle as the number of integral points in the x-
and y-direction. In particular, if the min corner and max corner are
the same, then the width and the height of the rectangle will both be
one since we have exactly one integral point with coordinates greater
or equal to the min corner and less or equal to the max corner.
Specifically, *width = maxX - minX + 1* and *height = maxY - minY +
1.*
"""
result["Rect2i"].__init__.func_doc = """__init__()
Constructs an empty rectangle.
----------------------------------------------------------------------
__init__(min, max)
Constructs a rectangle with ``min`` and ``max`` corners.
Parameters
----------
min : Vec2i
max : Vec2i
----------------------------------------------------------------------
__init__(min, width, height)
Constructs a rectangle with ``min`` corner and the indicated ``width``
and ``height`` .
Parameters
----------
min : Vec2i
width : int
height : int
"""
result["Rect2i"].IsNull.func_doc = """IsNull() -> bool
Returns true if the rectangle is a null rectangle.
A null rectangle has both the width and the height set to 0, that is
.. code-block:: text
GetMaxX() == GetMinX() - 1
and
.. code-block:: text
GetMaxY() == GetMinY() - 1
Remember that if ``GetMinX()`` and ``GetMaxX()`` return the same
value then the rectangle has width 1, and similarly for the height.
A null rectangle is both empty, and not valid.
"""
result["Rect2i"].IsEmpty.func_doc = """IsEmpty() -> bool
Returns true if the rectangle is empty.
An empty rectangle has one or both of its min coordinates strictly
greater than the corresponding max coordinate.
An empty rectangle is not valid.
"""
result["Rect2i"].IsValid.func_doc = """IsValid() -> bool
Return true if the rectangle is valid (equivalently, not empty).
"""
result["Rect2i"].GetNormalized.func_doc = """GetNormalized() -> Rect2i
Returns a normalized rectangle, i.e.
one that has a non-negative width and height.
``GetNormalized()`` swaps the min and max x-coordinates to ensure a
non-negative width, and similarly for the y-coordinates.
"""
result["Rect2i"].GetMin.func_doc = """GetMin() -> Vec2i
Returns the min corner of the rectangle.
"""
result["Rect2i"].GetMax.func_doc = """GetMax() -> Vec2i
Returns the max corner of the rectangle.
"""
result["Rect2i"].GetMinX.func_doc = """GetMinX() -> int
Return the X value of min corner.
"""
result["Rect2i"].SetMinX.func_doc = """SetMinX(x) -> None
Set the X value of the min corner.
Parameters
----------
x : int
"""
result["Rect2i"].GetMaxX.func_doc = """GetMaxX() -> int
Return the X value of the max corner.
"""
result["Rect2i"].SetMaxX.func_doc = """SetMaxX(x) -> None
Set the X value of the max corner.
Parameters
----------
x : int
"""
result["Rect2i"].GetMinY.func_doc = """GetMinY() -> int
Return the Y value of the min corner.
"""
result["Rect2i"].SetMinY.func_doc = """SetMinY(y) -> None
Set the Y value of the min corner.
Parameters
----------
y : int
"""
result["Rect2i"].GetMaxY.func_doc = """GetMaxY() -> int
Return the Y value of the max corner.
"""
result["Rect2i"].SetMaxY.func_doc = """SetMaxY(y) -> None
Set the Y value of the max corner.
Parameters
----------
y : int
"""
result["Rect2i"].SetMin.func_doc = """SetMin(min) -> None
Sets the min corner of the rectangle.
Parameters
----------
min : Vec2i
"""
result["Rect2i"].SetMax.func_doc = """SetMax(max) -> None
Sets the max corner of the rectangle.
Parameters
----------
max : Vec2i
"""
result["Rect2i"].GetCenter.func_doc = """GetCenter() -> Vec2i
Returns the center point of the rectangle.
"""
result["Rect2i"].Translate.func_doc = """Translate(displacement) -> None
Move the rectangle by ``displ`` .
Parameters
----------
displacement : Vec2i
"""
result["Rect2i"].GetArea.func_doc = """GetArea() -> int
Return the area of the rectangle.
"""
result["Rect2i"].GetSize.func_doc = """GetSize() -> Vec2i
Returns the size of the rectangle as a vector (width,height).
"""
result["Rect2i"].GetWidth.func_doc = """GetWidth() -> int
Returns the width of the rectangle.
If the min and max x-coordinates are coincident, the width is one.
"""
result["Rect2i"].GetHeight.func_doc = """GetHeight() -> int
Returns the height of the rectangle.
If the min and max y-coordinates are coincident, the height is one.
"""
result["Rect2i"].GetIntersection.func_doc = """GetIntersection(that) -> Rect2i
Computes the intersection of two rectangles.
Parameters
----------
that : Rect2i
"""
result["Rect2i"].GetUnion.func_doc = """GetUnion(that) -> Rect2i
Computes the union of two rectangles.
Parameters
----------
that : Rect2i
"""
result["Rect2i"].Contains.func_doc = """Contains(p) -> bool
Returns true if the specified point in the rectangle.
Parameters
----------
p : Vec2i
"""
result["Rotation"].__init__.func_doc = """__init__()
The default constructor leaves the rotation undefined.
----------------------------------------------------------------------
__init__(axis, angle)
This constructor initializes the rotation to be ``angle`` degrees
about ``axis`` .
Parameters
----------
axis : Vec3d
angle : float
----------------------------------------------------------------------
__init__(quaternion)
This constructor initializes the rotation from a quaternion.
Parameters
----------
quaternion : Quaternion
----------------------------------------------------------------------
__init__(quat)
This constructor initializes the rotation from a quaternion.
Note that this constructor accepts GfQuatf and GfQuath since they
implicitly convert to GfQuatd.
Parameters
----------
quat : Quatd
----------------------------------------------------------------------
__init__(rotateFrom, rotateTo)
This constructor initializes the rotation to one that brings the
``rotateFrom`` vector to align with ``rotateTo`` .
The passed vectors need not be unit length.
Parameters
----------
rotateFrom : Vec3d
rotateTo : Vec3d
"""
result["Rotation"].SetAxisAngle.func_doc = """SetAxisAngle(axis, angle) -> Rotation
Sets the rotation to be ``angle`` degrees about ``axis`` .
Parameters
----------
axis : Vec3d
angle : float
"""
result["Rotation"].SetQuat.func_doc = """SetQuat(quat) -> Rotation
Sets the rotation from a quaternion.
Note that this method accepts GfQuatf and GfQuath since they
implicitly convert to GfQuatd.
Parameters
----------
quat : Quatd
"""
result["Rotation"].SetQuaternion.func_doc = """SetQuaternion(quat) -> Rotation
Sets the rotation from a quaternion.
Parameters
----------
quat : Quaternion
"""
result["Rotation"].SetRotateInto.func_doc = """SetRotateInto(rotateFrom, rotateTo) -> Rotation
Sets the rotation to one that brings the ``rotateFrom`` vector to
align with ``rotateTo`` .
The passed vectors need not be unit length.
Parameters
----------
rotateFrom : Vec3d
rotateTo : Vec3d
"""
result["Rotation"].SetIdentity.func_doc = """SetIdentity() -> Rotation
Sets the rotation to an identity rotation.
(This is chosen to be 0 degrees around the positive X axis.)
"""
result["Rotation"].GetAxis.func_doc = """GetAxis() -> Vec3d
Returns the axis of rotation.
"""
result["Rotation"].GetAngle.func_doc = """GetAngle() -> float
Returns the rotation angle in degrees.
"""
result["Rotation"].GetQuaternion.func_doc = """GetQuaternion() -> Quaternion
Returns the rotation expressed as a quaternion.
"""
result["Rotation"].GetQuat.func_doc = """GetQuat() -> Quatd
Returns the rotation expressed as a quaternion.
"""
result["Rotation"].GetInverse.func_doc = """GetInverse() -> Rotation
Returns the inverse of this rotation.
"""
result["Rotation"].Decompose.func_doc = """Decompose(axis0, axis1, axis2) -> Vec3d
Decompose rotation about 3 orthogonal axes.
If the axes are not orthogonal, warnings will be spewed.
Parameters
----------
axis0 : Vec3d
axis1 : Vec3d
axis2 : Vec3d
"""
result["Rotation"].TransformDir.func_doc = """TransformDir(vec) -> Vec3f
Transforms row vector ``vec`` by the rotation, returning the result.
Parameters
----------
vec : Vec3f
----------------------------------------------------------------------
TransformDir(vec) -> Vec3d
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
vec : Vec3d
"""
result["Rotation"].DecomposeRotation.func_doc = """**classmethod** DecomposeRotation(rot, TwAxis, FBAxis, LRAxis, handedness, thetaTw, thetaFB, thetaLR, thetaSw, useHint, swShift) -> None
Parameters
----------
rot : Matrix4d
TwAxis : Vec3d
FBAxis : Vec3d
LRAxis : Vec3d
handedness : float
thetaTw : float
thetaFB : float
thetaLR : float
thetaSw : float
useHint : bool
swShift : float
"""
result["Rotation"].RotateOntoProjected.func_doc = """**classmethod** RotateOntoProjected(v1, v2, axis) -> Rotation
Parameters
----------
v1 : Vec3d
v2 : Vec3d
axis : Vec3d
"""
result["Rotation"].MatchClosestEulerRotation.func_doc = """**classmethod** MatchClosestEulerRotation(targetTw, targetFB, targetLR, targetSw, thetaTw, thetaFB, thetaLR, thetaSw) -> None
Replace the hint angles with the closest rotation of the given
rotation to the hint.
Each angle in the rotation will be within Pi of the corresponding hint
angle and the sum of the differences with the hint will be minimized.
If a given rotation value is null then that angle will be treated as
0.0 and ignored in the calculations.
All angles are in radians. The rotation order is Tw/FB/LR/Sw.
Parameters
----------
targetTw : float
targetFB : float
targetLR : float
targetSw : float
thetaTw : float
thetaFB : float
thetaLR : float
thetaSw : float
"""
result["Size2"].__init__.func_doc = """__init__()
Default constructor initializes components to zero.
----------------------------------------------------------------------
__init__(o)
Copy constructor.
Parameters
----------
o : Size2
----------------------------------------------------------------------
__init__(o)
Conversion from GfVec2i.
Parameters
----------
o : Vec2i
----------------------------------------------------------------------
__init__(v)
Construct from an array.
Parameters
----------
v : int
----------------------------------------------------------------------
__init__(v0, v1)
Construct from two values.
Parameters
----------
v0 : int
v1 : int
"""
result["Size2"].Set.func_doc = """Set(v) -> Size2
Set to the values in a given array.
Parameters
----------
v : int
----------------------------------------------------------------------
Set(v0, v1) -> Size2
Set to values passed directly.
Parameters
----------
v0 : int
v1 : int
"""
result["Size3"].__init__.func_doc = """__init__()
Default constructor initializes components to zero.
----------------------------------------------------------------------
__init__(o)
Copy constructor.
Parameters
----------
o : Size3
----------------------------------------------------------------------
__init__(o)
Conversion from GfVec3i.
Parameters
----------
o : Vec3i
----------------------------------------------------------------------
__init__(v)
Construct from an array.
Parameters
----------
v : int
----------------------------------------------------------------------
__init__(v0, v1, v2)
Construct from three values.
Parameters
----------
v0 : int
v1 : int
v2 : int
"""
result["Size3"].Set.func_doc = """Set(v) -> Size3
Set to the values in ``v`` .
Parameters
----------
v : int
----------------------------------------------------------------------
Set(v0, v1, v2) -> Size3
Set to values passed directly.
Parameters
----------
v0 : int
v1 : int
v2 : int
"""
result["Transform"].__doc__ = """
Basic type: Compound linear transformation.
This class represents a linear transformation specified as a series of
individual components: a *translation*, a *rotation*, a *scale*, a
*pivotPosition*, and a *pivotOrientation*. When applied to a point,
the point will be transformed as follows (in order):
- Scaled by the *scale* with respect to *pivotPosition* and the
orientation specified by the *pivotOrientation*.
- Rotated by the *rotation* about *pivotPosition*.
- Translated by *Translation*
That is, the cumulative matrix that this represents looks like this.
.. code-block:: text
M = -P \\* -O \\* S \\* O \\* R \\* P \\* T
where
- *T* is the *translation* matrix
- *P* is the matrix that translates by *pivotPosition*
- *R* is the *rotation* matrix
- *O* is the matrix that rotates to *pivotOrientation*
- *S* is the *scale* matrix
"""
result["Transform"].SetMatrix.func_doc = """SetMatrix(m) -> Transform
Sets the transform components to implement the transformation
represented by matrix ``m`` , ignoring any projection.
This tries to leave the current center unchanged.
Parameters
----------
m : Matrix4d
"""
result["Transform"].SetIdentity.func_doc = """SetIdentity() -> Transform
Sets the transformation to the identity transformation.
"""
result["Transform"].SetScale.func_doc = """SetScale(scale) -> None
Sets the scale component, leaving all others untouched.
Parameters
----------
scale : Vec3d
"""
result["Transform"].SetPivotOrientation.func_doc = """SetPivotOrientation(pivotOrient) -> None
Sets the pivot orientation component, leaving all others untouched.
Parameters
----------
pivotOrient : Rotation
"""
result["Transform"].SetRotation.func_doc = """SetRotation(rotation) -> None
Sets the rotation component, leaving all others untouched.
Parameters
----------
rotation : Rotation
"""
result["Transform"].SetPivotPosition.func_doc = """SetPivotPosition(pivPos) -> None
Sets the pivot position component, leaving all others untouched.
Parameters
----------
pivPos : Vec3d
"""
result["Transform"].SetTranslation.func_doc = """SetTranslation(translation) -> None
Sets the translation component, leaving all others untouched.
Parameters
----------
translation : Vec3d
"""
result["Transform"].GetScale.func_doc = """GetScale() -> Vec3d
Returns the scale component.
"""
result["Transform"].GetPivotOrientation.func_doc = """GetPivotOrientation() -> Rotation
Returns the pivot orientation component.
"""
result["Transform"].GetRotation.func_doc = """GetRotation() -> Rotation
Returns the rotation component.
"""
result["Transform"].GetPivotPosition.func_doc = """GetPivotPosition() -> Vec3d
Returns the pivot position component.
"""
result["Transform"].GetTranslation.func_doc = """GetTranslation() -> Vec3d
Returns the translation component.
"""
result["Transform"].GetMatrix.func_doc = """GetMatrix() -> Matrix4d
Returns a ``GfMatrix4d`` that implements the cumulative
transformation.
"""
result["Vec2d"].__doc__ = """
Basic type for a vector of 2 double components.
Represents a vector of 2 components of type ``double`` . It is
intended to be fast and simple.
"""
result["Vec2d"].__init__.func_doc = """__init__()
Default constructor does no initialization.
----------------------------------------------------------------------
__init__(value)
Initialize all elements to a single value.
Parameters
----------
value : float
----------------------------------------------------------------------
__init__(s0, s1)
Initialize all elements with explicit arguments.
Parameters
----------
s0 : float
s1 : float
----------------------------------------------------------------------
__init__(p)
Construct with pointer to values.
Parameters
----------
p : Scl
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfVec2f.
Parameters
----------
other : Vec2f
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfVec2h.
Parameters
----------
other : Vec2h
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfVec2i.
Parameters
----------
other : Vec2i
"""
result["Vec2d"].GetProjection.func_doc = """GetProjection(v) -> Vec2d
Returns the projection of ``this`` onto ``v`` .
That is:
.. code-block:: text
v \\* (\\*this \\* v)
Parameters
----------
v : Vec2d
"""
result["Vec2d"].GetComplement.func_doc = """GetComplement(b) -> Vec2d
Returns the orthogonal complement of ``this->GetProjection(b)`` .
That is:
.. code-block:: text
\\*this - this->GetProjection(b)
Parameters
----------
b : Vec2d
"""
result["Vec2d"].GetLength.func_doc = """GetLength() -> float
Length.
"""
result["Vec2d"].Normalize.func_doc = """Normalize(eps) -> float
Normalizes the vector in place to unit length, returning the length
before normalization.
If the length of the vector is smaller than ``eps`` , then the vector
is set to vector/ ``eps`` . The original length of the vector is
returned. See also GfNormalize() .
Parameters
----------
eps : float
"""
result["Vec2d"].GetNormalized.func_doc = """GetNormalized(eps) -> Vec2d
Parameters
----------
eps : float
"""
result["Vec2d"].XAxis.func_doc = """**classmethod** XAxis() -> Vec2d
Create a unit vector along the X-axis.
"""
result["Vec2d"].YAxis.func_doc = """**classmethod** YAxis() -> Vec2d
Create a unit vector along the Y-axis.
"""
result["Vec2d"].Axis.func_doc = """**classmethod** Axis(i) -> Vec2d
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 2.
Parameters
----------
i : int
"""
result["Vec2f"].__doc__ = """
Basic type for a vector of 2 float components.
Represents a vector of 2 components of type ``float`` . It is intended
to be fast and simple.
"""
result["Vec2f"].__init__.func_doc = """__init__()
Default constructor does no initialization.
----------------------------------------------------------------------
__init__(value)
Initialize all elements to a single value.
Parameters
----------
value : float
----------------------------------------------------------------------
__init__(s0, s1)
Initialize all elements with explicit arguments.
Parameters
----------
s0 : float
s1 : float
----------------------------------------------------------------------
__init__(p)
Construct with pointer to values.
Parameters
----------
p : Scl
----------------------------------------------------------------------
__init__(other)
Construct from GfVec2d.
Parameters
----------
other : Vec2d
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfVec2h.
Parameters
----------
other : Vec2h
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfVec2i.
Parameters
----------
other : Vec2i
"""
result["Vec2f"].GetProjection.func_doc = """GetProjection(v) -> Vec2f
Returns the projection of ``this`` onto ``v`` .
That is:
.. code-block:: text
v \\* (\\*this \\* v)
Parameters
----------
v : Vec2f
"""
result["Vec2f"].GetComplement.func_doc = """GetComplement(b) -> Vec2f
Returns the orthogonal complement of ``this->GetProjection(b)`` .
That is:
.. code-block:: text
\\*this - this->GetProjection(b)
Parameters
----------
b : Vec2f
"""
result["Vec2f"].GetLength.func_doc = """GetLength() -> float
Length.
"""
result["Vec2f"].Normalize.func_doc = """Normalize(eps) -> float
Normalizes the vector in place to unit length, returning the length
before normalization.
If the length of the vector is smaller than ``eps`` , then the vector
is set to vector/ ``eps`` . The original length of the vector is
returned. See also GfNormalize() .
Parameters
----------
eps : float
"""
result["Vec2f"].GetNormalized.func_doc = """GetNormalized(eps) -> Vec2f
Parameters
----------
eps : float
"""
result["Vec2f"].XAxis.func_doc = """**classmethod** XAxis() -> Vec2f
Create a unit vector along the X-axis.
"""
result["Vec2f"].YAxis.func_doc = """**classmethod** YAxis() -> Vec2f
Create a unit vector along the Y-axis.
"""
result["Vec2f"].Axis.func_doc = """**classmethod** Axis(i) -> Vec2f
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 2.
Parameters
----------
i : int
"""
result["Vec2h"].__doc__ = """
Basic type for a vector of 2 GfHalf components.
Represents a vector of 2 components of type ``GfHalf`` . It is
intended to be fast and simple.
"""
result["Vec2h"].__init__.func_doc = """__init__()
Default constructor does no initialization.
----------------------------------------------------------------------
__init__(value)
Initialize all elements to a single value.
Parameters
----------
value : GfHalf
----------------------------------------------------------------------
__init__(s0, s1)
Initialize all elements with explicit arguments.
Parameters
----------
s0 : GfHalf
s1 : GfHalf
----------------------------------------------------------------------
__init__(p)
Construct with pointer to values.
Parameters
----------
p : Scl
----------------------------------------------------------------------
__init__(other)
Construct from GfVec2d.
Parameters
----------
other : Vec2d
----------------------------------------------------------------------
__init__(other)
Construct from GfVec2f.
Parameters
----------
other : Vec2f
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfVec2i.
Parameters
----------
other : Vec2i
"""
result["Vec2h"].GetProjection.func_doc = """GetProjection(v) -> Vec2h
Returns the projection of ``this`` onto ``v`` .
That is:
.. code-block:: text
v \\* (\\*this \\* v)
Parameters
----------
v : Vec2h
"""
result["Vec2h"].GetComplement.func_doc = """GetComplement(b) -> Vec2h
Returns the orthogonal complement of ``this->GetProjection(b)`` .
That is:
.. code-block:: text
\\*this - this->GetProjection(b)
Parameters
----------
b : Vec2h
"""
result["Vec2h"].GetLength.func_doc = """GetLength() -> GfHalf
Length.
"""
result["Vec2h"].Normalize.func_doc = """Normalize(eps) -> GfHalf
Normalizes the vector in place to unit length, returning the length
before normalization.
If the length of the vector is smaller than ``eps`` , then the vector
is set to vector/ ``eps`` . The original length of the vector is
returned. See also GfNormalize() .
Parameters
----------
eps : GfHalf
"""
result["Vec2h"].GetNormalized.func_doc = """GetNormalized(eps) -> Vec2h
Parameters
----------
eps : GfHalf
"""
result["Vec2h"].XAxis.func_doc = """**classmethod** XAxis() -> Vec2h
Create a unit vector along the X-axis.
"""
result["Vec2h"].YAxis.func_doc = """**classmethod** YAxis() -> Vec2h
Create a unit vector along the Y-axis.
"""
result["Vec2h"].Axis.func_doc = """**classmethod** Axis(i) -> Vec2h
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 2.
Parameters
----------
i : int
"""
result["Vec2i"].__doc__ = """
Basic type for a vector of 2 int components.
Represents a vector of 2 components of type ``int`` . It is intended
to be fast and simple.
"""
result["Vec2i"].__init__.func_doc = """__init__()
Default constructor does no initialization.
----------------------------------------------------------------------
__init__(value)
Initialize all elements to a single value.
Parameters
----------
value : int
----------------------------------------------------------------------
__init__(s0, s1)
Initialize all elements with explicit arguments.
Parameters
----------
s0 : int
s1 : int
----------------------------------------------------------------------
__init__(p)
Construct with pointer to values.
Parameters
----------
p : Scl
"""
result["Vec2i"].XAxis.func_doc = """**classmethod** XAxis() -> Vec2i
Create a unit vector along the X-axis.
"""
result["Vec2i"].YAxis.func_doc = """**classmethod** YAxis() -> Vec2i
Create a unit vector along the Y-axis.
"""
result["Vec2i"].Axis.func_doc = """**classmethod** Axis(i) -> Vec2i
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 2.
Parameters
----------
i : int
"""
result["Vec3d"].__doc__ = """
Basic type for a vector of 3 double components.
Represents a vector of 3 components of type ``double`` . It is
intended to be fast and simple.
"""
result["Vec3d"].__init__.func_doc = """__init__()
Default constructor does no initialization.
----------------------------------------------------------------------
__init__(value)
Initialize all elements to a single value.
Parameters
----------
value : float
----------------------------------------------------------------------
__init__(s0, s1, s2)
Initialize all elements with explicit arguments.
Parameters
----------
s0 : float
s1 : float
s2 : float
----------------------------------------------------------------------
__init__(p)
Construct with pointer to values.
Parameters
----------
p : Scl
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfVec3f.
Parameters
----------
other : Vec3f
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfVec3h.
Parameters
----------
other : Vec3h
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfVec3i.
Parameters
----------
other : Vec3i
"""
result["Vec3d"].GetProjection.func_doc = """GetProjection(v) -> Vec3d
Returns the projection of ``this`` onto ``v`` .
That is:
.. code-block:: text
v \\* (\\*this \\* v)
Parameters
----------
v : Vec3d
"""
result["Vec3d"].GetComplement.func_doc = """GetComplement(b) -> Vec3d
Returns the orthogonal complement of ``this->GetProjection(b)`` .
That is:
.. code-block:: text
\\*this - this->GetProjection(b)
Parameters
----------
b : Vec3d
"""
result["Vec3d"].GetLength.func_doc = """GetLength() -> float
Length.
"""
result["Vec3d"].Normalize.func_doc = """Normalize(eps) -> float
Normalizes the vector in place to unit length, returning the length
before normalization.
If the length of the vector is smaller than ``eps`` , then the vector
is set to vector/ ``eps`` . The original length of the vector is
returned. See also GfNormalize() .
Parameters
----------
eps : float
"""
result["Vec3d"].GetNormalized.func_doc = """GetNormalized(eps) -> Vec3d
Parameters
----------
eps : float
"""
result["Vec3d"].BuildOrthonormalFrame.func_doc = """BuildOrthonormalFrame(v1, v2, eps) -> None
Sets ``v1`` and ``v2`` to unit vectors such that v1, v2 and \\*this
are mutually orthogonal.
If the length L of \\*this is smaller than ``eps`` , then v1 and v2
will have magnitude L/eps. As a result, the function delivers a
continuous result as \\*this shrinks in length.
Parameters
----------
v1 : Vec3d
v2 : Vec3d
eps : float
"""
result["Vec3d"].XAxis.func_doc = """**classmethod** XAxis() -> Vec3d
Create a unit vector along the X-axis.
"""
result["Vec3d"].YAxis.func_doc = """**classmethod** YAxis() -> Vec3d
Create a unit vector along the Y-axis.
"""
result["Vec3d"].ZAxis.func_doc = """**classmethod** ZAxis() -> Vec3d
Create a unit vector along the Z-axis.
"""
result["Vec3d"].Axis.func_doc = """**classmethod** Axis(i) -> Vec3d
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 3.
Parameters
----------
i : int
"""
result["Vec3d"].OrthogonalizeBasis.func_doc = """**classmethod** OrthogonalizeBasis(tx, ty, tz, normalize, eps) -> bool
Orthogonalize and optionally normalize a set of basis vectors.
This uses an iterative method that is very stable even when the
vectors are far from orthogonal (close to colinear). The number of
iterations and thus the computation time does increase as the vectors
become close to colinear, however. Returns a bool specifying whether
the solution converged after a number of iterations. If it did not
converge, the returned vectors will be as close as possible to
orthogonal within the iteration limit. Colinear vectors will be
unaltered, and the method will return false.
Parameters
----------
tx : Vec3d
ty : Vec3d
tz : Vec3d
normalize : bool
eps : float
"""
result["Vec3f"].__doc__ = """
Basic type for a vector of 3 float components.
Represents a vector of 3 components of type ``float`` . It is intended
to be fast and simple.
"""
result["Vec3f"].__init__.func_doc = """__init__()
Default constructor does no initialization.
----------------------------------------------------------------------
__init__(value)
Initialize all elements to a single value.
Parameters
----------
value : float
----------------------------------------------------------------------
__init__(s0, s1, s2)
Initialize all elements with explicit arguments.
Parameters
----------
s0 : float
s1 : float
s2 : float
----------------------------------------------------------------------
__init__(p)
Construct with pointer to values.
Parameters
----------
p : Scl
----------------------------------------------------------------------
__init__(other)
Construct from GfVec3d.
Parameters
----------
other : Vec3d
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfVec3h.
Parameters
----------
other : Vec3h
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfVec3i.
Parameters
----------
other : Vec3i
"""
result["Vec3f"].GetProjection.func_doc = """GetProjection(v) -> Vec3f
Returns the projection of ``this`` onto ``v`` .
That is:
.. code-block:: text
v \\* (\\*this \\* v)
Parameters
----------
v : Vec3f
"""
result["Vec3f"].GetComplement.func_doc = """GetComplement(b) -> Vec3f
Returns the orthogonal complement of ``this->GetProjection(b)`` .
That is:
.. code-block:: text
\\*this - this->GetProjection(b)
Parameters
----------
b : Vec3f
"""
result["Vec3f"].GetLength.func_doc = """GetLength() -> float
Length.
"""
result["Vec3f"].Normalize.func_doc = """Normalize(eps) -> float
Normalizes the vector in place to unit length, returning the length
before normalization.
If the length of the vector is smaller than ``eps`` , then the vector
is set to vector/ ``eps`` . The original length of the vector is
returned. See also GfNormalize() .
Parameters
----------
eps : float
"""
result["Vec3f"].GetNormalized.func_doc = """GetNormalized(eps) -> Vec3f
Parameters
----------
eps : float
"""
result["Vec3f"].BuildOrthonormalFrame.func_doc = """BuildOrthonormalFrame(v1, v2, eps) -> None
Sets ``v1`` and ``v2`` to unit vectors such that v1, v2 and \\*this
are mutually orthogonal.
If the length L of \\*this is smaller than ``eps`` , then v1 and v2
will have magnitude L/eps. As a result, the function delivers a
continuous result as \\*this shrinks in length.
Parameters
----------
v1 : Vec3f
v2 : Vec3f
eps : float
"""
result["Vec3f"].XAxis.func_doc = """**classmethod** XAxis() -> Vec3f
Create a unit vector along the X-axis.
"""
result["Vec3f"].YAxis.func_doc = """**classmethod** YAxis() -> Vec3f
Create a unit vector along the Y-axis.
"""
result["Vec3f"].ZAxis.func_doc = """**classmethod** ZAxis() -> Vec3f
Create a unit vector along the Z-axis.
"""
result["Vec3f"].Axis.func_doc = """**classmethod** Axis(i) -> Vec3f
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 3.
Parameters
----------
i : int
"""
result["Vec3f"].OrthogonalizeBasis.func_doc = """**classmethod** OrthogonalizeBasis(tx, ty, tz, normalize, eps) -> bool
Orthogonalize and optionally normalize a set of basis vectors.
This uses an iterative method that is very stable even when the
vectors are far from orthogonal (close to colinear). The number of
iterations and thus the computation time does increase as the vectors
become close to colinear, however. Returns a bool specifying whether
the solution converged after a number of iterations. If it did not
converge, the returned vectors will be as close as possible to
orthogonal within the iteration limit. Colinear vectors will be
unaltered, and the method will return false.
Parameters
----------
tx : Vec3f
ty : Vec3f
tz : Vec3f
normalize : bool
eps : float
"""
result["Vec3h"].__doc__ = """
Basic type for a vector of 3 GfHalf components.
Represents a vector of 3 components of type ``GfHalf`` . It is
intended to be fast and simple.
"""
result["Vec3h"].__init__.func_doc = """__init__()
Default constructor does no initialization.
----------------------------------------------------------------------
__init__(value)
Initialize all elements to a single value.
Parameters
----------
value : GfHalf
----------------------------------------------------------------------
__init__(s0, s1, s2)
Initialize all elements with explicit arguments.
Parameters
----------
s0 : GfHalf
s1 : GfHalf
s2 : GfHalf
----------------------------------------------------------------------
__init__(p)
Construct with pointer to values.
Parameters
----------
p : Scl
----------------------------------------------------------------------
__init__(other)
Construct from GfVec3d.
Parameters
----------
other : Vec3d
----------------------------------------------------------------------
__init__(other)
Construct from GfVec3f.
Parameters
----------
other : Vec3f
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfVec3i.
Parameters
----------
other : Vec3i
"""
result["Vec3h"].GetProjection.func_doc = """GetProjection(v) -> Vec3h
Returns the projection of ``this`` onto ``v`` .
That is:
.. code-block:: text
v \\* (\\*this \\* v)
Parameters
----------
v : Vec3h
"""
result["Vec3h"].GetComplement.func_doc = """GetComplement(b) -> Vec3h
Returns the orthogonal complement of ``this->GetProjection(b)`` .
That is:
.. code-block:: text
\\*this - this->GetProjection(b)
Parameters
----------
b : Vec3h
"""
result["Vec3h"].GetLength.func_doc = """GetLength() -> GfHalf
Length.
"""
result["Vec3h"].Normalize.func_doc = """Normalize(eps) -> GfHalf
Normalizes the vector in place to unit length, returning the length
before normalization.
If the length of the vector is smaller than ``eps`` , then the vector
is set to vector/ ``eps`` . The original length of the vector is
returned. See also GfNormalize() .
Parameters
----------
eps : GfHalf
"""
result["Vec3h"].GetNormalized.func_doc = """GetNormalized(eps) -> Vec3h
Parameters
----------
eps : GfHalf
"""
result["Vec3h"].BuildOrthonormalFrame.func_doc = """BuildOrthonormalFrame(v1, v2, eps) -> None
Sets ``v1`` and ``v2`` to unit vectors such that v1, v2 and \\*this
are mutually orthogonal.
If the length L of \\*this is smaller than ``eps`` , then v1 and v2
will have magnitude L/eps. As a result, the function delivers a
continuous result as \\*this shrinks in length.
Parameters
----------
v1 : Vec3h
v2 : Vec3h
eps : GfHalf
"""
result["Vec3h"].XAxis.func_doc = """**classmethod** XAxis() -> Vec3h
Create a unit vector along the X-axis.
"""
result["Vec3h"].YAxis.func_doc = """**classmethod** YAxis() -> Vec3h
Create a unit vector along the Y-axis.
"""
result["Vec3h"].ZAxis.func_doc = """**classmethod** ZAxis() -> Vec3h
Create a unit vector along the Z-axis.
"""
result["Vec3h"].Axis.func_doc = """**classmethod** Axis(i) -> Vec3h
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 3.
Parameters
----------
i : int
"""
result["Vec3h"].OrthogonalizeBasis.func_doc = """**classmethod** OrthogonalizeBasis(tx, ty, tz, normalize, eps) -> bool
Orthogonalize and optionally normalize a set of basis vectors.
This uses an iterative method that is very stable even when the
vectors are far from orthogonal (close to colinear). The number of
iterations and thus the computation time does increase as the vectors
become close to colinear, however. Returns a bool specifying whether
the solution converged after a number of iterations. If it did not
converge, the returned vectors will be as close as possible to
orthogonal within the iteration limit. Colinear vectors will be
unaltered, and the method will return false.
Parameters
----------
tx : Vec3h
ty : Vec3h
tz : Vec3h
normalize : bool
eps : float
"""
result["Vec3i"].__doc__ = """
Basic type for a vector of 3 int components.
Represents a vector of 3 components of type ``int`` . It is intended
to be fast and simple.
"""
result["Vec3i"].__init__.func_doc = """__init__()
Default constructor does no initialization.
----------------------------------------------------------------------
__init__(value)
Initialize all elements to a single value.
Parameters
----------
value : int
----------------------------------------------------------------------
__init__(s0, s1, s2)
Initialize all elements with explicit arguments.
Parameters
----------
s0 : int
s1 : int
s2 : int
----------------------------------------------------------------------
__init__(p)
Construct with pointer to values.
Parameters
----------
p : Scl
"""
result["Vec3i"].XAxis.func_doc = """**classmethod** XAxis() -> Vec3i
Create a unit vector along the X-axis.
"""
result["Vec3i"].YAxis.func_doc = """**classmethod** YAxis() -> Vec3i
Create a unit vector along the Y-axis.
"""
result["Vec3i"].ZAxis.func_doc = """**classmethod** ZAxis() -> Vec3i
Create a unit vector along the Z-axis.
"""
result["Vec3i"].Axis.func_doc = """**classmethod** Axis(i) -> Vec3i
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 3.
Parameters
----------
i : int
"""
result["Vec4d"].__doc__ = """
Basic type for a vector of 4 double components.
Represents a vector of 4 components of type ``double`` . It is
intended to be fast and simple.
"""
result["Vec4d"].__init__.func_doc = """__init__()
Default constructor does no initialization.
----------------------------------------------------------------------
__init__(value)
Initialize all elements to a single value.
Parameters
----------
value : float
----------------------------------------------------------------------
__init__(s0, s1, s2, s3)
Initialize all elements with explicit arguments.
Parameters
----------
s0 : float
s1 : float
s2 : float
s3 : float
----------------------------------------------------------------------
__init__(p)
Construct with pointer to values.
Parameters
----------
p : Scl
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfVec4f.
Parameters
----------
other : Vec4f
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfVec4h.
Parameters
----------
other : Vec4h
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfVec4i.
Parameters
----------
other : Vec4i
"""
result["Vec4d"].GetProjection.func_doc = """GetProjection(v) -> Vec4d
Returns the projection of ``this`` onto ``v`` .
That is:
.. code-block:: text
v \\* (\\*this \\* v)
Parameters
----------
v : Vec4d
"""
result["Vec4d"].GetComplement.func_doc = """GetComplement(b) -> Vec4d
Returns the orthogonal complement of ``this->GetProjection(b)`` .
That is:
.. code-block:: text
\\*this - this->GetProjection(b)
Parameters
----------
b : Vec4d
"""
result["Vec4d"].GetLength.func_doc = """GetLength() -> float
Length.
"""
result["Vec4d"].Normalize.func_doc = """Normalize(eps) -> float
Normalizes the vector in place to unit length, returning the length
before normalization.
If the length of the vector is smaller than ``eps`` , then the vector
is set to vector/ ``eps`` . The original length of the vector is
returned. See also GfNormalize() .
Parameters
----------
eps : float
"""
result["Vec4d"].GetNormalized.func_doc = """GetNormalized(eps) -> Vec4d
Parameters
----------
eps : float
"""
result["Vec4d"].XAxis.func_doc = """**classmethod** XAxis() -> Vec4d
Create a unit vector along the X-axis.
"""
result["Vec4d"].YAxis.func_doc = """**classmethod** YAxis() -> Vec4d
Create a unit vector along the Y-axis.
"""
result["Vec4d"].ZAxis.func_doc = """**classmethod** ZAxis() -> Vec4d
Create a unit vector along the Z-axis.
"""
result["Vec4d"].WAxis.func_doc = """**classmethod** WAxis() -> Vec4d
Create a unit vector along the W-axis.
"""
result["Vec4d"].Axis.func_doc = """**classmethod** Axis(i) -> Vec4d
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 4.
Parameters
----------
i : int
"""
result["Vec4f"].__doc__ = """
Basic type for a vector of 4 float components.
Represents a vector of 4 components of type ``float`` . It is intended
to be fast and simple.
"""
result["Vec4f"].__init__.func_doc = """__init__()
Default constructor does no initialization.
----------------------------------------------------------------------
__init__(value)
Initialize all elements to a single value.
Parameters
----------
value : float
----------------------------------------------------------------------
__init__(s0, s1, s2, s3)
Initialize all elements with explicit arguments.
Parameters
----------
s0 : float
s1 : float
s2 : float
s3 : float
----------------------------------------------------------------------
__init__(p)
Construct with pointer to values.
Parameters
----------
p : Scl
----------------------------------------------------------------------
__init__(other)
Construct from GfVec4d.
Parameters
----------
other : Vec4d
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfVec4h.
Parameters
----------
other : Vec4h
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfVec4i.
Parameters
----------
other : Vec4i
"""
result["Vec4f"].GetProjection.func_doc = """GetProjection(v) -> Vec4f
Returns the projection of ``this`` onto ``v`` .
That is:
.. code-block:: text
v \\* (\\*this \\* v)
Parameters
----------
v : Vec4f
"""
result["Vec4f"].GetComplement.func_doc = """GetComplement(b) -> Vec4f
Returns the orthogonal complement of ``this->GetProjection(b)`` .
That is:
.. code-block:: text
\\*this - this->GetProjection(b)
Parameters
----------
b : Vec4f
"""
result["Vec4f"].GetLength.func_doc = """GetLength() -> float
Length.
"""
result["Vec4f"].Normalize.func_doc = """Normalize(eps) -> float
Normalizes the vector in place to unit length, returning the length
before normalization.
If the length of the vector is smaller than ``eps`` , then the vector
is set to vector/ ``eps`` . The original length of the vector is
returned. See also GfNormalize() .
Parameters
----------
eps : float
"""
result["Vec4f"].GetNormalized.func_doc = """GetNormalized(eps) -> Vec4f
Parameters
----------
eps : float
"""
result["Vec4f"].XAxis.func_doc = """**classmethod** XAxis() -> Vec4f
Create a unit vector along the X-axis.
"""
result["Vec4f"].YAxis.func_doc = """**classmethod** YAxis() -> Vec4f
Create a unit vector along the Y-axis.
"""
result["Vec4f"].ZAxis.func_doc = """**classmethod** ZAxis() -> Vec4f
Create a unit vector along the Z-axis.
"""
result["Vec4f"].WAxis.func_doc = """**classmethod** WAxis() -> Vec4f
Create a unit vector along the W-axis.
"""
result["Vec4f"].Axis.func_doc = """**classmethod** Axis(i) -> Vec4f
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 4.
Parameters
----------
i : int
"""
result["Vec4h"].__doc__ = """
Basic type for a vector of 4 GfHalf components.
Represents a vector of 4 components of type ``GfHalf`` . It is
intended to be fast and simple.
"""
result["Vec4h"].__init__.func_doc = """__init__()
Default constructor does no initialization.
----------------------------------------------------------------------
__init__(value)
Initialize all elements to a single value.
Parameters
----------
value : GfHalf
----------------------------------------------------------------------
__init__(s0, s1, s2, s3)
Initialize all elements with explicit arguments.
Parameters
----------
s0 : GfHalf
s1 : GfHalf
s2 : GfHalf
s3 : GfHalf
----------------------------------------------------------------------
__init__(p)
Construct with pointer to values.
Parameters
----------
p : Scl
----------------------------------------------------------------------
__init__(other)
Construct from GfVec4d.
Parameters
----------
other : Vec4d
----------------------------------------------------------------------
__init__(other)
Construct from GfVec4f.
Parameters
----------
other : Vec4f
----------------------------------------------------------------------
__init__(other)
Implicitly convert from GfVec4i.
Parameters
----------
other : Vec4i
"""
result["Vec4h"].GetProjection.func_doc = """GetProjection(v) -> Vec4h
Returns the projection of ``this`` onto ``v`` .
That is:
.. code-block:: text
v \\* (\\*this \\* v)
Parameters
----------
v : Vec4h
"""
result["Vec4h"].GetComplement.func_doc = """GetComplement(b) -> Vec4h
Returns the orthogonal complement of ``this->GetProjection(b)`` .
That is:
.. code-block:: text
\\*this - this->GetProjection(b)
Parameters
----------
b : Vec4h
"""
result["Vec4h"].GetLength.func_doc = """GetLength() -> GfHalf
Length.
"""
result["Vec4h"].Normalize.func_doc = """Normalize(eps) -> GfHalf
Normalizes the vector in place to unit length, returning the length
before normalization.
If the length of the vector is smaller than ``eps`` , then the vector
is set to vector/ ``eps`` . The original length of the vector is
returned. See also GfNormalize() .
Parameters
----------
eps : GfHalf
"""
result["Vec4h"].GetNormalized.func_doc = """GetNormalized(eps) -> Vec4h
Parameters
----------
eps : GfHalf
"""
result["Vec4h"].XAxis.func_doc = """**classmethod** XAxis() -> Vec4h
Create a unit vector along the X-axis.
"""
result["Vec4h"].YAxis.func_doc = """**classmethod** YAxis() -> Vec4h
Create a unit vector along the Y-axis.
"""
result["Vec4h"].ZAxis.func_doc = """**classmethod** ZAxis() -> Vec4h
Create a unit vector along the Z-axis.
"""
result["Vec4h"].WAxis.func_doc = """**classmethod** WAxis() -> Vec4h
Create a unit vector along the W-axis.
"""
result["Vec4h"].Axis.func_doc = """**classmethod** Axis(i) -> Vec4h
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 4.
Parameters
----------
i : int
"""
result["Vec4i"].__doc__ = """
Basic type for a vector of 4 int components.
Represents a vector of 4 components of type ``int`` . It is intended
to be fast and simple.
"""
result["Vec4i"].__init__.func_doc = """__init__()
Default constructor does no initialization.
----------------------------------------------------------------------
__init__(value)
Initialize all elements to a single value.
Parameters
----------
value : int
----------------------------------------------------------------------
__init__(s0, s1, s2, s3)
Initialize all elements with explicit arguments.
Parameters
----------
s0 : int
s1 : int
s2 : int
s3 : int
----------------------------------------------------------------------
__init__(p)
Construct with pointer to values.
Parameters
----------
p : Scl
"""
result["Vec4i"].XAxis.func_doc = """**classmethod** XAxis() -> Vec4i
Create a unit vector along the X-axis.
"""
result["Vec4i"].YAxis.func_doc = """**classmethod** YAxis() -> Vec4i
Create a unit vector along the Y-axis.
"""
result["Vec4i"].ZAxis.func_doc = """**classmethod** ZAxis() -> Vec4i
Create a unit vector along the Z-axis.
"""
result["Vec4i"].WAxis.func_doc = """**classmethod** WAxis() -> Vec4i
Create a unit vector along the W-axis.
"""
result["Vec4i"].Axis.func_doc = """**classmethod** Axis(i) -> Vec4i
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 4.
Parameters
----------
i : int
"""
result["DualQuatd"].__doc__ = """"""
result["DualQuatf"].__doc__ = """"""
result["DualQuath"].__doc__ = """"""
result["Matrix2d"].__doc__ = """"""
result["Matrix2f"].__doc__ = """"""
result["Matrix3d"].__doc__ = """"""
result["Matrix3f"].__doc__ = """"""
result["Matrix4d"].__doc__ = """"""
result["Matrix4f"].__doc__ = """"""
result["Quatd"].__doc__ = """"""
result["Quatf"].__doc__ = """"""
result["Quath"].__doc__ = """"""
result["Rect2i"].__doc__ = """"""
result["Transform"].__doc__ = """"""
result["Vec2d"].__doc__ = """"""
result["Vec2f"].__doc__ = """"""
result["Vec2h"].__doc__ = """"""
result["Vec2i"].__doc__ = """"""
result["Vec3d"].__doc__ = """"""
result["Vec3f"].__doc__ = """"""
result["Vec3h"].__doc__ = """"""
result["Vec3i"].__doc__ = """"""
result["Vec4d"].__doc__ = """"""
result["Vec4f"].__doc__ = """"""
result["Vec4h"].__doc__ = """"""
result["Vec4i"].__doc__ = """"""
result["GetHomogenized"].func_doc = """GetHomogenized(v) -> Vec4f
Returns a vector which is ``v`` homogenized.
If the fourth element of ``v`` is 0, it is set to 1.
Parameters
----------
v : Vec4f
"""
result["HomogeneousCross"].func_doc = """HomogeneousCross(a, b) -> Vec4f
Homogenizes ``a`` and ``b`` and then performs the cross product on the
first three elements of each.
Returns the cross product as a homogenized vector.
Parameters
----------
a : Vec4f
b : Vec4f
----------------------------------------------------------------------
HomogeneousCross(a, b) -> Vec4d
Homogenizes ``a`` and ``b`` and then performs the cross product on the
first three elements of each.
Returns the cross product as a homogenized vector.
Parameters
----------
a : Vec4d
b : Vec4d
"""
result["MultiInterval"].__doc__ = """"""
result["IsClose"].func_doc = """IsClose(a, b, epsilon) -> bool
Returns true if ``a`` and ``b`` are with ``epsilon`` of each other.
Parameters
----------
a : float
b : float
epsilon : float
"""
result["RadiansToDegrees"].func_doc = """RadiansToDegrees(radians) -> float
Converts an angle in radians to degrees.
Parameters
----------
radians : float
"""
result["DegreesToRadians"].func_doc = """DegreesToRadians(degrees) -> float
Converts an angle in degrees to radians.
Parameters
----------
degrees : float
"""
result["Sqr"].func_doc = """Sqr(x) -> float
Returns the inner product of ``x`` with itself: specifically,
``x\\*x`` .
Defined for ``int`` , ``float`` , ``double`` , and all ``GfVec``
types.
Parameters
----------
x : T
"""
result["Sgn"].func_doc = """Sgn(v) -> T
Return the signum of ``v`` (i.e.
\\-1, 0, or 1).
The type ``T`` must implement the<and>operators; the function returns
zero only if value neither positive, nor negative.
Parameters
----------
v : T
"""
result["Sqrt"].func_doc = """Sqrt(f) -> float
Return sqrt( ``f`` ).
Parameters
----------
f : float
----------------------------------------------------------------------
Sqrt(f) -> float
Return sqrt( ``f`` ).
Parameters
----------
f : float
"""
result["Exp"].func_doc = """Exp(f) -> float
Return exp( ``f`` ).
Parameters
----------
f : float
----------------------------------------------------------------------
Exp(f) -> float
Return exp( ``f`` ).
Parameters
----------
f : float
"""
result["Log"].func_doc = """Log(f) -> float
Return log( ``f`` ).
Parameters
----------
f : float
----------------------------------------------------------------------
Log(f) -> float
Return log( ``f`` ).
Parameters
----------
f : float
"""
result["Floor"].func_doc = """Floor(f) -> float
Return floor( ``f`` ).
Parameters
----------
f : float
----------------------------------------------------------------------
Floor(f) -> float
Return floor( ``f`` ).
Parameters
----------
f : float
"""
result["Ceil"].func_doc = """Ceil(f) -> float
Return ceil( ``f`` ).
Parameters
----------
f : float
----------------------------------------------------------------------
Ceil(f) -> float
Return ceil( ``f`` ).
Parameters
----------
f : float
"""
result["Abs"].func_doc = """Abs(f) -> float
Return abs( ``f`` ).
Parameters
----------
f : float
----------------------------------------------------------------------
Abs(f) -> float
Return abs( ``f`` ).
Parameters
----------
f : float
"""
result["Round"].func_doc = """Round(f) -> float
Return round( ``f`` ).
Parameters
----------
f : float
----------------------------------------------------------------------
Round(f) -> float
Return round( ``f`` ).
Parameters
----------
f : float
"""
result["Pow"].func_doc = """Pow(f, p) -> float
Return pow( ``f`` , ``p`` ).
Parameters
----------
f : float
p : float
----------------------------------------------------------------------
Pow(f, p) -> float
Return pow( ``f`` , ``p`` ).
Parameters
----------
f : float
p : float
"""
result["Clamp"].func_doc = """Clamp(value, min, max) -> float
Return the resulting of clamping ``value`` to lie between ``min`` and
``max`` .
This function is also defined for GfVecs.
Parameters
----------
value : float
min : float
max : float
----------------------------------------------------------------------
Clamp(value, min, max) -> float
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
value : float
min : float
max : float
"""
result["Mod"].func_doc = """Mod(a, b) -> float
The mod function with"correct"behaviour for negative numbers.
If ``a`` = ``n`` ``b`` for some integer ``n`` , zero is returned.
Otherwise, for positive ``a`` , the value returned is ``fmod(a,b)`` ,
and for negative ``a`` , the value returned is ``fmod(a,b)+b`` .
Parameters
----------
a : float
b : float
"""
result["Lerp"].func_doc = """Lerp(alpha, a, b) -> T
Linear interpolation function.
For any type that supports multiplication by a scalar and binary
addition, returns
.. code-block:: text
(1-alpha) \\* a + alpha \\* b
Parameters
----------
alpha : float
a : T
b : T
"""
result["Min"].func_doc = """Min(a1, a2) -> T
Returns the smallest of the given ``values`` .
Parameters
----------
a1 : T
a2 : T
"""
result["Max"].func_doc = """Max(a1, a2) -> T
Returns the largest of the given ``values`` .
Parameters
----------
a1 : T
a2 : T
"""
result["Dot"].func_doc = """Dot(left, right) -> decltype(declval[Left]() declval[Right]())
Returns the dot (inner) product of two vectors.
For scalar types, this is just the regular product.
Parameters
----------
left : Left
right : Right
"""
result["CompMult"].func_doc = """CompMult(left, right) -> decltype(declval[Left]() declval[Right]())
Returns component-wise multiplication of vectors.
For scalar types, this is just the regular product.
Parameters
----------
left : Left
right : Right
"""
result["CompDiv"].func_doc = """CompDiv(left, right) -> decltype(declval[Left]()/declval[Right]())
Returns component-wise quotient of vectors.
For scalar types, this is just the regular quotient.
Parameters
----------
left : Left
right : Right
"""
result["Camera"].__doc__ = """"""
result["Plane"].__doc__ = """"""
result["Range1d"].__doc__ = """"""
result["Range1f"].__doc__ = """"""
result["Range2d"].__doc__ = """"""
result["Range2f"].__doc__ = """"""
result["Range3d"].__doc__ = """"""
result["Range3f"].__doc__ = """"""
result["Ray"].__doc__ = """"""
result["Camera"].focalLength = property(result["Camera"].focalLength.fget, result["Camera"].focalLength.fset, result["Camera"].focalLength.fdel, """type : float
Returns the focal length in tenths of a world unit (e.g., mm if the
world unit is assumed to be cm).
----------------------------------------------------------------------
type : None
These are the values actually stored in the class and they correspond
to measurements of an actual physical camera (in mm).
Together with the clipping range, they determine the camera frustum.
Sets the focal length in tenths of a world unit (e.g., mm if the world
unit is assumed to be cm).
""")
result["Camera"].horizontalAperture = property(result["Camera"].horizontalAperture.fget, result["Camera"].horizontalAperture.fset, result["Camera"].horizontalAperture.fdel, """type : float
Returns the width of the projector aperture in tenths of a world unit
(e.g., mm if the world unit is assumed to be cm).
----------------------------------------------------------------------
type : None
Sets the width of the projector aperture in tenths of a world unit
(e.g., mm if the world unit is assumed to be cm).
""")
result["Camera"].verticalAperture = property(result["Camera"].verticalAperture.fget, result["Camera"].verticalAperture.fset, result["Camera"].verticalAperture.fdel, """type : float
Returns the height of the projector aperture in tenths of a world unit
(e.g., mm if the world unit is assumed to be cm).
----------------------------------------------------------------------
type : None
Sets the height of the projector aperture in tenths of a world unit
(e.g., mm if the world unit is assumed to be cm).
""")
result["Camera"].horizontalApertureOffset = property(result["Camera"].horizontalApertureOffset.fget, result["Camera"].horizontalApertureOffset.fset, result["Camera"].horizontalApertureOffset.fdel, """type : float
Returns the horizontal offset of the projector aperture in tenths of a
world unit (e.g., mm if the world unit is assumed to be cm).
In particular, an offset is necessary when writing out a stereo camera
with finite convergence distance as two cameras.
----------------------------------------------------------------------
type : None
Sets the horizontal offset of the projector aperture in tenths of a
world unit (e.g., mm if the world unit is assumed to be cm).
""")
result["Camera"].verticalApertureOffset = property(result["Camera"].verticalApertureOffset.fget, result["Camera"].verticalApertureOffset.fset, result["Camera"].verticalApertureOffset.fdel, """type : float
Returns the vertical offset of the projector aperture in tenths of a
world unit (e.g., mm if the world unit is assumed to be cm).
----------------------------------------------------------------------
type : None
Sets the vertical offset of the projector aperture in tenths of a
world unit (e.g., mm if the world unit is assumed to be cm).
""")
result["Camera"].transform = property(result["Camera"].transform.fget, result["Camera"].transform.fset, result["Camera"].transform.fdel, """type : Matrix4d
Returns the transform of the filmback in world space.
This is exactly the transform specified via SetTransform() .
----------------------------------------------------------------------
type : None
Sets the transform of the filmback in world space to ``val`` .
""")
result["Camera"].projection = property(result["Camera"].projection.fget, result["Camera"].projection.fset, result["Camera"].projection.fdel, """type : Projection
Returns the projection type.
----------------------------------------------------------------------
type : None
Sets the projection type.
""")
result["Camera"].clippingRange = property(result["Camera"].clippingRange.fget, result["Camera"].clippingRange.fset, result["Camera"].clippingRange.fdel, """type : Range1f
Returns the clipping range in world units.
----------------------------------------------------------------------
type : None
Sets the clipping range in world units.
""")
result["Camera"].clippingPlanes = property(result["Camera"].clippingPlanes.fget, result["Camera"].clippingPlanes.fset, result["Camera"].clippingPlanes.fdel, """type : list[Vec4f]
Returns additional clipping planes.
----------------------------------------------------------------------
type : None
Sets additional arbitrarily oriented clipping planes.
A vector (a,b,c,d) encodes a clipping plane that clips off points
(x,y,z) with a \\* x + b \\* y + c \\* z + d \\* 1<0
where (x,y,z) are the coordinates in the camera's space.
""")
result["Camera"].fStop = property(result["Camera"].fStop.fget, result["Camera"].fStop.fset, result["Camera"].fStop.fdel, """type : float
Returns the lens aperture.
----------------------------------------------------------------------
type : None
Sets the lens aperture, unitless.
""")
result["Camera"].focusDistance = property(result["Camera"].focusDistance.fget, result["Camera"].focusDistance.fset, result["Camera"].focusDistance.fdel, """type : float
Returns the focus distance in world units.
----------------------------------------------------------------------
type : None
Sets the focus distance in world units.
""")
result["Camera"].aspectRatio = property(result["Camera"].aspectRatio.fget, result["Camera"].aspectRatio.fset, result["Camera"].aspectRatio.fdel, """type : float
Returns the projector aperture aspect ratio.
""")
result["Camera"].frustum = property(result["Camera"].frustum.fget, result["Camera"].frustum.fset, result["Camera"].frustum.fdel, """type : Frustum
Returns the computed, world-space camera frustum.
The frustum will always be that of a Y-up, -Z-looking camera.
""")
result["Quaternion"].real = property(result["Quaternion"].real.fget, result["Quaternion"].real.fset, result["Quaternion"].real.fdel, """type : None
Sets the real part of the quaternion.
""")
result["Quaternion"].imaginary = property(result["Quaternion"].imaginary.fget, result["Quaternion"].imaginary.fset, result["Quaternion"].imaginary.fdel, """type : None
Sets the imaginary part of the quaternion.
""")
result["Ray"].startPoint = property(result["Ray"].startPoint.fget, result["Ray"].startPoint.fset, result["Ray"].startPoint.fdel, """type : Vec3d
Returns the starting point of the segment.
""")
result["Ray"].direction = property(result["Ray"].direction.fget, result["Ray"].direction.fset, result["Ray"].direction.fdel, """type : Vec3d
Returns the direction vector of the segment.
This is not guaranteed to be unit length.
""") | 212,405 | Python | 15.32511 | 228 | 0.608983 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Gf/__init__.pyi | from __future__ import annotations
import pxr.Gf._gf
import typing
import Boost.Python
import pxr.Gf
__all__ = [
"Abs",
"Absf",
"ApplyGamma",
"BBox3d",
"Camera",
"Ceil",
"Ceilf",
"Clamp",
"Clampf",
"CompDiv",
"CompMult",
"ConvertDisplayToLinear",
"ConvertLinearToDisplay",
"Cross",
"DegreesToRadians",
"Dot",
"DualQuatd",
"DualQuatf",
"DualQuath",
"Exp",
"Expf",
"FindClosestPoints",
"FitPlaneToPoints",
"Floor",
"Floorf",
"Frustum",
"GetComplement",
"GetDisplayGamma",
"GetHomogenized",
"GetLength",
"GetNormalized",
"GetProjection",
"HomogeneousCross",
"Interval",
"IsClose",
"Lerp",
"Lerpf",
"Line",
"LineSeg",
"Log",
"Logf",
"MIN_ORTHO_TOLERANCE",
"MIN_VECTOR_LENGTH",
"Matrix2d",
"Matrix2f",
"Matrix3d",
"Matrix3f",
"Matrix4d",
"Matrix4f",
"Max",
"Min",
"Mod",
"Modf",
"MultiInterval",
"Normalize",
"Plane",
"Pow",
"Powf",
"Project",
"Quatd",
"Quaternion",
"Quatf",
"Quath",
"RadiansToDegrees",
"Range1d",
"Range1f",
"Range2d",
"Range2f",
"Range3d",
"Range3f",
"Ray",
"Rect2i",
"Rotation",
"Round",
"Roundf",
"Sgn",
"Size2",
"Size3",
"Slerp",
"Sqr",
"Sqrt",
"Sqrtf",
"Transform",
"Vec2d",
"Vec2f",
"Vec2h",
"Vec2i",
"Vec3d",
"Vec3f",
"Vec3h",
"Vec3i",
"Vec4d",
"Vec4f",
"Vec4h",
"Vec4i"
]
class BBox3d(Boost.Python.instance):
"""
Arbitrarily oriented 3D bounding box
"""
@staticmethod
def Combine(*args, **kwargs) -> None:
"""
**classmethod** Combine(b1, b2) -> BBox3d
Combines two bboxes, returning a new bbox that contains both.
This uses the coordinate space of one of the two original boxes as the
space of the result; it uses the one that produces whe smaller of the
two resulting boxes.
Parameters
----------
b1 : BBox3d
b2 : BBox3d
"""
@staticmethod
def ComputeAlignedBox() -> Range3d:
"""
ComputeAlignedBox() -> Range3d
Returns the axis-aligned range (as a ``GfRange3d`` ) that results from
applying the transformation matrix to the axis-aligned box and
aligning the result.
This synonym for ``ComputeAlignedRange`` exists for compatibility
purposes.
"""
@staticmethod
def ComputeAlignedRange() -> Range3d:
"""
ComputeAlignedRange() -> Range3d
Returns the axis-aligned range (as a ``GfRange3d`` ) that results from
applying the transformation matrix to the wxis-aligned box and
aligning the result.
"""
@staticmethod
def ComputeCentroid() -> Vec3d:
"""
ComputeCentroid() -> Vec3d
Returns the centroid of the bounding box.
The centroid is computed as the transformed centroid of the range.
"""
@staticmethod
def GetBox() -> Range3d:
"""
GetBox() -> Range3d
Returns the range of the axis-aligned untransformed box.
This synonym of ``GetRange`` exists for compatibility purposes.
"""
@staticmethod
def GetInverseMatrix() -> Matrix4d:
"""
GetInverseMatrix() -> Matrix4d
Returns the inverse of the transformation matrix.
This will be the identity matrix if the transformation matrix is not
invertible.
"""
@staticmethod
def GetMatrix() -> Matrix4d:
"""
GetMatrix() -> Matrix4d
Returns the transformation matrix.
"""
@staticmethod
def GetRange() -> Range3d:
"""
GetRange() -> Range3d
Returns the range of the axis-aligned untransformed box.
"""
@staticmethod
def GetVolume() -> float:
"""
GetVolume() -> float
Returns the volume of the box (0 for an empty box).
"""
@staticmethod
def HasZeroAreaPrimitives() -> bool:
"""
HasZeroAreaPrimitives() -> bool
Returns the current state of the zero-area primitives flag".
"""
@staticmethod
def Set(box, matrix) -> None:
"""
Set(box, matrix) -> None
Sets the axis-aligned box and transformation matrix.
Parameters
----------
box : Range3d
matrix : Matrix4d
"""
@staticmethod
def SetHasZeroAreaPrimitives(hasThem) -> None:
"""
SetHasZeroAreaPrimitives(hasThem) -> None
Sets the zero-area primitives flag to the given value.
Parameters
----------
hasThem : bool
"""
@staticmethod
def SetMatrix(matrix) -> None:
"""
SetMatrix(matrix) -> None
Sets the transformation matrix only.
The axis-aligned box is not modified.
Parameters
----------
matrix : Matrix4d
"""
@staticmethod
def SetRange(box) -> None:
"""
SetRange(box) -> None
Sets the range of the axis-aligned box only.
The transformation matrix is not modified.
Parameters
----------
box : Range3d
"""
@staticmethod
def Transform(matrix) -> None:
"""
Transform(matrix) -> None
Transforms the bounding box by the given matrix, which is assumed to
be a global transformation to apply to the box.
Therefore, this just post-multiplies the box's matrix by ``matrix`` .
Parameters
----------
matrix : Matrix4d
"""
@property
def box(self) -> None:
"""
:type: None
"""
@property
def hasZeroAreaPrimitives(self) -> None:
"""
:type: None
"""
@property
def matrix(self) -> None:
"""
:type: None
"""
__instance_size__ = 328
pass
class Camera(Boost.Python.instance):
class FOVDirection(pxr.Tf.Tf_PyEnumWrapper, pxr.Tf.Enum, Boost.Python.instance):
"""
Direction used for Field of View or orthographic size.
"""
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = 'Camera'
allValues: tuple # value = (Gf.Camera.FOVHorizontal, Gf.Camera.FOVVertical)
pass
class Projection(pxr.Tf.Tf_PyEnumWrapper, pxr.Tf.Enum, Boost.Python.instance):
"""
Projection type.
"""
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = 'Camera'
allValues: tuple # value = (Gf.Camera.Perspective, Gf.Camera.Orthographic)
pass
@staticmethod
def GetFieldOfView(direction) -> float:
"""
GetFieldOfView(direction) -> float
Returns the horizontal or vertical field of view in degrees.
Parameters
----------
direction : FOVDirection
"""
@staticmethod
def SetFromViewAndProjectionMatrix(viewMatrix, projMatix, focalLength) -> None:
"""
SetFromViewAndProjectionMatrix(viewMatrix, projMatix, focalLength) -> None
Sets the camera from a view and projection matrix.
Note that the projection matrix does only determine the ratio of
aperture to focal length, so there is a choice which defaults to 50mm
(or more accurately, 50 tenths of a world unit).
Parameters
----------
viewMatrix : Matrix4d
projMatix : Matrix4d
focalLength : float
"""
@staticmethod
def SetOrthographicFromAspectRatioAndSize(aspectRatio, orthographicSize, direction) -> None:
"""
SetOrthographicFromAspectRatioAndSize(aspectRatio, orthographicSize, direction) -> None
Sets the frustum to be orthographic such that it has the given
``aspectRatio`` and such that the orthographic width, respectively,
orthographic height (in cm) is equal to ``orthographicSize``
(depending on direction).
Parameters
----------
aspectRatio : float
orthographicSize : float
direction : FOVDirection
"""
@staticmethod
def SetPerspectiveFromAspectRatioAndFieldOfView(aspectRatio, fieldOfView, direction, horizontalAperture) -> None:
"""
SetPerspectiveFromAspectRatioAndFieldOfView(aspectRatio, fieldOfView, direction, horizontalAperture) -> None
Sets the frustum to be projective with the given ``aspectRatio`` and
horizontal, respectively, vertical field of view ``fieldOfView``
(similar to gluPerspective when direction = FOVVertical).
Do not pass values for ``horionztalAperture`` unless you care about
DepthOfField.
Parameters
----------
aspectRatio : float
fieldOfView : float
direction : FOVDirection
horizontalAperture : float
"""
@property
def aspectRatio(self) -> None:
"""
type : float
Returns the projector aperture aspect ratio.
:type: None
"""
@property
def clippingPlanes(self) -> None:
"""
type : list[Vec4f]
Returns additional clipping planes.
----------------------------------------------------------------------
type : None
Sets additional arbitrarily oriented clipping planes.
A vector (a,b,c,d) encodes a clipping plane that clips off points
(x,y,z) with a \* x + b \* y + c \* z + d \* 1<0
:type: None
"""
@property
def clippingRange(self) -> None:
"""
type : Range1f
Returns the clipping range in world units.
----------------------------------------------------------------------
type : None
Sets the clipping range in world units.
:type: None
"""
@property
def fStop(self) -> None:
"""
type : float
Returns the lens aperture.
----------------------------------------------------------------------
type : None
Sets the lens aperture, unitless.
:type: None
"""
@property
def focalLength(self) -> None:
"""
type : float
Returns the focal length in tenths of a world unit (e.g., mm if the
world unit is assumed to be cm).
----------------------------------------------------------------------
type : None
These are the values actually stored in the class and they correspond
to measurements of an actual physical camera (in mm).
Together with the clipping range, they determine the camera frustum.
Sets the focal length in tenths of a world unit (e.g., mm if the world
unit is assumed to be cm).
:type: None
"""
@property
def focusDistance(self) -> None:
"""
type : float
Returns the focus distance in world units.
----------------------------------------------------------------------
type : None
Sets the focus distance in world units.
:type: None
"""
@property
def frustum(self) -> None:
"""
type : Frustum
Returns the computed, world-space camera frustum.
The frustum will always be that of a Y-up, -Z-looking camera.
:type: None
"""
@property
def horizontalAperture(self) -> None:
"""
type : float
Returns the width of the projector aperture in tenths of a world unit
(e.g., mm if the world unit is assumed to be cm).
----------------------------------------------------------------------
type : None
Sets the width of the projector aperture in tenths of a world unit
(e.g., mm if the world unit is assumed to be cm).
:type: None
"""
@property
def horizontalApertureOffset(self) -> None:
"""
type : float
Returns the horizontal offset of the projector aperture in tenths of a
world unit (e.g., mm if the world unit is assumed to be cm).
In particular, an offset is necessary when writing out a stereo camera
with finite convergence distance as two cameras.
----------------------------------------------------------------------
type : None
Sets the horizontal offset of the projector aperture in tenths of a
world unit (e.g., mm if the world unit is assumed to be cm).
:type: None
"""
@property
def horizontalFieldOfView(self) -> None:
"""
:type: None
"""
@property
def projection(self) -> None:
"""
type : Projection
Returns the projection type.
----------------------------------------------------------------------
type : None
Sets the projection type.
:type: None
"""
@property
def transform(self) -> None:
"""
type : Matrix4d
Returns the transform of the filmback in world space.
This is exactly the transform specified via SetTransform() .
----------------------------------------------------------------------
type : None
Sets the transform of the filmback in world space to ``val`` .
:type: None
"""
@property
def verticalAperture(self) -> None:
"""
type : float
Returns the height of the projector aperture in tenths of a world unit
(e.g., mm if the world unit is assumed to be cm).
----------------------------------------------------------------------
type : None
Sets the height of the projector aperture in tenths of a world unit
(e.g., mm if the world unit is assumed to be cm).
:type: None
"""
@property
def verticalApertureOffset(self) -> None:
"""
type : float
Returns the vertical offset of the projector aperture in tenths of a
world unit (e.g., mm if the world unit is assumed to be cm).
----------------------------------------------------------------------
type : None
Sets the vertical offset of the projector aperture in tenths of a
world unit (e.g., mm if the world unit is assumed to be cm).
:type: None
"""
@property
def verticalFieldOfView(self) -> None:
"""
:type: None
"""
APERTURE_UNIT = 0.1
DEFAULT_HORIZONTAL_APERTURE = 20.955
DEFAULT_VERTICAL_APERTURE = 15.290799999999999
FOCAL_LENGTH_UNIT = 0.1
FOVHorizontal: pxr.Gf.FOVDirection # value = Gf.Camera.FOVHorizontal
FOVVertical: pxr.Gf.FOVDirection # value = Gf.Camera.FOVVertical
Orthographic: pxr.Gf.Projection # value = Gf.Camera.Orthographic
Perspective: pxr.Gf.Projection # value = Gf.Camera.Perspective
__instance_size__ = 208
pass
class DualQuatd(Boost.Python.instance):
@staticmethod
def GetConjugate() -> DualQuatd:
"""
GetConjugate() -> DualQuatd
Returns the conjugate of this dual quaternion.
"""
@staticmethod
def GetDual() -> Quatd:
"""
GetDual() -> Quatd
Returns the dual part of the dual quaternion.
"""
@staticmethod
def GetIdentity(*args, **kwargs) -> None:
"""
**classmethod** GetIdentity() -> DualQuatd
Returns the identity dual quaternion, which has a real part of
(1,0,0,0) and a dual part of (0,0,0,0).
"""
@staticmethod
def GetInverse() -> DualQuatd:
"""
GetInverse() -> DualQuatd
Returns the inverse of this dual quaternion.
"""
@staticmethod
def GetLength() -> tuple[float, float]:
"""
GetLength() -> tuple[float, float]
Returns geometric length of this dual quaternion.
"""
@staticmethod
def GetNormalized(eps) -> DualQuatd:
"""
GetNormalized(eps) -> DualQuatd
Returns a normalized (unit-length) version of this dual quaternion.
If the length of this dual quaternion is smaller than ``eps`` , this
returns the identity dual quaternion.
Parameters
----------
eps : float
"""
@staticmethod
def GetReal() -> Quatd:
"""
GetReal() -> Quatd
Returns the real part of the dual quaternion.
"""
@staticmethod
def GetTranslation() -> Vec3d:
"""
GetTranslation() -> Vec3d
Get the translation component of this dual quaternion.
"""
@staticmethod
def GetZero(*args, **kwargs) -> None:
"""
**classmethod** GetZero() -> DualQuatd
Returns the zero dual quaternion, which has a real part of (0,0,0,0)
and a dual part of (0,0,0,0).
"""
@staticmethod
def Normalize(eps) -> tuple[float, float]:
"""
Normalize(eps) -> tuple[float, float]
Normalizes this dual quaternion in place.
Normalizes this dual quaternion in place to unit length, returning the
length before normalization. If the length of this dual quaternion is
smaller than ``eps`` , this sets the dual quaternion to identity.
Parameters
----------
eps : float
"""
@staticmethod
def SetDual(dual) -> None:
"""
SetDual(dual) -> None
Sets the dual part of the dual quaternion.
Parameters
----------
dual : Quatd
"""
@staticmethod
def SetReal(real) -> None:
"""
SetReal(real) -> None
Sets the real part of the dual quaternion.
Parameters
----------
real : Quatd
"""
@staticmethod
def SetTranslation(translation) -> None:
"""
SetTranslation(translation) -> None
Set the translation component of this dual quaternion.
Parameters
----------
translation : Vec3d
"""
@staticmethod
def Transform(vec) -> Vec3d:
"""
Transform(vec) -> Vec3d
Transforms the row vector *vec* by the dual quaternion.
Parameters
----------
vec : Vec3d
"""
@property
def dual(self) -> None:
"""
:type: None
"""
@property
def real(self) -> None:
"""
:type: None
"""
pass
class DualQuatf(Boost.Python.instance):
@staticmethod
def GetConjugate() -> DualQuatf:
"""
GetConjugate() -> DualQuatf
Returns the conjugate of this dual quaternion.
"""
@staticmethod
def GetDual() -> Quatf:
"""
GetDual() -> Quatf
Returns the dual part of the dual quaternion.
"""
@staticmethod
def GetIdentity(*args, **kwargs) -> None:
"""
**classmethod** GetIdentity() -> DualQuatf
Returns the identity dual quaternion, which has a real part of
(1,0,0,0) and a dual part of (0,0,0,0).
"""
@staticmethod
def GetInverse() -> DualQuatf:
"""
GetInverse() -> DualQuatf
Returns the inverse of this dual quaternion.
"""
@staticmethod
def GetLength() -> tuple[float, float]:
"""
GetLength() -> tuple[float, float]
Returns geometric length of this dual quaternion.
"""
@staticmethod
def GetNormalized(eps) -> DualQuatf:
"""
GetNormalized(eps) -> DualQuatf
Returns a normalized (unit-length) version of this dual quaternion.
If the length of this dual quaternion is smaller than ``eps`` , this
returns the identity dual quaternion.
Parameters
----------
eps : float
"""
@staticmethod
def GetReal() -> Quatf:
"""
GetReal() -> Quatf
Returns the real part of the dual quaternion.
"""
@staticmethod
def GetTranslation() -> Vec3f:
"""
GetTranslation() -> Vec3f
Get the translation component of this dual quaternion.
"""
@staticmethod
def GetZero(*args, **kwargs) -> None:
"""
**classmethod** GetZero() -> DualQuatf
Returns the zero dual quaternion, which has a real part of (0,0,0,0)
and a dual part of (0,0,0,0).
"""
@staticmethod
def Normalize(eps) -> tuple[float, float]:
"""
Normalize(eps) -> tuple[float, float]
Normalizes this dual quaternion in place.
Normalizes this dual quaternion in place to unit length, returning the
length before normalization. If the length of this dual quaternion is
smaller than ``eps`` , this sets the dual quaternion to identity.
Parameters
----------
eps : float
"""
@staticmethod
def SetDual(dual) -> None:
"""
SetDual(dual) -> None
Sets the dual part of the dual quaternion.
Parameters
----------
dual : Quatf
"""
@staticmethod
def SetReal(real) -> None:
"""
SetReal(real) -> None
Sets the real part of the dual quaternion.
Parameters
----------
real : Quatf
"""
@staticmethod
def SetTranslation(translation) -> None:
"""
SetTranslation(translation) -> None
Set the translation component of this dual quaternion.
Parameters
----------
translation : Vec3f
"""
@staticmethod
def Transform(vec) -> Vec3f:
"""
Transform(vec) -> Vec3f
Transforms the row vector *vec* by the dual quaternion.
Parameters
----------
vec : Vec3f
"""
@property
def dual(self) -> None:
"""
:type: None
"""
@property
def real(self) -> None:
"""
:type: None
"""
pass
class DualQuath(Boost.Python.instance):
@staticmethod
def GetConjugate() -> DualQuath:
"""
GetConjugate() -> DualQuath
Returns the conjugate of this dual quaternion.
"""
@staticmethod
def GetDual() -> Quath:
"""
GetDual() -> Quath
Returns the dual part of the dual quaternion.
"""
@staticmethod
def GetIdentity(*args, **kwargs) -> None:
"""
**classmethod** GetIdentity() -> DualQuath
Returns the identity dual quaternion, which has a real part of
(1,0,0,0) and a dual part of (0,0,0,0).
"""
@staticmethod
def GetInverse() -> DualQuath:
"""
GetInverse() -> DualQuath
Returns the inverse of this dual quaternion.
"""
@staticmethod
def GetLength() -> tuple[GfHalf, GfHalf]:
"""
GetLength() -> tuple[GfHalf, GfHalf]
Returns geometric length of this dual quaternion.
"""
@staticmethod
def GetNormalized(eps) -> DualQuath:
"""
GetNormalized(eps) -> DualQuath
Returns a normalized (unit-length) version of this dual quaternion.
If the length of this dual quaternion is smaller than ``eps`` , this
returns the identity dual quaternion.
Parameters
----------
eps : GfHalf
"""
@staticmethod
def GetReal() -> Quath:
"""
GetReal() -> Quath
Returns the real part of the dual quaternion.
"""
@staticmethod
def GetTranslation() -> Vec3h:
"""
GetTranslation() -> Vec3h
Get the translation component of this dual quaternion.
"""
@staticmethod
def GetZero(*args, **kwargs) -> None:
"""
**classmethod** GetZero() -> DualQuath
Returns the zero dual quaternion, which has a real part of (0,0,0,0)
and a dual part of (0,0,0,0).
"""
@staticmethod
def Normalize(eps) -> tuple[GfHalf, GfHalf]:
"""
Normalize(eps) -> tuple[GfHalf, GfHalf]
Normalizes this dual quaternion in place.
Normalizes this dual quaternion in place to unit length, returning the
length before normalization. If the length of this dual quaternion is
smaller than ``eps`` , this sets the dual quaternion to identity.
Parameters
----------
eps : GfHalf
"""
@staticmethod
def SetDual(dual) -> None:
"""
SetDual(dual) -> None
Sets the dual part of the dual quaternion.
Parameters
----------
dual : Quath
"""
@staticmethod
def SetReal(real) -> None:
"""
SetReal(real) -> None
Sets the real part of the dual quaternion.
Parameters
----------
real : Quath
"""
@staticmethod
def SetTranslation(translation) -> None:
"""
SetTranslation(translation) -> None
Set the translation component of this dual quaternion.
Parameters
----------
translation : Vec3h
"""
@staticmethod
def Transform(vec) -> Vec3h:
"""
Transform(vec) -> Vec3h
Transforms the row vector *vec* by the dual quaternion.
Parameters
----------
vec : Vec3h
"""
@property
def dual(self) -> None:
"""
:type: None
"""
@property
def real(self) -> None:
"""
:type: None
"""
pass
class Frustum(Boost.Python.instance):
"""
Basic view frustum
"""
class ProjectionType(pxr.Tf.Tf_PyEnumWrapper, pxr.Tf.Enum, Boost.Python.instance):
"""
This enum is used to determine the type of projection represented by a
frustum.
"""
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = 'Frustum'
allValues: tuple # value = (Gf.Frustum.Orthographic, Gf.Frustum.Perspective)
pass
@staticmethod
def ComputeAspectRatio() -> float:
"""
ComputeAspectRatio() -> float
Returns the aspect ratio of the frustum, defined as the width of the
window divided by the height.
If the height is zero or negative, this returns 0.
"""
@staticmethod
def ComputeCorners() -> list[Vec3d]:
"""
ComputeCorners() -> list[Vec3d]
Returns the world-space corners of the frustum as a vector of 8
points, ordered as:
- Left bottom near
- Right bottom near
- Left top near
- Right top near
- Left bottom far
- Right bottom far
- Left top far
- Right top far
"""
@staticmethod
def ComputeCornersAtDistance(d) -> list[Vec3d]:
"""
ComputeCornersAtDistance(d) -> list[Vec3d]
Returns the world-space corners of the intersection of the frustum
with a plane parallel to the near/far plane at distance d from the
apex, ordered as:
- Left bottom
- Right bottom
- Left top
- Right top In particular, it gives the partial result of
ComputeCorners when given near or far distance.
Parameters
----------
d : float
"""
@staticmethod
def ComputeLookAtPoint() -> Vec3d:
"""
ComputeLookAtPoint() -> Vec3d
Computes and returns the world-space look-at point from the eye point
(position), view direction (rotation), and view distance.
"""
@staticmethod
@typing.overload
def ComputeNarrowedFrustum(windowPos, size) -> Frustum:
"""
ComputeNarrowedFrustum(windowPos, size) -> Frustum
Returns a frustum that is a narrowed-down version of this frustum.
The new frustum has the same near and far planes, but the other planes
are adjusted to be centered on ``windowPos`` with the new width and
height obtained from the existing width and height by multiplying by
``size`` [0] and ``size`` [1], respectively. Finally, the new frustum
is clipped against this frustum so that it is completely contained in
the existing frustum.
``windowPos`` is given in normalized coords (-1 to +1 in both
dimensions). ``size`` is given as a scalar (0 to 1 in both
dimensions).
If the ``windowPos`` or ``size`` given is outside these ranges, it may
result in returning a collapsed frustum.
This method is useful for computing a volume to use for interactive
picking.
Parameters
----------
windowPos : Vec2d
size : Vec2d
----------------------------------------------------------------------
Returns a frustum that is a narrowed-down version of this frustum.
The new frustum has the same near and far planes, but the other planes
are adjusted to be centered on ``worldPoint`` with the new width and
height obtained from the existing width and height by multiplying by
``size`` [0] and ``size`` [1], respectively. Finally, the new frustum
is clipped against this frustum so that it is completely contained in
the existing frustum.
``worldPoint`` is given in world space coordinates. ``size`` is given
as a scalar (0 to 1 in both dimensions).
If the ``size`` given is outside this range, it may result in
returning a collapsed frustum.
If the ``worldPoint`` is at or behind the eye of the frustum, it will
return a frustum equal to this frustum.
This method is useful for computing a volume to use for interactive
picking.
Parameters
----------
worldPoint : Vec3d
size : Vec2d
"""
@staticmethod
@typing.overload
def ComputeNarrowedFrustum(worldPoint, size) -> Frustum: ...
@staticmethod
@typing.overload
def ComputePickRay(windowPos) -> Ray:
"""
ComputePickRay(windowPos) -> Ray
Builds and returns a ``GfRay`` that can be used for picking at the
given normalized (-1 to +1 in both dimensions) window position.
Contrasted with ComputeRay() , that method returns a ray whose origin
is the eyepoint, while this method returns a ray whose origin is on
the near plane.
Parameters
----------
windowPos : Vec2d
----------------------------------------------------------------------
Builds and returns a ``GfRay`` that can be used for picking that
connects the viewpoint to the given 3d point in worldspace.
Parameters
----------
worldSpacePos : Vec3d
"""
@staticmethod
@typing.overload
def ComputePickRay(worldSpacePos) -> Ray: ...
@staticmethod
def ComputeProjectionMatrix() -> Matrix4d:
"""
ComputeProjectionMatrix() -> Matrix4d
Returns a GL-style projection matrix corresponding to the frustum's
projection.
"""
@staticmethod
def ComputeUpVector() -> Vec3d:
"""
ComputeUpVector() -> Vec3d
Returns the normalized world-space up vector, which is computed by
rotating the y axis by the frustum's rotation.
"""
@staticmethod
def ComputeViewDirection() -> Vec3d:
"""
ComputeViewDirection() -> Vec3d
Returns the normalized world-space view direction vector, which is
computed by rotating the -z axis by the frustum's rotation.
"""
@staticmethod
def ComputeViewFrame(side, up, view) -> None:
"""
ComputeViewFrame(side, up, view) -> None
Computes the view frame defined by this frustum.
The frame consists of the view direction, up vector and side vector,
as shown in this diagram.
.. code-block:: text
up
^ ^
| /
| / view
|/
+- - - - > side
Parameters
----------
side : Vec3d
up : Vec3d
view : Vec3d
"""
@staticmethod
def ComputeViewInverse() -> Matrix4d:
"""
ComputeViewInverse() -> Matrix4d
Returns a matrix that represents the inverse viewing transformation
for this frustum.
That is, it returns the matrix that converts points from eye (frustum)
space to world space.
"""
@staticmethod
def ComputeViewMatrix() -> Matrix4d:
"""
ComputeViewMatrix() -> Matrix4d
Returns a matrix that represents the viewing transformation for this
frustum.
That is, it returns the matrix that converts points from world space
to eye (frustum) space.
"""
@staticmethod
def FitToSphere(center, radius, slack) -> None:
"""
FitToSphere(center, radius, slack) -> None
Modifies the frustum to tightly enclose a sphere with the given center
and radius, using the current view direction.
The planes of the frustum are adjusted as necessary. The given amount
of slack is added to the sphere's radius is used around the sphere to
avoid boundary problems.
Parameters
----------
center : Vec3d
radius : float
slack : float
"""
@staticmethod
def GetFOV(*args, **kwargs) -> None:
"""
Returns the horizontal fov of the frustum. The fov of the
frustum is not necessarily the same value as displayed in
the viewer. The displayed fov is a function of the focal
length or FOV avar. The frustum's fov may be different due
to things like lens breathing.
If the frustum is not of type GfFrustum::Perspective, the
returned FOV will be 0.0.
"""
@staticmethod
def GetNearFar() -> Range1d:
"""
GetNearFar() -> Range1d
Returns the near/far interval.
"""
@staticmethod
def GetOrthographic(left, right, bottom, top, nearPlane, farPlane) -> bool:
"""
GetOrthographic(left, right, bottom, top, nearPlane, farPlane) -> bool
Returns the current frustum in the format used by
``SetOrthographic()`` .
If the current frustum is not an orthographic projection, this returns
``false`` and leaves the parameters untouched.
Parameters
----------
left : float
right : float
bottom : float
top : float
nearPlane : float
farPlane : float
"""
@staticmethod
def GetPerspective(*args, **kwargs) -> None:
"""
Returns the current perspective frustum values suitable
for use by SetPerspective. If the current frustum is a
perspective projection, the return value is a tuple of
fieldOfView, aspectRatio, nearDistance, farDistance).
If the current frustum is not perspective, the return
value is None.
"""
@staticmethod
def GetPosition() -> Vec3d:
"""
GetPosition() -> Vec3d
Returns the position of the frustum in world space.
"""
@staticmethod
def GetProjectionType() -> Frustum.ProjectionType:
"""
GetProjectionType() -> Frustum.ProjectionType
Returns the projection type.
"""
@staticmethod
def GetReferencePlaneDepth(*args, **kwargs) -> None:
"""
**classmethod** GetReferencePlaneDepth() -> float
Returns the depth of the reference plane.
"""
@staticmethod
def GetRotation() -> Rotation:
"""
GetRotation() -> Rotation
Returns the orientation of the frustum in world space as a rotation to
apply to the -z axis.
"""
@staticmethod
def GetViewDistance() -> float:
"""
GetViewDistance() -> float
Returns the view distance.
"""
@staticmethod
def GetWindow() -> Range2d:
"""
GetWindow() -> Range2d
Returns the window rectangle in the reference plane.
"""
@staticmethod
@typing.overload
def Intersects(bbox) -> bool:
"""
Intersects(bbox) -> bool
Returns true if the given axis-aligned bbox is inside or intersecting
the frustum.
Otherwise, it returns false. Useful when doing picking or frustum
culling.
Parameters
----------
bbox : BBox3d
----------------------------------------------------------------------
Returns true if the given point is inside or intersecting the frustum.
Otherwise, it returns false.
Parameters
----------
point : Vec3d
----------------------------------------------------------------------
Returns ``true`` if the line segment formed by the given points is
inside or intersecting the frustum.
Otherwise, it returns false.
Parameters
----------
p0 : Vec3d
p1 : Vec3d
----------------------------------------------------------------------
Returns ``true`` if the triangle formed by the given points is inside
or intersecting the frustum.
Otherwise, it returns false.
Parameters
----------
p0 : Vec3d
p1 : Vec3d
p2 : Vec3d
"""
@staticmethod
@typing.overload
def Intersects(point) -> bool: ...
@staticmethod
@typing.overload
def Intersects(p0, p1) -> bool: ...
@staticmethod
@typing.overload
def Intersects(p0, p1, p2) -> bool: ...
@staticmethod
def IntersectsViewVolume(*args, **kwargs) -> None:
"""
**classmethod** IntersectsViewVolume(bbox, vpMat) -> bool
Returns ``true`` if the bbox volume intersects the view volume given
by the view-projection matrix, erring on the side of false positives
for efficiency.
This method is intended for cases where a GfFrustum is not available
or when the view-projection matrix yields a view volume that is not
expressable as a GfFrustum.
Because it errs on the side of false positives, it is suitable for
early-out tests such as draw or intersection culling.
Parameters
----------
bbox : BBox3d
vpMat : Matrix4d
"""
@staticmethod
def SetNearFar(nearFar) -> None:
"""
SetNearFar(nearFar) -> None
Sets the near/far interval.
Parameters
----------
nearFar : Range1d
"""
@staticmethod
def SetOrthographic(left, right, bottom, top, nearPlane, farPlane) -> None:
"""
SetOrthographic(left, right, bottom, top, nearPlane, farPlane) -> None
Sets up the frustum in a manner similar to ``glOrtho()`` .
Sets the projection to ``GfFrustum::Orthographic`` and sets the window
and near/far specifications based on the given values.
Parameters
----------
left : float
right : float
bottom : float
top : float
nearPlane : float
farPlane : float
"""
@staticmethod
@typing.overload
def SetPerspective(fieldOfViewHeight, aspectRatio, nearDistance, farDistance) -> None:
"""
SetPerspective(fieldOfViewHeight, aspectRatio, nearDistance, farDistance) -> None
Sets up the frustum in a manner similar to ``gluPerspective()`` .
It sets the projection type to ``GfFrustum::Perspective`` and sets the
window specification so that the resulting symmetric frustum encloses
an angle of ``fieldOfViewHeight`` degrees in the vertical direction,
with ``aspectRatio`` used to figure the angle in the horizontal
direction. The near and far distances are specified as well. The
window coordinates are computed as:
.. code-block:: text
top = tan(fieldOfViewHeight / 2)
bottom = -top
right = top \* aspectRatio
left = -right
near = nearDistance
far = farDistance
Parameters
----------
fieldOfViewHeight : float
aspectRatio : float
nearDistance : float
farDistance : float
----------------------------------------------------------------------
Sets up the frustum in a manner similar to gluPerspective().
It sets the projection type to ``GfFrustum::Perspective`` and sets the
window specification so that:
If *isFovVertical* is true, the resulting symmetric frustum encloses
an angle of ``fieldOfView`` degrees in the vertical direction, with
``aspectRatio`` used to figure the angle in the horizontal direction.
If *isFovVertical* is false, the resulting symmetric frustum encloses
an angle of ``fieldOfView`` degrees in the horizontal direction, with
``aspectRatio`` used to figure the angle in the vertical direction.
The near and far distances are specified as well. The window
coordinates are computed as follows:
- if isFovVertical:
- top = tan(fieldOfView / 2)
- right = top \* aspectRatio
- if NOT isFovVertical:
- right = tan(fieldOfView / 2)
- top = right / aspectRation
- bottom = -top
- left = -right
- near = nearDistance
- far = farDistance
Parameters
----------
fieldOfView : float
isFovVertical : bool
aspectRatio : float
nearDistance : float
farDistance : float
"""
@staticmethod
@typing.overload
def SetPerspective(fieldOfView, isFovVertical, aspectRatio, nearDistance, farDistance) -> None: ...
@staticmethod
def SetPosition(position) -> None:
"""
SetPosition(position) -> None
Sets the position of the frustum in world space.
Parameters
----------
position : Vec3d
"""
@staticmethod
def SetPositionAndRotationFromMatrix(camToWorldXf) -> None:
"""
SetPositionAndRotationFromMatrix(camToWorldXf) -> None
Sets the position and rotation of the frustum from a camera matrix
(always from a y-Up camera).
The resulting frustum's transform will always represent a right-handed
and orthonormal coordinate sytem (scale, shear, and projection are
removed from the given ``camToWorldXf`` ).
Parameters
----------
camToWorldXf : Matrix4d
"""
@staticmethod
def SetProjectionType(projectionType) -> None:
"""
SetProjectionType(projectionType) -> None
Sets the projection type.
Parameters
----------
projectionType : Frustum.ProjectionType
"""
@staticmethod
def SetRotation(rotation) -> None:
"""
SetRotation(rotation) -> None
Sets the orientation of the frustum in world space as a rotation to
apply to the default frame: looking along the -z axis with the +y axis
as"up".
Parameters
----------
rotation : Rotation
"""
@staticmethod
def SetViewDistance(viewDistance) -> None:
"""
SetViewDistance(viewDistance) -> None
Sets the view distance.
Parameters
----------
viewDistance : float
"""
@staticmethod
def SetWindow(window) -> None:
"""
SetWindow(window) -> None
Sets the window rectangle in the reference plane that defines the
left, right, top, and bottom planes of the frustum.
Parameters
----------
window : Range2d
"""
@staticmethod
def Transform(matrix) -> Frustum:
"""
Transform(matrix) -> Frustum
Transforms the frustum by the given matrix.
The transformation matrix is applied as follows: the position and the
direction vector are transformed with the given matrix. Then the
length of the new direction vector is used to rescale the near and far
plane and the view distance. Finally, the points that define the
reference plane are transformed by the matrix. This method assures
that the frustum will not be sheared or perspective-projected.
Note that this definition means that the transformed frustum does not
preserve scales very well. Do *not* use this function to transform a
frustum that is to be used for precise operations such as intersection
testing.
Parameters
----------
matrix : Matrix4d
"""
@property
def nearFar(self) -> None:
"""
:type: None
"""
@property
def position(self) -> None:
"""
:type: None
"""
@property
def projectionType(self) -> None:
"""
:type: None
"""
@property
def rotation(self) -> None:
"""
:type: None
"""
@property
def viewDistance(self) -> None:
"""
:type: None
"""
@property
def window(self) -> None:
"""
:type: None
"""
Orthographic: pxr.Gf.ProjectionType # value = Gf.Frustum.Orthographic
Perspective: pxr.Gf.ProjectionType # value = Gf.Frustum.Perspective
__instance_size__ = 144
pass
class Interval(Boost.Python.instance):
"""
Basic mathematical interval class
"""
@staticmethod
def Contains(*args, **kwargs) -> None:
"""
Returns true if x is inside the interval.
Returns true if x is inside the interval.
"""
@staticmethod
def GetFullInterval(*args, **kwargs) -> None:
"""
**classmethod** GetFullInterval() -> Interval
Returns the full interval (-inf, inf).
"""
@staticmethod
def GetMax(*args, **kwargs) -> None:
"""
Get the maximum value.
"""
@staticmethod
def GetMin(*args, **kwargs) -> None:
"""
Get the minimum value.
"""
@staticmethod
def GetSize(*args, **kwargs) -> None:
"""
The width of the interval
"""
@staticmethod
def In(*args, **kwargs) -> None:
"""
Returns true if x is inside the interval.
"""
@staticmethod
def Intersects(i) -> bool:
"""
Intersects(i) -> bool
Return true iff the given interval i intersects this interval.
Parameters
----------
i : Interval
"""
@staticmethod
def IsEmpty(*args, **kwargs) -> None:
"""
True if the interval is empty.
"""
@staticmethod
def IsFinite() -> bool:
"""
IsFinite() -> bool
Returns true if both the maximum and minimum value are finite.
"""
@staticmethod
def IsMaxClosed() -> bool:
"""
IsMaxClosed() -> bool
Maximum boundary condition.
"""
@staticmethod
def IsMaxFinite() -> bool:
"""
IsMaxFinite() -> bool
Returns true if the maximum value is finite.
"""
@staticmethod
def IsMaxOpen() -> bool:
"""
IsMaxOpen() -> bool
Maximum boundary condition.
"""
@staticmethod
def IsMinClosed() -> bool:
"""
IsMinClosed() -> bool
Minimum boundary condition.
"""
@staticmethod
def IsMinFinite() -> bool:
"""
IsMinFinite() -> bool
Returns true if the minimum value is finite.
"""
@staticmethod
def IsMinOpen() -> bool:
"""
IsMinOpen() -> bool
Minimum boundary condition.
"""
@staticmethod
def SetMax(*args, **kwargs) -> None:
"""
Set the maximum value.
Set the maximum value and boundary condition.
"""
@staticmethod
def SetMin(*args, **kwargs) -> None:
"""
Set the minimum value.
Set the minimum value and boundary condition.
"""
@property
def finite(self) -> None:
"""
:type: None
"""
@property
def isEmpty(self) -> None:
"""
True if the interval is empty.
:type: None
"""
@property
def max(self) -> None:
"""
The maximum value.
:type: None
"""
@property
def maxClosed(self) -> None:
"""
:type: None
"""
@property
def maxFinite(self) -> None:
"""
:type: None
"""
@property
def maxOpen(self) -> None:
"""
:type: None
"""
@property
def min(self) -> None:
"""
The minimum value.
:type: None
"""
@property
def minClosed(self) -> None:
"""
:type: None
"""
@property
def minFinite(self) -> None:
"""
:type: None
"""
@property
def minOpen(self) -> None:
"""
:type: None
"""
@property
def size(self) -> None:
"""
The width of the interval.
:type: None
"""
__instance_size__ = 48
pass
class Line(Boost.Python.instance):
"""
Line class
"""
@staticmethod
def FindClosestPoint(point, t) -> Vec3d:
"""
FindClosestPoint(point, t) -> Vec3d
Returns the point on the line that is closest to ``point`` .
If ``t`` is not ``None`` , it will be set to the parametric distance
along the line of the returned point.
Parameters
----------
point : Vec3d
t : float
"""
@staticmethod
def GetDirection() -> Vec3d:
"""
GetDirection() -> Vec3d
Return the normalized direction of the line.
"""
@staticmethod
def GetPoint(t) -> Vec3d:
"""
GetPoint(t) -> Vec3d
Return the point on the line at ```` ( p0 + t \* dir).
Remember dir has been normalized so t represents a unit distance.
Parameters
----------
t : float
"""
@staticmethod
def Set(p0, dir) -> float:
"""
Set(p0, dir) -> float
Parameters
----------
p0 : Vec3d
dir : Vec3d
"""
@property
def direction(self) -> None:
"""
:type: None
"""
__instance_size__ = 64
pass
class LineSeg(Boost.Python.instance):
"""
Line segment class
"""
@staticmethod
def FindClosestPoint(point, t) -> Vec3d:
"""
FindClosestPoint(point, t) -> Vec3d
Returns the point on the line that is closest to ``point`` .
If ``t`` is not ``None`` , it will be set to the parametric distance
along the line of the closest point.
Parameters
----------
point : Vec3d
t : float
"""
@staticmethod
def GetDirection() -> Vec3d:
"""
GetDirection() -> Vec3d
Return the normalized direction of the line.
"""
@staticmethod
def GetLength() -> float:
"""
GetLength() -> float
Return the length of the line.
"""
@staticmethod
def GetPoint(t) -> Vec3d:
"""
GetPoint(t) -> Vec3d
Return the point on the segment specified by the parameter t.
p = p0 + t \* (p1 - p0)
Parameters
----------
t : float
"""
@property
def direction(self) -> None:
"""
:type: None
"""
@property
def length(self) -> None:
"""
:type: None
"""
__instance_size__ = 72
pass
class Matrix2d(Boost.Python.instance):
@staticmethod
def GetColumn(i) -> Vec2d:
"""
GetColumn(i) -> Vec2d
Gets a column of the matrix as a Vec2.
Parameters
----------
i : int
"""
@staticmethod
def GetDeterminant() -> float:
"""
GetDeterminant() -> float
Returns the determinant of the matrix.
"""
@staticmethod
def GetInverse(det, eps) -> Matrix2d:
"""
GetInverse(det, eps) -> Matrix2d
Returns the inverse of the matrix, or FLT_MAX \* SetIdentity() if the
matrix is singular.
(FLT_MAX is the largest value a ``float`` can have, as defined by the
system.) The matrix is considered singular if the determinant is less
than or equal to the optional parameter *eps*. If *det* is non-null,
``\*det`` is set to the determinant.
Parameters
----------
det : float
eps : float
"""
@staticmethod
def GetRow(i) -> Vec2d:
"""
GetRow(i) -> Vec2d
Gets a row of the matrix as a Vec2.
Parameters
----------
i : int
"""
@staticmethod
def GetTranspose() -> Matrix2d:
"""
GetTranspose() -> Matrix2d
Returns the transpose of the matrix.
"""
@staticmethod
@typing.overload
def Set(m00, m01, m10, m11) -> Matrix2d:
"""
Set(m00, m01, m10, m11) -> Matrix2d
Sets the matrix from 4 independent ``double`` values, specified in
row-major order.
For example, parameter *m10* specifies the value in row 1 and column
0.
Parameters
----------
m00 : float
m01 : float
m10 : float
m11 : float
----------------------------------------------------------------------
Sets the matrix from a 2x2 array of ``double`` values, specified in
row-major order.
Parameters
----------
m : float
"""
@staticmethod
@typing.overload
def Set(m) -> Matrix2d: ...
@staticmethod
def SetColumn(i, v) -> None:
"""
SetColumn(i, v) -> None
Sets a column of the matrix from a Vec2.
Parameters
----------
i : int
v : Vec2d
"""
@staticmethod
@typing.overload
def SetDiagonal(s) -> Matrix2d:
"""
SetDiagonal(s) -> Matrix2d
Sets the matrix to *s* times the identity matrix.
Parameters
----------
s : float
----------------------------------------------------------------------
Sets the matrix to have diagonal ( ``v[0], v[1]`` ).
Parameters
----------
arg1 : Vec2d
"""
@staticmethod
@typing.overload
def SetDiagonal(arg1) -> Matrix2d: ...
@staticmethod
def SetIdentity() -> Matrix2d:
"""
SetIdentity() -> Matrix2d
Sets the matrix to the identity matrix.
"""
@staticmethod
def SetRow(i, v) -> None:
"""
SetRow(i, v) -> None
Sets a row of the matrix from a Vec2.
Parameters
----------
i : int
v : Vec2d
"""
@staticmethod
def SetZero() -> Matrix2d:
"""
SetZero() -> Matrix2d
Sets the matrix to zero.
"""
__safe_for_unpickling__ = True
dimension = (2, 2)
pass
class Matrix2f(Boost.Python.instance):
@staticmethod
def GetColumn(i) -> Vec2f:
"""
GetColumn(i) -> Vec2f
Gets a column of the matrix as a Vec2.
Parameters
----------
i : int
"""
@staticmethod
def GetDeterminant() -> float:
"""
GetDeterminant() -> float
Returns the determinant of the matrix.
"""
@staticmethod
def GetInverse(det, eps) -> Matrix2f:
"""
GetInverse(det, eps) -> Matrix2f
Returns the inverse of the matrix, or FLT_MAX \* SetIdentity() if the
matrix is singular.
(FLT_MAX is the largest value a ``float`` can have, as defined by the
system.) The matrix is considered singular if the determinant is less
than or equal to the optional parameter *eps*. If *det* is non-null,
``\*det`` is set to the determinant.
Parameters
----------
det : float
eps : float
"""
@staticmethod
def GetRow(i) -> Vec2f:
"""
GetRow(i) -> Vec2f
Gets a row of the matrix as a Vec2.
Parameters
----------
i : int
"""
@staticmethod
def GetTranspose() -> Matrix2f:
"""
GetTranspose() -> Matrix2f
Returns the transpose of the matrix.
"""
@staticmethod
@typing.overload
def Set(m00, m01, m10, m11) -> Matrix2f:
"""
Set(m00, m01, m10, m11) -> Matrix2f
Sets the matrix from 4 independent ``float`` values, specified in row-
major order.
For example, parameter *m10* specifies the value in row 1 and column
0.
Parameters
----------
m00 : float
m01 : float
m10 : float
m11 : float
----------------------------------------------------------------------
Sets the matrix from a 2x2 array of ``float`` values, specified in
row-major order.
Parameters
----------
m : float
"""
@staticmethod
@typing.overload
def Set(m) -> Matrix2f: ...
@staticmethod
def SetColumn(i, v) -> None:
"""
SetColumn(i, v) -> None
Sets a column of the matrix from a Vec2.
Parameters
----------
i : int
v : Vec2f
"""
@staticmethod
@typing.overload
def SetDiagonal(s) -> Matrix2f:
"""
SetDiagonal(s) -> Matrix2f
Sets the matrix to *s* times the identity matrix.
Parameters
----------
s : float
----------------------------------------------------------------------
Sets the matrix to have diagonal ( ``v[0], v[1]`` ).
Parameters
----------
arg1 : Vec2f
"""
@staticmethod
@typing.overload
def SetDiagonal(arg1) -> Matrix2f: ...
@staticmethod
def SetIdentity() -> Matrix2f:
"""
SetIdentity() -> Matrix2f
Sets the matrix to the identity matrix.
"""
@staticmethod
def SetRow(i, v) -> None:
"""
SetRow(i, v) -> None
Sets a row of the matrix from a Vec2.
Parameters
----------
i : int
v : Vec2f
"""
@staticmethod
def SetZero() -> Matrix2f:
"""
SetZero() -> Matrix2f
Sets the matrix to zero.
"""
__safe_for_unpickling__ = True
dimension = (2, 2)
pass
class Matrix3d(Boost.Python.instance):
@staticmethod
def ExtractRotation() -> Rotation:
"""
ExtractRotation() -> Rotation
Returns the rotation corresponding to this matrix.
This works well only if the matrix represents a rotation.
For good results, consider calling Orthonormalize() before calling
this method.
"""
@staticmethod
def GetColumn(i) -> Vec3d:
"""
GetColumn(i) -> Vec3d
Gets a column of the matrix as a Vec3.
Parameters
----------
i : int
"""
@staticmethod
def GetDeterminant() -> float:
"""
GetDeterminant() -> float
Returns the determinant of the matrix.
"""
@staticmethod
def GetHandedness() -> float:
"""
GetHandedness() -> float
Returns the sign of the determinant of the matrix, i.e.
1 for a right-handed matrix, -1 for a left-handed matrix, and 0 for a
singular matrix.
"""
@staticmethod
def GetInverse(det, eps) -> Matrix3d:
"""
GetInverse(det, eps) -> Matrix3d
Returns the inverse of the matrix, or FLT_MAX \* SetIdentity() if the
matrix is singular.
(FLT_MAX is the largest value a ``float`` can have, as defined by the
system.) The matrix is considered singular if the determinant is less
than or equal to the optional parameter *eps*. If *det* is non-null,
``\*det`` is set to the determinant.
Parameters
----------
det : float
eps : float
"""
@staticmethod
def GetOrthonormalized(issueWarning) -> Matrix3d:
"""
GetOrthonormalized(issueWarning) -> Matrix3d
Returns an orthonormalized copy of the matrix.
Parameters
----------
issueWarning : bool
"""
@staticmethod
def GetRow(i) -> Vec3d:
"""
GetRow(i) -> Vec3d
Gets a row of the matrix as a Vec3.
Parameters
----------
i : int
"""
@staticmethod
def GetTranspose() -> Matrix3d:
"""
GetTranspose() -> Matrix3d
Returns the transpose of the matrix.
"""
@staticmethod
def IsLeftHanded() -> bool:
"""
IsLeftHanded() -> bool
Returns true if the vectors in matrix form a left-handed coordinate
system.
"""
@staticmethod
def IsRightHanded() -> bool:
"""
IsRightHanded() -> bool
Returns true if the vectors in the matrix form a right-handed
coordinate system.
"""
@staticmethod
def Orthonormalize(issueWarning) -> bool:
"""
Orthonormalize(issueWarning) -> bool
Makes the matrix orthonormal in place.
This is an iterative method that is much more stable than the previous
cross/cross method. If the iterative method does not converge, a
warning is issued.
Returns true if the iteration converged, false otherwise. Leaves any
translation part of the matrix unchanged. If *issueWarning* is true,
this method will issue a warning if the iteration does not converge,
otherwise it will be silent.
Parameters
----------
issueWarning : bool
"""
@staticmethod
@typing.overload
def Set(m00, m01, m02, m10, m11, m12, m20, m21, m22) -> Matrix3d:
"""
Set(m00, m01, m02, m10, m11, m12, m20, m21, m22) -> Matrix3d
Sets the matrix from 9 independent ``double`` values, specified in
row-major order.
For example, parameter *m10* specifies the value in row 1 and column
0.
Parameters
----------
m00 : float
m01 : float
m02 : float
m10 : float
m11 : float
m12 : float
m20 : float
m21 : float
m22 : float
----------------------------------------------------------------------
Sets the matrix from a 3x3 array of ``double`` values, specified in
row-major order.
Parameters
----------
m : float
"""
@staticmethod
@typing.overload
def Set(m) -> Matrix3d: ...
@staticmethod
def SetColumn(i, v) -> None:
"""
SetColumn(i, v) -> None
Sets a column of the matrix from a Vec3.
Parameters
----------
i : int
v : Vec3d
"""
@staticmethod
@typing.overload
def SetDiagonal(s) -> Matrix3d:
"""
SetDiagonal(s) -> Matrix3d
Sets the matrix to *s* times the identity matrix.
Parameters
----------
s : float
----------------------------------------------------------------------
Sets the matrix to have diagonal ( ``v[0], v[1], v[2]`` ).
Parameters
----------
arg1 : Vec3d
"""
@staticmethod
@typing.overload
def SetDiagonal(arg1) -> Matrix3d: ...
@staticmethod
def SetIdentity() -> Matrix3d:
"""
SetIdentity() -> Matrix3d
Sets the matrix to the identity matrix.
"""
@staticmethod
def SetRotate(rot) -> Matrix3d:
"""
SetRotate(rot) -> Matrix3d
Sets the matrix to specify a rotation equivalent to *rot*.
Parameters
----------
rot : Quatd
----------------------------------------------------------------------
Sets the matrix to specify a rotation equivalent to *rot*.
Parameters
----------
rot : Rotation
"""
@staticmethod
def SetRow(i, v) -> None:
"""
SetRow(i, v) -> None
Sets a row of the matrix from a Vec3.
Parameters
----------
i : int
v : Vec3d
"""
@staticmethod
@typing.overload
def SetScale(scaleFactors) -> Matrix3d:
"""
SetScale(scaleFactors) -> Matrix3d
Sets the matrix to specify a nonuniform scaling in x, y, and z by the
factors in vector *scaleFactors*.
Parameters
----------
scaleFactors : Vec3d
----------------------------------------------------------------------
Sets matrix to specify a uniform scaling by *scaleFactor*.
Parameters
----------
scaleFactor : float
"""
@staticmethod
@typing.overload
def SetScale(scaleFactor) -> Matrix3d: ...
@staticmethod
def SetZero() -> Matrix3d:
"""
SetZero() -> Matrix3d
Sets the matrix to zero.
"""
__safe_for_unpickling__ = True
dimension = (3, 3)
pass
class Matrix3f(Boost.Python.instance):
@staticmethod
def ExtractRotation() -> Rotation:
"""
ExtractRotation() -> Rotation
Returns the rotation corresponding to this matrix.
This works well only if the matrix represents a rotation.
For good results, consider calling Orthonormalize() before calling
this method.
"""
@staticmethod
def GetColumn(i) -> Vec3f:
"""
GetColumn(i) -> Vec3f
Gets a column of the matrix as a Vec3.
Parameters
----------
i : int
"""
@staticmethod
def GetDeterminant() -> float:
"""
GetDeterminant() -> float
Returns the determinant of the matrix.
"""
@staticmethod
def GetHandedness() -> float:
"""
GetHandedness() -> float
Returns the sign of the determinant of the matrix, i.e.
1 for a right-handed matrix, -1 for a left-handed matrix, and 0 for a
singular matrix.
"""
@staticmethod
def GetInverse(det, eps) -> Matrix3f:
"""
GetInverse(det, eps) -> Matrix3f
Returns the inverse of the matrix, or FLT_MAX \* SetIdentity() if the
matrix is singular.
(FLT_MAX is the largest value a ``float`` can have, as defined by the
system.) The matrix is considered singular if the determinant is less
than or equal to the optional parameter *eps*. If *det* is non-null,
``\*det`` is set to the determinant.
Parameters
----------
det : float
eps : float
"""
@staticmethod
def GetOrthonormalized(issueWarning) -> Matrix3f:
"""
GetOrthonormalized(issueWarning) -> Matrix3f
Returns an orthonormalized copy of the matrix.
Parameters
----------
issueWarning : bool
"""
@staticmethod
def GetRow(i) -> Vec3f:
"""
GetRow(i) -> Vec3f
Gets a row of the matrix as a Vec3.
Parameters
----------
i : int
"""
@staticmethod
def GetTranspose() -> Matrix3f:
"""
GetTranspose() -> Matrix3f
Returns the transpose of the matrix.
"""
@staticmethod
def IsLeftHanded() -> bool:
"""
IsLeftHanded() -> bool
Returns true if the vectors in matrix form a left-handed coordinate
system.
"""
@staticmethod
def IsRightHanded() -> bool:
"""
IsRightHanded() -> bool
Returns true if the vectors in the matrix form a right-handed
coordinate system.
"""
@staticmethod
def Orthonormalize(issueWarning) -> bool:
"""
Orthonormalize(issueWarning) -> bool
Makes the matrix orthonormal in place.
This is an iterative method that is much more stable than the previous
cross/cross method. If the iterative method does not converge, a
warning is issued.
Returns true if the iteration converged, false otherwise. Leaves any
translation part of the matrix unchanged. If *issueWarning* is true,
this method will issue a warning if the iteration does not converge,
otherwise it will be silent.
Parameters
----------
issueWarning : bool
"""
@staticmethod
@typing.overload
def Set(m00, m01, m02, m10, m11, m12, m20, m21, m22) -> Matrix3f:
"""
Set(m00, m01, m02, m10, m11, m12, m20, m21, m22) -> Matrix3f
Sets the matrix from 9 independent ``float`` values, specified in row-
major order.
For example, parameter *m10* specifies the value in row 1 and column
0.
Parameters
----------
m00 : float
m01 : float
m02 : float
m10 : float
m11 : float
m12 : float
m20 : float
m21 : float
m22 : float
----------------------------------------------------------------------
Sets the matrix from a 3x3 array of ``float`` values, specified in
row-major order.
Parameters
----------
m : float
"""
@staticmethod
@typing.overload
def Set(m) -> Matrix3f: ...
@staticmethod
def SetColumn(i, v) -> None:
"""
SetColumn(i, v) -> None
Sets a column of the matrix from a Vec3.
Parameters
----------
i : int
v : Vec3f
"""
@staticmethod
@typing.overload
def SetDiagonal(s) -> Matrix3f:
"""
SetDiagonal(s) -> Matrix3f
Sets the matrix to *s* times the identity matrix.
Parameters
----------
s : float
----------------------------------------------------------------------
Sets the matrix to have diagonal ( ``v[0], v[1], v[2]`` ).
Parameters
----------
arg1 : Vec3f
"""
@staticmethod
@typing.overload
def SetDiagonal(arg1) -> Matrix3f: ...
@staticmethod
def SetIdentity() -> Matrix3f:
"""
SetIdentity() -> Matrix3f
Sets the matrix to the identity matrix.
"""
@staticmethod
def SetRotate(rot) -> Matrix3f:
"""
SetRotate(rot) -> Matrix3f
Sets the matrix to specify a rotation equivalent to *rot*.
Parameters
----------
rot : Quatf
----------------------------------------------------------------------
Sets the matrix to specify a rotation equivalent to *rot*.
Parameters
----------
rot : Rotation
"""
@staticmethod
def SetRow(i, v) -> None:
"""
SetRow(i, v) -> None
Sets a row of the matrix from a Vec3.
Parameters
----------
i : int
v : Vec3f
"""
@staticmethod
@typing.overload
def SetScale(scaleFactors) -> Matrix3f:
"""
SetScale(scaleFactors) -> Matrix3f
Sets the matrix to specify a nonuniform scaling in x, y, and z by the
factors in vector *scaleFactors*.
Parameters
----------
scaleFactors : Vec3f
----------------------------------------------------------------------
Sets matrix to specify a uniform scaling by *scaleFactor*.
Parameters
----------
scaleFactor : float
"""
@staticmethod
@typing.overload
def SetScale(scaleFactor) -> Matrix3f: ...
@staticmethod
def SetZero() -> Matrix3f:
"""
SetZero() -> Matrix3f
Sets the matrix to zero.
"""
__safe_for_unpickling__ = True
dimension = (3, 3)
pass
class Matrix4d(Boost.Python.instance):
@staticmethod
def ExtractRotation() -> Rotation:
"""
ExtractRotation() -> Rotation
Returns the rotation corresponding to this matrix.
This works well only if the matrix represents a rotation.
For good results, consider calling Orthonormalize() before calling
this method.
"""
@staticmethod
def ExtractRotationMatrix() -> Matrix3d:
"""
ExtractRotationMatrix() -> Matrix3d
Returns the rotation corresponding to this matrix.
This works well only if the matrix represents a rotation.
For good results, consider calling Orthonormalize() before calling
this method.
"""
@staticmethod
def ExtractRotationQuat() -> Quatd:
"""
ExtractRotationQuat() -> Quatd
Return the rotation corresponding to this matrix as a quaternion.
This works well only if the matrix represents a rotation.
For good results, consider calling Orthonormalize() before calling
this method.
"""
@staticmethod
def ExtractTranslation() -> Vec3d:
"""
ExtractTranslation() -> Vec3d
Returns the translation part of the matrix, defined as the first three
elements of the last row.
"""
@staticmethod
def Factor(r, s, u, t, p, eps) -> bool:
"""
Factor(r, s, u, t, p, eps) -> bool
Factors the matrix into 5 components:
- ``*M* = r \* s \* -r \* u \* t`` where
- *t* is a translation.
- *u* and *r* are rotations, and *-r* is the transpose (inverse) of
*r*. The *u* matrix may contain shear information.
- *s* is a scale. Any projection information could be returned in
matrix *p*, but currently p is never modified.
Returns ``false`` if the matrix is singular (as determined by *eps*).
In that case, any zero scales in *s* are clamped to *eps* to allow
computation of *u*.
Parameters
----------
r : Matrix4d
s : Vec3d
u : Matrix4d
t : Vec3d
p : Matrix4d
eps : float
"""
@staticmethod
def GetColumn(i) -> Vec4d:
"""
GetColumn(i) -> Vec4d
Gets a column of the matrix as a Vec4.
Parameters
----------
i : int
"""
@staticmethod
def GetDeterminant() -> float:
"""
GetDeterminant() -> float
Returns the determinant of the matrix.
"""
@staticmethod
def GetDeterminant3() -> float:
"""
GetDeterminant3() -> float
Returns the determinant of the upper 3x3 matrix.
This method is useful when the matrix describes a linear
transformation such as a rotation or scale because the other values in
the 4x4 matrix are not important.
"""
@staticmethod
def GetHandedness() -> float:
"""
GetHandedness() -> float
Returns the sign of the determinant of the upper 3x3 matrix, i.e.
1 for a right-handed matrix, -1 for a left-handed matrix, and 0 for a
singular matrix.
"""
@staticmethod
def GetInverse(det, eps) -> Matrix4d:
"""
GetInverse(det, eps) -> Matrix4d
Returns the inverse of the matrix, or FLT_MAX \* SetIdentity() if the
matrix is singular.
(FLT_MAX is the largest value a ``float`` can have, as defined by the
system.) The matrix is considered singular if the determinant is less
than or equal to the optional parameter *eps*. If *det* is non-null,
``\*det`` is set to the determinant.
Parameters
----------
det : float
eps : float
"""
@staticmethod
def GetOrthonormalized(issueWarning) -> Matrix4d:
"""
GetOrthonormalized(issueWarning) -> Matrix4d
Returns an orthonormalized copy of the matrix.
Parameters
----------
issueWarning : bool
"""
@staticmethod
def GetRow(i) -> Vec4d:
"""
GetRow(i) -> Vec4d
Gets a row of the matrix as a Vec4.
Parameters
----------
i : int
"""
@staticmethod
def GetRow3(i) -> Vec3d:
"""
GetRow3(i) -> Vec3d
Gets a row of the matrix as a Vec3.
Parameters
----------
i : int
"""
@staticmethod
def GetTranspose() -> Matrix4d:
"""
GetTranspose() -> Matrix4d
Returns the transpose of the matrix.
"""
@staticmethod
def HasOrthogonalRows3() -> bool:
"""
HasOrthogonalRows3() -> bool
Returns true, if the row vectors of the upper 3x3 matrix form an
orthogonal basis.
Note they do not have to be unit length for this test to return true.
"""
@staticmethod
def IsLeftHanded() -> bool:
"""
IsLeftHanded() -> bool
Returns true if the vectors in the upper 3x3 matrix form a left-handed
coordinate system.
"""
@staticmethod
def IsRightHanded() -> bool:
"""
IsRightHanded() -> bool
Returns true if the vectors in the upper 3x3 matrix form a right-
handed coordinate system.
"""
@staticmethod
def Orthonormalize(issueWarning) -> bool:
"""
Orthonormalize(issueWarning) -> bool
Makes the matrix orthonormal in place.
This is an iterative method that is much more stable than the previous
cross/cross method. If the iterative method does not converge, a
warning is issued.
Returns true if the iteration converged, false otherwise. Leaves any
translation part of the matrix unchanged. If *issueWarning* is true,
this method will issue a warning if the iteration does not converge,
otherwise it will be silent.
Parameters
----------
issueWarning : bool
"""
@staticmethod
def RemoveScaleShear() -> Matrix4d:
"""
RemoveScaleShear() -> Matrix4d
Returns the matrix with any scaling or shearing removed, leaving only
the rotation and translation.
If the matrix cannot be decomposed, returns the original matrix.
"""
@staticmethod
@typing.overload
def Set(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) -> Matrix4d:
"""
Set(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) -> Matrix4d
Sets the matrix from 16 independent ``double`` values, specified in
row-major order.
For example, parameter *m10* specifies the value in row 1 and column
0.
Parameters
----------
m00 : float
m01 : float
m02 : float
m03 : float
m10 : float
m11 : float
m12 : float
m13 : float
m20 : float
m21 : float
m22 : float
m23 : float
m30 : float
m31 : float
m32 : float
m33 : float
----------------------------------------------------------------------
Sets the matrix from a 4x4 array of ``double`` values, specified in
row-major order.
Parameters
----------
m : float
"""
@staticmethod
@typing.overload
def Set(m) -> Matrix4d: ...
@staticmethod
def SetColumn(i, v) -> None:
"""
SetColumn(i, v) -> None
Sets a column of the matrix from a Vec4.
Parameters
----------
i : int
v : Vec4d
"""
@staticmethod
@typing.overload
def SetDiagonal(s) -> Matrix4d:
"""
SetDiagonal(s) -> Matrix4d
Sets the matrix to *s* times the identity matrix.
Parameters
----------
s : float
----------------------------------------------------------------------
Sets the matrix to have diagonal ( ``v[0], v[1], v[2], v[3]`` ).
Parameters
----------
arg1 : Vec4d
"""
@staticmethod
@typing.overload
def SetDiagonal(arg1) -> Matrix4d: ...
@staticmethod
def SetIdentity() -> Matrix4d:
"""
SetIdentity() -> Matrix4d
Sets the matrix to the identity matrix.
"""
@staticmethod
@typing.overload
def SetLookAt(eyePoint, centerPoint, upDirection) -> Matrix4d:
"""
SetLookAt(eyePoint, centerPoint, upDirection) -> Matrix4d
Sets the matrix to specify a viewing matrix from parameters similar to
those used by ``gluLookAt(3G)`` .
*eyePoint* represents the eye point in world space. *centerPoint*
represents the world-space center of attention. *upDirection* is a
vector indicating which way is up.
Parameters
----------
eyePoint : Vec3d
centerPoint : Vec3d
upDirection : Vec3d
----------------------------------------------------------------------
Sets the matrix to specify a viewing matrix from a world-space
*eyePoint* and a world-space rotation that rigidly rotates the
orientation from its canonical frame, which is defined to be looking
along the ``-z`` axis with the ``+y`` axis as the up direction.
Parameters
----------
eyePoint : Vec3d
orientation : Rotation
"""
@staticmethod
@typing.overload
def SetLookAt(eyePoint, orientation) -> Matrix4d: ...
@staticmethod
@typing.overload
def SetRotate(rot) -> Matrix4d:
"""
SetRotate(rot) -> Matrix4d
Sets the matrix to specify a rotation equivalent to *rot*, and clears
the translation.
Parameters
----------
rot : Quatd
----------------------------------------------------------------------
Sets the matrix to specify a rotation equivalent to *rot*, and clears
the translation.
Parameters
----------
rot : Rotation
----------------------------------------------------------------------
Sets the matrix to specify a rotation equivalent to *mx*, and clears
the translation.
Parameters
----------
mx : Matrix3d
"""
@staticmethod
@typing.overload
def SetRotate(mx) -> Matrix4d: ...
@staticmethod
@typing.overload
def SetRotateOnly(rot) -> Matrix4d:
"""
SetRotateOnly(rot) -> Matrix4d
Sets the matrix to specify a rotation equivalent to *rot*, without
clearing the translation.
Parameters
----------
rot : Quatd
----------------------------------------------------------------------
Sets the matrix to specify a rotation equivalent to *rot*, without
clearing the translation.
Parameters
----------
rot : Rotation
----------------------------------------------------------------------
Sets the matrix to specify a rotation equivalent to *mx*, without
clearing the translation.
Parameters
----------
mx : Matrix3d
"""
@staticmethod
@typing.overload
def SetRotateOnly(mx) -> Matrix4d: ...
@staticmethod
def SetRow(i, v) -> None:
"""
SetRow(i, v) -> None
Sets a row of the matrix from a Vec4.
Parameters
----------
i : int
v : Vec4d
"""
@staticmethod
def SetRow3(i, v) -> None:
"""
SetRow3(i, v) -> None
Sets a row of the matrix from a Vec3.
The fourth element of the row is ignored.
Parameters
----------
i : int
v : Vec3d
"""
@staticmethod
@typing.overload
def SetScale(scaleFactors) -> Matrix4d:
"""
SetScale(scaleFactors) -> Matrix4d
Sets the matrix to specify a nonuniform scaling in x, y, and z by the
factors in vector *scaleFactors*.
Parameters
----------
scaleFactors : Vec3d
----------------------------------------------------------------------
Sets matrix to specify a uniform scaling by *scaleFactor*.
Parameters
----------
scaleFactor : float
"""
@staticmethod
@typing.overload
def SetScale(scaleFactor) -> Matrix4d: ...
@staticmethod
@typing.overload
def SetTransform(rotate, translate) -> Matrix4d:
"""
SetTransform(rotate, translate) -> Matrix4d
Sets matrix to specify a rotation by *rotate* and a translation by
*translate*.
Parameters
----------
rotate : Rotation
translate : Vec3d
----------------------------------------------------------------------
Sets matrix to specify a rotation by *rotmx* and a translation by
*translate*.
Parameters
----------
rotmx : Matrix3d
translate : Vec3d
"""
@staticmethod
@typing.overload
def SetTransform(rotmx, translate) -> Matrix4d: ...
@staticmethod
def SetTranslate(trans) -> Matrix4d:
"""
SetTranslate(trans) -> Matrix4d
Sets matrix to specify a translation by the vector *trans*, and clears
the rotation.
Parameters
----------
trans : Vec3d
"""
@staticmethod
def SetTranslateOnly(t) -> Matrix4d:
"""
SetTranslateOnly(t) -> Matrix4d
Sets matrix to specify a translation by the vector *trans*, without
clearing the rotation.
Parameters
----------
t : Vec3d
"""
@staticmethod
def SetZero() -> Matrix4d:
"""
SetZero() -> Matrix4d
Sets the matrix to zero.
"""
@staticmethod
@typing.overload
def Transform(vec) -> Vec3d:
"""
Transform(vec) -> Vec3d
Transforms the row vector *vec* by the matrix, returning the result.
This treats the vector as a 4-component vector whose fourth component
is 1.
Parameters
----------
vec : Vec3d
----------------------------------------------------------------------
Transforms the row vector *vec* by the matrix, returning the result.
This treats the vector as a 4-component vector whose fourth component
is 1. This is an overloaded method; it differs from the other version
in that it returns a different value type.
Parameters
----------
vec : Vec3f
"""
@staticmethod
@typing.overload
def Transform(vec) -> Vec3f: ...
@staticmethod
@typing.overload
def TransformAffine(vec) -> Vec3d:
"""
TransformAffine(vec) -> Vec3d
Transforms the row vector *vec* by the matrix, returning the result.
This treats the vector as a 4-component vector whose fourth component
is 1 and ignores the fourth column of the matrix (i.e. assumes it is
(0, 0, 0, 1)).
Parameters
----------
vec : Vec3d
----------------------------------------------------------------------
Transforms the row vector *vec* by the matrix, returning the result.
This treats the vector as a 4-component vector whose fourth component
is 1 and ignores the fourth column of the matrix (i.e. assumes it is
(0, 0, 0, 1)).
Parameters
----------
vec : Vec3f
"""
@staticmethod
@typing.overload
def TransformAffine(vec) -> Vec3f: ...
@staticmethod
@typing.overload
def TransformDir(vec) -> Vec3d:
"""
TransformDir(vec) -> Vec3d
Transforms row vector *vec* by the matrix, returning the result.
This treats the vector as a direction vector, so the translation
information in the matrix is ignored. That is, it treats the vector as
a 4-component vector whose fourth component is 0.
Parameters
----------
vec : Vec3d
----------------------------------------------------------------------
Transforms row vector *vec* by the matrix, returning the result.
This treats the vector as a direction vector, so the translation
information in the matrix is ignored. That is, it treats the vector as
a 4-component vector whose fourth component is 0. This is an
overloaded method; it differs from the other version in that it
returns a different value type.
Parameters
----------
vec : Vec3f
"""
@staticmethod
@typing.overload
def TransformDir(vec) -> Vec3f: ...
__safe_for_unpickling__ = True
dimension = (4, 4)
pass
class Matrix4f(Boost.Python.instance):
@staticmethod
def ExtractRotation() -> Rotation:
"""
ExtractRotation() -> Rotation
Returns the rotation corresponding to this matrix.
This works well only if the matrix represents a rotation.
For good results, consider calling Orthonormalize() before calling
this method.
"""
@staticmethod
def ExtractRotationMatrix() -> Matrix3f:
"""
ExtractRotationMatrix() -> Matrix3f
Returns the rotation corresponding to this matrix.
This works well only if the matrix represents a rotation.
For good results, consider calling Orthonormalize() before calling
this method.
"""
@staticmethod
def ExtractRotationQuat() -> Quatf:
"""
ExtractRotationQuat() -> Quatf
Return the rotation corresponding to this matrix as a quaternion.
This works well only if the matrix represents a rotation.
For good results, consider calling Orthonormalize() before calling
this method.
"""
@staticmethod
def ExtractTranslation() -> Vec3f:
"""
ExtractTranslation() -> Vec3f
Returns the translation part of the matrix, defined as the first three
elements of the last row.
"""
@staticmethod
def Factor(r, s, u, t, p, eps) -> bool:
"""
Factor(r, s, u, t, p, eps) -> bool
Factors the matrix into 5 components:
- ``*M* = r \* s \* -r \* u \* t`` where
- *t* is a translation.
- *u* and *r* are rotations, and *-r* is the transpose (inverse) of
*r*. The *u* matrix may contain shear information.
- *s* is a scale. Any projection information could be returned in
matrix *p*, but currently p is never modified.
Returns ``false`` if the matrix is singular (as determined by *eps*).
In that case, any zero scales in *s* are clamped to *eps* to allow
computation of *u*.
Parameters
----------
r : Matrix4f
s : Vec3f
u : Matrix4f
t : Vec3f
p : Matrix4f
eps : float
"""
@staticmethod
def GetColumn(i) -> Vec4f:
"""
GetColumn(i) -> Vec4f
Gets a column of the matrix as a Vec4.
Parameters
----------
i : int
"""
@staticmethod
def GetDeterminant() -> float:
"""
GetDeterminant() -> float
Returns the determinant of the matrix.
"""
@staticmethod
def GetDeterminant3() -> float:
"""
GetDeterminant3() -> float
Returns the determinant of the upper 3x3 matrix.
This method is useful when the matrix describes a linear
transformation such as a rotation or scale because the other values in
the 4x4 matrix are not important.
"""
@staticmethod
def GetHandedness() -> float:
"""
GetHandedness() -> float
Returns the sign of the determinant of the upper 3x3 matrix, i.e.
1 for a right-handed matrix, -1 for a left-handed matrix, and 0 for a
singular matrix.
"""
@staticmethod
def GetInverse(det, eps) -> Matrix4f:
"""
GetInverse(det, eps) -> Matrix4f
Returns the inverse of the matrix, or FLT_MAX \* SetIdentity() if the
matrix is singular.
(FLT_MAX is the largest value a ``float`` can have, as defined by the
system.) The matrix is considered singular if the determinant is less
than or equal to the optional parameter *eps*. If *det* is non-null,
``\*det`` is set to the determinant.
Parameters
----------
det : float
eps : float
"""
@staticmethod
def GetOrthonormalized(issueWarning) -> Matrix4f:
"""
GetOrthonormalized(issueWarning) -> Matrix4f
Returns an orthonormalized copy of the matrix.
Parameters
----------
issueWarning : bool
"""
@staticmethod
def GetRow(i) -> Vec4f:
"""
GetRow(i) -> Vec4f
Gets a row of the matrix as a Vec4.
Parameters
----------
i : int
"""
@staticmethod
def GetRow3(i) -> Vec3f:
"""
GetRow3(i) -> Vec3f
Gets a row of the matrix as a Vec3.
Parameters
----------
i : int
"""
@staticmethod
def GetTranspose() -> Matrix4f:
"""
GetTranspose() -> Matrix4f
Returns the transpose of the matrix.
"""
@staticmethod
def HasOrthogonalRows3() -> bool:
"""
HasOrthogonalRows3() -> bool
Returns true, if the row vectors of the upper 3x3 matrix form an
orthogonal basis.
Note they do not have to be unit length for this test to return true.
"""
@staticmethod
def IsLeftHanded() -> bool:
"""
IsLeftHanded() -> bool
Returns true if the vectors in the upper 3x3 matrix form a left-handed
coordinate system.
"""
@staticmethod
def IsRightHanded() -> bool:
"""
IsRightHanded() -> bool
Returns true if the vectors in the upper 3x3 matrix form a right-
handed coordinate system.
"""
@staticmethod
def Orthonormalize(issueWarning) -> bool:
"""
Orthonormalize(issueWarning) -> bool
Makes the matrix orthonormal in place.
This is an iterative method that is much more stable than the previous
cross/cross method. If the iterative method does not converge, a
warning is issued.
Returns true if the iteration converged, false otherwise. Leaves any
translation part of the matrix unchanged. If *issueWarning* is true,
this method will issue a warning if the iteration does not converge,
otherwise it will be silent.
Parameters
----------
issueWarning : bool
"""
@staticmethod
def RemoveScaleShear() -> Matrix4f:
"""
RemoveScaleShear() -> Matrix4f
Returns the matrix with any scaling or shearing removed, leaving only
the rotation and translation.
If the matrix cannot be decomposed, returns the original matrix.
"""
@staticmethod
@typing.overload
def Set(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) -> Matrix4f:
"""
Set(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) -> Matrix4f
Sets the matrix from 16 independent ``float`` values, specified in
row-major order.
For example, parameter *m10* specifies the value in row1 and column 0.
Parameters
----------
m00 : float
m01 : float
m02 : float
m03 : float
m10 : float
m11 : float
m12 : float
m13 : float
m20 : float
m21 : float
m22 : float
m23 : float
m30 : float
m31 : float
m32 : float
m33 : float
----------------------------------------------------------------------
Sets the matrix from a 4x4 array of ``float`` values, specified in
row-major order.
Parameters
----------
m : float
"""
@staticmethod
@typing.overload
def Set(m) -> Matrix4f: ...
@staticmethod
def SetColumn(i, v) -> None:
"""
SetColumn(i, v) -> None
Sets a column of the matrix from a Vec4.
Parameters
----------
i : int
v : Vec4f
"""
@staticmethod
@typing.overload
def SetDiagonal(s) -> Matrix4f:
"""
SetDiagonal(s) -> Matrix4f
Sets the matrix to *s* times the identity matrix.
Parameters
----------
s : float
----------------------------------------------------------------------
Sets the matrix to have diagonal ( ``v[0], v[1], v[2], v[3]`` ).
Parameters
----------
arg1 : Vec4f
"""
@staticmethod
@typing.overload
def SetDiagonal(arg1) -> Matrix4f: ...
@staticmethod
def SetIdentity() -> Matrix4f:
"""
SetIdentity() -> Matrix4f
Sets the matrix to the identity matrix.
"""
@staticmethod
@typing.overload
def SetLookAt(eyePoint, centerPoint, upDirection) -> Matrix4f:
"""
SetLookAt(eyePoint, centerPoint, upDirection) -> Matrix4f
Sets the matrix to specify a viewing matrix from parameters similar to
those used by ``gluLookAt(3G)`` .
*eyePoint* represents the eye point in world space. *centerPoint*
represents the world-space center of attention. *upDirection* is a
vector indicating which way is up.
Parameters
----------
eyePoint : Vec3f
centerPoint : Vec3f
upDirection : Vec3f
----------------------------------------------------------------------
Sets the matrix to specify a viewing matrix from a world-space
*eyePoint* and a world-space rotation that rigidly rotates the
orientation from its canonical frame, which is defined to be looking
along the ``-z`` axis with the ``+y`` axis as the up direction.
Parameters
----------
eyePoint : Vec3f
orientation : Rotation
"""
@staticmethod
@typing.overload
def SetLookAt(eyePoint, orientation) -> Matrix4f: ...
@staticmethod
@typing.overload
def SetRotate(rot) -> Matrix4f:
"""
SetRotate(rot) -> Matrix4f
Sets the matrix to specify a rotation equivalent to *rot*, and clears
the translation.
Parameters
----------
rot : Quatf
----------------------------------------------------------------------
Sets the matrix to specify a rotation equivalent to *rot*, and clears
the translation.
Parameters
----------
rot : Rotation
----------------------------------------------------------------------
Sets the matrix to specify a rotation equivalent to *mx*, and clears
the translation.
Parameters
----------
mx : Matrix3f
"""
@staticmethod
@typing.overload
def SetRotate(mx) -> Matrix4f: ...
@staticmethod
@typing.overload
def SetRotateOnly(rot) -> Matrix4f:
"""
SetRotateOnly(rot) -> Matrix4f
Sets the matrix to specify a rotation equivalent to *rot*, without
clearing the translation.
Parameters
----------
rot : Quatf
----------------------------------------------------------------------
Sets the matrix to specify a rotation equivalent to *rot*, without
clearing the translation.
Parameters
----------
rot : Rotation
----------------------------------------------------------------------
Sets the matrix to specify a rotation equivalent to *mx*, without
clearing the translation.
Parameters
----------
mx : Matrix3f
"""
@staticmethod
@typing.overload
def SetRotateOnly(mx) -> Matrix4f: ...
@staticmethod
def SetRow(i, v) -> None:
"""
SetRow(i, v) -> None
Sets a row of the matrix from a Vec4.
Parameters
----------
i : int
v : Vec4f
"""
@staticmethod
def SetRow3(i, v) -> None:
"""
SetRow3(i, v) -> None
Sets a row of the matrix from a Vec3.
The fourth element of the row is ignored.
Parameters
----------
i : int
v : Vec3f
"""
@staticmethod
@typing.overload
def SetScale(scaleFactors) -> Matrix4f:
"""
SetScale(scaleFactors) -> Matrix4f
Sets the matrix to specify a nonuniform scaling in x, y, and z by the
factors in vector *scaleFactors*.
Parameters
----------
scaleFactors : Vec3f
----------------------------------------------------------------------
Sets matrix to specify a uniform scaling by *scaleFactor*.
Parameters
----------
scaleFactor : float
"""
@staticmethod
@typing.overload
def SetScale(scaleFactor) -> Matrix4f: ...
@staticmethod
@typing.overload
def SetTransform(rotate, translate) -> Matrix4f:
"""
SetTransform(rotate, translate) -> Matrix4f
Sets matrix to specify a rotation by *rotate* and a translation by
*translate*.
Parameters
----------
rotate : Rotation
translate : Vec3f
----------------------------------------------------------------------
Sets matrix to specify a rotation by *rotmx* and a translation by
*translate*.
Parameters
----------
rotmx : Matrix3f
translate : Vec3f
"""
@staticmethod
@typing.overload
def SetTransform(rotmx, translate) -> Matrix4f: ...
@staticmethod
def SetTranslate(trans) -> Matrix4f:
"""
SetTranslate(trans) -> Matrix4f
Sets matrix to specify a translation by the vector *trans*, and clears
the rotation.
Parameters
----------
trans : Vec3f
"""
@staticmethod
def SetTranslateOnly(t) -> Matrix4f:
"""
SetTranslateOnly(t) -> Matrix4f
Sets matrix to specify a translation by the vector *trans*, without
clearing the rotation.
Parameters
----------
t : Vec3f
"""
@staticmethod
def SetZero() -> Matrix4f:
"""
SetZero() -> Matrix4f
Sets the matrix to zero.
"""
@staticmethod
@typing.overload
def Transform(vec) -> Vec3d:
"""
Transform(vec) -> Vec3d
Transforms the row vector *vec* by the matrix, returning the result.
This treats the vector as a 4-component vector whose fourth component
is 1.
Parameters
----------
vec : Vec3d
----------------------------------------------------------------------
Transforms the row vector *vec* by the matrix, returning the result.
This treats the vector as a 4-component vector whose fourth component
is 1. This is an overloaded method; it differs from the other version
in that it returns a different value type.
Parameters
----------
vec : Vec3f
"""
@staticmethod
@typing.overload
def Transform(vec) -> Vec3f: ...
@staticmethod
@typing.overload
def TransformAffine(vec) -> Vec3d:
"""
TransformAffine(vec) -> Vec3d
Transforms the row vector *vec* by the matrix, returning the result.
This treats the vector as a 4-component vector whose fourth component
is 1 and ignores the fourth column of the matrix (i.e. assumes it is
(0, 0, 0, 1)).
Parameters
----------
vec : Vec3d
----------------------------------------------------------------------
Transforms the row vector *vec* by the matrix, returning the result.
This treats the vector as a 4-component vector whose fourth component
is 1 and ignores the fourth column of the matrix (i.e. assumes it is
(0, 0, 0, 1)).
Parameters
----------
vec : Vec3f
"""
@staticmethod
@typing.overload
def TransformAffine(vec) -> Vec3f: ...
@staticmethod
@typing.overload
def TransformDir(vec) -> Vec3d:
"""
TransformDir(vec) -> Vec3d
Transforms row vector *vec* by the matrix, returning the result.
This treats the vector as a direction vector, so the translation
information in the matrix is ignored. That is, it treats the vector as
a 4-component vector whose fourth component is 0.
Parameters
----------
vec : Vec3d
----------------------------------------------------------------------
Transforms row vector *vec* by the matrix, returning the result.
This treats the vector as a direction vector, so the translation
information in the matrix is ignored. That is, it treats the vector as
a 4-component vector whose fourth component is 0. This is an
overloaded method; it differs from the other version in that it
returns a different value type.
Parameters
----------
vec : Vec3f
"""
@staticmethod
@typing.overload
def TransformDir(vec) -> Vec3f: ...
__safe_for_unpickling__ = True
dimension = (4, 4)
pass
class MultiInterval(Boost.Python.instance):
@staticmethod
@typing.overload
def Add(i) -> None:
"""
Add(i) -> None
Add the given interval to the multi-interval.
Parameters
----------
i : Interval
----------------------------------------------------------------------
Add the given multi-interval to the multi-interval.
Sets this object to the union of the two sets.
Parameters
----------
s : MultiInterval
"""
@staticmethod
@typing.overload
def Add(s) -> None: ...
@staticmethod
def ArithmeticAdd(i) -> None:
"""
ArithmeticAdd(i) -> None
Uses the given interval to extend the multi-interval in the interval
arithmetic sense.
Parameters
----------
i : Interval
"""
@staticmethod
def Clear() -> None:
"""
Clear() -> None
Clear the multi-interval.
"""
@staticmethod
def Contains(*args, **kwargs) -> None:
"""
Returns true if x is inside the multi-interval.
Returns true if x is inside the multi-interval.
Returns true if x is inside the multi-interval.
"""
@staticmethod
def GetBounds() -> Interval:
"""
GetBounds() -> Interval
Returns an interval bounding the entire multi-interval.
Returns an empty interval if the multi-interval is empty.
"""
@staticmethod
def GetComplement() -> MultiInterval:
"""
GetComplement() -> MultiInterval
Return the complement of this set.
"""
@staticmethod
def GetFullInterval(*args, **kwargs) -> None:
"""
**classmethod** GetFullInterval() -> MultiInterval
Returns the full interval (-inf, inf).
"""
@staticmethod
def GetSize() -> int:
"""
GetSize() -> int
Returns the number of intervals in the set.
"""
@staticmethod
@typing.overload
def Intersect(i) -> None:
"""
Intersect(i) -> None
Parameters
----------
i : Interval
----------------------------------------------------------------------
Parameters
----------
s : MultiInterval
"""
@staticmethod
@typing.overload
def Intersect(s) -> None: ...
@staticmethod
def IsEmpty() -> bool:
"""
IsEmpty() -> bool
Returns true if the multi-interval is empty.
"""
@staticmethod
@typing.overload
def Remove(i) -> None:
"""
Remove(i) -> None
Remove the given interval from this multi-interval.
Parameters
----------
i : Interval
----------------------------------------------------------------------
Remove the given multi-interval from this multi-interval.
Parameters
----------
s : MultiInterval
"""
@staticmethod
@typing.overload
def Remove(s) -> None: ...
@property
def bounds(self) -> None:
"""
:type: None
"""
@property
def isEmpty(self) -> None:
"""
:type: None
"""
@property
def size(self) -> None:
"""
:type: None
"""
__instance_size__ = 32
pass
class Plane(Boost.Python.instance):
@staticmethod
def GetDistance(p) -> float:
"""
GetDistance(p) -> float
Returns the distance of point ``from`` the plane.
This distance will be positive if the point is on the side of the
plane containing the normal.
Parameters
----------
p : Vec3d
"""
@staticmethod
def GetDistanceFromOrigin() -> float:
"""
GetDistanceFromOrigin() -> float
Returns the distance of the plane from the origin.
"""
@staticmethod
def GetEquation() -> Vec4d:
"""
GetEquation() -> Vec4d
Give the coefficients of the equation of the plane.
Suitable to OpenGL calls to set the clipping plane.
"""
@staticmethod
def GetNormal() -> Vec3d:
"""
GetNormal() -> Vec3d
Returns the unit-length normal vector of the plane.
"""
@staticmethod
@typing.overload
def IntersectsPositiveHalfSpace(box) -> bool:
"""
IntersectsPositiveHalfSpace(box) -> bool
Returns ``true`` if the given aligned bounding box is at least
partially on the positive side (the one the normal points into) of the
plane.
Parameters
----------
box : Range3d
----------------------------------------------------------------------
Returns true if the given point is on the plane or within its positive
half space.
Parameters
----------
pt : Vec3d
"""
@staticmethod
@typing.overload
def IntersectsPositiveHalfSpace(pt) -> bool: ...
@staticmethod
def Project(p) -> Vec3d:
"""
Project(p) -> Vec3d
Return the projection of ``p`` onto the plane.
Parameters
----------
p : Vec3d
"""
@staticmethod
def Reorient(p) -> None:
"""
Reorient(p) -> None
Flip the plane normal (if necessary) so that ``p`` is in the positive
halfspace.
Parameters
----------
p : Vec3d
"""
@staticmethod
@typing.overload
def Set(normal, distanceToOrigin) -> None:
"""
Set(normal, distanceToOrigin) -> None
Sets this to the plane perpendicular to ``normal`` and at ``distance``
units from the origin.
The passed-in normal is normalized to unit length first.
Parameters
----------
normal : Vec3d
distanceToOrigin : float
----------------------------------------------------------------------
This constructor sets this to the plane perpendicular to ``normal``
and that passes through ``point`` .
The passed-in normal is normalized to unit length first.
Parameters
----------
normal : Vec3d
point : Vec3d
----------------------------------------------------------------------
This constructor sets this to the plane that contains the three given
points.
The normal is constructed from the cross product of ( ``p1`` - ``p0``
) ( ``p2`` - ``p0`` ). Results are undefined if the points are
collinear.
Parameters
----------
p0 : Vec3d
p1 : Vec3d
p2 : Vec3d
----------------------------------------------------------------------
This method sets this to the plane given by the equation ``eqn`` [0]
\* x + ``eqn`` [1] \* y + ``eqn`` [2] \* z + ``eqn`` [3] = 0.
Parameters
----------
eqn : Vec4d
"""
@staticmethod
@typing.overload
def Set(normal, point) -> None: ...
@staticmethod
@typing.overload
def Set(p0, p1, p2) -> None: ...
@staticmethod
@typing.overload
def Set(eqn) -> None: ...
@staticmethod
def Transform(matrix) -> Plane:
"""
Transform(matrix) -> Plane
Transforms the plane by the given matrix.
Parameters
----------
matrix : Matrix4d
"""
@property
def distanceFromOrigin(self) -> None:
"""
:type: None
"""
@property
def normal(self) -> None:
"""
:type: None
"""
__instance_size__ = 48
pass
class Quatd(Boost.Python.instance):
@staticmethod
def GetConjugate() -> Quatd:
"""
GetConjugate() -> Quatd
Return this quaternion's conjugate, which is the quaternion with the
same real coefficient and negated imaginary coefficients.
"""
@staticmethod
def GetIdentity(*args, **kwargs) -> None:
"""
**classmethod** GetIdentity() -> Quatd
Return the identity quaternion, with real coefficient 1 and an
imaginary coefficients all zero.
"""
@staticmethod
def GetImaginary() -> Vec3d:
"""
GetImaginary() -> Vec3d
Return the imaginary coefficient.
"""
@staticmethod
def GetInverse() -> Quatd:
"""
GetInverse() -> Quatd
Return this quaternion's inverse, or reciprocal.
This is the quaternion's conjugate divided by it's squared length.
"""
@staticmethod
def GetLength() -> float:
"""
GetLength() -> float
Return geometric length of this quaternion.
"""
@staticmethod
def GetNormalized(eps) -> Quatd:
"""
GetNormalized(eps) -> Quatd
length of this quaternion is smaller than ``eps`` , return the
identity quaternion.
Parameters
----------
eps : float
"""
@staticmethod
def GetReal() -> float:
"""
GetReal() -> float
Return the real coefficient.
"""
@staticmethod
def GetZero(*args, **kwargs) -> None:
"""
**classmethod** GetZero() -> Quatd
Return the zero quaternion, with real coefficient 0 and an imaginary
coefficients all zero.
"""
@staticmethod
def Normalize(eps) -> float:
"""
Normalize(eps) -> float
Normalizes this quaternion in place to unit length, returning the
length before normalization.
If the length of this quaternion is smaller than ``eps`` , this sets
the quaternion to identity.
Parameters
----------
eps : float
"""
@staticmethod
@typing.overload
def SetImaginary(imaginary) -> None:
"""
SetImaginary(imaginary) -> None
Set the imaginary coefficients.
Parameters
----------
imaginary : Vec3d
----------------------------------------------------------------------
Set the imaginary coefficients.
Parameters
----------
i : float
j : float
k : float
"""
@staticmethod
@typing.overload
def SetImaginary(i, j, k) -> None: ...
@staticmethod
def SetReal(real) -> None:
"""
SetReal(real) -> None
Set the real coefficient.
Parameters
----------
real : float
"""
@staticmethod
def Transform(point) -> Vec3d:
"""
Transform(point) -> Vec3d
Transform the GfVec3d point.
If the quaternion is normalized, the transformation is a rotation.
Given a GfQuatd q, q.Transform(point) is equivalent to: (q \*
GfQuatd(0, point) \* q.GetInverse()).GetImaginary()
but is more efficient.
Parameters
----------
point : Vec3d
"""
@property
def imaginary(self) -> None:
"""
:type: None
"""
@property
def real(self) -> None:
"""
:type: None
"""
pass
class Quaternion(Boost.Python.instance):
"""
Quaternion class
"""
@staticmethod
def GetIdentity(*args, **kwargs) -> None:
"""
**classmethod** GetIdentity() -> Quaternion
Returns the identity quaternion, which has a real part of 1 and an
imaginary part of (0,0,0).
"""
@staticmethod
def GetImaginary() -> Vec3d:
"""
GetImaginary() -> Vec3d
Returns the imaginary part of the quaternion.
"""
@staticmethod
def GetInverse() -> Quaternion:
"""
GetInverse() -> Quaternion
Returns the inverse of this quaternion.
"""
@staticmethod
def GetLength() -> float:
"""
GetLength() -> float
Returns geometric length of this quaternion.
"""
@staticmethod
def GetNormalized(eps) -> Quaternion:
"""
GetNormalized(eps) -> Quaternion
Returns a normalized (unit-length) version of this quaternion.
direction as this. If the length of this quaternion is smaller than
``eps`` , this returns the identity quaternion.
Parameters
----------
eps : float
"""
@staticmethod
def GetReal() -> float:
"""
GetReal() -> float
Returns the real part of the quaternion.
"""
@staticmethod
def GetZero(*args, **kwargs) -> None:
"""
**classmethod** GetZero() -> Quaternion
Returns the zero quaternion, which has a real part of 0 and an
imaginary part of (0,0,0).
"""
@staticmethod
def Normalize(eps) -> float:
"""
Normalize(eps) -> float
Normalizes this quaternion in place to unit length, returning the
length before normalization.
If the length of this quaternion is smaller than ``eps`` , this sets
the quaternion to identity.
Parameters
----------
eps : float
"""
@property
def imaginary(self) -> None:
"""
type : None
Sets the imaginary part of the quaternion.
:type: None
"""
@property
def real(self) -> None:
"""
type : None
Sets the real part of the quaternion.
:type: None
"""
__instance_size__ = 48
pass
class Quatf(Boost.Python.instance):
@staticmethod
def GetConjugate() -> Quatf:
"""
GetConjugate() -> Quatf
Return this quaternion's conjugate, which is the quaternion with the
same real coefficient and negated imaginary coefficients.
"""
@staticmethod
def GetIdentity(*args, **kwargs) -> None:
"""
**classmethod** GetIdentity() -> Quatf
Return the identity quaternion, with real coefficient 1 and an
imaginary coefficients all zero.
"""
@staticmethod
def GetImaginary() -> Vec3f:
"""
GetImaginary() -> Vec3f
Return the imaginary coefficient.
"""
@staticmethod
def GetInverse() -> Quatf:
"""
GetInverse() -> Quatf
Return this quaternion's inverse, or reciprocal.
This is the quaternion's conjugate divided by it's squared length.
"""
@staticmethod
def GetLength() -> float:
"""
GetLength() -> float
Return geometric length of this quaternion.
"""
@staticmethod
def GetNormalized(eps) -> Quatf:
"""
GetNormalized(eps) -> Quatf
length of this quaternion is smaller than ``eps`` , return the
identity quaternion.
Parameters
----------
eps : float
"""
@staticmethod
def GetReal() -> float:
"""
GetReal() -> float
Return the real coefficient.
"""
@staticmethod
def GetZero(*args, **kwargs) -> None:
"""
**classmethod** GetZero() -> Quatf
Return the zero quaternion, with real coefficient 0 and an imaginary
coefficients all zero.
"""
@staticmethod
def Normalize(eps) -> float:
"""
Normalize(eps) -> float
Normalizes this quaternion in place to unit length, returning the
length before normalization.
If the length of this quaternion is smaller than ``eps`` , this sets
the quaternion to identity.
Parameters
----------
eps : float
"""
@staticmethod
@typing.overload
def SetImaginary(imaginary) -> None:
"""
SetImaginary(imaginary) -> None
Set the imaginary coefficients.
Parameters
----------
imaginary : Vec3f
----------------------------------------------------------------------
Set the imaginary coefficients.
Parameters
----------
i : float
j : float
k : float
"""
@staticmethod
@typing.overload
def SetImaginary(i, j, k) -> None: ...
@staticmethod
def SetReal(real) -> None:
"""
SetReal(real) -> None
Set the real coefficient.
Parameters
----------
real : float
"""
@staticmethod
def Transform(point) -> Vec3f:
"""
Transform(point) -> Vec3f
Transform the GfVec3f point.
If the quaternion is normalized, the transformation is a rotation.
Given a GfQuatf q, q.Transform(point) is equivalent to: (q \*
GfQuatf(0, point) \* q.GetInverse()).GetImaginary()
but is more efficient.
Parameters
----------
point : Vec3f
"""
@property
def imaginary(self) -> None:
"""
:type: None
"""
@property
def real(self) -> None:
"""
:type: None
"""
pass
class Quath(Boost.Python.instance):
@staticmethod
def GetConjugate() -> Quath:
"""
GetConjugate() -> Quath
Return this quaternion's conjugate, which is the quaternion with the
same real coefficient and negated imaginary coefficients.
"""
@staticmethod
def GetIdentity(*args, **kwargs) -> None:
"""
**classmethod** GetIdentity() -> Quath
Return the identity quaternion, with real coefficient 1 and an
imaginary coefficients all zero.
"""
@staticmethod
def GetImaginary() -> Vec3h:
"""
GetImaginary() -> Vec3h
Return the imaginary coefficient.
"""
@staticmethod
def GetInverse() -> Quath:
"""
GetInverse() -> Quath
Return this quaternion's inverse, or reciprocal.
This is the quaternion's conjugate divided by it's squared length.
"""
@staticmethod
def GetLength() -> GfHalf:
"""
GetLength() -> GfHalf
Return geometric length of this quaternion.
"""
@staticmethod
def GetNormalized(eps) -> Quath:
"""
GetNormalized(eps) -> Quath
length of this quaternion is smaller than ``eps`` , return the
identity quaternion.
Parameters
----------
eps : GfHalf
"""
@staticmethod
def GetReal() -> GfHalf:
"""
GetReal() -> GfHalf
Return the real coefficient.
"""
@staticmethod
def GetZero(*args, **kwargs) -> None:
"""
**classmethod** GetZero() -> Quath
Return the zero quaternion, with real coefficient 0 and an imaginary
coefficients all zero.
"""
@staticmethod
def Normalize(eps) -> GfHalf:
"""
Normalize(eps) -> GfHalf
Normalizes this quaternion in place to unit length, returning the
length before normalization.
If the length of this quaternion is smaller than ``eps`` , this sets
the quaternion to identity.
Parameters
----------
eps : GfHalf
"""
@staticmethod
@typing.overload
def SetImaginary(imaginary) -> None:
"""
SetImaginary(imaginary) -> None
Set the imaginary coefficients.
Parameters
----------
imaginary : Vec3h
----------------------------------------------------------------------
Set the imaginary coefficients.
Parameters
----------
i : GfHalf
j : GfHalf
k : GfHalf
"""
@staticmethod
@typing.overload
def SetImaginary(i, j, k) -> None: ...
@staticmethod
def SetReal(real) -> None:
"""
SetReal(real) -> None
Set the real coefficient.
Parameters
----------
real : GfHalf
"""
@staticmethod
def Transform(point) -> Vec3h:
"""
Transform(point) -> Vec3h
Transform the GfVec3h point.
If the quaternion is normalized, the transformation is a rotation.
Given a GfQuath q, q.Transform(point) is equivalent to: (q \*
GfQuath(0, point) \* q.GetInverse()).GetImaginary()
but is more efficient.
Parameters
----------
point : Vec3h
"""
@property
def imaginary(self) -> None:
"""
:type: None
"""
@property
def real(self) -> None:
"""
:type: None
"""
pass
class Range1d(Boost.Python.instance):
@staticmethod
@typing.overload
def Contains(point) -> bool:
"""
Contains(point) -> bool
Returns true if the ``point`` is located inside the range.
As with all operations of this type, the range is assumed to include
its extrema.
Parameters
----------
point : float
----------------------------------------------------------------------
Returns true if the ``range`` is located entirely inside the range.
As with all operations of this type, the ranges are assumed to include
their extrema.
Parameters
----------
range : Range1d
"""
@staticmethod
@typing.overload
def Contains(range) -> bool: ...
@staticmethod
def GetDistanceSquared(p) -> float:
"""
GetDistanceSquared(p) -> float
Compute the squared distance from a point to the range.
Parameters
----------
p : float
"""
@staticmethod
def GetIntersection(*args, **kwargs) -> None:
"""
**classmethod** GetIntersection(a, b) -> Range1d
Returns a ``GfRange1d`` that describes the intersection of ``a`` and
``b`` .
Parameters
----------
a : Range1d
b : Range1d
"""
@staticmethod
def GetMax() -> float:
"""
GetMax() -> float
Returns the maximum value of the range.
"""
@staticmethod
def GetMidpoint() -> float:
"""
GetMidpoint() -> float
Returns the midpoint of the range, that is, 0.5\*(min+max).
Note: this returns zero in the case of default-constructed ranges, or
ranges set via SetEmpty() .
"""
@staticmethod
def GetMin() -> float:
"""
GetMin() -> float
Returns the minimum value of the range.
"""
@staticmethod
def GetSize() -> float:
"""
GetSize() -> float
Returns the size of the range.
"""
@staticmethod
def GetUnion(*args, **kwargs) -> None:
"""
**classmethod** GetUnion(a, b) -> Range1d
Returns the smallest ``GfRange1d`` which contains both ``a`` and ``b``
.
Parameters
----------
a : Range1d
b : Range1d
"""
@staticmethod
def IntersectWith(b) -> Range1d:
"""
IntersectWith(b) -> Range1d
Modifies this range to hold its intersection with ``b`` and returns
the result.
Parameters
----------
b : Range1d
"""
@staticmethod
def IsEmpty() -> bool:
"""
IsEmpty() -> bool
Returns whether the range is empty (max<min).
"""
@staticmethod
def SetEmpty() -> None:
"""
SetEmpty() -> None
Sets the range to an empty interval.
"""
@staticmethod
def SetMax(max) -> None:
"""
SetMax(max) -> None
Sets the maximum value of the range.
Parameters
----------
max : float
"""
@staticmethod
def SetMin(min) -> None:
"""
SetMin(min) -> None
Sets the minimum value of the range.
Parameters
----------
min : float
"""
@staticmethod
def UnionWith(b) -> Range1d:
"""
UnionWith(b) -> Range1d
Extend ``this`` to include ``b`` .
Parameters
----------
b : Range1d
----------------------------------------------------------------------
Extend ``this`` to include ``b`` .
Parameters
----------
b : float
"""
@property
def max(self) -> None:
"""
:type: None
"""
@property
def min(self) -> None:
"""
:type: None
"""
__instance_size__ = 32
dimension = 1
pass
class Range1f(Boost.Python.instance):
@staticmethod
@typing.overload
def Contains(point) -> bool:
"""
Contains(point) -> bool
Returns true if the ``point`` is located inside the range.
As with all operations of this type, the range is assumed to include
its extrema.
Parameters
----------
point : float
----------------------------------------------------------------------
Returns true if the ``range`` is located entirely inside the range.
As with all operations of this type, the ranges are assumed to include
their extrema.
Parameters
----------
range : Range1f
"""
@staticmethod
@typing.overload
def Contains(range) -> bool: ...
@staticmethod
def GetDistanceSquared(p) -> float:
"""
GetDistanceSquared(p) -> float
Compute the squared distance from a point to the range.
Parameters
----------
p : float
"""
@staticmethod
def GetIntersection(*args, **kwargs) -> None:
"""
**classmethod** GetIntersection(a, b) -> Range1f
Returns a ``GfRange1f`` that describes the intersection of ``a`` and
``b`` .
Parameters
----------
a : Range1f
b : Range1f
"""
@staticmethod
def GetMax() -> float:
"""
GetMax() -> float
Returns the maximum value of the range.
"""
@staticmethod
def GetMidpoint() -> float:
"""
GetMidpoint() -> float
Returns the midpoint of the range, that is, 0.5\*(min+max).
Note: this returns zero in the case of default-constructed ranges, or
ranges set via SetEmpty() .
"""
@staticmethod
def GetMin() -> float:
"""
GetMin() -> float
Returns the minimum value of the range.
"""
@staticmethod
def GetSize() -> float:
"""
GetSize() -> float
Returns the size of the range.
"""
@staticmethod
def GetUnion(*args, **kwargs) -> None:
"""
**classmethod** GetUnion(a, b) -> Range1f
Returns the smallest ``GfRange1f`` which contains both ``a`` and ``b``
.
Parameters
----------
a : Range1f
b : Range1f
"""
@staticmethod
def IntersectWith(b) -> Range1f:
"""
IntersectWith(b) -> Range1f
Modifies this range to hold its intersection with ``b`` and returns
the result.
Parameters
----------
b : Range1f
"""
@staticmethod
def IsEmpty() -> bool:
"""
IsEmpty() -> bool
Returns whether the range is empty (max<min).
"""
@staticmethod
def SetEmpty() -> None:
"""
SetEmpty() -> None
Sets the range to an empty interval.
"""
@staticmethod
def SetMax(max) -> None:
"""
SetMax(max) -> None
Sets the maximum value of the range.
Parameters
----------
max : float
"""
@staticmethod
def SetMin(min) -> None:
"""
SetMin(min) -> None
Sets the minimum value of the range.
Parameters
----------
min : float
"""
@staticmethod
def UnionWith(b) -> Range1f:
"""
UnionWith(b) -> Range1f
Extend ``this`` to include ``b`` .
Parameters
----------
b : Range1f
----------------------------------------------------------------------
Extend ``this`` to include ``b`` .
Parameters
----------
b : float
"""
@property
def max(self) -> None:
"""
:type: None
"""
@property
def min(self) -> None:
"""
:type: None
"""
__instance_size__ = 24
dimension = 1
pass
class Range2d(Boost.Python.instance):
@staticmethod
@typing.overload
def Contains(point) -> bool:
"""
Contains(point) -> bool
Returns true if the ``point`` is located inside the range.
As with all operations of this type, the range is assumed to include
its extrema.
Parameters
----------
point : Vec2d
----------------------------------------------------------------------
Returns true if the ``range`` is located entirely inside the range.
As with all operations of this type, the ranges are assumed to include
their extrema.
Parameters
----------
range : Range2d
"""
@staticmethod
@typing.overload
def Contains(range) -> bool: ...
@staticmethod
def GetCorner(i) -> Vec2d:
"""
GetCorner(i) -> Vec2d
Returns the ith corner of the range, in the following order: SW, SE,
NW, NE.
Parameters
----------
i : int
"""
@staticmethod
def GetDistanceSquared(p) -> float:
"""
GetDistanceSquared(p) -> float
Compute the squared distance from a point to the range.
Parameters
----------
p : Vec2d
"""
@staticmethod
def GetIntersection(*args, **kwargs) -> None:
"""
**classmethod** GetIntersection(a, b) -> Range2d
Returns a ``GfRange2d`` that describes the intersection of ``a`` and
``b`` .
Parameters
----------
a : Range2d
b : Range2d
"""
@staticmethod
def GetMax() -> Vec2d:
"""
GetMax() -> Vec2d
Returns the maximum value of the range.
"""
@staticmethod
def GetMidpoint() -> Vec2d:
"""
GetMidpoint() -> Vec2d
Returns the midpoint of the range, that is, 0.5\*(min+max).
Note: this returns zero in the case of default-constructed ranges, or
ranges set via SetEmpty() .
"""
@staticmethod
def GetMin() -> Vec2d:
"""
GetMin() -> Vec2d
Returns the minimum value of the range.
"""
@staticmethod
def GetQuadrant(i) -> Range2d:
"""
GetQuadrant(i) -> Range2d
Returns the ith quadrant of the range, in the following order: SW, SE,
NW, NE.
Parameters
----------
i : int
"""
@staticmethod
def GetSize() -> Vec2d:
"""
GetSize() -> Vec2d
Returns the size of the range.
"""
@staticmethod
def GetUnion(*args, **kwargs) -> None:
"""
**classmethod** GetUnion(a, b) -> Range2d
Returns the smallest ``GfRange2d`` which contains both ``a`` and ``b``
.
Parameters
----------
a : Range2d
b : Range2d
"""
@staticmethod
def IntersectWith(b) -> Range2d:
"""
IntersectWith(b) -> Range2d
Modifies this range to hold its intersection with ``b`` and returns
the result.
Parameters
----------
b : Range2d
"""
@staticmethod
def IsEmpty() -> bool:
"""
IsEmpty() -> bool
Returns whether the range is empty (max<min).
"""
@staticmethod
def SetEmpty() -> None:
"""
SetEmpty() -> None
Sets the range to an empty interval.
"""
@staticmethod
def SetMax(max) -> None:
"""
SetMax(max) -> None
Sets the maximum value of the range.
Parameters
----------
max : Vec2d
"""
@staticmethod
def SetMin(min) -> None:
"""
SetMin(min) -> None
Sets the minimum value of the range.
Parameters
----------
min : Vec2d
"""
@staticmethod
def UnionWith(b) -> Range2d:
"""
UnionWith(b) -> Range2d
Extend ``this`` to include ``b`` .
Parameters
----------
b : Range2d
----------------------------------------------------------------------
Extend ``this`` to include ``b`` .
Parameters
----------
b : Vec2d
"""
@property
def max(self) -> None:
"""
:type: None
"""
@property
def min(self) -> None:
"""
:type: None
"""
__instance_size__ = 48
dimension = 2
unitSquare: pxr.Gf.Range2d # value = Gf.Range2d(Gf.Vec2d(0.0, 0.0), Gf.Vec2d(1.0, 1.0))
pass
class Range2f(Boost.Python.instance):
@staticmethod
@typing.overload
def Contains(point) -> bool:
"""
Contains(point) -> bool
Returns true if the ``point`` is located inside the range.
As with all operations of this type, the range is assumed to include
its extrema.
Parameters
----------
point : Vec2f
----------------------------------------------------------------------
Returns true if the ``range`` is located entirely inside the range.
As with all operations of this type, the ranges are assumed to include
their extrema.
Parameters
----------
range : Range2f
"""
@staticmethod
@typing.overload
def Contains(range) -> bool: ...
@staticmethod
def GetCorner(i) -> Vec2f:
"""
GetCorner(i) -> Vec2f
Returns the ith corner of the range, in the following order: SW, SE,
NW, NE.
Parameters
----------
i : int
"""
@staticmethod
def GetDistanceSquared(p) -> float:
"""
GetDistanceSquared(p) -> float
Compute the squared distance from a point to the range.
Parameters
----------
p : Vec2f
"""
@staticmethod
def GetIntersection(*args, **kwargs) -> None:
"""
**classmethod** GetIntersection(a, b) -> Range2f
Returns a ``GfRange2f`` that describes the intersection of ``a`` and
``b`` .
Parameters
----------
a : Range2f
b : Range2f
"""
@staticmethod
def GetMax() -> Vec2f:
"""
GetMax() -> Vec2f
Returns the maximum value of the range.
"""
@staticmethod
def GetMidpoint() -> Vec2f:
"""
GetMidpoint() -> Vec2f
Returns the midpoint of the range, that is, 0.5\*(min+max).
Note: this returns zero in the case of default-constructed ranges, or
ranges set via SetEmpty() .
"""
@staticmethod
def GetMin() -> Vec2f:
"""
GetMin() -> Vec2f
Returns the minimum value of the range.
"""
@staticmethod
def GetQuadrant(i) -> Range2f:
"""
GetQuadrant(i) -> Range2f
Returns the ith quadrant of the range, in the following order: SW, SE,
NW, NE.
Parameters
----------
i : int
"""
@staticmethod
def GetSize() -> Vec2f:
"""
GetSize() -> Vec2f
Returns the size of the range.
"""
@staticmethod
def GetUnion(*args, **kwargs) -> None:
"""
**classmethod** GetUnion(a, b) -> Range2f
Returns the smallest ``GfRange2f`` which contains both ``a`` and ``b``
.
Parameters
----------
a : Range2f
b : Range2f
"""
@staticmethod
def IntersectWith(b) -> Range2f:
"""
IntersectWith(b) -> Range2f
Modifies this range to hold its intersection with ``b`` and returns
the result.
Parameters
----------
b : Range2f
"""
@staticmethod
def IsEmpty() -> bool:
"""
IsEmpty() -> bool
Returns whether the range is empty (max<min).
"""
@staticmethod
def SetEmpty() -> None:
"""
SetEmpty() -> None
Sets the range to an empty interval.
"""
@staticmethod
def SetMax(max) -> None:
"""
SetMax(max) -> None
Sets the maximum value of the range.
Parameters
----------
max : Vec2f
"""
@staticmethod
def SetMin(min) -> None:
"""
SetMin(min) -> None
Sets the minimum value of the range.
Parameters
----------
min : Vec2f
"""
@staticmethod
def UnionWith(b) -> Range2f:
"""
UnionWith(b) -> Range2f
Extend ``this`` to include ``b`` .
Parameters
----------
b : Range2f
----------------------------------------------------------------------
Extend ``this`` to include ``b`` .
Parameters
----------
b : Vec2f
"""
@property
def max(self) -> None:
"""
:type: None
"""
@property
def min(self) -> None:
"""
:type: None
"""
__instance_size__ = 32
dimension = 2
unitSquare: pxr.Gf.Range2f # value = Gf.Range2f(Gf.Vec2f(0.0, 0.0), Gf.Vec2f(1.0, 1.0))
pass
class Range3d(Boost.Python.instance):
@staticmethod
@typing.overload
def Contains(point) -> bool:
"""
Contains(point) -> bool
Returns true if the ``point`` is located inside the range.
As with all operations of this type, the range is assumed to include
its extrema.
Parameters
----------
point : Vec3d
----------------------------------------------------------------------
Returns true if the ``range`` is located entirely inside the range.
As with all operations of this type, the ranges are assumed to include
their extrema.
Parameters
----------
range : Range3d
"""
@staticmethod
@typing.overload
def Contains(range) -> bool: ...
@staticmethod
def GetCorner(i) -> Vec3d:
"""
GetCorner(i) -> Vec3d
Returns the ith corner of the range, in the following order: LDB, RDB,
LUB, RUB, LDF, RDF, LUF, RUF.
Where L/R is left/right, D/U is down/up, and B/F is back/front.
Parameters
----------
i : int
"""
@staticmethod
def GetDistanceSquared(p) -> float:
"""
GetDistanceSquared(p) -> float
Compute the squared distance from a point to the range.
Parameters
----------
p : Vec3d
"""
@staticmethod
def GetIntersection(*args, **kwargs) -> None:
"""
**classmethod** GetIntersection(a, b) -> Range3d
Returns a ``GfRange3d`` that describes the intersection of ``a`` and
``b`` .
Parameters
----------
a : Range3d
b : Range3d
"""
@staticmethod
def GetMax() -> Vec3d:
"""
GetMax() -> Vec3d
Returns the maximum value of the range.
"""
@staticmethod
def GetMidpoint() -> Vec3d:
"""
GetMidpoint() -> Vec3d
Returns the midpoint of the range, that is, 0.5\*(min+max).
Note: this returns zero in the case of default-constructed ranges, or
ranges set via SetEmpty() .
"""
@staticmethod
def GetMin() -> Vec3d:
"""
GetMin() -> Vec3d
Returns the minimum value of the range.
"""
@staticmethod
def GetOctant(i) -> Range3d:
"""
GetOctant(i) -> Range3d
Returns the ith octant of the range, in the following order: LDB, RDB,
LUB, RUB, LDF, RDF, LUF, RUF.
Where L/R is left/right, D/U is down/up, and B/F is back/front.
Parameters
----------
i : int
"""
@staticmethod
def GetSize() -> Vec3d:
"""
GetSize() -> Vec3d
Returns the size of the range.
"""
@staticmethod
def GetUnion(*args, **kwargs) -> None:
"""
**classmethod** GetUnion(a, b) -> Range3d
Returns the smallest ``GfRange3d`` which contains both ``a`` and ``b``
.
Parameters
----------
a : Range3d
b : Range3d
"""
@staticmethod
def IntersectWith(b) -> Range3d:
"""
IntersectWith(b) -> Range3d
Modifies this range to hold its intersection with ``b`` and returns
the result.
Parameters
----------
b : Range3d
"""
@staticmethod
def IsEmpty() -> bool:
"""
IsEmpty() -> bool
Returns whether the range is empty (max<min).
"""
@staticmethod
def SetEmpty() -> None:
"""
SetEmpty() -> None
Sets the range to an empty interval.
"""
@staticmethod
def SetMax(max) -> None:
"""
SetMax(max) -> None
Sets the maximum value of the range.
Parameters
----------
max : Vec3d
"""
@staticmethod
def SetMin(min) -> None:
"""
SetMin(min) -> None
Sets the minimum value of the range.
Parameters
----------
min : Vec3d
"""
@staticmethod
def UnionWith(b) -> Range3d:
"""
UnionWith(b) -> Range3d
Extend ``this`` to include ``b`` .
Parameters
----------
b : Range3d
----------------------------------------------------------------------
Extend ``this`` to include ``b`` .
Parameters
----------
b : Vec3d
"""
@property
def max(self) -> None:
"""
:type: None
"""
@property
def min(self) -> None:
"""
:type: None
"""
__instance_size__ = 64
dimension = 3
unitCube: pxr.Gf.Range3d # value = Gf.Range3d(Gf.Vec3d(0.0, 0.0, 0.0), Gf.Vec3d(1.0, 1.0, 1.0))
pass
class Range3f(Boost.Python.instance):
@staticmethod
@typing.overload
def Contains(point) -> bool:
"""
Contains(point) -> bool
Returns true if the ``point`` is located inside the range.
As with all operations of this type, the range is assumed to include
its extrema.
Parameters
----------
point : Vec3f
----------------------------------------------------------------------
Returns true if the ``range`` is located entirely inside the range.
As with all operations of this type, the ranges are assumed to include
their extrema.
Parameters
----------
range : Range3f
"""
@staticmethod
@typing.overload
def Contains(range) -> bool: ...
@staticmethod
def GetCorner(i) -> Vec3f:
"""
GetCorner(i) -> Vec3f
Returns the ith corner of the range, in the following order: LDB, RDB,
LUB, RUB, LDF, RDF, LUF, RUF.
Where L/R is left/right, D/U is down/up, and B/F is back/front.
Parameters
----------
i : int
"""
@staticmethod
def GetDistanceSquared(p) -> float:
"""
GetDistanceSquared(p) -> float
Compute the squared distance from a point to the range.
Parameters
----------
p : Vec3f
"""
@staticmethod
def GetIntersection(*args, **kwargs) -> None:
"""
**classmethod** GetIntersection(a, b) -> Range3f
Returns a ``GfRange3f`` that describes the intersection of ``a`` and
``b`` .
Parameters
----------
a : Range3f
b : Range3f
"""
@staticmethod
def GetMax() -> Vec3f:
"""
GetMax() -> Vec3f
Returns the maximum value of the range.
"""
@staticmethod
def GetMidpoint() -> Vec3f:
"""
GetMidpoint() -> Vec3f
Returns the midpoint of the range, that is, 0.5\*(min+max).
Note: this returns zero in the case of default-constructed ranges, or
ranges set via SetEmpty() .
"""
@staticmethod
def GetMin() -> Vec3f:
"""
GetMin() -> Vec3f
Returns the minimum value of the range.
"""
@staticmethod
def GetOctant(i) -> Range3f:
"""
GetOctant(i) -> Range3f
Returns the ith octant of the range, in the following order: LDB, RDB,
LUB, RUB, LDF, RDF, LUF, RUF.
Where L/R is left/right, D/U is down/up, and B/F is back/front.
Parameters
----------
i : int
"""
@staticmethod
def GetSize() -> Vec3f:
"""
GetSize() -> Vec3f
Returns the size of the range.
"""
@staticmethod
def GetUnion(*args, **kwargs) -> None:
"""
**classmethod** GetUnion(a, b) -> Range3f
Returns the smallest ``GfRange3f`` which contains both ``a`` and ``b``
.
Parameters
----------
a : Range3f
b : Range3f
"""
@staticmethod
def IntersectWith(b) -> Range3f:
"""
IntersectWith(b) -> Range3f
Modifies this range to hold its intersection with ``b`` and returns
the result.
Parameters
----------
b : Range3f
"""
@staticmethod
def IsEmpty() -> bool:
"""
IsEmpty() -> bool
Returns whether the range is empty (max<min).
"""
@staticmethod
def SetEmpty() -> None:
"""
SetEmpty() -> None
Sets the range to an empty interval.
"""
@staticmethod
def SetMax(max) -> None:
"""
SetMax(max) -> None
Sets the maximum value of the range.
Parameters
----------
max : Vec3f
"""
@staticmethod
def SetMin(min) -> None:
"""
SetMin(min) -> None
Sets the minimum value of the range.
Parameters
----------
min : Vec3f
"""
@staticmethod
def UnionWith(b) -> Range3f:
"""
UnionWith(b) -> Range3f
Extend ``this`` to include ``b`` .
Parameters
----------
b : Range3f
----------------------------------------------------------------------
Extend ``this`` to include ``b`` .
Parameters
----------
b : Vec3f
"""
@property
def max(self) -> None:
"""
:type: None
"""
@property
def min(self) -> None:
"""
:type: None
"""
__instance_size__ = 40
dimension = 3
unitCube: pxr.Gf.Range3f # value = Gf.Range3f(Gf.Vec3f(0.0, 0.0, 0.0), Gf.Vec3f(1.0, 1.0, 1.0))
pass
class Ray(Boost.Python.instance):
@staticmethod
def FindClosestPoint(point, rayDistance) -> Vec3d:
"""
FindClosestPoint(point, rayDistance) -> Vec3d
Returns the point on the ray that is closest to ``point`` .
If ``rayDistance`` is not ``None`` , it will be set to the parametric
distance along the ray of the closest point.
Parameters
----------
point : Vec3d
rayDistance : float
"""
@staticmethod
def GetPoint(distance) -> Vec3d:
"""
GetPoint(distance) -> Vec3d
Returns the point that is ``distance`` units from the starting point
along the direction vector, expressed in parametic distance.
Parameters
----------
distance : float
"""
@staticmethod
def Intersect(*args, **kwargs) -> typing.Any:
"""
Intersects the ray with the triangle formed by points p0,
p1, and p2. The first item in the tuple is true if the ray
intersects the triangle. dist is the the parametric
distance to the intersection point, the barycentric
coordinates of the intersection point, and the front-facing
flag. The barycentric coordinates are defined with respect
to the three vertices taken in order. The front-facing
flag is True if the intersection hit the side of the
triangle that is formed when the vertices are ordered
counter-clockwise (right-hand rule).
Barycentric coordinates are defined to sum to 1 and satisfy
this relationsip:
intersectionPoint = (barycentricCoords[0] * p0 +
barycentricCoords[1] * p1 +
barycentricCoords[2] * p2);
----------------------------------------------------------------------
Intersects the ray with the Gf.Plane. The first item in
the returned tuple is true if the ray intersects the plane.
dist is the parametric distance to the intersection point
and frontfacing is true if the intersection is on the side
of the plane toward which the plane's normal points.
----------------------------------------------------------------------
Intersects the plane with an sphere. intersects is true if
the ray intersects it at all within the sphere. If there is
an intersection then enterDist and exitDist will be the
parametric distances to the two intersection points.
----------------------------------------------------------------------
Intersects the plane with an infinite cylinder. intersects
is true if the ray intersects it at all within the
sphere. If there is an intersection then enterDist and
exitDist will be the parametric distances to the two
intersection points.
----------------------------------------------------------------------
Intersects the plane with an cylinder. intersects
is true if the ray intersects it at all within the
sphere. If there is an intersection then enterDist and
exitDist will be the parametric distances to the two
intersection points.
----------------------------------------------------------------------
"""
@staticmethod
def SetEnds(startPoint, endPoint) -> None:
"""
SetEnds(startPoint, endPoint) -> None
Sets the ray by specifying a starting point and an ending point.
Parameters
----------
startPoint : Vec3d
endPoint : Vec3d
"""
@staticmethod
def SetPointAndDirection(startPoint, direction) -> None:
"""
SetPointAndDirection(startPoint, direction) -> None
Sets the ray by specifying a starting point and a direction.
Parameters
----------
startPoint : Vec3d
direction : Vec3d
"""
@staticmethod
def Transform(matrix) -> Ray:
"""
Transform(matrix) -> Ray
Transforms the ray by the given matrix.
Parameters
----------
matrix : Matrix4d
"""
@property
def direction(self) -> None:
"""
type : Vec3d
Returns the direction vector of the segment.
This is not guaranteed to be unit length.
:type: None
"""
@property
def startPoint(self) -> None:
"""
type : Vec3d
Returns the starting point of the segment.
:type: None
"""
__instance_size__ = 64
pass
class Rect2i(Boost.Python.instance):
@staticmethod
def Contains(p) -> bool:
"""
Contains(p) -> bool
Returns true if the specified point in the rectangle.
Parameters
----------
p : Vec2i
"""
@staticmethod
def GetArea() -> int:
"""
GetArea() -> int
Return the area of the rectangle.
"""
@staticmethod
def GetCenter() -> Vec2i:
"""
GetCenter() -> Vec2i
Returns the center point of the rectangle.
"""
@staticmethod
def GetHeight() -> int:
"""
GetHeight() -> int
Returns the height of the rectangle.
If the min and max y-coordinates are coincident, the height is one.
"""
@staticmethod
def GetIntersection(that) -> Rect2i:
"""
GetIntersection(that) -> Rect2i
Computes the intersection of two rectangles.
Parameters
----------
that : Rect2i
"""
@staticmethod
def GetMax() -> Vec2i:
"""
GetMax() -> Vec2i
Returns the max corner of the rectangle.
"""
@staticmethod
def GetMaxX() -> int:
"""
GetMaxX() -> int
Return the X value of the max corner.
"""
@staticmethod
def GetMaxY() -> int:
"""
GetMaxY() -> int
Return the Y value of the max corner.
"""
@staticmethod
def GetMin() -> Vec2i:
"""
GetMin() -> Vec2i
Returns the min corner of the rectangle.
"""
@staticmethod
def GetMinX() -> int:
"""
GetMinX() -> int
Return the X value of min corner.
"""
@staticmethod
def GetMinY() -> int:
"""
GetMinY() -> int
Return the Y value of the min corner.
"""
@staticmethod
def GetNormalized() -> Rect2i:
"""
GetNormalized() -> Rect2i
Returns a normalized rectangle, i.e.
one that has a non-negative width and height.
``GetNormalized()`` swaps the min and max x-coordinates to ensure a
non-negative width, and similarly for the y-coordinates.
"""
@staticmethod
def GetSize() -> Vec2i:
"""
GetSize() -> Vec2i
Returns the size of the rectangle as a vector (width,height).
"""
@staticmethod
def GetUnion(that) -> Rect2i:
"""
GetUnion(that) -> Rect2i
Computes the union of two rectangles.
Parameters
----------
that : Rect2i
"""
@staticmethod
def GetWidth() -> int:
"""
GetWidth() -> int
Returns the width of the rectangle.
If the min and max x-coordinates are coincident, the width is one.
"""
@staticmethod
def IsEmpty() -> bool:
"""
IsEmpty() -> bool
Returns true if the rectangle is empty.
An empty rectangle has one or both of its min coordinates strictly
greater than the corresponding max coordinate.
An empty rectangle is not valid.
"""
@staticmethod
def IsNull() -> bool:
"""
IsNull() -> bool
Returns true if the rectangle is a null rectangle.
A null rectangle has both the width and the height set to 0, that is
.. code-block:: text
GetMaxX() == GetMinX() - 1
and
.. code-block:: text
GetMaxY() == GetMinY() - 1
Remember that if ``GetMinX()`` and ``GetMaxX()`` return the same
value then the rectangle has width 1, and similarly for the height.
A null rectangle is both empty, and not valid.
"""
@staticmethod
def IsValid() -> bool:
"""
IsValid() -> bool
Return true if the rectangle is valid (equivalently, not empty).
"""
@staticmethod
def SetMax(max) -> None:
"""
SetMax(max) -> None
Sets the max corner of the rectangle.
Parameters
----------
max : Vec2i
"""
@staticmethod
def SetMaxX(x) -> None:
"""
SetMaxX(x) -> None
Set the X value of the max corner.
Parameters
----------
x : int
"""
@staticmethod
def SetMaxY(y) -> None:
"""
SetMaxY(y) -> None
Set the Y value of the max corner.
Parameters
----------
y : int
"""
@staticmethod
def SetMin(min) -> None:
"""
SetMin(min) -> None
Sets the min corner of the rectangle.
Parameters
----------
min : Vec2i
"""
@staticmethod
def SetMinX(x) -> None:
"""
SetMinX(x) -> None
Set the X value of the min corner.
Parameters
----------
x : int
"""
@staticmethod
def SetMinY(y) -> None:
"""
SetMinY(y) -> None
Set the Y value of the min corner.
Parameters
----------
y : int
"""
@staticmethod
def Translate(displacement) -> None:
"""
Translate(displacement) -> None
Move the rectangle by ``displ`` .
Parameters
----------
displacement : Vec2i
"""
@property
def max(self) -> None:
"""
:type: None
"""
@property
def maxX(self) -> None:
"""
:type: None
"""
@property
def maxY(self) -> None:
"""
:type: None
"""
@property
def min(self) -> None:
"""
:type: None
"""
@property
def minX(self) -> None:
"""
:type: None
"""
@property
def minY(self) -> None:
"""
:type: None
"""
__instance_size__ = 32
pass
class Rotation(Boost.Python.instance):
"""
3-space rotation
"""
@staticmethod
def Decompose(axis0, axis1, axis2) -> Vec3d:
"""
Decompose(axis0, axis1, axis2) -> Vec3d
Decompose rotation about 3 orthogonal axes.
If the axes are not orthogonal, warnings will be spewed.
Parameters
----------
axis0 : Vec3d
axis1 : Vec3d
axis2 : Vec3d
"""
@staticmethod
def DecomposeRotation(*args, **kwargs) -> None:
"""
**classmethod** DecomposeRotation(rot, TwAxis, FBAxis, LRAxis, handedness, thetaTw, thetaFB, thetaLR, thetaSw, useHint, swShift) -> None
Parameters
----------
rot : Matrix4d
TwAxis : Vec3d
FBAxis : Vec3d
LRAxis : Vec3d
handedness : float
thetaTw : float
thetaFB : float
thetaLR : float
thetaSw : float
useHint : bool
swShift : float
"""
@staticmethod
def DecomposeRotation3(*args, **kwargs) -> None: ...
@staticmethod
def GetAngle() -> float:
"""
GetAngle() -> float
Returns the rotation angle in degrees.
"""
@staticmethod
def GetAxis() -> Vec3d:
"""
GetAxis() -> Vec3d
Returns the axis of rotation.
"""
@staticmethod
def GetInverse() -> Rotation:
"""
GetInverse() -> Rotation
Returns the inverse of this rotation.
"""
@staticmethod
def GetQuat() -> Quatd:
"""
GetQuat() -> Quatd
Returns the rotation expressed as a quaternion.
"""
@staticmethod
def GetQuaternion() -> Quaternion:
"""
GetQuaternion() -> Quaternion
Returns the rotation expressed as a quaternion.
"""
@staticmethod
def MatchClosestEulerRotation(*args, **kwargs) -> None:
"""
**classmethod** MatchClosestEulerRotation(targetTw, targetFB, targetLR, targetSw, thetaTw, thetaFB, thetaLR, thetaSw) -> None
Replace the hint angles with the closest rotation of the given
rotation to the hint.
Each angle in the rotation will be within Pi of the corresponding hint
angle and the sum of the differences with the hint will be minimized.
If a given rotation value is null then that angle will be treated as
0.0 and ignored in the calculations.
All angles are in radians. The rotation order is Tw/FB/LR/Sw.
Parameters
----------
targetTw : float
targetFB : float
targetLR : float
targetSw : float
thetaTw : float
thetaFB : float
thetaLR : float
thetaSw : float
"""
@staticmethod
def RotateOntoProjected(*args, **kwargs) -> None:
"""
**classmethod** RotateOntoProjected(v1, v2, axis) -> Rotation
Parameters
----------
v1 : Vec3d
v2 : Vec3d
axis : Vec3d
"""
@staticmethod
def SetAxisAngle(axis, angle) -> Rotation:
"""
SetAxisAngle(axis, angle) -> Rotation
Sets the rotation to be ``angle`` degrees about ``axis`` .
Parameters
----------
axis : Vec3d
angle : float
"""
@staticmethod
def SetIdentity() -> Rotation:
"""
SetIdentity() -> Rotation
Sets the rotation to an identity rotation.
(This is chosen to be 0 degrees around the positive X axis.)
"""
@staticmethod
def SetQuat(quat) -> Rotation:
"""
SetQuat(quat) -> Rotation
Sets the rotation from a quaternion.
Note that this method accepts GfQuatf and GfQuath since they
implicitly convert to GfQuatd.
Parameters
----------
quat : Quatd
"""
@staticmethod
def SetQuaternion(quat) -> Rotation:
"""
SetQuaternion(quat) -> Rotation
Sets the rotation from a quaternion.
Parameters
----------
quat : Quaternion
"""
@staticmethod
def SetRotateInto(rotateFrom, rotateTo) -> Rotation:
"""
SetRotateInto(rotateFrom, rotateTo) -> Rotation
Sets the rotation to one that brings the ``rotateFrom`` vector to
align with ``rotateTo`` .
The passed vectors need not be unit length.
Parameters
----------
rotateFrom : Vec3d
rotateTo : Vec3d
"""
@staticmethod
@typing.overload
def TransformDir(vec) -> Vec3f:
"""
TransformDir(vec) -> Vec3f
Transforms row vector ``vec`` by the rotation, returning the result.
Parameters
----------
vec : Vec3f
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
vec : Vec3d
"""
@staticmethod
@typing.overload
def TransformDir(vec) -> Vec3d: ...
@property
def angle(self) -> None:
"""
:type: None
"""
@property
def axis(self) -> None:
"""
:type: None
"""
__instance_size__ = 48
pass
class Size2(Boost.Python.instance):
"""
A 2D size class
"""
@staticmethod
@typing.overload
def Set(v) -> Size2:
"""
Set(v) -> Size2
Set to the values in a given array.
Parameters
----------
v : int
----------------------------------------------------------------------
Set to values passed directly.
Parameters
----------
v0 : int
v1 : int
"""
@staticmethod
@typing.overload
def Set(v0, v1) -> Size2: ...
__instance_size__ = 32
dimension = 2
pass
class Size3(Boost.Python.instance):
"""
A 3D size class
"""
@staticmethod
@typing.overload
def Set(v) -> Size3:
"""
Set(v) -> Size3
Set to the values in ``v`` .
Parameters
----------
v : int
----------------------------------------------------------------------
Set to values passed directly.
Parameters
----------
v0 : int
v1 : int
v2 : int
"""
@staticmethod
@typing.overload
def Set(v0, v1, v2) -> Size3: ...
__instance_size__ = 40
dimension = 3
pass
class Transform(Boost.Python.instance):
@staticmethod
def GetMatrix() -> Matrix4d:
"""
GetMatrix() -> Matrix4d
Returns a ``GfMatrix4d`` that implements the cumulative
transformation.
"""
@staticmethod
def GetPivotOrientation() -> Rotation:
"""
GetPivotOrientation() -> Rotation
Returns the pivot orientation component.
"""
@staticmethod
def GetPivotPosition() -> Vec3d:
"""
GetPivotPosition() -> Vec3d
Returns the pivot position component.
"""
@staticmethod
def GetRotation() -> Rotation:
"""
GetRotation() -> Rotation
Returns the rotation component.
"""
@staticmethod
def GetScale() -> Vec3d:
"""
GetScale() -> Vec3d
Returns the scale component.
"""
@staticmethod
def GetTranslation() -> Vec3d:
"""
GetTranslation() -> Vec3d
Returns the translation component.
"""
@staticmethod
def Set(*args, **kwargs) -> None:
"""
Set method used by old 2x code. (Deprecated)
"""
@staticmethod
def SetIdentity() -> Transform:
"""
SetIdentity() -> Transform
Sets the transformation to the identity transformation.
"""
@staticmethod
def SetMatrix(m) -> Transform:
"""
SetMatrix(m) -> Transform
Sets the transform components to implement the transformation
represented by matrix ``m`` , ignoring any projection.
This tries to leave the current center unchanged.
Parameters
----------
m : Matrix4d
"""
@staticmethod
def SetPivotOrientation(pivotOrient) -> None:
"""
SetPivotOrientation(pivotOrient) -> None
Sets the pivot orientation component, leaving all others untouched.
Parameters
----------
pivotOrient : Rotation
"""
@staticmethod
def SetPivotPosition(pivPos) -> None:
"""
SetPivotPosition(pivPos) -> None
Sets the pivot position component, leaving all others untouched.
Parameters
----------
pivPos : Vec3d
"""
@staticmethod
def SetRotation(rotation) -> None:
"""
SetRotation(rotation) -> None
Sets the rotation component, leaving all others untouched.
Parameters
----------
rotation : Rotation
"""
@staticmethod
def SetScale(scale) -> None:
"""
SetScale(scale) -> None
Sets the scale component, leaving all others untouched.
Parameters
----------
scale : Vec3d
"""
@staticmethod
def SetTranslation(translation) -> None:
"""
SetTranslation(translation) -> None
Sets the translation component, leaving all others untouched.
Parameters
----------
translation : Vec3d
"""
@property
def pivotOrientation(self) -> None:
"""
:type: None
"""
@property
def pivotPosition(self) -> None:
"""
:type: None
"""
@property
def rotation(self) -> None:
"""
:type: None
"""
@property
def scale(self) -> None:
"""
:type: None
"""
@property
def translation(self) -> None:
"""
:type: None
"""
__instance_size__ = 152
pass
class Vec2d(Boost.Python.instance):
@staticmethod
def Axis(*args, **kwargs) -> None:
"""
**classmethod** Axis(i) -> Vec2d
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 2.
Parameters
----------
i : int
"""
@staticmethod
def GetComplement(b) -> Vec2d:
"""
GetComplement(b) -> Vec2d
Returns the orthogonal complement of ``this->GetProjection(b)`` .
That is:
.. code-block:: text
\*this - this->GetProjection(b)
Parameters
----------
b : Vec2d
"""
@staticmethod
def GetDot(*args, **kwargs) -> None: ...
@staticmethod
def GetLength() -> float:
"""
GetLength() -> float
Length.
"""
@staticmethod
def GetNormalized(eps) -> Vec2d:
"""
GetNormalized(eps) -> Vec2d
Parameters
----------
eps : float
"""
@staticmethod
def GetProjection(v) -> Vec2d:
"""
GetProjection(v) -> Vec2d
Returns the projection of ``this`` onto ``v`` .
That is:
.. code-block:: text
v \* (\*this \* v)
Parameters
----------
v : Vec2d
"""
@staticmethod
def Normalize(eps) -> float:
"""
Normalize(eps) -> float
Normalizes the vector in place to unit length, returning the length
before normalization.
If the length of the vector is smaller than ``eps`` , then the vector
is set to vector/ ``eps`` . The original length of the vector is
returned. See also GfNormalize() .
Parameters
----------
eps : float
"""
@staticmethod
def XAxis(*args, **kwargs) -> None:
"""
**classmethod** XAxis() -> Vec2d
Create a unit vector along the X-axis.
"""
@staticmethod
def YAxis(*args, **kwargs) -> None:
"""
**classmethod** YAxis() -> Vec2d
Create a unit vector along the Y-axis.
"""
__isGfVec = True
__safe_for_unpickling__ = True
dimension = 2
pass
class Vec2f(Boost.Python.instance):
@staticmethod
def Axis(*args, **kwargs) -> None:
"""
**classmethod** Axis(i) -> Vec2f
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 2.
Parameters
----------
i : int
"""
@staticmethod
def GetComplement(b) -> Vec2f:
"""
GetComplement(b) -> Vec2f
Returns the orthogonal complement of ``this->GetProjection(b)`` .
That is:
.. code-block:: text
\*this - this->GetProjection(b)
Parameters
----------
b : Vec2f
"""
@staticmethod
def GetDot(*args, **kwargs) -> None: ...
@staticmethod
def GetLength() -> float:
"""
GetLength() -> float
Length.
"""
@staticmethod
def GetNormalized(eps) -> Vec2f:
"""
GetNormalized(eps) -> Vec2f
Parameters
----------
eps : float
"""
@staticmethod
def GetProjection(v) -> Vec2f:
"""
GetProjection(v) -> Vec2f
Returns the projection of ``this`` onto ``v`` .
That is:
.. code-block:: text
v \* (\*this \* v)
Parameters
----------
v : Vec2f
"""
@staticmethod
def Normalize(eps) -> float:
"""
Normalize(eps) -> float
Normalizes the vector in place to unit length, returning the length
before normalization.
If the length of the vector is smaller than ``eps`` , then the vector
is set to vector/ ``eps`` . The original length of the vector is
returned. See also GfNormalize() .
Parameters
----------
eps : float
"""
@staticmethod
def XAxis(*args, **kwargs) -> None:
"""
**classmethod** XAxis() -> Vec2f
Create a unit vector along the X-axis.
"""
@staticmethod
def YAxis(*args, **kwargs) -> None:
"""
**classmethod** YAxis() -> Vec2f
Create a unit vector along the Y-axis.
"""
__isGfVec = True
__safe_for_unpickling__ = True
dimension = 2
pass
class Vec2h(Boost.Python.instance):
@staticmethod
def Axis(*args, **kwargs) -> None:
"""
**classmethod** Axis(i) -> Vec2h
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 2.
Parameters
----------
i : int
"""
@staticmethod
def GetComplement(b) -> Vec2h:
"""
GetComplement(b) -> Vec2h
Returns the orthogonal complement of ``this->GetProjection(b)`` .
That is:
.. code-block:: text
\*this - this->GetProjection(b)
Parameters
----------
b : Vec2h
"""
@staticmethod
def GetDot(*args, **kwargs) -> None: ...
@staticmethod
def GetLength() -> GfHalf:
"""
GetLength() -> GfHalf
Length.
"""
@staticmethod
def GetNormalized(eps) -> Vec2h:
"""
GetNormalized(eps) -> Vec2h
Parameters
----------
eps : GfHalf
"""
@staticmethod
def GetProjection(v) -> Vec2h:
"""
GetProjection(v) -> Vec2h
Returns the projection of ``this`` onto ``v`` .
That is:
.. code-block:: text
v \* (\*this \* v)
Parameters
----------
v : Vec2h
"""
@staticmethod
def Normalize(eps) -> GfHalf:
"""
Normalize(eps) -> GfHalf
Normalizes the vector in place to unit length, returning the length
before normalization.
If the length of the vector is smaller than ``eps`` , then the vector
is set to vector/ ``eps`` . The original length of the vector is
returned. See also GfNormalize() .
Parameters
----------
eps : GfHalf
"""
@staticmethod
def XAxis(*args, **kwargs) -> None:
"""
**classmethod** XAxis() -> Vec2h
Create a unit vector along the X-axis.
"""
@staticmethod
def YAxis(*args, **kwargs) -> None:
"""
**classmethod** YAxis() -> Vec2h
Create a unit vector along the Y-axis.
"""
__isGfVec = True
__safe_for_unpickling__ = True
dimension = 2
pass
class Vec2i(Boost.Python.instance):
@staticmethod
def Axis(*args, **kwargs) -> None:
"""
**classmethod** Axis(i) -> Vec2i
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 2.
Parameters
----------
i : int
"""
@staticmethod
def GetDot(*args, **kwargs) -> None: ...
@staticmethod
def XAxis(*args, **kwargs) -> None:
"""
**classmethod** XAxis() -> Vec2i
Create a unit vector along the X-axis.
"""
@staticmethod
def YAxis(*args, **kwargs) -> None:
"""
**classmethod** YAxis() -> Vec2i
Create a unit vector along the Y-axis.
"""
__isGfVec = True
__safe_for_unpickling__ = True
dimension = 2
pass
class Vec3d(Boost.Python.instance):
@staticmethod
def Axis(*args, **kwargs) -> None:
"""
**classmethod** Axis(i) -> Vec3d
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 3.
Parameters
----------
i : int
"""
@staticmethod
def BuildOrthonormalFrame(v1, v2, eps) -> None:
"""
BuildOrthonormalFrame(v1, v2, eps) -> None
Sets ``v1`` and ``v2`` to unit vectors such that v1, v2 and \*this
are mutually orthogonal.
If the length L of \*this is smaller than ``eps`` , then v1 and v2
will have magnitude L/eps. As a result, the function delivers a
continuous result as \*this shrinks in length.
Parameters
----------
v1 : Vec3d
v2 : Vec3d
eps : float
"""
@staticmethod
def GetComplement(b) -> Vec3d:
"""
GetComplement(b) -> Vec3d
Returns the orthogonal complement of ``this->GetProjection(b)`` .
That is:
.. code-block:: text
\*this - this->GetProjection(b)
Parameters
----------
b : Vec3d
"""
@staticmethod
def GetCross(*args, **kwargs) -> None: ...
@staticmethod
def GetDot(*args, **kwargs) -> None: ...
@staticmethod
def GetLength() -> float:
"""
GetLength() -> float
Length.
"""
@staticmethod
def GetNormalized(eps) -> Vec3d:
"""
GetNormalized(eps) -> Vec3d
Parameters
----------
eps : float
"""
@staticmethod
def GetProjection(v) -> Vec3d:
"""
GetProjection(v) -> Vec3d
Returns the projection of ``this`` onto ``v`` .
That is:
.. code-block:: text
v \* (\*this \* v)
Parameters
----------
v : Vec3d
"""
@staticmethod
def Normalize(eps) -> float:
"""
Normalize(eps) -> float
Normalizes the vector in place to unit length, returning the length
before normalization.
If the length of the vector is smaller than ``eps`` , then the vector
is set to vector/ ``eps`` . The original length of the vector is
returned. See also GfNormalize() .
Parameters
----------
eps : float
"""
@staticmethod
def OrthogonalizeBasis(*args, **kwargs) -> None:
"""
**classmethod** OrthogonalizeBasis(tx, ty, tz, normalize, eps) -> bool
Orthogonalize and optionally normalize a set of basis vectors.
This uses an iterative method that is very stable even when the
vectors are far from orthogonal (close to colinear). The number of
iterations and thus the computation time does increase as the vectors
become close to colinear, however. Returns a bool specifying whether
the solution converged after a number of iterations. If it did not
converge, the returned vectors will be as close as possible to
orthogonal within the iteration limit. Colinear vectors will be
unaltered, and the method will return false.
Parameters
----------
tx : Vec3d
ty : Vec3d
tz : Vec3d
normalize : bool
eps : float
"""
@staticmethod
def XAxis(*args, **kwargs) -> None:
"""
**classmethod** XAxis() -> Vec3d
Create a unit vector along the X-axis.
"""
@staticmethod
def YAxis(*args, **kwargs) -> None:
"""
**classmethod** YAxis() -> Vec3d
Create a unit vector along the Y-axis.
"""
@staticmethod
def ZAxis(*args, **kwargs) -> None:
"""
**classmethod** ZAxis() -> Vec3d
Create a unit vector along the Z-axis.
"""
__isGfVec = True
__safe_for_unpickling__ = True
dimension = 3
pass
class Vec3f(Boost.Python.instance):
@staticmethod
def Axis(*args, **kwargs) -> None:
"""
**classmethod** Axis(i) -> Vec3f
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 3.
Parameters
----------
i : int
"""
@staticmethod
def BuildOrthonormalFrame(v1, v2, eps) -> None:
"""
BuildOrthonormalFrame(v1, v2, eps) -> None
Sets ``v1`` and ``v2`` to unit vectors such that v1, v2 and \*this
are mutually orthogonal.
If the length L of \*this is smaller than ``eps`` , then v1 and v2
will have magnitude L/eps. As a result, the function delivers a
continuous result as \*this shrinks in length.
Parameters
----------
v1 : Vec3f
v2 : Vec3f
eps : float
"""
@staticmethod
def GetComplement(b) -> Vec3f:
"""
GetComplement(b) -> Vec3f
Returns the orthogonal complement of ``this->GetProjection(b)`` .
That is:
.. code-block:: text
\*this - this->GetProjection(b)
Parameters
----------
b : Vec3f
"""
@staticmethod
def GetCross(*args, **kwargs) -> None: ...
@staticmethod
def GetDot(*args, **kwargs) -> None: ...
@staticmethod
def GetLength() -> float:
"""
GetLength() -> float
Length.
"""
@staticmethod
def GetNormalized(eps) -> Vec3f:
"""
GetNormalized(eps) -> Vec3f
Parameters
----------
eps : float
"""
@staticmethod
def GetProjection(v) -> Vec3f:
"""
GetProjection(v) -> Vec3f
Returns the projection of ``this`` onto ``v`` .
That is:
.. code-block:: text
v \* (\*this \* v)
Parameters
----------
v : Vec3f
"""
@staticmethod
def Normalize(eps) -> float:
"""
Normalize(eps) -> float
Normalizes the vector in place to unit length, returning the length
before normalization.
If the length of the vector is smaller than ``eps`` , then the vector
is set to vector/ ``eps`` . The original length of the vector is
returned. See also GfNormalize() .
Parameters
----------
eps : float
"""
@staticmethod
def OrthogonalizeBasis(*args, **kwargs) -> None:
"""
**classmethod** OrthogonalizeBasis(tx, ty, tz, normalize, eps) -> bool
Orthogonalize and optionally normalize a set of basis vectors.
This uses an iterative method that is very stable even when the
vectors are far from orthogonal (close to colinear). The number of
iterations and thus the computation time does increase as the vectors
become close to colinear, however. Returns a bool specifying whether
the solution converged after a number of iterations. If it did not
converge, the returned vectors will be as close as possible to
orthogonal within the iteration limit. Colinear vectors will be
unaltered, and the method will return false.
Parameters
----------
tx : Vec3f
ty : Vec3f
tz : Vec3f
normalize : bool
eps : float
"""
@staticmethod
def XAxis(*args, **kwargs) -> None:
"""
**classmethod** XAxis() -> Vec3f
Create a unit vector along the X-axis.
"""
@staticmethod
def YAxis(*args, **kwargs) -> None:
"""
**classmethod** YAxis() -> Vec3f
Create a unit vector along the Y-axis.
"""
@staticmethod
def ZAxis(*args, **kwargs) -> None:
"""
**classmethod** ZAxis() -> Vec3f
Create a unit vector along the Z-axis.
"""
__isGfVec = True
__safe_for_unpickling__ = True
dimension = 3
pass
class Vec3h(Boost.Python.instance):
@staticmethod
def Axis(*args, **kwargs) -> None:
"""
**classmethod** Axis(i) -> Vec3h
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 3.
Parameters
----------
i : int
"""
@staticmethod
def BuildOrthonormalFrame(v1, v2, eps) -> None:
"""
BuildOrthonormalFrame(v1, v2, eps) -> None
Sets ``v1`` and ``v2`` to unit vectors such that v1, v2 and \*this
are mutually orthogonal.
If the length L of \*this is smaller than ``eps`` , then v1 and v2
will have magnitude L/eps. As a result, the function delivers a
continuous result as \*this shrinks in length.
Parameters
----------
v1 : Vec3h
v2 : Vec3h
eps : GfHalf
"""
@staticmethod
def GetComplement(b) -> Vec3h:
"""
GetComplement(b) -> Vec3h
Returns the orthogonal complement of ``this->GetProjection(b)`` .
That is:
.. code-block:: text
\*this - this->GetProjection(b)
Parameters
----------
b : Vec3h
"""
@staticmethod
def GetCross(*args, **kwargs) -> None: ...
@staticmethod
def GetDot(*args, **kwargs) -> None: ...
@staticmethod
def GetLength() -> GfHalf:
"""
GetLength() -> GfHalf
Length.
"""
@staticmethod
def GetNormalized(eps) -> Vec3h:
"""
GetNormalized(eps) -> Vec3h
Parameters
----------
eps : GfHalf
"""
@staticmethod
def GetProjection(v) -> Vec3h:
"""
GetProjection(v) -> Vec3h
Returns the projection of ``this`` onto ``v`` .
That is:
.. code-block:: text
v \* (\*this \* v)
Parameters
----------
v : Vec3h
"""
@staticmethod
def Normalize(eps) -> GfHalf:
"""
Normalize(eps) -> GfHalf
Normalizes the vector in place to unit length, returning the length
before normalization.
If the length of the vector is smaller than ``eps`` , then the vector
is set to vector/ ``eps`` . The original length of the vector is
returned. See also GfNormalize() .
Parameters
----------
eps : GfHalf
"""
@staticmethod
def OrthogonalizeBasis(*args, **kwargs) -> None:
"""
**classmethod** OrthogonalizeBasis(tx, ty, tz, normalize, eps) -> bool
Orthogonalize and optionally normalize a set of basis vectors.
This uses an iterative method that is very stable even when the
vectors are far from orthogonal (close to colinear). The number of
iterations and thus the computation time does increase as the vectors
become close to colinear, however. Returns a bool specifying whether
the solution converged after a number of iterations. If it did not
converge, the returned vectors will be as close as possible to
orthogonal within the iteration limit. Colinear vectors will be
unaltered, and the method will return false.
Parameters
----------
tx : Vec3h
ty : Vec3h
tz : Vec3h
normalize : bool
eps : float
"""
@staticmethod
def XAxis(*args, **kwargs) -> None:
"""
**classmethod** XAxis() -> Vec3h
Create a unit vector along the X-axis.
"""
@staticmethod
def YAxis(*args, **kwargs) -> None:
"""
**classmethod** YAxis() -> Vec3h
Create a unit vector along the Y-axis.
"""
@staticmethod
def ZAxis(*args, **kwargs) -> None:
"""
**classmethod** ZAxis() -> Vec3h
Create a unit vector along the Z-axis.
"""
__isGfVec = True
__safe_for_unpickling__ = True
dimension = 3
pass
class Vec3i(Boost.Python.instance):
@staticmethod
def Axis(*args, **kwargs) -> None:
"""
**classmethod** Axis(i) -> Vec3i
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 3.
Parameters
----------
i : int
"""
@staticmethod
def GetDot(*args, **kwargs) -> None: ...
@staticmethod
def XAxis(*args, **kwargs) -> None:
"""
**classmethod** XAxis() -> Vec3i
Create a unit vector along the X-axis.
"""
@staticmethod
def YAxis(*args, **kwargs) -> None:
"""
**classmethod** YAxis() -> Vec3i
Create a unit vector along the Y-axis.
"""
@staticmethod
def ZAxis(*args, **kwargs) -> None:
"""
**classmethod** ZAxis() -> Vec3i
Create a unit vector along the Z-axis.
"""
__isGfVec = True
__safe_for_unpickling__ = True
dimension = 3
pass
class Vec4d(Boost.Python.instance):
@staticmethod
def Axis(*args, **kwargs) -> None:
"""
**classmethod** Axis(i) -> Vec4d
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 4.
Parameters
----------
i : int
"""
@staticmethod
def GetComplement(b) -> Vec4d:
"""
GetComplement(b) -> Vec4d
Returns the orthogonal complement of ``this->GetProjection(b)`` .
That is:
.. code-block:: text
\*this - this->GetProjection(b)
Parameters
----------
b : Vec4d
"""
@staticmethod
def GetDot(*args, **kwargs) -> None: ...
@staticmethod
def GetLength() -> float:
"""
GetLength() -> float
Length.
"""
@staticmethod
def GetNormalized(eps) -> Vec4d:
"""
GetNormalized(eps) -> Vec4d
Parameters
----------
eps : float
"""
@staticmethod
def GetProjection(v) -> Vec4d:
"""
GetProjection(v) -> Vec4d
Returns the projection of ``this`` onto ``v`` .
That is:
.. code-block:: text
v \* (\*this \* v)
Parameters
----------
v : Vec4d
"""
@staticmethod
def Normalize(eps) -> float:
"""
Normalize(eps) -> float
Normalizes the vector in place to unit length, returning the length
before normalization.
If the length of the vector is smaller than ``eps`` , then the vector
is set to vector/ ``eps`` . The original length of the vector is
returned. See also GfNormalize() .
Parameters
----------
eps : float
"""
@staticmethod
def WAxis(*args, **kwargs) -> None:
"""
**classmethod** WAxis() -> Vec4d
Create a unit vector along the W-axis.
"""
@staticmethod
def XAxis(*args, **kwargs) -> None:
"""
**classmethod** XAxis() -> Vec4d
Create a unit vector along the X-axis.
"""
@staticmethod
def YAxis(*args, **kwargs) -> None:
"""
**classmethod** YAxis() -> Vec4d
Create a unit vector along the Y-axis.
"""
@staticmethod
def ZAxis(*args, **kwargs) -> None:
"""
**classmethod** ZAxis() -> Vec4d
Create a unit vector along the Z-axis.
"""
__isGfVec = True
__safe_for_unpickling__ = True
dimension = 4
pass
class Vec4f(Boost.Python.instance):
@staticmethod
def Axis(*args, **kwargs) -> None:
"""
**classmethod** Axis(i) -> Vec4f
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 4.
Parameters
----------
i : int
"""
@staticmethod
def GetComplement(b) -> Vec4f:
"""
GetComplement(b) -> Vec4f
Returns the orthogonal complement of ``this->GetProjection(b)`` .
That is:
.. code-block:: text
\*this - this->GetProjection(b)
Parameters
----------
b : Vec4f
"""
@staticmethod
def GetDot(*args, **kwargs) -> None: ...
@staticmethod
def GetLength() -> float:
"""
GetLength() -> float
Length.
"""
@staticmethod
def GetNormalized(eps) -> Vec4f:
"""
GetNormalized(eps) -> Vec4f
Parameters
----------
eps : float
"""
@staticmethod
def GetProjection(v) -> Vec4f:
"""
GetProjection(v) -> Vec4f
Returns the projection of ``this`` onto ``v`` .
That is:
.. code-block:: text
v \* (\*this \* v)
Parameters
----------
v : Vec4f
"""
@staticmethod
def Normalize(eps) -> float:
"""
Normalize(eps) -> float
Normalizes the vector in place to unit length, returning the length
before normalization.
If the length of the vector is smaller than ``eps`` , then the vector
is set to vector/ ``eps`` . The original length of the vector is
returned. See also GfNormalize() .
Parameters
----------
eps : float
"""
@staticmethod
def WAxis(*args, **kwargs) -> None:
"""
**classmethod** WAxis() -> Vec4f
Create a unit vector along the W-axis.
"""
@staticmethod
def XAxis(*args, **kwargs) -> None:
"""
**classmethod** XAxis() -> Vec4f
Create a unit vector along the X-axis.
"""
@staticmethod
def YAxis(*args, **kwargs) -> None:
"""
**classmethod** YAxis() -> Vec4f
Create a unit vector along the Y-axis.
"""
@staticmethod
def ZAxis(*args, **kwargs) -> None:
"""
**classmethod** ZAxis() -> Vec4f
Create a unit vector along the Z-axis.
"""
__isGfVec = True
__safe_for_unpickling__ = True
dimension = 4
pass
class Vec4h(Boost.Python.instance):
@staticmethod
def Axis(*args, **kwargs) -> None:
"""
**classmethod** Axis(i) -> Vec4h
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 4.
Parameters
----------
i : int
"""
@staticmethod
def GetComplement(b) -> Vec4h:
"""
GetComplement(b) -> Vec4h
Returns the orthogonal complement of ``this->GetProjection(b)`` .
That is:
.. code-block:: text
\*this - this->GetProjection(b)
Parameters
----------
b : Vec4h
"""
@staticmethod
def GetDot(*args, **kwargs) -> None: ...
@staticmethod
def GetLength() -> GfHalf:
"""
GetLength() -> GfHalf
Length.
"""
@staticmethod
def GetNormalized(eps) -> Vec4h:
"""
GetNormalized(eps) -> Vec4h
Parameters
----------
eps : GfHalf
"""
@staticmethod
def GetProjection(v) -> Vec4h:
"""
GetProjection(v) -> Vec4h
Returns the projection of ``this`` onto ``v`` .
That is:
.. code-block:: text
v \* (\*this \* v)
Parameters
----------
v : Vec4h
"""
@staticmethod
def Normalize(eps) -> GfHalf:
"""
Normalize(eps) -> GfHalf
Normalizes the vector in place to unit length, returning the length
before normalization.
If the length of the vector is smaller than ``eps`` , then the vector
is set to vector/ ``eps`` . The original length of the vector is
returned. See also GfNormalize() .
Parameters
----------
eps : GfHalf
"""
@staticmethod
def WAxis(*args, **kwargs) -> None:
"""
**classmethod** WAxis() -> Vec4h
Create a unit vector along the W-axis.
"""
@staticmethod
def XAxis(*args, **kwargs) -> None:
"""
**classmethod** XAxis() -> Vec4h
Create a unit vector along the X-axis.
"""
@staticmethod
def YAxis(*args, **kwargs) -> None:
"""
**classmethod** YAxis() -> Vec4h
Create a unit vector along the Y-axis.
"""
@staticmethod
def ZAxis(*args, **kwargs) -> None:
"""
**classmethod** ZAxis() -> Vec4h
Create a unit vector along the Z-axis.
"""
__isGfVec = True
__safe_for_unpickling__ = True
dimension = 4
pass
class Vec4i(Boost.Python.instance):
@staticmethod
def Axis(*args, **kwargs) -> None:
"""
**classmethod** Axis(i) -> Vec4i
Create a unit vector along the i-th axis, zero-based.
Return the zero vector if ``i`` is greater than or equal to 4.
Parameters
----------
i : int
"""
@staticmethod
def GetDot(*args, **kwargs) -> None: ...
@staticmethod
def WAxis(*args, **kwargs) -> None:
"""
**classmethod** WAxis() -> Vec4i
Create a unit vector along the W-axis.
"""
@staticmethod
def XAxis(*args, **kwargs) -> None:
"""
**classmethod** XAxis() -> Vec4i
Create a unit vector along the X-axis.
"""
@staticmethod
def YAxis(*args, **kwargs) -> None:
"""
**classmethod** YAxis() -> Vec4i
Create a unit vector along the Y-axis.
"""
@staticmethod
def ZAxis(*args, **kwargs) -> None:
"""
**classmethod** ZAxis() -> Vec4i
Create a unit vector along the Z-axis.
"""
__isGfVec = True
__safe_for_unpickling__ = True
dimension = 4
pass
def Abs(f) -> float:
"""
Abs(f) -> float
Return abs( ``f`` ).
Parameters
----------
f : float
----------------------------------------------------------------------
Return abs( ``f`` ).
Parameters
----------
f : float
"""
def Absf(f) -> float:
"""
f : float
Use instead of Abs() to return the absolute value of f as a float instead of a double.
"""
def ApplyGamma(*args, **kwargs) -> None:
pass
def Ceil(f) -> float:
"""
Ceil(f) -> float
Return ceil( ``f`` ).
Parameters
----------
f : float
----------------------------------------------------------------------
Return ceil( ``f`` ).
Parameters
----------
f : float
"""
def Ceilf(f) -> float:
"""
f : float
Use instead of Ceil() to return the ceiling of f as a float instead of a double.
"""
def Clamp(value, min, max) -> float:
"""
Clamp(value, min, max) -> float
Return the resulting of clamping ``value`` to lie between ``min`` and
``max`` .
This function is also defined for GfVecs.
Parameters
----------
value : float
min : float
max : float
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
value : float
min : float
max : float
"""
def Clampf(f) -> float:
"""
f : float
Use instead of Clamp() to return the clamped value of f as a float instead of a double.
"""
def CompDiv(left, right) -> decltype(declval[Left]()/declval[Right]()):
"""
CompDiv(left, right) -> decltype(declval[Left]()/declval[Right]())
Returns component-wise quotient of vectors.
For scalar types, this is just the regular quotient.
Parameters
----------
left : Left
right : Right
"""
def CompMult(*args, **kwargs) -> typing.Any:
"""
CompMult(left, right) -> decltype(declval[Left]() declval[Right]())
Returns component-wise multiplication of vectors.
For scalar types, this is just the regular product.
Parameters
----------
left : Left
right : Right
"""
def ConvertDisplayToLinear(*args, **kwargs) -> None:
pass
def ConvertLinearToDisplay(*args, **kwargs) -> None:
pass
def Cross(*args, **kwargs) -> None:
pass
def DegreesToRadians(degrees) -> float:
"""
DegreesToRadians(degrees) -> float
Converts an angle in degrees to radians.
Parameters
----------
degrees : float
"""
def Dot(*args, **kwargs) -> typing.Any:
"""
Dot(left, right) -> decltype(declval[Left]() declval[Right]())
Returns the dot (inner) product of two vectors.
For scalar types, this is just the regular product.
Parameters
----------
left : Left
right : Right
"""
def Exp(f) -> float:
"""
Exp(f) -> float
Return exp( ``f`` ).
Parameters
----------
f : float
----------------------------------------------------------------------
Return exp( ``f`` ).
Parameters
----------
f : float
"""
def Expf(f) -> float:
"""
f : float
Use instead of Exp() to return the exponent of f as a float instead of a double.
"""
def FindClosestPoints(*args, **kwargs) -> typing.Any:
"""
l1 : GfLine
l2 : GfLine
Computes the closest points between two lines, returning a tuple. The first item in the tuple is true if the linesintersect. The two points are returned in p1 and p2. The parametric distance of each point on the lines is returned in t1 and t2.
----------------------------------------------------------------------
l1 : GfLine
s2 : GfLineSeg
Computes the closest points between a line and a line segment, returning a tuple. The first item in the tuple is true if they intersect. The two points are returned in p1 and p2. The parametric distance of each point on the line and line segment is returned in t1 and t2.
----------------------------------------------------------------------
l1 : GfLineSeg
l2 : GfLineSeg
Computes the closest points between two line segments, returning a tuple. The first item in the tuple is true if they intersect. The two points are returned in p1 and p2. The parametric distance of each point on the line and line segment is returned in t1 and t2.
----------------------------------------------------------------------
r1 : GfRay
l2 : GfLine
Computes the closest points between a ray and a line,
returning a tuple. The first item in the tuple is true if they intersect. The two points are returned in p1 and p2.
The parametric distance of each point on the ray and line is
returned in t1 and t2.
----------------------------------------------------------------------
r1 : GfRay
s2 : GfLineSeg
Computes the closest points between a ray and a line segment,
returning a tuple. The first item in the tuple is true if they intersect. The two points are returned in p1 and p2.
The parametric distance of each point on the ray and line
segment is returned in t1 and t2.
----------------------------------------------------------------------
"""
def FitPlaneToPoints(*args, **kwargs) -> None:
pass
def Floor(f) -> float:
"""
Floor(f) -> float
Return floor( ``f`` ).
Parameters
----------
f : float
----------------------------------------------------------------------
Return floor( ``f`` ).
Parameters
----------
f : float
"""
def Floorf(f) -> float:
"""
f : float
Use instead of Floor() to return the floor of f as a float instead of a double.
"""
def GetComplement(*args, **kwargs) -> None:
pass
def GetDisplayGamma(*args, **kwargs) -> None:
pass
def GetHomogenized(v) -> Vec4f:
"""
GetHomogenized(v) -> Vec4f
Returns a vector which is ``v`` homogenized.
If the fourth element of ``v`` is 0, it is set to 1.
Parameters
----------
v : Vec4f
"""
def GetLength(*args, **kwargs) -> None:
pass
def GetNormalized(*args, **kwargs) -> None:
pass
def GetProjection(*args, **kwargs) -> None:
pass
@typing.overload
def HomogeneousCross(a, b) -> Vec4f:
"""
HomogeneousCross(a, b) -> Vec4f
Homogenizes ``a`` and ``b`` and then performs the cross product on the
first three elements of each.
Returns the cross product as a homogenized vector.
Parameters
----------
a : Vec4f
b : Vec4f
----------------------------------------------------------------------
Homogenizes ``a`` and ``b`` and then performs the cross product on the
first three elements of each.
Returns the cross product as a homogenized vector.
Parameters
----------
a : Vec4d
b : Vec4d
"""
@typing.overload
def HomogeneousCross(a, b) -> Vec4d:
pass
def IsClose(a, b, epsilon) -> bool:
"""
IsClose(a, b, epsilon) -> bool
Returns true if ``a`` and ``b`` are with ``epsilon`` of each other.
Parameters
----------
a : float
b : float
epsilon : float
"""
def Lerp(alpha, a, b) -> T:
"""
Lerp(alpha, a, b) -> T
Linear interpolation function.
For any type that supports multiplication by a scalar and binary
addition, returns
.. code-block:: text
(1-alpha) \* a + alpha \* b
Parameters
----------
alpha : float
a : T
b : T
"""
def Lerpf(f) -> float:
"""
f : float
Use instead of Lerp() to return the linear interpolation of f as a float instead of a double.
"""
def Log(f) -> float:
"""
Log(f) -> float
Return log( ``f`` ).
Parameters
----------
f : float
----------------------------------------------------------------------
Return log( ``f`` ).
Parameters
----------
f : float
"""
def Logf(f) -> float:
"""
f : float
Use instead of Log() to return the logarithm of f as a float instead of a double.
"""
def Max(a1, a2) -> T:
"""
Max(a1, a2) -> T
Returns the largest of the given ``values`` .
Parameters
----------
a1 : T
a2 : T
"""
def Min(a1, a2) -> T:
"""
Min(a1, a2) -> T
Returns the smallest of the given ``values`` .
Parameters
----------
a1 : T
a2 : T
"""
def Mod(a, b) -> float:
"""
Mod(a, b) -> float
The mod function with"correct"behaviour for negative numbers.
If ``a`` = ``n`` ``b`` for some integer ``n`` , zero is returned.
Otherwise, for positive ``a`` , the value returned is ``fmod(a,b)`` ,
and for negative ``a`` , the value returned is ``fmod(a,b)+b`` .
Parameters
----------
a : float
b : float
"""
def Modf(f) -> float:
"""
f : float
Use instead of Mod() to return the modulus of f as a float instead of a double.
"""
def Normalize(*args, **kwargs) -> None:
pass
def Pow(f, p) -> float:
"""
Pow(f, p) -> float
Return pow( ``f`` , ``p`` ).
Parameters
----------
f : float
p : float
----------------------------------------------------------------------
Return pow( ``f`` , ``p`` ).
Parameters
----------
f : float
p : float
"""
def Powf(f) -> float:
"""
f : float
Use instead of Pow() to return the power of f as a float instead of a double.
"""
def Project(*args, **kwargs) -> None:
pass
def RadiansToDegrees(radians) -> float:
"""
RadiansToDegrees(radians) -> float
Converts an angle in radians to degrees.
Parameters
----------
radians : float
"""
def Round(f) -> float:
"""
Round(f) -> float
Return round( ``f`` ).
Parameters
----------
f : float
----------------------------------------------------------------------
Return round( ``f`` ).
Parameters
----------
f : float
"""
def Roundf(f) -> float:
"""
f : float
Use instead of Round() to return the rounded value of f as a float instead of a double.
"""
def Sgn(v) -> T:
"""
Sgn(v) -> T
Return the signum of ``v`` (i.e.
\-1, 0, or 1).
The type ``T`` must implement the<and>operators; the function returns
zero only if value neither positive, nor negative.
Parameters
----------
v : T
"""
def Slerp(*args, **kwargs) -> None:
pass
def Sqr(x) -> float:
"""
Sqr(x) -> float
Returns the inner product of ``x`` with itself: specifically,
``x\*x`` .
Defined for ``int`` , ``float`` , ``double`` , and all ``GfVec``
types.
Parameters
----------
x : T
"""
def Sqrt(f) -> float:
"""
Sqrt(f) -> float
Return sqrt( ``f`` ).
Parameters
----------
f : float
----------------------------------------------------------------------
Return sqrt( ``f`` ).
Parameters
----------
f : float
"""
def Sqrtf(f) -> float:
"""
f : float
Use instead of Sqrt() to return the square root of f as a float instead of a double.
"""
def _HalfRoundTrip(*args, **kwargs) -> None:
pass
MIN_ORTHO_TOLERANCE = 1e-06
MIN_VECTOR_LENGTH = 1e-10
__MFB_FULL_PACKAGE_NAME = 'gf'
| 216,833 | unknown | 19.988675 | 276 | 0.51358 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Garch/__init__.py | #
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
"""
garch
"""
from pxr import Tf
Tf.PreparePythonModule()
del Tf
| 1,127 | Python | 33.181817 | 74 | 0.759539 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Garch/__DOC.py | def Execute(result):
result["GLPlatformDebugContext"].__doc__ = """
Platform specific context (e.g. X11/GLX) which supports debug output.
"""
result["GLPlatformDebugContext"].makeCurrent.func_doc = """makeCurrent() -> None
"""
result["GLPlatformDebugContext"].__init__.func_doc = """__init__(majorVersion, minorVersion, coreProfile, directRenderering)
Parameters
----------
majorVersion : int
minorVersion : int
coreProfile : bool
directRenderering : bool
""" | 479 | Python | 18.199999 | 127 | 0.697286 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Pcp/__init__.py | #
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
from pxr import Tf
Tf.PreparePythonModule()
del Tf
| 1,110 | Python | 40.148147 | 74 | 0.766667 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Pcp/__DOC.py | def Execute(result):
result["Cache"].__doc__ = """
PcpCache is the context required to make requests of the Pcp
composition algorithm and cache the results.
Because the algorithms are recursive making a request typically makes
other internal requests to solve subproblems caching subproblem
results is required for reasonable performance, and so this cache is
the only entrypoint to the algorithms.
There is a set of parameters that affect the composition results:
- variant fallbacks: per named variant set, an ordered list of
fallback values to use when composing a prim that defines a variant
set but does not specify a selection
- payload inclusion set: an SdfPath set used to identify which
prims should have their payloads included during composition; this is
the basis for explicit control over the"working set"of composition
- file format target: the file format target that Pcp will request
when opening scene description layers
- "USD mode"configures the Pcp composition algorithm to provide
only a custom, lighter subset of the full feature set, as needed by
the Universal Scene Description system
There are a number of different computations that can be requested.
These include computing a layer stack from a PcpLayerStackIdentifier,
computing a prim index or prim stack, and computing a property index.
"""
result["Cache"].GetLayerStackIdentifier.func_doc = """GetLayerStackIdentifier() -> LayerStackIdentifier
Get the identifier of the layerStack used for composition.
"""
result["Cache"].HasRootLayerStack.func_doc = """HasRootLayerStack(layerStack) -> bool
Return true if this cache's root layer stack is ``layerStack`` , false
otherwise.
This is functionally equivalent to comparing against the result of
GetLayerStack() , but does not require constructing a TfWeakPtr or any
refcount operations.
Parameters
----------
layerStack : LayerStack
----------------------------------------------------------------------
HasRootLayerStack(layerStack) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
layerStack : LayerStack
"""
result["Cache"].GetVariantFallbacks.func_doc = """GetVariantFallbacks() -> PcpVariantFallbackMap
Get the list of fallbacks to attempt to use when evaluating variant
sets that lack an authored selection.
"""
result["Cache"].SetVariantFallbacks.func_doc = """SetVariantFallbacks(map, changes) -> None
Set the list of fallbacks to attempt to use when evaluating variant
sets that lack an authored selection.
If ``changes`` is not ``None`` then it's adjusted to reflect the
changes necessary to see the change in standin preferences, otherwise
those changes are applied immediately.
Parameters
----------
map : PcpVariantFallbackMap
changes : PcpChanges
"""
result["Cache"].IsPayloadIncluded.func_doc = """IsPayloadIncluded(path) -> bool
Return true if the payload is included for the given path.
Parameters
----------
path : Path
"""
result["Cache"].RequestPayloads.func_doc = """RequestPayloads(pathsToInclude, pathsToExclude, changes) -> None
Request payloads to be included or excluded from composition.
pathsToInclude
is a set of paths to add to the set for payload inclusion.
pathsToExclude
is a set of paths to remove from the set for payload inclusion.
changes
if not ``None`` , is adjusted to reflect the changes necessary to see
the change in payloads; otherwise those changes are applied
immediately.
If a path is listed in both pathsToInclude and pathsToExclude, it will
be treated as an inclusion only.
Parameters
----------
pathsToInclude : SdfPathSet
pathsToExclude : SdfPathSet
changes : PcpChanges
"""
result["Cache"].RequestLayerMuting.func_doc = """RequestLayerMuting(layersToMute, layersToUnmute, changes, newLayersMuted, newLayersUnmuted) -> None
Request layers to be muted or unmuted in this cache.
Muted layers are ignored during composition and do not appear in any
layer stacks. The root layer of this stage may not be muted;
attempting to do so will generate a coding error. If the root layer of
a reference or payload layer stack is muted, the behavior is as if the
muted layer did not exist, which means a composition error will be
generated.
A canonical identifier for each layer in ``layersToMute`` will be
computed using ArResolver::CreateIdentifier using the cache's root
layer as the anchoring asset. Any layer encountered during composition
with the same identifier will be considered muted and ignored.
Note that muting a layer will cause this cache to release all
references to that layer. If no other client is holding on to
references to that layer, it will be unloaded. In this case, if there
are unsaved edits to the muted layer, those edits are lost. Since
anonymous layers are not serialized, muting an anonymous layer will
cause that layer and its contents to be lost in this case.
If ``changes`` is not ``nullptr`` , it is adjusted to reflect the
changes necessary to see the change in muted layers. Otherwise, those
changes are applied immediately.
``newLayersMuted`` and ``newLayersUnmuted`` contains the pruned vector
of layers which are muted or unmuted by this call to
RequestLayerMuting.
Parameters
----------
layersToMute : list[str]
layersToUnmute : list[str]
changes : PcpChanges
newLayersMuted : list[str]
newLayersUnmuted : list[str]
"""
result["Cache"].GetMutedLayers.func_doc = """GetMutedLayers() -> list[str]
Returns the list of canonical identifiers for muted layers in this
cache.
See documentation on RequestLayerMuting for more details.
"""
result["Cache"].IsLayerMuted.func_doc = """IsLayerMuted(layerIdentifier) -> bool
Returns true if the layer specified by ``layerIdentifier`` is muted in
this cache, false otherwise.
If ``layerIdentifier`` is relative, it is assumed to be relative to
this cache's root layer. See documentation on RequestLayerMuting for
more details.
Parameters
----------
layerIdentifier : str
----------------------------------------------------------------------
IsLayerMuted(anchorLayer, layerIdentifier, canonicalMutedLayerIdentifier) -> bool
Returns true if the layer specified by ``layerIdentifier`` is muted in
this cache, false otherwise.
If ``layerIdentifier`` is relative, it is assumed to be relative to
``anchorLayer`` . If ``canonicalMutedLayerIdentifier`` is supplied, it
will be populated with the canonical identifier of the muted layer if
this function returns true. See documentation on RequestLayerMuting
for more details.
Parameters
----------
anchorLayer : Layer
layerIdentifier : str
canonicalMutedLayerIdentifier : str
"""
result["Cache"].ComputeLayerStack.func_doc = """ComputeLayerStack(identifier, allErrors) -> LayerStack
Returns the layer stack for ``identifier`` if it exists, otherwise
creates a new layer stack for ``identifier`` .
This returns ``None`` if ``identifier`` is invalid (i.e. its root
layer is ``None`` ). ``allErrors`` will contain any errors encountered
while creating a new layer stack. It'll be unchanged if the layer
stack already existed.
Parameters
----------
identifier : LayerStackIdentifier
allErrors : list[PcpError]
"""
result["Cache"].UsesLayerStack.func_doc = """UsesLayerStack(layerStack) -> bool
Return true if ``layerStack`` is used by this cache in its
composition, false otherwise.
Parameters
----------
layerStack : LayerStack
"""
result["Cache"].ComputePrimIndex.func_doc = """ComputePrimIndex(primPath, allErrors) -> PrimIndex
Compute and return a reference to the cached result for the prim index
for the given path.
``allErrors`` will contain any errors encountered while performing
this operation.
Parameters
----------
primPath : Path
allErrors : list[PcpError]
"""
result["Cache"].FindPrimIndex.func_doc = """FindPrimIndex(primPath) -> PrimIndex
Returns a pointer to the cached computed prim index for the given
path, or None if it has not been computed.
Parameters
----------
primPath : Path
"""
result["Cache"].ComputePropertyIndex.func_doc = """ComputePropertyIndex(propPath, allErrors) -> PropertyIndex
Compute and return a reference to the cached result for the property
index for the given path.
``allErrors`` will contain any errors encountered while performing
this operation.
Parameters
----------
propPath : Path
allErrors : list[PcpError]
"""
result["Cache"].FindPropertyIndex.func_doc = """FindPropertyIndex(propPath) -> PropertyIndex
Returns a pointer to the cached computed property index for the given
path, or None if it has not been computed.
Parameters
----------
propPath : Path
"""
result["Cache"].ComputeRelationshipTargetPaths.func_doc = """ComputeRelationshipTargetPaths(relationshipPath, paths, localOnly, stopProperty, includeStopProperty, deletedPaths, allErrors) -> None
Compute the relationship target paths for the relationship at
``relationshipPath`` into ``paths`` .
If ``localOnly`` is ``true`` then this will compose relationship
targets from local nodes only. If ``stopProperty`` is not ``None``
then this will stop composing relationship targets at ``stopProperty``
, including ``stopProperty`` iff ``includeStopProperty`` is ``true`` .
If not ``None`` , ``deletedPaths`` will be populated with target paths
whose deletion contributed to the computed result. ``allErrors`` will
contain any errors encountered while performing this operation.
Parameters
----------
relationshipPath : Path
paths : list[SdfPath]
localOnly : bool
stopProperty : Spec
includeStopProperty : bool
deletedPaths : list[SdfPath]
allErrors : list[PcpError]
"""
result["Cache"].ComputeAttributeConnectionPaths.func_doc = """ComputeAttributeConnectionPaths(attributePath, paths, localOnly, stopProperty, includeStopProperty, deletedPaths, allErrors) -> None
Compute the attribute connection paths for the attribute at
``attributePath`` into ``paths`` .
If ``localOnly`` is ``true`` then this will compose attribute
connections from local nodes only. If ``stopProperty`` is not ``None``
then this will stop composing attribute connections at
``stopProperty`` , including ``stopProperty`` iff
``includeStopProperty`` is ``true`` . If not ``None`` ,
``deletedPaths`` will be populated with connection paths whose
deletion contributed to the computed result. ``allErrors`` will
contain any errors encountered while performing this operation.
Parameters
----------
attributePath : Path
paths : list[SdfPath]
localOnly : bool
stopProperty : Spec
includeStopProperty : bool
deletedPaths : list[SdfPath]
allErrors : list[PcpError]
"""
result["Cache"].GetUsedLayers.func_doc = """GetUsedLayers() -> SdfLayerHandleSet
Returns set of all layers used by this cache.
"""
result["Cache"].GetUsedLayersRevision.func_doc = """GetUsedLayersRevision() -> int
Return a number that can be used to determine whether or not the set
of layers used by this cache may have changed or not.
For example, if one calls GetUsedLayers() and saves the
GetUsedLayersRevision() , and then later calls GetUsedLayersRevision()
again, if the number is unchanged, then GetUsedLayers() is guaranteed
to be unchanged as well.
"""
result["Cache"].FindAllLayerStacksUsingLayer.func_doc = """FindAllLayerStacksUsingLayer(layer) -> list[PcpLayerStackPtr]
Returns every computed & cached layer stack that includes ``layer`` .
Parameters
----------
layer : Layer
"""
result["Cache"].FindSiteDependencies.func_doc = """FindSiteDependencies(siteLayerStack, sitePath, depMask, recurseOnSite, recurseOnIndex, filterForExistingCachesOnly) -> list[PcpDependency]
Returns dependencies on the given site of scene description, as
discovered by the cached index computations.
depMask
specifies what classes of dependency to include; see
PcpDependencyFlags for details recurseOnSite
includes incoming dependencies on children of sitePath recurseOnIndex
extends the result to include all PcpCache child indexes below
discovered results filterForExistingCachesOnly
filters the results to only paths representing computed prim and
property index caches; otherwise a recursively-expanded result can
include un-computed paths that are expected to depend on the site
Parameters
----------
siteLayerStack : LayerStack
sitePath : Path
depMask : PcpDependencyFlags
recurseOnSite : bool
recurseOnIndex : bool
filterForExistingCachesOnly : bool
----------------------------------------------------------------------
FindSiteDependencies(siteLayer, sitePath, depMask, recurseOnSite, recurseOnIndex, filterForExistingCachesOnly) -> list[PcpDependency]
Returns dependencies on the given site of scene description, as
discovered by the cached index computations.
This method overload takes a site layer rather than a layer stack. It
will check every layer stack using that layer, and apply any relevant
sublayer offsets to the map functions in the returned
PcpDependencyVector.
See the other method for parameter details.
Parameters
----------
siteLayer : Layer
sitePath : Path
depMask : PcpDependencyFlags
recurseOnSite : bool
recurseOnIndex : bool
filterForExistingCachesOnly : bool
"""
result["Cache"].IsInvalidSublayerIdentifier.func_doc = """IsInvalidSublayerIdentifier(identifier) -> bool
Returns true if ``identifier`` was used as a sublayer path in a layer
stack but did not identify a valid layer.
This is functionally equivalent to examining the values in the vector
returned by GetInvalidSublayerIdentifiers, but more efficient.
Parameters
----------
identifier : str
"""
result["Cache"].IsInvalidAssetPath.func_doc = """IsInvalidAssetPath(resolvedAssetPath) -> bool
Returns true if ``resolvedAssetPath`` was used by a prim (e.g.
in a reference) but did not resolve to a valid asset. This is
functionally equivalent to examining the values in the map returned by
GetInvalidAssetPaths, but more efficient.
Parameters
----------
resolvedAssetPath : str
"""
result["Cache"].HasAnyDynamicFileFormatArgumentDependencies.func_doc = """HasAnyDynamicFileFormatArgumentDependencies() -> bool
Returns true if any prim index in this cache has a dependency on a
dynamic file format argument field.
"""
result["Cache"].IsPossibleDynamicFileFormatArgumentField.func_doc = """IsPossibleDynamicFileFormatArgumentField(field) -> bool
Returns true if the given ``field`` is the name of a field that was
composed while generating dynamic file format arguments for any prim
index in this cache.
Parameters
----------
field : str
"""
result["Cache"].GetDynamicFileFormatArgumentDependencyData.func_doc = """GetDynamicFileFormatArgumentDependencyData(primIndexPath) -> DynamicFileFormatDependencyData
Returns the dynamic file format dependency data object for the prim
index with the given ``primIndexPath`` .
This will return an empty dependency data if either there is no cache
prim index for the path or if the prim index has no dynamic file
formats that it depends on.
Parameters
----------
primIndexPath : Path
"""
result["Cache"].Reload.func_doc = """Reload(changes) -> None
Reload the layers of the layer stack, except session layers and
sublayers of session layers.
This will also try to load sublayers in this cache's layer stack that
could not be loaded previously. It will also try to load any
referenced or payloaded layer that could not be loaded previously.
Clients should subsequently ``Apply()`` ``changes`` to use any now-
valid layers.
Parameters
----------
changes : PcpChanges
"""
result["Cache"].PrintStatistics.func_doc = """PrintStatistics() -> None
Prints various statistics about the data stored in this cache.
"""
result["Cache"].__init__.func_doc = """__init__(arg1)
Parameters
----------
arg1 : Cache
----------------------------------------------------------------------
__init__(layerStackIdentifier, fileFormatTarget, usd)
Construct a PcpCache to compose results for the layer stack identified
by *layerStackIdentifier*.
If ``fileFormatTarget`` is given, Pcp will specify
``fileFormatTarget`` as the file format target when searching for or
opening a layer.
If ``usd`` is true, computation of prim indices and composition of
prim child names are performed without relocates, inherits,
permissions, symmetry, or payloads, and without populating the prim
stack and gathering its dependencies.
Parameters
----------
layerStackIdentifier : LayerStackIdentifier
fileFormatTarget : str
usd : bool
"""
result["Dependency"].__doc__ = """
Description of a dependency.
"""
result["DynamicFileFormatDependencyData"].__doc__ = """
Contains the necessary information for storing a prim index's
dependency on dynamic file format arguments and determining if a field
change affects the prim index. This data structure does not store the
prim index or its path itself and is expected to be the data in some
other data structure that maps prim indexes to its dependencies.
"""
result["DynamicFileFormatDependencyData"].IsEmpty.func_doc = """IsEmpty() -> bool
Returns whether this dependency data is empty.
"""
result["DynamicFileFormatDependencyData"].GetRelevantFieldNames.func_doc = """GetRelevantFieldNames() -> str.Set
Returns a list of field names that were composed for any of the
dependency contexts that were added to this dependency.
"""
result["DynamicFileFormatDependencyData"].CanFieldChangeAffectFileFormatArguments.func_doc = """CanFieldChangeAffectFileFormatArguments(fieldName, oldValue, newValue) -> bool
Given a ``field`` name and the changed field values in
``oldAndNewValues`` this return whether this change can affect any of
the file format arguments generated by any of the contexts stored in
this dependency.
Parameters
----------
fieldName : str
oldValue : VtValue
newValue : VtValue
"""
result["ErrorArcCycle"].__doc__ = """
Arcs between PcpNodes that form a cycle.
"""
result["ErrorArcPermissionDenied"].__doc__ = """
Arcs that were not made between PcpNodes because of permission
restrictions.
"""
result["ErrorBase"].__doc__ = """
Base class for all error types.
"""
result["ErrorCapacityExceeded"].__doc__ = """
Exceeded the capacity for composition arcs at a single site.
"""
result["ErrorInconsistentAttributeType"].__doc__ = """
Attributes that have specs with conflicting definitions.
"""
result["ErrorInconsistentAttributeVariability"].__doc__ = """
Attributes that have specs with conflicting variability.
"""
result["ErrorInconsistentPropertyType"].__doc__ = """
Properties that have specs with conflicting definitions.
"""
result["ErrorInvalidAssetPath"].__doc__ = """
Invalid asset paths used by references or payloads.
"""
result["ErrorInvalidAssetPathBase"].__doc__ = """"""
result["ErrorInvalidExternalTargetPath"].__doc__ = """
Invalid target or connection path in some scope that points to an
object outside of that scope.
"""
result["ErrorInvalidInstanceTargetPath"].__doc__ = """
Invalid target or connection path authored in an inherited class that
points to an instance of that class.
"""
result["ErrorInvalidPrimPath"].__doc__ = """
Invalid prim paths used by references or payloads.
"""
result["ErrorInvalidReferenceOffset"].__doc__ = """
References or payloads that use invalid layer offsets.
"""
result["ErrorInvalidSublayerOffset"].__doc__ = """
Sublayers that use invalid layer offsets.
"""
result["ErrorInvalidSublayerOwnership"].__doc__ = """
Sibling layers that have the same owner.
"""
result["ErrorInvalidSublayerPath"].__doc__ = """
Asset paths that could not be both resolved and loaded.
"""
result["ErrorInvalidTargetPath"].__doc__ = """
Invalid target or connection path.
"""
result["ErrorMutedAssetPath"].__doc__ = """
Muted asset paths used by references or payloads.
"""
result["ErrorOpinionAtRelocationSource"].__doc__ = """
Opinions were found at a relocation source path.
"""
result["ErrorPrimPermissionDenied"].__doc__ = """
Layers with illegal opinions about private prims.
"""
result["ErrorPropertyPermissionDenied"].__doc__ = """
Layers with illegal opinions about private properties.
"""
result["ErrorSublayerCycle"].__doc__ = """
Layers that recursively sublayer themselves.
"""
result["ErrorTargetPathBase"].__doc__ = """
Base class for composition errors related to target or connection
paths.
"""
result["ErrorTargetPermissionDenied"].__doc__ = """
Paths with illegal opinions about private targets.
"""
result["ErrorUnresolvedPrimPath"].__doc__ = """
Asset paths that could not be both resolved and loaded.
"""
result["InstanceKey"].__doc__ = """
A PcpInstanceKey identifies instanceable prim indexes that share the
same set of opinions. Instanceable prim indexes with equal instance
keys are guaranteed to have the same opinions for name children and
properties beneath those name children. They are NOT guaranteed to
have the same opinions for direct properties of the prim indexes
themselves.
"""
result["InstanceKey"].__init__.func_doc = """__init__()
----------------------------------------------------------------------
__init__(primIndex)
Create an instance key for the given prim index.
Parameters
----------
primIndex : PrimIndex
"""
result["LayerStack"].__doc__ = """
Represents a stack of layers that contribute opinions to composition.
Each PcpLayerStack is identified by a PcpLayerStackIdentifier. This
identifier contains all of the parameters needed to construct a layer
stack, such as the root layer, session layer, and path resolver
context.
PcpLayerStacks are constructed and managed by a
Pcp_LayerStackRegistry.
"""
result["LayerStackIdentifier"].__doc__ = """
Arguments used to identify a layer stack.
Objects of this type are immutable.
"""
result["LayerStackIdentifier"].__init__.func_doc = """__init__()
Construct with all empty pointers.
----------------------------------------------------------------------
__init__(rootLayer_, sessionLayer_, pathResolverContext_)
Construct with given pointers.
If all arguments are ``TfNullPtr`` then the result is identical to the
default constructed object.
Parameters
----------
rootLayer_ : Layer
sessionLayer_ : Layer
pathResolverContext_ : ResolverContext
"""
result["LayerStackSite"].__doc__ = """
A site specifies a path in a layer stack of scene description.
"""
result["MapExpression"].__doc__ = """
An expression that yields a PcpMapFunction value.
Expressions comprise constant values, variables, and operators applied
to sub-expressions. Expressions cache their computed values
internally. Assigning a new value to a variable automatically
invalidates the cached values of dependent expressions. Common
(sub-)expressions are automatically detected and shared.
PcpMapExpression exists solely to support efficient incremental
handling of relocates edits. It represents a tree of the namespace
mapping operations and their inputs, so we can narrowly redo the
computation when one of the inputs changes.
"""
result["MapExpression"].Compose.func_doc = """Compose(f) -> MapExpression
Create a new PcpMapExpression representing the application of f's
value, followed by the application of this expression's value.
Parameters
----------
f : MapExpression
"""
result["MapExpression"].Inverse.func_doc = """Inverse() -> MapExpression
Create a new PcpMapExpression representing the inverse of f.
"""
result["MapExpression"].AddRootIdentity.func_doc = """AddRootIdentity() -> MapExpression
Return a new expression representing this expression with an added (if
necessary) mapping from</>to</>.
"""
result["MapExpression"].Identity.func_doc = """**classmethod** Identity() -> MapExpression
Return an expression representing PcpMapFunction::Identity() .
"""
result["MapExpression"].Constant.func_doc = """**classmethod** Constant(constValue) -> MapExpression
Create a new constant.
Parameters
----------
constValue : Value
"""
result["MapExpression"].MapSourceToTarget.func_doc = """MapSourceToTarget(path) -> Path
Map a path in the source namespace to the target.
If the path is not in the domain, returns an empty path.
Parameters
----------
path : Path
"""
result["MapExpression"].MapTargetToSource.func_doc = """MapTargetToSource(path) -> Path
Map a path in the target namespace to the source.
If the path is not in the co-domain, returns an empty path.
Parameters
----------
path : Path
"""
result["MapExpression"].Evaluate.func_doc = """Evaluate() -> Value
Evaluate this expression, yielding a PcpMapFunction value.
The computed result is cached. The return value is a reference to the
internal cached value. The cache is automatically invalidated as
needed.
"""
result["MapExpression"].__init__.func_doc = """__init__()
Default-construct a None expression.
----------------------------------------------------------------------
__init__(node)
Parameters
----------
node : _Node
"""
result["MapFunction"].__doc__ = """
A function that maps values from one namespace (and time domain) to
another. It represents the transformation that an arc such as a
reference arc applies as it incorporates values across the arc.
Take the example of a reference arc, where a source path</Model>is
referenced as a target path,</Model_1>. The source path</Model>is the
source of the opinions; the target path</Model_1>is where they are
incorporated in the scene. Values in the model that refer to paths
relative to</Model>must be transformed to be relative
to</Model_1>instead. The PcpMapFunction for the arc provides this
service.
Map functions have a specific *domain*, or set of values they can
operate on. Any values outside the domain cannot be mapped. The domain
precisely tracks what areas of namespace can be referred to across
various forms of arcs.
Map functions can be chained to represent a series of map operations
applied in sequence. The map function represent the cumulative effect
as efficiently as possible. For example, in the case of a chained
reference from</Model>to</Model>to</Model>to</Model_1>, this is
effectively the same as a mapping directly from</Model>to</Model_1>.
Representing the cumulative effect of arcs in this way is important
for handling larger scenes efficiently.
Map functions can be *inverted*. Formally, map functions are
bijections (one-to-one and onto), which ensures that they can be
inverted. Put differently, no information is lost by applying a map
function to set of values within its domain; they retain their
distinct identities and can always be mapped back.
One analogy that may or may not be helpful: In the same way a
geometric transform maps a model's points in its rest space into the
world coordinates for a particular instance, a PcpMapFunction maps
values about a referenced model into the composed scene for a
particular instance of that model. But rather than translating and
rotating points, the map function shifts the values in namespace (and
time).
"""
result["MapFunction"].__init__.func_doc = """__init__()
Construct a null function.
----------------------------------------------------------------------
__init__(sourceToTargetBegin, sourceToTargetEnd, offset, hasRootIdentity)
Parameters
----------
sourceToTargetBegin : PathPair
sourceToTargetEnd : PathPair
offset : LayerOffset
hasRootIdentity : bool
"""
result["MapFunction"].MapSourceToTarget.func_doc = """MapSourceToTarget(path) -> Path
Map a path in the source namespace to the target.
If the path is not in the domain, returns an empty path.
Parameters
----------
path : Path
"""
result["MapFunction"].MapTargetToSource.func_doc = """MapTargetToSource(path) -> Path
Map a path in the target namespace to the source.
If the path is not in the co-domain, returns an empty path.
Parameters
----------
path : Path
"""
result["MapFunction"].Compose.func_doc = """Compose(f) -> MapFunction
Compose this map over the given map function.
The result will represent the application of f followed by the
application of this function.
Parameters
----------
f : MapFunction
"""
result["MapFunction"].ComposeOffset.func_doc = """ComposeOffset(newOffset) -> MapFunction
Compose this map function over a hypothetical map function that has an
identity path mapping and ``offset`` .
This is equivalent to building such a map function and invoking
Compose() , but is faster.
Parameters
----------
newOffset : LayerOffset
"""
result["MapFunction"].GetInverse.func_doc = """GetInverse() -> MapFunction
Return the inverse of this map function.
This returns a true inverse ``inv:`` for any path p in this function's
domain that it maps to p', inv(p') ->p.
"""
result["MapFunction"].Identity.func_doc = """**classmethod** Identity() -> MapFunction
Construct an identity map function.
"""
result["MapFunction"].IdentityPathMap.func_doc = """**classmethod** IdentityPathMap() -> PathMap
Returns an identity path mapping.
"""
result["NodeRef"].__doc__ = """
PcpNode represents a node in an expression tree for compositing scene
description.
A node represents the opinions from a particular site. In addition, it
may have child nodes, representing nested expressions that are
composited over/under this node.
Child nodes are stored and composited in strength order.
Each node holds information about the arc to its parent. This captures
both the relative strength of the sub-expression as well as any value-
mapping needed, such as to rename opinions from a model to use in a
particular instance.
"""
result["NodeRef"].GetOriginRootNode.func_doc = """GetOriginRootNode() -> NodeRef
Walk up to the root origin node for this node.
This is the very first node that caused this node to be added to the
graph. For instance, the root origin node of an implied inherit is the
original inherit node.
"""
result["NodeRef"].GetRootNode.func_doc = """GetRootNode() -> NodeRef
Walk up to the root node of this expression.
"""
result["NodeRef"].GetDepthBelowIntroduction.func_doc = """GetDepthBelowIntroduction() -> int
Return the number of levels of namespace this node's site is below the
level at which it was introduced by an arc.
"""
result["NodeRef"].GetPathAtIntroduction.func_doc = """GetPathAtIntroduction() -> Path
Returns the path for this node's site when it was introduced.
"""
result["NodeRef"].GetIntroPath.func_doc = """GetIntroPath() -> Path
Get the path that introduced this node.
Specifically, this is the path the parent node had at the level of
namespace where this node was added as a child. For a root node, this
returns the absolute root path. See also GetDepthBelowIntroduction() .
"""
result["NodeRef"].IsRootNode.func_doc = """IsRootNode() -> bool
Returns true if this node is the root node of the prim index graph.
"""
result["NodeRef"].IsDueToAncestor.func_doc = """IsDueToAncestor() -> bool
"""
result["NodeRef"].CanContributeSpecs.func_doc = """CanContributeSpecs() -> bool
Returns true if this node is allowed to contribute opinions for
composition, false otherwise.
"""
result["PrimIndex"].__doc__ = """
PcpPrimIndex is an index of the all sites of scene description that
contribute opinions to a specific prim, under composition semantics.
PcpComputePrimIndex() builds an index ("indexes") the given prim site.
At any site there may be scene description values expressing arcs that
represent instructions to pull in further scene description.
PcpComputePrimIndex() recursively follows these arcs, building and
ordering the results.
"""
result["PrimIndex"].GetNodeProvidingSpec.func_doc = """GetNodeProvidingSpec(primSpec) -> NodeRef
Returns the node that brings opinions from ``primSpec`` into this prim
index.
If no such node exists, returns an invalid PcpNodeRef.
Parameters
----------
primSpec : PrimSpec
----------------------------------------------------------------------
GetNodeProvidingSpec(layer, path) -> NodeRef
Returns the node that brings opinions from the Sd prim spec at
``layer`` and ``path`` into this prim index.
If no such node exists, returns an invalid PcpNodeRef.
Parameters
----------
layer : Layer
path : Path
"""
result["PrimIndex"].PrintStatistics.func_doc = """PrintStatistics() -> None
Prints various statistics about this prim index.
"""
result["PrimIndex"].DumpToString.func_doc = """DumpToString(includeInheritOriginInfo, includeMaps) -> str
Dump the prim index contents to a string.
If ``includeInheritOriginInfo`` is ``true`` , output for implied
inherit nodes will include information about the originating inherit
node. If ``includeMaps`` is ``true`` , output for each node will
include the mappings to the parent and root node.
Parameters
----------
includeInheritOriginInfo : bool
includeMaps : bool
"""
result["PrimIndex"].DumpToDotGraph.func_doc = """DumpToDotGraph(filename, includeInheritOriginInfo, includeMaps) -> None
Dump the prim index in dot format to the file named ``filename`` .
See Dump(\\.\\.\\.) for information regarding arguments.
Parameters
----------
filename : str
includeInheritOriginInfo : bool
includeMaps : bool
"""
result["PrimIndex"].ComputePrimChildNames.func_doc = """ComputePrimChildNames(nameOrder, prohibitedNameSet) -> None
Compute the prim child names for the given path.
``errors`` will contain any errors encountered while performing this
operation.
Parameters
----------
nameOrder : list[TfToken]
prohibitedNameSet : PcpTokenSet
"""
result["PrimIndex"].ComputePrimPropertyNames.func_doc = """ComputePrimPropertyNames(nameOrder) -> None
Compute the prim property names for the given path.
``errors`` will contain any errors encountered while performing this
operation. The ``nameOrder`` vector must not contain any duplicate
entries.
Parameters
----------
nameOrder : list[TfToken]
"""
result["PrimIndex"].ComposeAuthoredVariantSelections.func_doc = """ComposeAuthoredVariantSelections() -> SdfVariantSelectionMap
Compose the authored prim variant selections.
These are the variant selections expressed in scene description. Note
that these selections may not have actually been applied, if they are
invalid.
This result is not cached, but computed each time.
"""
result["PrimIndex"].GetSelectionAppliedForVariantSet.func_doc = """GetSelectionAppliedForVariantSet(variantSet) -> str
Return the variant selection applied for the named variant set.
If none was applied, this returns an empty string. This can be
different from the authored variant selection; for example, if the
authored selection is invalid.
Parameters
----------
variantSet : str
"""
result["PrimIndex"].IsValid.func_doc = """IsValid() -> bool
Return true if this index is valid.
A default-constructed index is invalid.
"""
result["PrimIndex"].IsInstanceable.func_doc = """IsInstanceable() -> bool
Returns true if this prim index is instanceable.
Instanceable prim indexes with the same instance key are guaranteed to
have the same set of opinions, but may not have local opinions about
name children.
PcpInstanceKey
"""
result["PropertyIndex"].__doc__ = """
PcpPropertyIndex is an index of all sites in scene description that
contribute opinions to a specific property, under composition
semantics.
"""
result["Site"].__doc__ = """
A site specifies a path in a layer stack of scene description.
"""
result["Cache"].layerStack = property(result["Cache"].layerStack.fget, result["Cache"].layerStack.fset, result["Cache"].layerStack.fdel, """type : LayerStack
Get the layer stack for GetLayerStackIdentifier() .
Note that this will neither compute the layer stack nor report errors.
So if the layer stack has not been computed yet this will return
``None`` . Use ComputeLayerStack() if you need to compute the layer
stack if it hasn't been computed already and/or get errors caused by
computing the layer stack.
""")
result["Cache"].fileFormatTarget = property(result["Cache"].fileFormatTarget.fget, result["Cache"].fileFormatTarget.fset, result["Cache"].fileFormatTarget.fdel, """type : str
Returns the file format target this cache is configured for.
""")
result["LayerStack"].identifier = property(result["LayerStack"].identifier.fget, result["LayerStack"].identifier.fset, result["LayerStack"].identifier.fdel, """type : LayerStackIdentifier
Returns the identifier for this layer stack.
""")
result["LayerStack"].layers = property(result["LayerStack"].layers.fget, result["LayerStack"].layers.fset, result["LayerStack"].layers.fdel, """type : list[SdfLayerRefPtr]
Returns the layers in this layer stack in strong-to-weak order.
Note that this is only the *local* layer stack it does not include
any layers brought in by references inside prims.
""")
result["LayerStack"].layerTree = property(result["LayerStack"].layerTree.fget, result["LayerStack"].layerTree.fset, result["LayerStack"].layerTree.fdel, """type : LayerTree
Returns the layer tree representing the structure of this layer stack.
""")
result["LayerStack"].mutedLayers = property(result["LayerStack"].mutedLayers.fget, result["LayerStack"].mutedLayers.fset, result["LayerStack"].mutedLayers.fdel, """type : set[str]
Returns the set of layers that were muted in this layer stack.
""")
result["LayerStack"].localErrors = property(result["LayerStack"].localErrors.fget, result["LayerStack"].localErrors.fset, result["LayerStack"].localErrors.fdel, """type : list[PcpError]
Return the list of errors local to this layer stack.
""")
result["LayerStack"].relocatesSourceToTarget = property(result["LayerStack"].relocatesSourceToTarget.fget, result["LayerStack"].relocatesSourceToTarget.fset, result["LayerStack"].relocatesSourceToTarget.fdel, """type : SdfRelocatesMap
Returns relocation source-to-target mapping for this layer stack.
This map combines the individual relocation entries found across all
layers in this layer stack; multiple entries that affect a single prim
will be combined into a single entry. For instance, if this layer
stack contains relocations { /A: /B} and { /A/C: /A/D}, this map will
contain { /A: /B} and { /B/C: /B/D}. This allows consumers to go from
unrelocated namespace to relocated namespace in a single step.
""")
result["LayerStack"].relocatesTargetToSource = property(result["LayerStack"].relocatesTargetToSource.fget, result["LayerStack"].relocatesTargetToSource.fset, result["LayerStack"].relocatesTargetToSource.fdel, """type : SdfRelocatesMap
Returns relocation target-to-source mapping for this layer stack.
See GetRelocatesSourceToTarget for more details.
""")
result["LayerStack"].incrementalRelocatesSourceToTarget = property(result["LayerStack"].incrementalRelocatesSourceToTarget.fget, result["LayerStack"].incrementalRelocatesSourceToTarget.fset, result["LayerStack"].incrementalRelocatesSourceToTarget.fdel, """type : SdfRelocatesMap
Returns incremental relocation source-to-target mapping for this layer
stack.
This map contains the individual relocation entries found across all
layers in this layer stack; it does not combine ancestral entries with
descendant entries. For instance, if this layer stack contains
relocations { /A: /B} and { /A/C: /A/D}, this map will contain { /A:
/B} and { /A/C: /A/D}.
""")
result["LayerStack"].incrementalRelocatesTargetToSource = property(result["LayerStack"].incrementalRelocatesTargetToSource.fget, result["LayerStack"].incrementalRelocatesTargetToSource.fset, result["LayerStack"].incrementalRelocatesTargetToSource.fdel, """type : SdfRelocatesMap
Returns incremental relocation target-to-source mapping for this layer
stack.
See GetIncrementalRelocatesTargetToSource for more details.
""")
result["LayerStack"].pathsToPrimsWithRelocates = property(result["LayerStack"].pathsToPrimsWithRelocates.fget, result["LayerStack"].pathsToPrimsWithRelocates.fset, result["LayerStack"].pathsToPrimsWithRelocates.fdel, """type : list[SdfPath]
Returns a list of paths to all prims across all layers in this layer
stack that contained relocates.
""")
result["MapExpression"].isIdentity = property(result["MapExpression"].isIdentity.fget, result["MapExpression"].isIdentity.fset, result["MapExpression"].isIdentity.fdel, """type : bool
Return true if the evaluated map function is the identity function.
For identity, MapSourceToTarget() always returns the path unchanged.
""")
result["MapExpression"].timeOffset = property(result["MapExpression"].timeOffset.fget, result["MapExpression"].timeOffset.fset, result["MapExpression"].timeOffset.fdel, """type : LayerOffset
The time offset of the mapping.
""")
result["MapExpression"].isNull = property(result["MapExpression"].isNull.fget, result["MapExpression"].isNull.fset, result["MapExpression"].isNull.fdel, """type : bool
Return true if this is a null expression.
""")
result["MapFunction"].isNull = property(result["MapFunction"].isNull.fget, result["MapFunction"].isNull.fset, result["MapFunction"].isNull.fdel, """type : bool
Return true if this map function is the null function.
For a null function, MapSourceToTarget() always returns an empty path.
""")
result["MapFunction"].isIdentity = property(result["MapFunction"].isIdentity.fget, result["MapFunction"].isIdentity.fset, result["MapFunction"].isIdentity.fdel, """type : bool
Return true if the map function is the identity function.
The identity function has an identity path mapping and time offset.
""")
result["MapFunction"].isIdentityPathMapping = property(result["MapFunction"].isIdentityPathMapping.fget, result["MapFunction"].isIdentityPathMapping.fset, result["MapFunction"].isIdentityPathMapping.fdel, """type : bool
Return true if the map function uses the identity path mapping.
If true, MapSourceToTarget() always returns the path unchanged.
However, this map function may have a non-identity time offset.
""")
result["MapFunction"].sourceToTargetMap = property(result["MapFunction"].sourceToTargetMap.fget, result["MapFunction"].sourceToTargetMap.fset, result["MapFunction"].sourceToTargetMap.fdel, """type : PathMap
The set of path mappings, from source to target.
""")
result["MapFunction"].timeOffset = property(result["MapFunction"].timeOffset.fget, result["MapFunction"].timeOffset.fset, result["MapFunction"].timeOffset.fdel, """type : LayerOffset
The time offset of the mapping.
""")
result["NodeRef"].arcType = property(result["NodeRef"].arcType.fget, result["NodeRef"].arcType.fset, result["NodeRef"].arcType.fdel, """type : ArcType
Returns the type of arc connecting this node to its parent node.
""")
result["NodeRef"].mapToParent = property(result["NodeRef"].mapToParent.fget, result["NodeRef"].mapToParent.fset, result["NodeRef"].mapToParent.fdel, """type : MapExpression
Returns mapping function used to translate paths and values from this
node to its parent node.
""")
result["NodeRef"].mapToRoot = property(result["NodeRef"].mapToRoot.fget, result["NodeRef"].mapToRoot.fset, result["NodeRef"].mapToRoot.fdel, """type : MapExpression
Returns mapping function used to translate paths and values from this
node directly to the root node.
""")
result["NodeRef"].siblingNumAtOrigin = property(result["NodeRef"].siblingNumAtOrigin.fget, result["NodeRef"].siblingNumAtOrigin.fset, result["NodeRef"].siblingNumAtOrigin.fdel, """type : int
Returns this node's index among siblings with the same arc type at
this node's origin.
""")
result["NodeRef"].namespaceDepth = property(result["NodeRef"].namespaceDepth.fget, result["NodeRef"].namespaceDepth.fset, result["NodeRef"].namespaceDepth.fdel, """type : int
Returns the absolute namespace depth of the node that introduced this
node.
Note that this does *not* count any variant selections.
""")
result["NodeRef"].site = property(result["NodeRef"].site.fget, result["NodeRef"].site.fset, result["NodeRef"].site.fdel, """type : LayerStackSite
Get the site this node represents.
""")
result["NodeRef"].path = property(result["NodeRef"].path.fget, result["NodeRef"].path.fset, result["NodeRef"].path.fdel, """type : Path
Returns the path for the site this node represents.
""")
result["NodeRef"].layerStack = property(result["NodeRef"].layerStack.fget, result["NodeRef"].layerStack.fset, result["NodeRef"].layerStack.fdel, """type : LayerStack
Returns the layer stack for the site this node represents.
""")
result["NodeRef"].hasSymmetry = property(result["NodeRef"].hasSymmetry.fget, result["NodeRef"].hasSymmetry.fset, result["NodeRef"].hasSymmetry.fdel, """type : None
Get/set whether this node provides any symmetry opinions, either
directly or from a namespace ancestor.
""")
result["NodeRef"].permission = property(result["NodeRef"].permission.fget, result["NodeRef"].permission.fset, result["NodeRef"].permission.fdel, """type : Permission
----------------------------------------------------------------------
type : None
Get/set the permission for this node.
This indicates whether specs on this node can be accessed from other
nodes.
""")
result["NodeRef"].isInert = property(result["NodeRef"].isInert.fget, result["NodeRef"].isInert.fset, result["NodeRef"].isInert.fdel, """type : bool
""")
result["NodeRef"].isCulled = property(result["NodeRef"].isCulled.fget, result["NodeRef"].isCulled.fset, result["NodeRef"].isCulled.fdel, """type : bool
""")
result["NodeRef"].isRestricted = property(result["NodeRef"].isRestricted.fget, result["NodeRef"].isRestricted.fset, result["NodeRef"].isRestricted.fdel, """type : bool
""")
result["NodeRef"].hasSpecs = property(result["NodeRef"].hasSpecs.fget, result["NodeRef"].hasSpecs.fset, result["NodeRef"].hasSpecs.fdel, """type : None
Returns true if this node has opinions authored for composition, false
otherwise.
""")
result["PrimIndex"].localErrors = property(result["PrimIndex"].localErrors.fget, result["PrimIndex"].localErrors.fset, result["PrimIndex"].localErrors.fdel, """type : list[PcpError]
Return the list of errors local to this prim.
""")
result["PrimIndex"].rootNode = property(result["PrimIndex"].rootNode.fget, result["PrimIndex"].rootNode.fset, result["PrimIndex"].rootNode.fdel, """type : NodeRef
Returns the root node of the prim index graph.
""")
result["PropertyIndex"].localErrors = property(result["PropertyIndex"].localErrors.fget, result["PropertyIndex"].localErrors.fset, result["PropertyIndex"].localErrors.fdel, """type : list[PcpError]
Return the list of errors local to this property.
""") | 46,707 | Python | 25.78211 | 281 | 0.738861 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Pcp/__init__.pyi | from __future__ import annotations
import pxr.Pcp._pcp
import typing
import Boost.Python
import pxr.Pcp
import pxr.Tf
__all__ = [
"ArcType",
"ArcTypeInherit",
"ArcTypePayload",
"ArcTypeReference",
"ArcTypeRelocate",
"ArcTypeRoot",
"ArcTypeSpecialize",
"ArcTypeVariant",
"Cache",
"Dependency",
"DependencyType",
"DependencyTypeAncestral",
"DependencyTypeAnyIncludingVirtual",
"DependencyTypeAnyNonVirtual",
"DependencyTypeDirect",
"DependencyTypeNonVirtual",
"DependencyTypeNone",
"DependencyTypePartlyDirect",
"DependencyTypePurelyDirect",
"DependencyTypeRoot",
"DependencyTypeVirtual",
"DynamicFileFormatDependencyData",
"ErrorArcCycle",
"ErrorArcPermissionDenied",
"ErrorBase",
"ErrorCapacityExceeded",
"ErrorInconsistentAttributeType",
"ErrorInconsistentAttributeVariability",
"ErrorInconsistentPropertyType",
"ErrorInvalidAssetPath",
"ErrorInvalidAssetPathBase",
"ErrorInvalidExternalTargetPath",
"ErrorInvalidInstanceTargetPath",
"ErrorInvalidPrimPath",
"ErrorInvalidReferenceOffset",
"ErrorInvalidSublayerOffset",
"ErrorInvalidSublayerOwnership",
"ErrorInvalidSublayerPath",
"ErrorInvalidTargetPath",
"ErrorMutedAssetPath",
"ErrorOpinionAtRelocationSource",
"ErrorPrimPermissionDenied",
"ErrorPropertyPermissionDenied",
"ErrorSublayerCycle",
"ErrorTargetPathBase",
"ErrorTargetPermissionDenied",
"ErrorType",
"ErrorType_ArcCapacityExceeded",
"ErrorType_ArcCycle",
"ErrorType_ArcNamespaceDepthCapacityExceeded",
"ErrorType_ArcPermissionDenied",
"ErrorType_InconsistentAttributeType",
"ErrorType_InconsistentAttributeVariability",
"ErrorType_InconsistentPropertyType",
"ErrorType_IndexCapacityExceeded",
"ErrorType_InternalAssetPath",
"ErrorType_InvalidAssetPath",
"ErrorType_InvalidExternalTargetPath",
"ErrorType_InvalidInstanceTargetPath",
"ErrorType_InvalidPrimPath",
"ErrorType_InvalidReferenceOffset",
"ErrorType_InvalidSublayerOffset",
"ErrorType_InvalidSublayerOwnership",
"ErrorType_InvalidSublayerPath",
"ErrorType_InvalidTargetPath",
"ErrorType_InvalidVariantSelection",
"ErrorType_OpinionAtRelocationSource",
"ErrorType_PrimPermissionDenied",
"ErrorType_PropertyPermissionDenied",
"ErrorType_SublayerCycle",
"ErrorType_TargetPermissionDenied",
"ErrorType_UnresolvedPrimPath",
"ErrorUnresolvedPrimPath",
"InstanceKey",
"LayerStack",
"LayerStackIdentifier",
"LayerStackSite",
"MapExpression",
"MapFunction",
"NodeRef",
"PrimIndex",
"PropertyIndex",
"Site",
"TranslatePathFromNodeToRoot",
"TranslatePathFromRootToNode"
]
class ArcType(pxr.Tf.Tf_PyEnumWrapper, pxr.Tf.Enum, Boost.Python.instance):
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = ''
allValues: tuple # value = (Pcp.ArcTypeRoot, Pcp.ArcTypeInherit, Pcp.ArcTypeRelocate, Pcp.ArcTypeVariant, Pcp.ArcTypeReference, Pcp.ArcTypePayload, Pcp.ArcTypeSpecialize)
pass
class Cache(Boost.Python.instance):
"""
PcpCache is the context required to make requests of the Pcp
composition algorithm and cache the results.
Because the algorithms are recursive making a request typically makes
other internal requests to solve subproblems caching subproblem
results is required for reasonable performance, and so this cache is
the only entrypoint to the algorithms.
There is a set of parameters that affect the composition results:
- variant fallbacks: per named variant set, an ordered list of
fallback values to use when composing a prim that defines a variant
set but does not specify a selection
- payload inclusion set: an SdfPath set used to identify which
prims should have their payloads included during composition; this is
the basis for explicit control over the"working set"of composition
- file format target: the file format target that Pcp will request
when opening scene description layers
- "USD mode"configures the Pcp composition algorithm to provide
only a custom, lighter subset of the full feature set, as needed by
the Universal Scene Description system
There are a number of different computations that can be requested.
These include computing a layer stack from a PcpLayerStackIdentifier,
computing a prim index or prim stack, and computing a property index.
"""
@staticmethod
def ComputeAttributeConnectionPaths(attributePath, paths, localOnly, stopProperty, includeStopProperty, deletedPaths, allErrors) -> None:
"""
ComputeAttributeConnectionPaths(attributePath, paths, localOnly, stopProperty, includeStopProperty, deletedPaths, allErrors) -> None
Compute the attribute connection paths for the attribute at
``attributePath`` into ``paths`` .
If ``localOnly`` is ``true`` then this will compose attribute
connections from local nodes only. If ``stopProperty`` is not ``None``
then this will stop composing attribute connections at
``stopProperty`` , including ``stopProperty`` iff
``includeStopProperty`` is ``true`` . If not ``None`` ,
``deletedPaths`` will be populated with connection paths whose
deletion contributed to the computed result. ``allErrors`` will
contain any errors encountered while performing this operation.
Parameters
----------
attributePath : Path
paths : list[SdfPath]
localOnly : bool
stopProperty : Spec
includeStopProperty : bool
deletedPaths : list[SdfPath]
allErrors : list[PcpError]
"""
@staticmethod
def ComputeLayerStack(identifier, allErrors) -> LayerStack:
"""
ComputeLayerStack(identifier, allErrors) -> LayerStack
Returns the layer stack for ``identifier`` if it exists, otherwise
creates a new layer stack for ``identifier`` .
This returns ``None`` if ``identifier`` is invalid (i.e. its root
layer is ``None`` ). ``allErrors`` will contain any errors encountered
while creating a new layer stack. It'll be unchanged if the layer
stack already existed.
Parameters
----------
identifier : LayerStackIdentifier
allErrors : list[PcpError]
"""
@staticmethod
def ComputePrimIndex(primPath, allErrors) -> PrimIndex:
"""
ComputePrimIndex(primPath, allErrors) -> PrimIndex
Compute and return a reference to the cached result for the prim index
for the given path.
``allErrors`` will contain any errors encountered while performing
this operation.
Parameters
----------
primPath : Path
allErrors : list[PcpError]
"""
@staticmethod
def ComputePropertyIndex(propPath, allErrors) -> PropertyIndex:
"""
ComputePropertyIndex(propPath, allErrors) -> PropertyIndex
Compute and return a reference to the cached result for the property
index for the given path.
``allErrors`` will contain any errors encountered while performing
this operation.
Parameters
----------
propPath : Path
allErrors : list[PcpError]
"""
@staticmethod
def ComputeRelationshipTargetPaths(relationshipPath, paths, localOnly, stopProperty, includeStopProperty, deletedPaths, allErrors) -> None:
"""
ComputeRelationshipTargetPaths(relationshipPath, paths, localOnly, stopProperty, includeStopProperty, deletedPaths, allErrors) -> None
Compute the relationship target paths for the relationship at
``relationshipPath`` into ``paths`` .
If ``localOnly`` is ``true`` then this will compose relationship
targets from local nodes only. If ``stopProperty`` is not ``None``
then this will stop composing relationship targets at ``stopProperty``
, including ``stopProperty`` iff ``includeStopProperty`` is ``true`` .
If not ``None`` , ``deletedPaths`` will be populated with target paths
whose deletion contributed to the computed result. ``allErrors`` will
contain any errors encountered while performing this operation.
Parameters
----------
relationshipPath : Path
paths : list[SdfPath]
localOnly : bool
stopProperty : Spec
includeStopProperty : bool
deletedPaths : list[SdfPath]
allErrors : list[PcpError]
"""
@staticmethod
def FindAllLayerStacksUsingLayer(layer) -> list[PcpLayerStackPtr]:
"""
FindAllLayerStacksUsingLayer(layer) -> list[PcpLayerStackPtr]
Returns every computed & cached layer stack that includes ``layer`` .
Parameters
----------
layer : Layer
"""
@staticmethod
def FindPrimIndex(primPath) -> PrimIndex:
"""
FindPrimIndex(primPath) -> PrimIndex
Returns a pointer to the cached computed prim index for the given
path, or None if it has not been computed.
Parameters
----------
primPath : Path
"""
@staticmethod
def FindPropertyIndex(propPath) -> PropertyIndex:
"""
FindPropertyIndex(propPath) -> PropertyIndex
Returns a pointer to the cached computed property index for the given
path, or None if it has not been computed.
Parameters
----------
propPath : Path
"""
@staticmethod
@typing.overload
def FindSiteDependencies(siteLayerStack, sitePath, depMask, recurseOnSite, recurseOnIndex, filterForExistingCachesOnly) -> list[PcpDependency]:
"""
FindSiteDependencies(siteLayerStack, sitePath, depMask, recurseOnSite, recurseOnIndex, filterForExistingCachesOnly) -> list[PcpDependency]
Returns dependencies on the given site of scene description, as
discovered by the cached index computations.
depMask
specifies what classes of dependency to include; see
PcpDependencyFlags for details recurseOnSite
includes incoming dependencies on children of sitePath recurseOnIndex
extends the result to include all PcpCache child indexes below
discovered results filterForExistingCachesOnly
filters the results to only paths representing computed prim and
property index caches; otherwise a recursively-expanded result can
include un-computed paths that are expected to depend on the site
Parameters
----------
siteLayerStack : LayerStack
sitePath : Path
depMask : PcpDependencyFlags
recurseOnSite : bool
recurseOnIndex : bool
filterForExistingCachesOnly : bool
----------------------------------------------------------------------
Returns dependencies on the given site of scene description, as
discovered by the cached index computations.
This method overload takes a site layer rather than a layer stack. It
will check every layer stack using that layer, and apply any relevant
sublayer offsets to the map functions in the returned
PcpDependencyVector.
See the other method for parameter details.
Parameters
----------
siteLayer : Layer
sitePath : Path
depMask : PcpDependencyFlags
recurseOnSite : bool
recurseOnIndex : bool
filterForExistingCachesOnly : bool
"""
@staticmethod
@typing.overload
def FindSiteDependencies(siteLayer, sitePath, depMask, recurseOnSite, recurseOnIndex, filterForExistingCachesOnly) -> list[PcpDependency]: ...
@staticmethod
def GetDynamicFileFormatArgumentDependencyData(primIndexPath) -> DynamicFileFormatDependencyData:
"""
GetDynamicFileFormatArgumentDependencyData(primIndexPath) -> DynamicFileFormatDependencyData
Returns the dynamic file format dependency data object for the prim
index with the given ``primIndexPath`` .
This will return an empty dependency data if either there is no cache
prim index for the path or if the prim index has no dynamic file
formats that it depends on.
Parameters
----------
primIndexPath : Path
"""
@staticmethod
def GetLayerStackIdentifier() -> LayerStackIdentifier:
"""
GetLayerStackIdentifier() -> LayerStackIdentifier
Get the identifier of the layerStack used for composition.
"""
@staticmethod
def GetMutedLayers() -> list[str]:
"""
GetMutedLayers() -> list[str]
Returns the list of canonical identifiers for muted layers in this
cache.
See documentation on RequestLayerMuting for more details.
"""
@staticmethod
def GetUsedLayers() -> SdfLayerHandleSet:
"""
GetUsedLayers() -> SdfLayerHandleSet
Returns set of all layers used by this cache.
"""
@staticmethod
def GetUsedLayersRevision() -> int:
"""
GetUsedLayersRevision() -> int
Return a number that can be used to determine whether or not the set
of layers used by this cache may have changed or not.
For example, if one calls GetUsedLayers() and saves the
GetUsedLayersRevision() , and then later calls GetUsedLayersRevision()
again, if the number is unchanged, then GetUsedLayers() is guaranteed
to be unchanged as well.
"""
@staticmethod
def GetVariantFallbacks() -> PcpVariantFallbackMap:
"""
GetVariantFallbacks() -> PcpVariantFallbackMap
Get the list of fallbacks to attempt to use when evaluating variant
sets that lack an authored selection.
"""
@staticmethod
def HasAnyDynamicFileFormatArgumentDependencies() -> bool:
"""
HasAnyDynamicFileFormatArgumentDependencies() -> bool
Returns true if any prim index in this cache has a dependency on a
dynamic file format argument field.
"""
@staticmethod
def HasRootLayerStack(layerStack) -> bool:
"""
HasRootLayerStack(layerStack) -> bool
Return true if this cache's root layer stack is ``layerStack`` , false
otherwise.
This is functionally equivalent to comparing against the result of
GetLayerStack() , but does not require constructing a TfWeakPtr or any
refcount operations.
Parameters
----------
layerStack : LayerStack
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
layerStack : LayerStack
"""
@staticmethod
def IsInvalidAssetPath(resolvedAssetPath) -> bool:
"""
IsInvalidAssetPath(resolvedAssetPath) -> bool
Returns true if ``resolvedAssetPath`` was used by a prim (e.g.
in a reference) but did not resolve to a valid asset. This is
functionally equivalent to examining the values in the map returned by
GetInvalidAssetPaths, but more efficient.
Parameters
----------
resolvedAssetPath : str
"""
@staticmethod
def IsInvalidSublayerIdentifier(identifier) -> bool:
"""
IsInvalidSublayerIdentifier(identifier) -> bool
Returns true if ``identifier`` was used as a sublayer path in a layer
stack but did not identify a valid layer.
This is functionally equivalent to examining the values in the vector
returned by GetInvalidSublayerIdentifiers, but more efficient.
Parameters
----------
identifier : str
"""
@staticmethod
@typing.overload
def IsLayerMuted(layerIdentifier) -> bool:
"""
IsLayerMuted(layerIdentifier) -> bool
Returns true if the layer specified by ``layerIdentifier`` is muted in
this cache, false otherwise.
If ``layerIdentifier`` is relative, it is assumed to be relative to
this cache's root layer. See documentation on RequestLayerMuting for
more details.
Parameters
----------
layerIdentifier : str
----------------------------------------------------------------------
Returns true if the layer specified by ``layerIdentifier`` is muted in
this cache, false otherwise.
If ``layerIdentifier`` is relative, it is assumed to be relative to
``anchorLayer`` . If ``canonicalMutedLayerIdentifier`` is supplied, it
will be populated with the canonical identifier of the muted layer if
this function returns true. See documentation on RequestLayerMuting
for more details.
Parameters
----------
anchorLayer : Layer
layerIdentifier : str
canonicalMutedLayerIdentifier : str
"""
@staticmethod
@typing.overload
def IsLayerMuted(anchorLayer, layerIdentifier, canonicalMutedLayerIdentifier) -> bool: ...
@staticmethod
def IsPayloadIncluded(path) -> bool:
"""
IsPayloadIncluded(path) -> bool
Return true if the payload is included for the given path.
Parameters
----------
path : Path
"""
@staticmethod
def IsPossibleDynamicFileFormatArgumentField(field) -> bool:
"""
IsPossibleDynamicFileFormatArgumentField(field) -> bool
Returns true if the given ``field`` is the name of a field that was
composed while generating dynamic file format arguments for any prim
index in this cache.
Parameters
----------
field : str
"""
@staticmethod
def PrintStatistics() -> None:
"""
PrintStatistics() -> None
Prints various statistics about the data stored in this cache.
"""
@staticmethod
def Reload(changes) -> None:
"""
Reload(changes) -> None
Reload the layers of the layer stack, except session layers and
sublayers of session layers.
This will also try to load sublayers in this cache's layer stack that
could not be loaded previously. It will also try to load any
referenced or payloaded layer that could not be loaded previously.
Clients should subsequently ``Apply()`` ``changes`` to use any now-
valid layers.
Parameters
----------
changes : PcpChanges
"""
@staticmethod
def RequestLayerMuting(layersToMute, layersToUnmute, changes, newLayersMuted, newLayersUnmuted) -> None:
"""
RequestLayerMuting(layersToMute, layersToUnmute, changes, newLayersMuted, newLayersUnmuted) -> None
Request layers to be muted or unmuted in this cache.
Muted layers are ignored during composition and do not appear in any
layer stacks. The root layer of this stage may not be muted;
attempting to do so will generate a coding error. If the root layer of
a reference or payload layer stack is muted, the behavior is as if the
muted layer did not exist, which means a composition error will be
generated.
A canonical identifier for each layer in ``layersToMute`` will be
computed using ArResolver::CreateIdentifier using the cache's root
layer as the anchoring asset. Any layer encountered during composition
with the same identifier will be considered muted and ignored.
Note that muting a layer will cause this cache to release all
references to that layer. If no other client is holding on to
references to that layer, it will be unloaded. In this case, if there
are unsaved edits to the muted layer, those edits are lost. Since
anonymous layers are not serialized, muting an anonymous layer will
cause that layer and its contents to be lost in this case.
If ``changes`` is not ``nullptr`` , it is adjusted to reflect the
changes necessary to see the change in muted layers. Otherwise, those
changes are applied immediately.
``newLayersMuted`` and ``newLayersUnmuted`` contains the pruned vector
of layers which are muted or unmuted by this call to
RequestLayerMuting.
Parameters
----------
layersToMute : list[str]
layersToUnmute : list[str]
changes : PcpChanges
newLayersMuted : list[str]
newLayersUnmuted : list[str]
"""
@staticmethod
def RequestPayloads(pathsToInclude, pathsToExclude, changes) -> None:
"""
RequestPayloads(pathsToInclude, pathsToExclude, changes) -> None
Request payloads to be included or excluded from composition.
pathsToInclude
is a set of paths to add to the set for payload inclusion.
pathsToExclude
is a set of paths to remove from the set for payload inclusion.
changes
if not ``None`` , is adjusted to reflect the changes necessary to see
the change in payloads; otherwise those changes are applied
immediately.
If a path is listed in both pathsToInclude and pathsToExclude, it will
be treated as an inclusion only.
Parameters
----------
pathsToInclude : SdfPathSet
pathsToExclude : SdfPathSet
changes : PcpChanges
"""
@staticmethod
def SetVariantFallbacks(map, changes) -> None:
"""
SetVariantFallbacks(map, changes) -> None
Set the list of fallbacks to attempt to use when evaluating variant
sets that lack an authored selection.
If ``changes`` is not ``None`` then it's adjusted to reflect the
changes necessary to see the change in standin preferences, otherwise
those changes are applied immediately.
Parameters
----------
map : PcpVariantFallbackMap
changes : PcpChanges
"""
@staticmethod
def UsesLayerStack(layerStack) -> bool:
"""
UsesLayerStack(layerStack) -> bool
Return true if ``layerStack`` is used by this cache in its
composition, false otherwise.
Parameters
----------
layerStack : LayerStack
"""
@property
def fileFormatTarget(self) -> None:
"""
type : str
Returns the file format target this cache is configured for.
:type: None
"""
@property
def layerStack(self) -> None:
"""
type : LayerStack
Get the layer stack for GetLayerStackIdentifier() .
Note that this will neither compute the layer stack nor report errors.
So if the layer stack has not been computed yet this will return
``None`` . Use ComputeLayerStack() if you need to compute the layer
stack if it hasn't been computed already and/or get errors caused by
computing the layer stack.
:type: None
"""
__instance_size__ = 328
pass
class Dependency(Boost.Python.instance):
"""
Description of a dependency.
"""
@property
def indexPath(self) -> None:
"""
:type: None
"""
@property
def mapFunc(self) -> None:
"""
:type: None
"""
@property
def sitePath(self) -> None:
"""
:type: None
"""
pass
class DependencyType(pxr.Tf.Tf_PyEnumWrapper, pxr.Tf.Enum, Boost.Python.instance):
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = ''
allValues: tuple # value = (Pcp.DependencyTypeNone, Pcp.DependencyTypeRoot, Pcp.DependencyTypePurelyDirect, Pcp.DependencyTypePartlyDirect, Pcp.DependencyTypeDirect, Pcp.DependencyTypeAncestral, Pcp.DependencyTypeVirtual, Pcp.DependencyTypeNonVirtual, Pcp.DependencyTypeAnyNonVirtual, Pcp.DependencyTypeAnyIncludingVirtual)
pass
class DynamicFileFormatDependencyData(Boost.Python.instance):
"""
Contains the necessary information for storing a prim index's
dependency on dynamic file format arguments and determining if a field
change affects the prim index. This data structure does not store the
prim index or its path itself and is expected to be the data in some
other data structure that maps prim indexes to its dependencies.
"""
@staticmethod
def CanFieldChangeAffectFileFormatArguments(fieldName, oldValue, newValue) -> bool:
"""
CanFieldChangeAffectFileFormatArguments(fieldName, oldValue, newValue) -> bool
Given a ``field`` name and the changed field values in
``oldAndNewValues`` this return whether this change can affect any of
the file format arguments generated by any of the contexts stored in
this dependency.
Parameters
----------
fieldName : str
oldValue : VtValue
newValue : VtValue
"""
@staticmethod
def GetRelevantFieldNames() -> str.typing.Set:
"""
GetRelevantFieldNames() -> str.Set
Returns a list of field names that were composed for any of the
dependency contexts that were added to this dependency.
"""
@staticmethod
def IsEmpty() -> bool:
"""
IsEmpty() -> bool
Returns whether this dependency data is empty.
"""
pass
class ErrorArcCycle(ErrorBase, Boost.Python.instance):
"""
Arcs between PcpNodes that form a cycle.
"""
pass
class ErrorArcPermissionDenied(ErrorBase, Boost.Python.instance):
"""
Arcs that were not made between PcpNodes because of permission
restrictions.
"""
pass
class ErrorCapacityExceeded(ErrorBase, Boost.Python.instance):
"""
Exceeded the capacity for composition arcs at a single site.
"""
pass
class ErrorInconsistentAttributeType(ErrorBase, Boost.Python.instance):
"""
Attributes that have specs with conflicting definitions.
"""
pass
class ErrorInconsistentAttributeVariability(ErrorBase, Boost.Python.instance):
"""
Attributes that have specs with conflicting variability.
"""
pass
class ErrorInconsistentPropertyType(ErrorBase, Boost.Python.instance):
"""
Properties that have specs with conflicting definitions.
"""
pass
class ErrorInvalidAssetPath(ErrorInvalidAssetPathBase, ErrorBase, Boost.Python.instance):
"""
Invalid asset paths used by references or payloads.
"""
pass
class ErrorInvalidAssetPathBase(ErrorBase, Boost.Python.instance):
pass
class ErrorInvalidExternalTargetPath(ErrorTargetPathBase, ErrorBase, Boost.Python.instance):
"""
Invalid target or connection path in some scope that points to an
object outside of that scope.
"""
pass
class ErrorInvalidInstanceTargetPath(ErrorTargetPathBase, ErrorBase, Boost.Python.instance):
"""
Invalid target or connection path authored in an inherited class that
points to an instance of that class.
"""
pass
class ErrorInvalidPrimPath(ErrorBase, Boost.Python.instance):
"""
Invalid prim paths used by references or payloads.
"""
pass
class ErrorInvalidReferenceOffset(ErrorBase, Boost.Python.instance):
"""
References or payloads that use invalid layer offsets.
"""
pass
class ErrorInvalidSublayerOffset(ErrorBase, Boost.Python.instance):
"""
Sublayers that use invalid layer offsets.
"""
pass
class ErrorInvalidSublayerOwnership(ErrorBase, Boost.Python.instance):
"""
Sibling layers that have the same owner.
"""
pass
class ErrorInvalidSublayerPath(ErrorBase, Boost.Python.instance):
"""
Asset paths that could not be both resolved and loaded.
"""
pass
class ErrorInvalidTargetPath(ErrorTargetPathBase, ErrorBase, Boost.Python.instance):
"""
Invalid target or connection path.
"""
pass
class ErrorMutedAssetPath(ErrorInvalidAssetPathBase, ErrorBase, Boost.Python.instance):
"""
Muted asset paths used by references or payloads.
"""
pass
class ErrorOpinionAtRelocationSource(ErrorBase, Boost.Python.instance):
"""
Opinions were found at a relocation source path.
"""
pass
class ErrorPrimPermissionDenied(ErrorBase, Boost.Python.instance):
"""
Layers with illegal opinions about private prims.
"""
pass
class ErrorPropertyPermissionDenied(ErrorBase, Boost.Python.instance):
"""
Layers with illegal opinions about private properties.
"""
pass
class ErrorSublayerCycle(ErrorBase, Boost.Python.instance):
"""
Layers that recursively sublayer themselves.
"""
pass
class ErrorTargetPermissionDenied(ErrorTargetPathBase, ErrorBase, Boost.Python.instance):
"""
Paths with illegal opinions about private targets.
"""
pass
class ErrorTargetPathBase(ErrorBase, Boost.Python.instance):
"""
Base class for composition errors related to target or connection
paths.
"""
pass
class ErrorBase(Boost.Python.instance):
"""
Base class for all error types.
"""
@property
def errorType(self) -> None:
"""
:type: None
"""
pass
class ErrorType(pxr.Tf.Tf_PyEnumWrapper, pxr.Tf.Enum, Boost.Python.instance):
@staticmethod
def GetValueFromName(*args, **kwargs) -> None: ...
_baseName = ''
allValues: tuple # value = (Pcp.ErrorType_ArcCycle, Pcp.ErrorType_ArcPermissionDenied, Pcp.ErrorType_IndexCapacityExceeded, Pcp.ErrorType_ArcCapacityExceeded, Pcp.ErrorType_ArcNamespaceDepthCapacityExceeded, Pcp.ErrorType_InconsistentPropertyType, Pcp.ErrorType_InconsistentAttributeType, Pcp.ErrorType_InconsistentAttributeVariability, Pcp.ErrorType_InternalAssetPath, Pcp.ErrorType_InvalidPrimPath, Pcp.ErrorType_InvalidAssetPath, Pcp.ErrorType_InvalidInstanceTargetPath, Pcp.ErrorType_InvalidExternalTargetPath, Pcp.ErrorType_InvalidTargetPath, Pcp.ErrorType_InvalidReferenceOffset, Pcp.ErrorType_InvalidSublayerOffset, Pcp.ErrorType_InvalidSublayerOwnership, Pcp.ErrorType_InvalidSublayerPath, Pcp.ErrorType_InvalidVariantSelection, Pcp.ErrorType_OpinionAtRelocationSource, Pcp.ErrorType_PrimPermissionDenied, Pcp.ErrorType_PropertyPermissionDenied, Pcp.ErrorType_SublayerCycle, Pcp.ErrorType_TargetPermissionDenied, Pcp.ErrorType_UnresolvedPrimPath)
pass
class ErrorUnresolvedPrimPath(ErrorBase, Boost.Python.instance):
"""
Asset paths that could not be both resolved and loaded.
"""
pass
class InstanceKey(Boost.Python.instance):
"""
A PcpInstanceKey identifies instanceable prim indexes that share the
same set of opinions. Instanceable prim indexes with equal instance
keys are guaranteed to have the same opinions for name children and
properties beneath those name children. They are NOT guaranteed to
have the same opinions for direct properties of the prim indexes
themselves.
"""
@staticmethod
def __hash_(*args, **kwargs) -> None: ...
__instance_size__ = 72
pass
class LayerStack(Boost.Python.instance):
"""
Represents a stack of layers that contribute opinions to composition.
Each PcpLayerStack is identified by a PcpLayerStackIdentifier. This
identifier contains all of the parameters needed to construct a layer
stack, such as the root layer, session layer, and path resolver
context.
PcpLayerStacks are constructed and managed by a
Pcp_LayerStackRegistry.
"""
@property
def expired(self) -> None:
"""
True if this object has expired, False otherwise.
:type: None
"""
@property
def identifier(self) -> None:
"""
type : LayerStackIdentifier
Returns the identifier for this layer stack.
:type: None
"""
@property
def incrementalRelocatesSourceToTarget(self) -> None:
"""
type : SdfRelocatesMap
Returns incremental relocation source-to-target mapping for this layer
stack.
This map contains the individual relocation entries found across all
layers in this layer stack; it does not combine ancestral entries with
descendant entries. For instance, if this layer stack contains
relocations { /A: /B} and { /A/C: /A/D}, this map will contain { /A:
/B} and { /A/C: /A/D}.
:type: None
"""
@property
def incrementalRelocatesTargetToSource(self) -> None:
"""
type : SdfRelocatesMap
Returns incremental relocation target-to-source mapping for this layer
stack.
See GetIncrementalRelocatesTargetToSource for more details.
:type: None
"""
@property
def layerOffsets(self) -> None:
"""
:type: None
"""
@property
def layerTree(self) -> None:
"""
type : LayerTree
Returns the layer tree representing the structure of this layer stack.
:type: None
"""
@property
def layers(self) -> None:
"""
type : list[SdfLayerRefPtr]
Returns the layers in this layer stack in strong-to-weak order.
Note that this is only the *local* layer stack it does not include
any layers brought in by references inside prims.
:type: None
"""
@property
def localErrors(self) -> None:
"""
type : list[PcpError]
Return the list of errors local to this layer stack.
:type: None
"""
@property
def mutedLayers(self) -> None:
"""
type : set[str]
Returns the set of layers that were muted in this layer stack.
:type: None
"""
@property
def pathsToPrimsWithRelocates(self) -> None:
"""
type : list[SdfPath]
Returns a list of paths to all prims across all layers in this layer
stack that contained relocates.
:type: None
"""
@property
def relocatesSourceToTarget(self) -> None:
"""
type : SdfRelocatesMap
Returns relocation source-to-target mapping for this layer stack.
This map combines the individual relocation entries found across all
layers in this layer stack; multiple entries that affect a single prim
will be combined into a single entry. For instance, if this layer
stack contains relocations { /A: /B} and { /A/C: /A/D}, this map will
contain { /A: /B} and { /B/C: /B/D}. This allows consumers to go from
unrelocated namespace to relocated namespace in a single step.
:type: None
"""
@property
def relocatesTargetToSource(self) -> None:
"""
type : SdfRelocatesMap
Returns relocation target-to-source mapping for this layer stack.
See GetRelocatesSourceToTarget for more details.
:type: None
"""
pass
class LayerStackIdentifier(Boost.Python.instance):
"""
Arguments used to identify a layer stack.
Objects of this type are immutable.
"""
@property
def pathResolverContext(self) -> None:
"""
:type: None
"""
@property
def rootLayer(self) -> None:
"""
:type: None
"""
@property
def sessionLayer(self) -> None:
"""
:type: None
"""
__instance_size__ = 80
pass
class LayerStackSite(Boost.Python.instance):
"""
A site specifies a path in a layer stack of scene description.
"""
@property
def layerStack(self) -> None:
"""
:type: None
"""
@property
def path(self) -> None:
"""
:type: None
"""
pass
class MapExpression(Boost.Python.instance):
"""
An expression that yields a PcpMapFunction value.
Expressions comprise constant values, variables, and operators applied
to sub-expressions. Expressions cache their computed values
internally. Assigning a new value to a variable automatically
invalidates the cached values of dependent expressions. Common
(sub-)expressions are automatically detected and shared.
PcpMapExpression exists solely to support efficient incremental
handling of relocates edits. It represents a tree of the namespace
mapping operations and their inputs, so we can narrowly redo the
computation when one of the inputs changes.
"""
@staticmethod
def AddRootIdentity() -> MapExpression:
"""
AddRootIdentity() -> MapExpression
Return a new expression representing this expression with an added (if
necessary) mapping from</>to</>.
"""
@staticmethod
def Compose(f) -> MapExpression:
"""
Compose(f) -> MapExpression
Create a new PcpMapExpression representing the application of f's
value, followed by the application of this expression's value.
Parameters
----------
f : MapExpression
"""
@staticmethod
def Constant(*args, **kwargs) -> None:
"""
**classmethod** Constant(constValue) -> MapExpression
Create a new constant.
Parameters
----------
constValue : Value
"""
@staticmethod
def Evaluate() -> Value:
"""
Evaluate() -> Value
Evaluate this expression, yielding a PcpMapFunction value.
The computed result is cached. The return value is a reference to the
internal cached value. The cache is automatically invalidated as
needed.
"""
@staticmethod
def Identity(*args, **kwargs) -> None:
"""
**classmethod** Identity() -> MapExpression
Return an expression representing PcpMapFunction::Identity() .
"""
@staticmethod
def Inverse() -> MapExpression:
"""
Inverse() -> MapExpression
Create a new PcpMapExpression representing the inverse of f.
"""
@staticmethod
def MapSourceToTarget(path) -> Path:
"""
MapSourceToTarget(path) -> Path
Map a path in the source namespace to the target.
If the path is not in the domain, returns an empty path.
Parameters
----------
path : Path
"""
@staticmethod
def MapTargetToSource(path) -> Path:
"""
MapTargetToSource(path) -> Path
Map a path in the target namespace to the source.
If the path is not in the co-domain, returns an empty path.
Parameters
----------
path : Path
"""
@property
def isIdentity(self) -> None:
"""
type : bool
Return true if the evaluated map function is the identity function.
For identity, MapSourceToTarget() always returns the path unchanged.
:type: None
"""
@property
def isNull(self) -> None:
"""
type : bool
Return true if this is a null expression.
:type: None
"""
@property
def timeOffset(self) -> None:
"""
type : LayerOffset
The time offset of the mapping.
:type: None
"""
__instance_size__ = 24
pass
class MapFunction(Boost.Python.instance):
"""
A function that maps values from one namespace (and time domain) to
another. It represents the transformation that an arc such as a
reference arc applies as it incorporates values across the arc.
Take the example of a reference arc, where a source path</Model>is
referenced as a target path,</Model_1>. The source path</Model>is the
source of the opinions; the target path</Model_1>is where they are
incorporated in the scene. Values in the model that refer to paths
relative to</Model>must be transformed to be relative
to</Model_1>instead. The PcpMapFunction for the arc provides this
service.
Map functions have a specific *domain*, or set of values they can
operate on. Any values outside the domain cannot be mapped. The domain
precisely tracks what areas of namespace can be referred to across
various forms of arcs.
Map functions can be chained to represent a series of map operations
applied in sequence. The map function represent the cumulative effect
as efficiently as possible. For example, in the case of a chained
reference from</Model>to</Model>to</Model>to</Model_1>, this is
effectively the same as a mapping directly from</Model>to</Model_1>.
Representing the cumulative effect of arcs in this way is important
for handling larger scenes efficiently.
Map functions can be *inverted*. Formally, map functions are
bijections (one-to-one and onto), which ensures that they can be
inverted. Put differently, no information is lost by applying a map
function to set of values within its domain; they retain their
distinct identities and can always be mapped back.
One analogy that may or may not be helpful: In the same way a
geometric transform maps a model's points in its rest space into the
world coordinates for a particular instance, a PcpMapFunction maps
values about a referenced model into the composed scene for a
particular instance of that model. But rather than translating and
rotating points, the map function shifts the values in namespace (and
time).
"""
@staticmethod
def Compose(f) -> MapFunction:
"""
Compose(f) -> MapFunction
Compose this map over the given map function.
The result will represent the application of f followed by the
application of this function.
Parameters
----------
f : MapFunction
"""
@staticmethod
def ComposeOffset(newOffset) -> MapFunction:
"""
ComposeOffset(newOffset) -> MapFunction
Compose this map function over a hypothetical map function that has an
identity path mapping and ``offset`` .
This is equivalent to building such a map function and invoking
Compose() , but is faster.
Parameters
----------
newOffset : LayerOffset
"""
@staticmethod
def GetInverse() -> MapFunction:
"""
GetInverse() -> MapFunction
Return the inverse of this map function.
This returns a true inverse ``inv:`` for any path p in this function's
domain that it maps to p', inv(p') ->p.
"""
@staticmethod
def Identity(*args, **kwargs) -> None:
"""
**classmethod** Identity() -> MapFunction
Construct an identity map function.
"""
@staticmethod
def IdentityPathMap(*args, **kwargs) -> None:
"""
**classmethod** IdentityPathMap() -> PathMap
Returns an identity path mapping.
"""
@staticmethod
def MapSourceToTarget(path) -> Path:
"""
MapSourceToTarget(path) -> Path
Map a path in the source namespace to the target.
If the path is not in the domain, returns an empty path.
Parameters
----------
path : Path
"""
@staticmethod
def MapTargetToSource(path) -> Path:
"""
MapTargetToSource(path) -> Path
Map a path in the target namespace to the source.
If the path is not in the co-domain, returns an empty path.
Parameters
----------
path : Path
"""
@property
def isIdentity(self) -> None:
"""
type : bool
Return true if the map function is the identity function.
The identity function has an identity path mapping and time offset.
:type: None
"""
@property
def isIdentityPathMapping(self) -> None:
"""
type : bool
Return true if the map function uses the identity path mapping.
If true, MapSourceToTarget() always returns the path unchanged.
However, this map function may have a non-identity time offset.
:type: None
"""
@property
def isNull(self) -> None:
"""
type : bool
Return true if this map function is the null function.
For a null function, MapSourceToTarget() always returns an empty path.
:type: None
"""
@property
def sourceToTargetMap(self) -> None:
"""
type : PathMap
The set of path mappings, from source to target.
:type: None
"""
@property
def timeOffset(self) -> None:
"""
type : LayerOffset
The time offset of the mapping.
:type: None
"""
__instance_size__ = 72
pass
class NodeRef(Boost.Python.instance):
"""
PcpNode represents a node in an expression tree for compositing scene
description.
A node represents the opinions from a particular site. In addition, it
may have child nodes, representing nested expressions that are
composited over/under this node.
Child nodes are stored and composited in strength order.
Each node holds information about the arc to its parent. This captures
both the relative strength of the sub-expression as well as any value-
mapping needed, such as to rename opinions from a model to use in a
particular instance.
"""
@staticmethod
def CanContributeSpecs() -> bool:
"""
CanContributeSpecs() -> bool
Returns true if this node is allowed to contribute opinions for
composition, false otherwise.
"""
@staticmethod
def GetDepthBelowIntroduction() -> int:
"""
GetDepthBelowIntroduction() -> int
Return the number of levels of namespace this node's site is below the
level at which it was introduced by an arc.
"""
@staticmethod
def GetIntroPath() -> Path:
"""
GetIntroPath() -> Path
Get the path that introduced this node.
Specifically, this is the path the parent node had at the level of
namespace where this node was added as a child. For a root node, this
returns the absolute root path. See also GetDepthBelowIntroduction() .
"""
@staticmethod
def GetOriginRootNode() -> NodeRef:
"""
GetOriginRootNode() -> NodeRef
Walk up to the root origin node for this node.
This is the very first node that caused this node to be added to the
graph. For instance, the root origin node of an implied inherit is the
original inherit node.
"""
@staticmethod
def GetPathAtIntroduction() -> Path:
"""
GetPathAtIntroduction() -> Path
Returns the path for this node's site when it was introduced.
"""
@staticmethod
def GetRootNode() -> NodeRef:
"""
GetRootNode() -> NodeRef
Walk up to the root node of this expression.
"""
@staticmethod
def IsDueToAncestor() -> bool:
"""
IsDueToAncestor() -> bool
"""
@staticmethod
def IsRootNode() -> bool:
"""
IsRootNode() -> bool
Returns true if this node is the root node of the prim index graph.
"""
@property
def arcType(self) -> None:
"""
type : ArcType
Returns the type of arc connecting this node to its parent node.
:type: None
"""
@property
def children(self) -> None:
"""
:type: None
"""
@property
def hasSpecs(self) -> None:
"""
type : None
Returns true if this node has opinions authored for composition, false
otherwise.
:type: None
"""
@property
def hasSymmetry(self) -> None:
"""
type : None
Get/set whether this node provides any symmetry opinions, either
directly or from a namespace ancestor.
:type: None
"""
@property
def isCulled(self) -> None:
"""
type : bool
:type: None
"""
@property
def isInert(self) -> None:
"""
type : bool
:type: None
"""
@property
def isRestricted(self) -> None:
"""
type : bool
:type: None
"""
@property
def layerStack(self) -> None:
"""
type : LayerStack
Returns the layer stack for the site this node represents.
:type: None
"""
@property
def mapToParent(self) -> None:
"""
type : MapExpression
Returns mapping function used to translate paths and values from this
node to its parent node.
:type: None
"""
@property
def mapToRoot(self) -> None:
"""
type : MapExpression
Returns mapping function used to translate paths and values from this
node directly to the root node.
:type: None
"""
@property
def namespaceDepth(self) -> None:
"""
type : int
Returns the absolute namespace depth of the node that introduced this
node.
Note that this does *not* count any variant selections.
:type: None
"""
@property
def origin(self) -> None:
"""
:type: None
"""
@property
def parent(self) -> None:
"""
:type: None
"""
@property
def path(self) -> None:
"""
type : Path
Returns the path for the site this node represents.
:type: None
"""
@property
def permission(self) -> None:
"""
type : Permission
----------------------------------------------------------------------
type : None
Get/set the permission for this node.
This indicates whether specs on this node can be accessed from other
nodes.
:type: None
"""
@property
def siblingNumAtOrigin(self) -> None:
"""
type : int
Returns this node's index among siblings with the same arc type at
this node's origin.
:type: None
"""
@property
def site(self) -> None:
"""
type : LayerStackSite
Get the site this node represents.
:type: None
"""
pass
class PrimIndex(Boost.Python.instance):
"""
PcpPrimIndex is an index of the all sites of scene description that
contribute opinions to a specific prim, under composition semantics.
PcpComputePrimIndex() builds an index ("indexes") the given prim site.
At any site there may be scene description values expressing arcs that
represent instructions to pull in further scene description.
PcpComputePrimIndex() recursively follows these arcs, building and
ordering the results.
"""
@staticmethod
def ComposeAuthoredVariantSelections() -> SdfVariantSelectionMap:
"""
ComposeAuthoredVariantSelections() -> SdfVariantSelectionMap
Compose the authored prim variant selections.
These are the variant selections expressed in scene description. Note
that these selections may not have actually been applied, if they are
invalid.
This result is not cached, but computed each time.
"""
@staticmethod
def ComputePrimChildNames(nameOrder, prohibitedNameSet) -> None:
"""
ComputePrimChildNames(nameOrder, prohibitedNameSet) -> None
Compute the prim child names for the given path.
``errors`` will contain any errors encountered while performing this
operation.
Parameters
----------
nameOrder : list[TfToken]
prohibitedNameSet : PcpTokenSet
"""
@staticmethod
def ComputePrimPropertyNames(nameOrder) -> None:
"""
ComputePrimPropertyNames(nameOrder) -> None
Compute the prim property names for the given path.
``errors`` will contain any errors encountered while performing this
operation. The ``nameOrder`` vector must not contain any duplicate
entries.
Parameters
----------
nameOrder : list[TfToken]
"""
@staticmethod
def DumpToDotGraph(filename, includeInheritOriginInfo, includeMaps) -> None:
"""
DumpToDotGraph(filename, includeInheritOriginInfo, includeMaps) -> None
Dump the prim index in dot format to the file named ``filename`` .
See Dump(\.\.\.) for information regarding arguments.
Parameters
----------
filename : str
includeInheritOriginInfo : bool
includeMaps : bool
"""
@staticmethod
def DumpToString(includeInheritOriginInfo, includeMaps) -> str:
"""
DumpToString(includeInheritOriginInfo, includeMaps) -> str
Dump the prim index contents to a string.
If ``includeInheritOriginInfo`` is ``true`` , output for implied
inherit nodes will include information about the originating inherit
node. If ``includeMaps`` is ``true`` , output for each node will
include the mappings to the parent and root node.
Parameters
----------
includeInheritOriginInfo : bool
includeMaps : bool
"""
@staticmethod
@typing.overload
def GetNodeProvidingSpec(primSpec) -> NodeRef:
"""
GetNodeProvidingSpec(primSpec) -> NodeRef
Returns the node that brings opinions from ``primSpec`` into this prim
index.
If no such node exists, returns an invalid PcpNodeRef.
Parameters
----------
primSpec : PrimSpec
----------------------------------------------------------------------
Returns the node that brings opinions from the Sd prim spec at
``layer`` and ``path`` into this prim index.
If no such node exists, returns an invalid PcpNodeRef.
Parameters
----------
layer : Layer
path : Path
"""
@staticmethod
@typing.overload
def GetNodeProvidingSpec(layer, path) -> NodeRef: ...
@staticmethod
def GetSelectionAppliedForVariantSet(variantSet) -> str:
"""
GetSelectionAppliedForVariantSet(variantSet) -> str
Return the variant selection applied for the named variant set.
If none was applied, this returns an empty string. This can be
different from the authored variant selection; for example, if the
authored selection is invalid.
Parameters
----------
variantSet : str
"""
@staticmethod
def IsInstanceable() -> bool:
"""
IsInstanceable() -> bool
Returns true if this prim index is instanceable.
Instanceable prim indexes with the same instance key are guaranteed to
have the same set of opinions, but may not have local opinions about
name children.
PcpInstanceKey
"""
@staticmethod
def IsValid() -> bool:
"""
IsValid() -> bool
Return true if this index is valid.
A default-constructed index is invalid.
"""
@staticmethod
def PrintStatistics() -> None:
"""
PrintStatistics() -> None
Prints various statistics about this prim index.
"""
@property
def hasAnyPayloads(self) -> None:
"""
:type: None
"""
@property
def localErrors(self) -> None:
"""
type : list[PcpError]
Return the list of errors local to this prim.
:type: None
"""
@property
def primStack(self) -> None:
"""
:type: None
"""
@property
def rootNode(self) -> None:
"""
type : NodeRef
Returns the root node of the prim index graph.
:type: None
"""
pass
class PropertyIndex(Boost.Python.instance):
"""
PcpPropertyIndex is an index of all sites in scene description that
contribute opinions to a specific property, under composition
semantics.
"""
@property
def localErrors(self) -> None:
"""
type : list[PcpError]
Return the list of errors local to this property.
:type: None
"""
@property
def localPropertyStack(self) -> None:
"""
:type: None
"""
@property
def propertyStack(self) -> None:
"""
:type: None
"""
pass
class Site(Boost.Python.instance):
"""
A site specifies a path in a layer stack of scene description.
"""
@property
def layerStack(self) -> None:
"""
:type: None
"""
@property
def path(self) -> None:
"""
:type: None
"""
pass
class _TestChangeProcessor(Boost.Python.instance):
@staticmethod
def GetPrimChanges(*args, **kwargs) -> None: ...
@staticmethod
def GetSignificantChanges(*args, **kwargs) -> None: ...
@staticmethod
def GetSpecChanges(*args, **kwargs) -> None: ...
__instance_size__ = 32
pass
def TranslatePathFromNodeToRoot(*args, **kwargs) -> None:
pass
def TranslatePathFromRootToNode(*args, **kwargs) -> None:
pass
ArcTypeInherit: pxr.Pcp.ArcType # value = Pcp.ArcTypeInherit
ArcTypePayload: pxr.Pcp.ArcType # value = Pcp.ArcTypePayload
ArcTypeReference: pxr.Pcp.ArcType # value = Pcp.ArcTypeReference
ArcTypeRelocate: pxr.Pcp.ArcType # value = Pcp.ArcTypeRelocate
ArcTypeRoot: pxr.Pcp.ArcType # value = Pcp.ArcTypeRoot
ArcTypeSpecialize: pxr.Pcp.ArcType # value = Pcp.ArcTypeSpecialize
ArcTypeVariant: pxr.Pcp.ArcType # value = Pcp.ArcTypeVariant
DependencyTypeAncestral: pxr.Pcp.DependencyType # value = Pcp.DependencyTypeAncestral
DependencyTypeAnyIncludingVirtual: pxr.Pcp.DependencyType # value = Pcp.DependencyTypeAnyIncludingVirtual
DependencyTypeAnyNonVirtual: pxr.Pcp.DependencyType # value = Pcp.DependencyTypeAnyNonVirtual
DependencyTypeDirect: pxr.Pcp.DependencyType # value = Pcp.DependencyTypeDirect
DependencyTypeNonVirtual: pxr.Pcp.DependencyType # value = Pcp.DependencyTypeNonVirtual
DependencyTypeNone: pxr.Pcp.DependencyType # value = Pcp.DependencyTypeNone
DependencyTypePartlyDirect: pxr.Pcp.DependencyType # value = Pcp.DependencyTypePartlyDirect
DependencyTypePurelyDirect: pxr.Pcp.DependencyType # value = Pcp.DependencyTypePurelyDirect
DependencyTypeRoot: pxr.Pcp.DependencyType # value = Pcp.DependencyTypeRoot
DependencyTypeVirtual: pxr.Pcp.DependencyType # value = Pcp.DependencyTypeVirtual
ErrorType_ArcCapacityExceeded: pxr.Pcp.ErrorType # value = Pcp.ErrorType_ArcCapacityExceeded
ErrorType_ArcCycle: pxr.Pcp.ErrorType # value = Pcp.ErrorType_ArcCycle
ErrorType_ArcNamespaceDepthCapacityExceeded: pxr.Pcp.ErrorType # value = Pcp.ErrorType_ArcNamespaceDepthCapacityExceeded
ErrorType_ArcPermissionDenied: pxr.Pcp.ErrorType # value = Pcp.ErrorType_ArcPermissionDenied
ErrorType_InconsistentAttributeType: pxr.Pcp.ErrorType # value = Pcp.ErrorType_InconsistentAttributeType
ErrorType_InconsistentAttributeVariability: pxr.Pcp.ErrorType # value = Pcp.ErrorType_InconsistentAttributeVariability
ErrorType_InconsistentPropertyType: pxr.Pcp.ErrorType # value = Pcp.ErrorType_InconsistentPropertyType
ErrorType_IndexCapacityExceeded: pxr.Pcp.ErrorType # value = Pcp.ErrorType_IndexCapacityExceeded
ErrorType_InternalAssetPath: pxr.Pcp.ErrorType # value = Pcp.ErrorType_InternalAssetPath
ErrorType_InvalidAssetPath: pxr.Pcp.ErrorType # value = Pcp.ErrorType_InvalidAssetPath
ErrorType_InvalidExternalTargetPath: pxr.Pcp.ErrorType # value = Pcp.ErrorType_InvalidExternalTargetPath
ErrorType_InvalidInstanceTargetPath: pxr.Pcp.ErrorType # value = Pcp.ErrorType_InvalidInstanceTargetPath
ErrorType_InvalidPrimPath: pxr.Pcp.ErrorType # value = Pcp.ErrorType_InvalidPrimPath
ErrorType_InvalidReferenceOffset: pxr.Pcp.ErrorType # value = Pcp.ErrorType_InvalidReferenceOffset
ErrorType_InvalidSublayerOffset: pxr.Pcp.ErrorType # value = Pcp.ErrorType_InvalidSublayerOffset
ErrorType_InvalidSublayerOwnership: pxr.Pcp.ErrorType # value = Pcp.ErrorType_InvalidSublayerOwnership
ErrorType_InvalidSublayerPath: pxr.Pcp.ErrorType # value = Pcp.ErrorType_InvalidSublayerPath
ErrorType_InvalidTargetPath: pxr.Pcp.ErrorType # value = Pcp.ErrorType_InvalidTargetPath
ErrorType_InvalidVariantSelection: pxr.Pcp.ErrorType # value = Pcp.ErrorType_InvalidVariantSelection
ErrorType_OpinionAtRelocationSource: pxr.Pcp.ErrorType # value = Pcp.ErrorType_OpinionAtRelocationSource
ErrorType_PrimPermissionDenied: pxr.Pcp.ErrorType # value = Pcp.ErrorType_PrimPermissionDenied
ErrorType_PropertyPermissionDenied: pxr.Pcp.ErrorType # value = Pcp.ErrorType_PropertyPermissionDenied
ErrorType_SublayerCycle: pxr.Pcp.ErrorType # value = Pcp.ErrorType_SublayerCycle
ErrorType_TargetPermissionDenied: pxr.Pcp.ErrorType # value = Pcp.ErrorType_TargetPermissionDenied
ErrorType_UnresolvedPrimPath: pxr.Pcp.ErrorType # value = Pcp.ErrorType_UnresolvedPrimPath
__MFB_FULL_PACKAGE_NAME = 'pcp'
| 61,570 | unknown | 28.097826 | 958 | 0.647491 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Plug/__init__.py | #
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
"""
This package defines facilities for dealing with plugins.
"""
from pxr import Tf
Tf.PreparePythonModule()
del Tf
| 1,178 | Python | 35.843749 | 74 | 0.764007 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Plug/__DOC.py | def Execute(result):
result["Notice"].__doc__ = """
Notifications sent by the Plug module.
"""
result["Plugin"].__doc__ = """
Defines an interface to registered plugins.
Plugins are registered using the interfaces in ``PlugRegistry`` .
For each registered plugin, there is an instance of ``PlugPlugin``
which can be used to load and unload the plugin and to retrieve
information about the classes implemented by the plugin.
"""
result["Plugin"].Load.func_doc = """Load() -> bool
Loads the plugin.
This is a noop if the plugin is already loaded.
"""
result["Plugin"].GetMetadataForType.func_doc = """GetMetadataForType(type) -> JsObject
Returns the metadata sub-dictionary for a particular type.
Parameters
----------
type : Type
"""
result["Plugin"].DeclaresType.func_doc = """DeclaresType(type, includeSubclasses) -> bool
Returns true if ``type`` is declared by this plugin.
If ``includeSubclasses`` is specified, also returns true if any
subclasses of ``type`` have been declared.
Parameters
----------
type : Type
includeSubclasses : bool
"""
result["Plugin"].MakeResourcePath.func_doc = """MakeResourcePath(path) -> str
Build a plugin resource path by returning a given absolute path or
combining the plugin's resource path with a given relative path.
Parameters
----------
path : str
"""
result["Plugin"].FindPluginResource.func_doc = """FindPluginResource(path, verify) -> str
Find a plugin resource by absolute or relative path optionally
verifying that file exists.
If verification fails an empty path is returned. Relative paths are
relative to the plugin's resource path.
Parameters
----------
path : str
verify : bool
"""
result["Registry"].__doc__ = """
Defines an interface for registering plugins.
PlugRegistry maintains a registry of plug-ins known to the system and
provides an interface for base classes to load any plug-ins required
to instantiate a subclass of a given type.
Defining a Base Class API
=========================
In order to use this facility you will generally provide a module
which defines the API for a plug-in base class. This API will be
sufficient for the application or framework to make use of custom
subclasses that will be written by plug-in developers.
For example, if you have an image processing application, you might
want to support plug-ins that implement image filters. You can define
an abstract base class for image filters that declares the API your
application will require image filters to implement; perhaps something
simple like C++ Code Example 1 (Doxygen only).
People writing custom filters would write a subclass of ImageFilter
that overrides the two methods, implementing their own special
filtering behavior.
Enabling Plug-in Loading for the Base Class
===========================================
In order for ImageFilter to be able to load plug-ins that implement
these custom subclasses, it must be registered with the TfType system.
The ImageFilter base class, as was mentioned earlier, should be made
available in a module that the application links with. This is done
so that plug-ins that want to provide ImageFilters can also link with
the module allowing them to subclass ImageFilter.
Registering Plug-ins
====================
A plug-in developer can now write plug-ins with ImageFilter
subclasses. Plug-ins can be implemented either as native dynamic
modules (either regular dynamic modules or framework bundles) or
as Python modules.
Plug-ins must be registered with the registry. All plugins are
registered via RegisterPlugins() . Plug-in Python modules must be
directly importable (in other words they must be able to be found in
Python's module path.) Plugins are registered by providing a path or
paths to JSON files that describe the location, structure and contents
of the plugin. The standard name for these files in plugInfo.json.
Typically, the application that hosts plug-ins will locate and
register plug-ins at startup.
The plug-in facility is lazy. It does not dynamically load code from
plug-in bundles until that code is required.
plugInfo.json
=============
A plugInfo.json file has the following structure:
.. code-block:: text
{
# Comments are allowed and indicated by a hash at the start of a
# line or after spaces and tabs. They continue to the end of line.
# Blank lines are okay, too.
# This is optional. It may contain any number of strings.
# Paths may be absolute or relative.
# Paths ending with slash have plugInfo.json appended automatically.
# '\\*' may be used anywhere to match any character except slash.
# '\\*\\*' may be used anywhere to match any character including slash.
"Includes": [
"/absolute/path/to/plugInfo.json",
"/absolute/path/to/custom.filename",
"/absolute/path/to/directory/with/plugInfo/",
"relative/path/to/plugInfo.json",
"relative/path/to/directory/with/plugInfo/",
"glob\\*/pa\\*th/\\*to\\*/\\*/plugInfo.json",
"recursive/pa\\*\\*th/\\*\\*/"
],
# This is optional. It may contain any number of objects.
"Plugins": [
{
# Type is required and may be "module", "python" or "resource".
"Type": "module",
# Name is required. It should be the Python module name,
# the shared module name, or a unique resource name.
"Name": "myplugin",
# Root is optional. It defaults to ".".
# This gives the path to the plugin as a whole if the plugin
# has substructure. For Python it should be the directory
# with the __init__.py file. The path is usually relative.
"Root": ".",
# LibraryPath is required by Type "module" and unused
# otherwise. It gives the path to the shared module
# object, either absolute or relative to Root.
"LibraryPath": "libmyplugin.so",
# ResourcePath is option. It defaults to ".".
# This gives the path to the plugin's resources directory.
# The path is either absolute or relative to Root.
"ResourcePath": "resources",
# Info is required. It's described below.
"Info": {
# Plugin contents.
}
}
]
}
As a special case, if a plugInfo.json contains an object that doesn't
have either the"Includes"or"Plugins"keys then it's as if the object
was in a"Plugins"array.
Advertising a Plug-in's Contents
================================
Once the plug-ins are registered, the plug-in facility must also be
able to tell what they contain. Specifically, it must be able to find
out what subclasses of what plug-in base classes each plug-in
contains. Plug-ins must advertise this information through their
plugInfo.json file in the"Info"key. In the"Info"object there should be
a key"Types"holding an object.
This"Types"object's keys are names of subclasses and its values are
yet more objects (the subclass meta-data objects). The meta-data
objects can contain arbitrary key-value pairs. The plug-in mechanism
will look for a meta-data key called"displayName"whose value should be
the display name of the subclass. The plug-in mechanism will look for
a meta-data key called"bases"whose value should be an array of base
class type names.
For example, a bundle that contains a subclass of ImageFilter might
have a plugInfo.json that looks like the following example.
.. code-block:: text
{
"Types": {
"MyCustomCoolFilter" : {
"bases": ["ImageFilter"],
"displayName": "Add Coolness to Image"
# other arbitrary metadata for MyCustomCoolFilter here
}
}
}
What this says is that the plug-in contains a type called
MyCustomCoolFilter which has a base class ImageFilter and that this
subclass should be called"Add Coolness to Image"in user-visible
contexts.
In addition to the"displayName"meta-data key which is actually known
to the plug-in facility, you may put whatever other information you
want into a class'meta-data dictionary. If your plug-in base class
wants to define custom keys that it requires all subclasses to
provide, you can do that. Or, if a plug-in writer wants to define
their own keys that their code will look for at runtime, that is OK as
well.
Working with Subclasses of a Plug-in Base Class
===============================================
Most code with uses types defined in plug-ins doesn't deal with the
Plug API directly. Instead, the TfType interface is used to lookup
types and to manufacture instances. The TfType interface will take
care to load any required plugins.
To wrap up our example, the application that wants to actually use
ImageFilter plug-ins would probably do a couple of things. First, it
would get a list of available ImageFilters to present to the user.
This could be accomplished as shown in Python Code Example 2 (Doxygen
only).
Then, when the user picks a filter from the list, it would manufacture
and instance of the filter as shown in Python Code Example 3 (Doxygen
only).
As was mentioned earlier, this plug-in facility tries to be as lazy as
possible about loading the code associated with plug-ins. To that end,
loading of a plugin will be deferred until an instance of a type is
manufactured which requires the plugin.
Multiple Subclasses of Multiple Plug-in Base Classes
====================================================
It is possible for a bundle to implement multiple subclasses for a
plug-in base class if desired. If you want to package half a dozen
ImageFilter subclasses in one bundle, that will work fine. All must be
declared in the plugInfo.json.
It is possible for there to be multiple classes in your application or
framework that are plug-in base classes. Plug-ins that implement
subclasses of any of these base classes can all coexist. And, it is
possible to have subclasses of multiple plug-in base classes in the
same bundle.
When putting multiple subclasses (of the same or different base
classes) in a bundle, keep in mind that dynamic loading happens for
the whole bundle the first time any subclass is needed, the whole
bundle will be loaded. But this is generally not a big concern.
For example, say the example application also has a plug-in base
class"ImageCodec"that allows people to add support for reading and
writing other image formats. Imagine that you want to supply a plug-in
that has two codecs and a filter all in a single plug-in. Your
plugInfo.json"Info"object might look something like this example.
.. code-block:: text
{
"Types": {
"MyTIFFCodec": {
"bases": ["ImageCodec"],
"displayName": "TIFF Image"
},
"MyJPEGCodec": {
"bases": ["ImageCodec"],
"displayName": "JPEG Image"
},
"MyCustomCoolFilter" : {
"bases": ["ImageFilter"],
"displayName": "Add Coolness to Image"
}
}
}
Dependencies on Other Plug-ins
==============================
If you write a plug-in that has dependencies on another plug-in that
you cannot (or do not want to) link against statically, you can
declare the dependencies in your plug-in's plugInfo.json. A plug-in
declares dependencies on other classes with a PluginDependencies key
whose value is a dictionary. The keys of the dictionary are plug-in
base class names and the values are arrays of subclass names.
The following example contains an example of a plug-in that depends on
two classes from the plug-in in the previous example.
.. code-block:: text
{
"Types": {
"UltraCoolFilter": {
"bases": ["MyCustomCoolFilter"],
"displayName": "Add Unbelievable Coolness to Image"
# A subclass of MyCustomCoolFilter that also uses MyTIFFCodec
}
},
"PluginDependencies": {
"ImageFilter": ["MyCustomCoolFilter"],
"ImageCodec": ["MyTIFFCodec"]
}
}
The ImageFilter provided by the plug-in in this example depends on the
other ImageFilter MyCoolImageFilter and the ImageCodec MyTIFFCodec.
Before loading this plug-in, the plug-in facility will ensure that
those two classes are present, loading the plug-in that contains them
if needed.
"""
result["Registry"].__init__.func_doc = """__init__(arg1)
Parameters
----------
arg1 : Registry
----------------------------------------------------------------------
__init__() -> PLUG_LOCAL
"""
result["Registry"].FindTypeByName.func_doc = """**classmethod** FindTypeByName(typeName) -> Type
Retrieve the ``TfType`` corresponding to the given ``name`` .
See the documentation for ``TfType::FindByName`` for more information.
Use this function if you expect that ``name`` may name a type provided
by a plugin. Calling this function will incur plugin discovery (but
not loading) if plugin discovery has not yet occurred.
Note that additional plugins may be registered during program runtime.
Plug-In Discovery & Registration
Parameters
----------
typeName : str
"""
result["Registry"].FindDerivedTypeByName.func_doc = """**classmethod** FindDerivedTypeByName(base, typeName) -> Type
Retrieve the ``TfType`` that derives from ``base`` and has the given
alias or type name ``typeName`` .
See the documentation for ``TfType::FindDerivedByName`` for more
information. Use this function if you expect that the derived type may
be provided by a plugin. Calling this function will incur plugin
discovery (but not loading) if plugin discovery has not yet occurred.
Note that additional plugins may be registered during program runtime.
Plug-In Discovery & Registration
Parameters
----------
base : Type
typeName : str
----------------------------------------------------------------------
FindDerivedTypeByName(typeName) -> Type
Retrieve the ``TfType`` that derives from ``Base`` and has the given
alias or type name ``typeName`` .
See the documentation for ``TfType::FindDerivedByName`` for more
information. Use this function if you expect that the derived type may
be provided by a plugin. Calling this function will incur plugin
discovery (but not loading) if plugin discovery has not yet occurred.
Note that additional plugins may be registered during program runtime.
Plug-In Discovery & Registration
Parameters
----------
typeName : str
"""
result["Registry"].GetDirectlyDerivedTypes.func_doc = """**classmethod** GetDirectlyDerivedTypes(base) -> list[Type]
Return a vector of types derived directly from *base*.
Use this function if you expect that plugins may provide types derived
from *base*. Otherwise, use *TfType::GetDirectlyDerivedTypes*.
Parameters
----------
base : Type
"""
result["Registry"].GetAllDerivedTypes.func_doc = """**classmethod** GetAllDerivedTypes(base, result) -> None
Return the set of all types derived (directly or indirectly) from
*base*.
Use this function if you expect that plugins may provide types derived
from *base*. Otherwise, use *TfType::GetAllDerivedTypes*.
Note that additional plugins may be registered during program runtime.
Plug-In Discovery & Registration
Parameters
----------
base : Type
result : set[Type]
----------------------------------------------------------------------
GetAllDerivedTypes(result) -> None
Return the set of all types derived (directly or indirectly) from
*Base*.
Use this function if you expect that plugins may provide types derived
from *base*. Otherwise, use *TfType::GetAllDerivedTypes*.
Note that additional plugins may be registered during program runtime.
Plug-In Discovery & Registration
Parameters
----------
result : set[Type]
"""
result["Registry"].RegisterPlugins.func_doc = """RegisterPlugins(pathToPlugInfo) -> list[PlugPluginPtr]
Registers all plug-ins discovered at *pathToPlugInfo*.
Sends PlugNotice::DidRegisterPlugins with any newly registered
plugins.
Parameters
----------
pathToPlugInfo : str
----------------------------------------------------------------------
RegisterPlugins(pathsToPlugInfo) -> list[PlugPluginPtr]
Registers all plug-ins discovered in any of *pathsToPlugInfo*.
Sends PlugNotice::DidRegisterPlugins with any newly registered
plugins.
Parameters
----------
pathsToPlugInfo : list[str]
"""
result["Registry"].GetPluginForType.func_doc = """GetPluginForType(t) -> Plugin
Returns the plug-in for the given type, or a null pointer if there is
no registered plug-in.
Parameters
----------
t : Type
"""
result["Registry"].GetAllPlugins.func_doc = """GetAllPlugins() -> list[PlugPluginPtr]
Returns all registered plug-ins.
Note that additional plugins may be registered during program runtime.
Plug-In Discovery & Registration
"""
result["Registry"].GetPluginWithName.func_doc = """GetPluginWithName(name) -> Plugin
Returns a plugin with the specified module name.
Note that additional plugins may be registered during program runtime.
Plug-In Discovery & Registration
Parameters
----------
name : str
"""
result["Registry"].GetStringFromPluginMetaData.func_doc = """GetStringFromPluginMetaData(type, key) -> str
Looks for a string associated with *type* and *key* and returns it, or
an empty string if *type* or *key* are not found.
Parameters
----------
type : Type
key : str
"""
result["Plugin"].isLoaded = property(result["Plugin"].isLoaded.fget, result["Plugin"].isLoaded.fset, result["Plugin"].isLoaded.fdel, """type : bool
Returns ``true`` if the plugin is currently loaded.
Resource plugins always report as loaded.
""")
result["Plugin"].isPythonModule = property(result["Plugin"].isPythonModule.fget, result["Plugin"].isPythonModule.fset, result["Plugin"].isPythonModule.fdel, """type : bool
Returns ``true`` if the plugin is a python module.
""")
result["Plugin"].isResource = property(result["Plugin"].isResource.fget, result["Plugin"].isResource.fset, result["Plugin"].isResource.fdel, """type : bool
Returns ``true`` if the plugin is resource-only.
""")
result["Plugin"].metadata = property(result["Plugin"].metadata.fget, result["Plugin"].metadata.fset, result["Plugin"].metadata.fdel, """type : JsObject
Returns the dictionary containing meta-data for the plugin.
""")
result["Plugin"].name = property(result["Plugin"].name.fget, result["Plugin"].name.fset, result["Plugin"].name.fdel, """type : str
Returns the plugin's name.
""")
result["Plugin"].path = property(result["Plugin"].path.fget, result["Plugin"].path.fset, result["Plugin"].path.fdel, """type : str
Returns the plugin's filesystem path.
""")
result["Plugin"].resourcePath = property(result["Plugin"].resourcePath.fget, result["Plugin"].resourcePath.fset, result["Plugin"].resourcePath.fdel, """type : str
Returns the plugin's resources filesystem path.
""") | 18,993 | Python | 28.402477 | 174 | 0.696046 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Plug/__init__.pyi | from __future__ import annotations
import pxr.Plug._plug
import typing
import Boost.Python
__all__ = [
"Notice",
"Plugin",
"Registry"
]
class Notice(Boost.Python.instance):
"""
Notifications sent by the Plug module.
"""
class Base(pxr.Tf.Notice, Boost.Python.instance):
pass
class DidRegisterPlugins(Base, pxr.Tf.Notice, Boost.Python.instance):
@staticmethod
def GetNewPlugins(*args, **kwargs) -> None: ...
pass
pass
class Plugin(Boost.Python.instance):
"""
Defines an interface to registered plugins.
Plugins are registered using the interfaces in ``PlugRegistry`` .
For each registered plugin, there is an instance of ``PlugPlugin``
which can be used to load and unload the plugin and to retrieve
information about the classes implemented by the plugin.
"""
@staticmethod
def DeclaresType(type, includeSubclasses) -> bool:
"""
DeclaresType(type, includeSubclasses) -> bool
Returns true if ``type`` is declared by this plugin.
If ``includeSubclasses`` is specified, also returns true if any
subclasses of ``type`` have been declared.
Parameters
----------
type : Type
includeSubclasses : bool
"""
@staticmethod
def FindPluginResource(path, verify) -> str:
"""
FindPluginResource(path, verify) -> str
Find a plugin resource by absolute or relative path optionally
verifying that file exists.
If verification fails an empty path is returned. Relative paths are
relative to the plugin's resource path.
Parameters
----------
path : str
verify : bool
"""
@staticmethod
def GetMetadataForType(type) -> JsObject:
"""
GetMetadataForType(type) -> JsObject
Returns the metadata sub-dictionary for a particular type.
Parameters
----------
type : Type
"""
@staticmethod
def Load() -> bool:
"""
Load() -> bool
Loads the plugin.
This is a noop if the plugin is already loaded.
"""
@staticmethod
def MakeResourcePath(path) -> str:
"""
MakeResourcePath(path) -> str
Build a plugin resource path by returning a given absolute path or
combining the plugin's resource path with a given relative path.
Parameters
----------
path : str
"""
@property
def expired(self) -> None:
"""
True if this object has expired, False otherwise.
:type: None
"""
@property
def isLoaded(self) -> None:
"""
type : bool
Returns ``true`` if the plugin is currently loaded.
Resource plugins always report as loaded.
:type: None
"""
@property
def isPythonModule(self) -> None:
"""
type : bool
Returns ``true`` if the plugin is a python module.
:type: None
"""
@property
def isResource(self) -> None:
"""
type : bool
Returns ``true`` if the plugin is resource-only.
:type: None
"""
@property
def metadata(self) -> None:
"""
type : JsObject
Returns the dictionary containing meta-data for the plugin.
:type: None
"""
@property
def name(self) -> None:
"""
type : str
Returns the plugin's name.
:type: None
"""
@property
def path(self) -> None:
"""
type : str
Returns the plugin's filesystem path.
:type: None
"""
@property
def resourcePath(self) -> None:
"""
type : str
Returns the plugin's resources filesystem path.
:type: None
"""
pass
class Registry(Boost.Python.instance):
"""
Defines an interface for registering plugins.
PlugRegistry maintains a registry of plug-ins known to the system and
provides an interface for base classes to load any plug-ins required
to instantiate a subclass of a given type.
Defining a Base Class API
=========================
In order to use this facility you will generally provide a module
which defines the API for a plug-in base class. This API will be
sufficient for the application or framework to make use of custom
subclasses that will be written by plug-in developers.
For example, if you have an image processing application, you might
want to support plug-ins that implement image filters. You can define
an abstract base class for image filters that declares the API your
application will require image filters to implement; perhaps something
simple like C++ Code Example 1 (Doxygen only).
People writing custom filters would write a subclass of ImageFilter
that overrides the two methods, implementing their own special
filtering behavior.
Enabling Plug-in Loading for the Base Class
===========================================
In order for ImageFilter to be able to load plug-ins that implement
these custom subclasses, it must be registered with the TfType system.
The ImageFilter base class, as was mentioned earlier, should be made
available in a module that the application links with. This is done
so that plug-ins that want to provide ImageFilters can also link with
the module allowing them to subclass ImageFilter.
Registering Plug-ins
====================
A plug-in developer can now write plug-ins with ImageFilter
subclasses. Plug-ins can be implemented either as native dynamic
modules (either regular dynamic modules or framework bundles) or
as Python modules.
Plug-ins must be registered with the registry. All plugins are
registered via RegisterPlugins() . Plug-in Python modules must be
directly importable (in other words they must be able to be found in
Python's module path.) Plugins are registered by providing a path or
paths to JSON files that describe the location, structure and contents
of the plugin. The standard name for these files in plugInfo.json.
Typically, the application that hosts plug-ins will locate and
register plug-ins at startup.
The plug-in facility is lazy. It does not dynamically load code from
plug-in bundles until that code is required.
plugInfo.json
=============
A plugInfo.json file has the following structure:
.. code-block:: text
{
# Comments are allowed and indicated by a hash at the start of a
# line or after spaces and tabs. They continue to the end of line.
# Blank lines are okay, too.
# This is optional. It may contain any number of strings.
# Paths may be absolute or relative.
# Paths ending with slash have plugInfo.json appended automatically.
# '\*' may be used anywhere to match any character except slash.
# '\*\*' may be used anywhere to match any character including slash.
"Includes": [
"/absolute/path/to/plugInfo.json",
"/absolute/path/to/custom.filename",
"/absolute/path/to/directory/with/plugInfo/",
"relative/path/to/plugInfo.json",
"relative/path/to/directory/with/plugInfo/",
"glob\*/pa\*th/\*to\*/\*/plugInfo.json",
"recursive/pa\*\*th/\*\*/"
],
# This is optional. It may contain any number of objects.
"Plugins": [
{
# Type is required and may be "module", "python" or "resource".
"Type": "module",
# Name is required. It should be the Python module name,
# the shared module name, or a unique resource name.
"Name": "myplugin",
# Root is optional. It defaults to ".".
# This gives the path to the plugin as a whole if the plugin
# has substructure. For Python it should be the directory
# with the __init__.py file. The path is usually relative.
"Root": ".",
# LibraryPath is required by Type "module" and unused
# otherwise. It gives the path to the shared module
# object, either absolute or relative to Root.
"LibraryPath": "libmyplugin.so",
# ResourcePath is option. It defaults to ".".
# This gives the path to the plugin's resources directory.
# The path is either absolute or relative to Root.
"ResourcePath": "resources",
# Info is required. It's described below.
"Info": {
# Plugin contents.
}
}
]
}
As a special case, if a plugInfo.json contains an object that doesn't
have either the"Includes"or"Plugins"keys then it's as if the object
was in a"Plugins"array.
Advertising a Plug-in's Contents
================================
Once the plug-ins are registered, the plug-in facility must also be
able to tell what they contain. Specifically, it must be able to find
out what subclasses of what plug-in base classes each plug-in
contains. Plug-ins must advertise this information through their
plugInfo.json file in the"Info"key. In the"Info"object there should be
a key"Types"holding an object.
This"Types"object's keys are names of subclasses and its values are
yet more objects (the subclass meta-data objects). The meta-data
objects can contain arbitrary key-value pairs. The plug-in mechanism
will look for a meta-data key called"displayName"whose value should be
the display name of the subclass. The plug-in mechanism will look for
a meta-data key called"bases"whose value should be an array of base
class type names.
For example, a bundle that contains a subclass of ImageFilter might
have a plugInfo.json that looks like the following example.
.. code-block:: text
{
"Types": {
"MyCustomCoolFilter" : {
"bases": ["ImageFilter"],
"displayName": "Add Coolness to Image"
# other arbitrary metadata for MyCustomCoolFilter here
}
}
}
What this says is that the plug-in contains a type called
MyCustomCoolFilter which has a base class ImageFilter and that this
subclass should be called"Add Coolness to Image"in user-visible
contexts.
In addition to the"displayName"meta-data key which is actually known
to the plug-in facility, you may put whatever other information you
want into a class'meta-data dictionary. If your plug-in base class
wants to define custom keys that it requires all subclasses to
provide, you can do that. Or, if a plug-in writer wants to define
their own keys that their code will look for at runtime, that is OK as
well.
Working with Subclasses of a Plug-in Base Class
===============================================
Most code with uses types defined in plug-ins doesn't deal with the
Plug API directly. Instead, the TfType interface is used to lookup
types and to manufacture instances. The TfType interface will take
care to load any required plugins.
To wrap up our example, the application that wants to actually use
ImageFilter plug-ins would probably do a couple of things. First, it
would get a list of available ImageFilters to present to the user.
This could be accomplished as shown in Python Code Example 2 (Doxygen
only).
Then, when the user picks a filter from the list, it would manufacture
and instance of the filter as shown in Python Code Example 3 (Doxygen
only).
As was mentioned earlier, this plug-in facility tries to be as lazy as
possible about loading the code associated with plug-ins. To that end,
loading of a plugin will be deferred until an instance of a type is
manufactured which requires the plugin.
Multiple Subclasses of Multiple Plug-in Base Classes
====================================================
It is possible for a bundle to implement multiple subclasses for a
plug-in base class if desired. If you want to package half a dozen
ImageFilter subclasses in one bundle, that will work fine. All must be
declared in the plugInfo.json.
It is possible for there to be multiple classes in your application or
framework that are plug-in base classes. Plug-ins that implement
subclasses of any of these base classes can all coexist. And, it is
possible to have subclasses of multiple plug-in base classes in the
same bundle.
When putting multiple subclasses (of the same or different base
classes) in a bundle, keep in mind that dynamic loading happens for
the whole bundle the first time any subclass is needed, the whole
bundle will be loaded. But this is generally not a big concern.
For example, say the example application also has a plug-in base
class"ImageCodec"that allows people to add support for reading and
writing other image formats. Imagine that you want to supply a plug-in
that has two codecs and a filter all in a single plug-in. Your
plugInfo.json"Info"object might look something like this example.
.. code-block:: text
{
"Types": {
"MyTIFFCodec": {
"bases": ["ImageCodec"],
"displayName": "TIFF Image"
},
"MyJPEGCodec": {
"bases": ["ImageCodec"],
"displayName": "JPEG Image"
},
"MyCustomCoolFilter" : {
"bases": ["ImageFilter"],
"displayName": "Add Coolness to Image"
}
}
}
Dependencies on Other Plug-ins
==============================
If you write a plug-in that has dependencies on another plug-in that
you cannot (or do not want to) link against statically, you can
declare the dependencies in your plug-in's plugInfo.json. A plug-in
declares dependencies on other classes with a PluginDependencies key
whose value is a dictionary. The keys of the dictionary are plug-in
base class names and the values are arrays of subclass names.
The following example contains an example of a plug-in that depends on
two classes from the plug-in in the previous example.
.. code-block:: text
{
"Types": {
"UltraCoolFilter": {
"bases": ["MyCustomCoolFilter"],
"displayName": "Add Unbelievable Coolness to Image"
# A subclass of MyCustomCoolFilter that also uses MyTIFFCodec
}
},
"PluginDependencies": {
"ImageFilter": ["MyCustomCoolFilter"],
"ImageCodec": ["MyTIFFCodec"]
}
}
The ImageFilter provided by the plug-in in this example depends on the
other ImageFilter MyCoolImageFilter and the ImageCodec MyTIFFCodec.
Before loading this plug-in, the plug-in facility will ensure that
those two classes are present, loading the plug-in that contains them
if needed.
"""
@staticmethod
def FindDerivedTypeByName(typeName) -> Type:
"""
**classmethod** FindDerivedTypeByName(base, typeName) -> Type
Retrieve the ``TfType`` that derives from ``base`` and has the given
alias or type name ``typeName`` .
See the documentation for ``TfType::FindDerivedByName`` for more
information. Use this function if you expect that the derived type may
be provided by a plugin. Calling this function will incur plugin
discovery (but not loading) if plugin discovery has not yet occurred.
Note that additional plugins may be registered during program runtime.
Plug-In Discovery & Registration
Parameters
----------
base : Type
typeName : str
----------------------------------------------------------------------
Retrieve the ``TfType`` that derives from ``Base`` and has the given
alias or type name ``typeName`` .
See the documentation for ``TfType::FindDerivedByName`` for more
information. Use this function if you expect that the derived type may
be provided by a plugin. Calling this function will incur plugin
discovery (but not loading) if plugin discovery has not yet occurred.
Note that additional plugins may be registered during program runtime.
Plug-In Discovery & Registration
Parameters
----------
typeName : str
"""
@staticmethod
def FindTypeByName(*args, **kwargs) -> None:
"""
**classmethod** FindTypeByName(typeName) -> Type
Retrieve the ``TfType`` corresponding to the given ``name`` .
See the documentation for ``TfType::FindByName`` for more information.
Use this function if you expect that ``name`` may name a type provided
by a plugin. Calling this function will incur plugin discovery (but
not loading) if plugin discovery has not yet occurred.
Note that additional plugins may be registered during program runtime.
Plug-In Discovery & Registration
Parameters
----------
typeName : str
"""
@staticmethod
def GetAllDerivedTypes(result) -> None:
"""
**classmethod** GetAllDerivedTypes(base, result) -> None
Return the set of all types derived (directly or indirectly) from
*base*.
Use this function if you expect that plugins may provide types derived
from *base*. Otherwise, use *TfType::GetAllDerivedTypes*.
Note that additional plugins may be registered during program runtime.
Plug-In Discovery & Registration
Parameters
----------
base : Type
result : set[Type]
----------------------------------------------------------------------
Return the set of all types derived (directly or indirectly) from
*Base*.
Use this function if you expect that plugins may provide types derived
from *base*. Otherwise, use *TfType::GetAllDerivedTypes*.
Note that additional plugins may be registered during program runtime.
Plug-In Discovery & Registration
Parameters
----------
result : set[Type]
"""
@staticmethod
def GetAllPlugins() -> list[PlugPluginPtr]:
"""
GetAllPlugins() -> list[PlugPluginPtr]
Returns all registered plug-ins.
Note that additional plugins may be registered during program runtime.
Plug-In Discovery & Registration
"""
@staticmethod
def GetDirectlyDerivedTypes(*args, **kwargs) -> None:
"""
**classmethod** GetDirectlyDerivedTypes(base) -> list[Type]
Return a vector of types derived directly from *base*.
Use this function if you expect that plugins may provide types derived
from *base*. Otherwise, use *TfType::GetDirectlyDerivedTypes*.
Parameters
----------
base : Type
"""
@staticmethod
def GetPluginForType(t) -> Plugin:
"""
GetPluginForType(t) -> Plugin
Returns the plug-in for the given type, or a null pointer if there is
no registered plug-in.
Parameters
----------
t : Type
"""
@staticmethod
def GetPluginWithName(name) -> Plugin:
"""
GetPluginWithName(name) -> Plugin
Returns a plugin with the specified module name.
Note that additional plugins may be registered during program runtime.
Plug-In Discovery & Registration
Parameters
----------
name : str
"""
@staticmethod
def GetStringFromPluginMetaData(type, key) -> str:
"""
GetStringFromPluginMetaData(type, key) -> str
Looks for a string associated with *type* and *key* and returns it, or
an empty string if *type* or *key* are not found.
Parameters
----------
type : Type
key : str
"""
@staticmethod
@typing.overload
def RegisterPlugins(pathToPlugInfo) -> list[PlugPluginPtr]:
"""
RegisterPlugins(pathToPlugInfo) -> list[PlugPluginPtr]
Registers all plug-ins discovered at *pathToPlugInfo*.
Sends PlugNotice::DidRegisterPlugins with any newly registered
plugins.
Parameters
----------
pathToPlugInfo : str
----------------------------------------------------------------------
Registers all plug-ins discovered in any of *pathsToPlugInfo*.
Sends PlugNotice::DidRegisterPlugins with any newly registered
plugins.
Parameters
----------
pathsToPlugInfo : list[str]
"""
@staticmethod
@typing.overload
def RegisterPlugins(pathsToPlugInfo) -> list[PlugPluginPtr]: ...
@staticmethod
def __init__() -> PLUG_LOCAL:
"""
__init__(arg1)
Parameters
----------
arg1 : Registry
----------------------------------------------------------------------
"""
@property
def expired(self) -> None:
"""
True if this object has expired, False otherwise.
:type: None
"""
pass
class _TestPlugBase1(Boost.Python.instance):
@staticmethod
def GetTypeName(*args, **kwargs) -> None: ...
@property
def expired(self) -> None:
"""
True if this object has expired, False otherwise.
:type: None
"""
pass
class _TestPlugBase2(Boost.Python.instance):
@staticmethod
def GetTypeName(*args, **kwargs) -> None: ...
@property
def expired(self) -> None:
"""
True if this object has expired, False otherwise.
:type: None
"""
pass
class _TestPlugBase3(Boost.Python.instance):
@staticmethod
def GetTypeName(*args, **kwargs) -> None: ...
@property
def expired(self) -> None:
"""
True if this object has expired, False otherwise.
:type: None
"""
pass
class _TestPlugBase4(Boost.Python.instance):
@staticmethod
def GetTypeName(*args, **kwargs) -> None: ...
@property
def expired(self) -> None:
"""
True if this object has expired, False otherwise.
:type: None
"""
pass
def _LoadPluginsConcurrently(*args, **kwargs) -> None:
pass
__MFB_FULL_PACKAGE_NAME = 'plug'
| 23,072 | unknown | 29.200262 | 81 | 0.604802 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdShade/__init__.py | #
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
from pxr import Tf
Tf.PreparePythonModule()
del Tf
| 1,110 | Python | 40.148147 | 74 | 0.766667 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdShade/__DOC.py | def Execute(result):
result["ConnectableAPI"].__doc__ = """
UsdShadeConnectableAPI is an API schema that provides a common
interface for creating outputs and making connections between shading
parameters and outputs. The interface is common to all UsdShade
schemas that support Inputs and Outputs, which currently includes
UsdShadeShader, UsdShadeNodeGraph, and UsdShadeMaterial.
One can construct a UsdShadeConnectableAPI directly from a UsdPrim, or
from objects of any of the schema classes listed above. If it seems
onerous to need to construct a secondary schema object to interact
with Inputs and Outputs, keep in mind that any function whose purpose
is either to walk material/shader networks via their connections, or
to create such networks, can typically be written entirely in terms of
UsdShadeConnectableAPI objects, without needing to care what the
underlying prim type is.
Additionally, the most common UsdShadeConnectableAPI behaviors
(creating Inputs and Outputs, and making connections) are wrapped as
convenience methods on the prim schema classes (creation) and
UsdShadeInput and UsdShadeOutput.
"""
result["ConnectableAPI"].CanConnect.func_doc = """**classmethod** CanConnect(input, source) -> bool
Determines whether the given input can be connected to the given
source attribute, which can be an input or an output.
The result depends on the"connectability"of the input and the source
attributes. Depending on the prim type, this may require the plugin
that defines connectability behavior for that prim type be loaded.
UsdShadeInput::SetConnectability
UsdShadeInput::GetConnectability
Parameters
----------
input : Input
source : Attribute
----------------------------------------------------------------------
CanConnect(input, sourceInput) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
sourceInput : Input
----------------------------------------------------------------------
CanConnect(input, sourceOutput) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
sourceOutput : Output
----------------------------------------------------------------------
CanConnect(output, source) -> bool
Determines whether the given output can be connected to the given
source attribute, which can be an input or an output.
An output is considered to be connectable only if it belongs to a
node-graph. Shader outputs are not connectable.
``source`` is an optional argument. If a valid UsdAttribute is
supplied for it, this method will return true only if the source
attribute is owned by a descendant of the node-graph owning the
output.
Parameters
----------
output : Output
source : Attribute
----------------------------------------------------------------------
CanConnect(output, sourceInput) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
sourceInput : Input
----------------------------------------------------------------------
CanConnect(output, sourceOutput) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
sourceOutput : Output
"""
result["ConnectableAPI"].ConnectToSource.func_doc = """**classmethod** ConnectToSource(shadingAttr, source, mod) -> bool
Authors a connection for a given shading attribute ``shadingAttr`` .
``shadingAttr`` can represent a parameter, an input or an output.
``source`` is a struct that describes the upstream source attribute
with all the information necessary to make a connection. See the
documentation for UsdShadeConnectionSourceInfo. ``mod`` describes the
operation that should be applied to the list of connections. By
default the new connection will replace any existing connections, but
it can add to the list of connections to represent multiple input
connections.
``true`` if a connection was created successfully. ``false`` if
``shadingAttr`` or ``source`` is invalid.
This method does not verify the connectability of the shading
attribute to the source. Clients must invoke CanConnect() themselves
to ensure compatibility.
The source shading attribute is created if it doesn't exist already.
Parameters
----------
shadingAttr : Attribute
source : ConnectionSourceInfo
mod : ConnectionModification
----------------------------------------------------------------------
ConnectToSource(input, source, mod) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
source : ConnectionSourceInfo
mod : ConnectionModification
----------------------------------------------------------------------
ConnectToSource(output, source, mod) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
source : ConnectionSourceInfo
mod : ConnectionModification
----------------------------------------------------------------------
ConnectToSource(shadingAttr, source, sourceName, sourceType, typeName) -> bool
Deprecated
Please use the versions that take a UsdShadeConnectionSourceInfo to
describe the upstream source This is an overloaded member function,
provided for convenience. It differs from the above function only in
what argument(s) it accepts.
Parameters
----------
shadingAttr : Attribute
source : ConnectableAPI
sourceName : str
sourceType : AttributeType
typeName : ValueTypeName
----------------------------------------------------------------------
ConnectToSource(input, source, sourceName, sourceType, typeName) -> bool
Deprecated
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
source : ConnectableAPI
sourceName : str
sourceType : AttributeType
typeName : ValueTypeName
----------------------------------------------------------------------
ConnectToSource(output, source, sourceName, sourceType, typeName) -> bool
Deprecated
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
source : ConnectableAPI
sourceName : str
sourceType : AttributeType
typeName : ValueTypeName
----------------------------------------------------------------------
ConnectToSource(shadingAttr, sourcePath) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Connect the given shading attribute to the source at path,
``sourcePath`` .
``sourcePath`` should be the fully namespaced property path.
This overload is provided for convenience, for use in contexts where
the prim types are unknown or unavailable.
Parameters
----------
shadingAttr : Attribute
sourcePath : Path
----------------------------------------------------------------------
ConnectToSource(input, sourcePath) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
sourcePath : Path
----------------------------------------------------------------------
ConnectToSource(output, sourcePath) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
sourcePath : Path
----------------------------------------------------------------------
ConnectToSource(shadingAttr, sourceInput) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Connect the given shading attribute to the given source input.
Parameters
----------
shadingAttr : Attribute
sourceInput : Input
----------------------------------------------------------------------
ConnectToSource(input, sourceInput) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
sourceInput : Input
----------------------------------------------------------------------
ConnectToSource(output, sourceInput) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
sourceInput : Input
----------------------------------------------------------------------
ConnectToSource(shadingAttr, sourceOutput) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Connect the given shading attribute to the given source output.
Parameters
----------
shadingAttr : Attribute
sourceOutput : Output
----------------------------------------------------------------------
ConnectToSource(input, sourceOutput) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
sourceOutput : Output
----------------------------------------------------------------------
ConnectToSource(output, sourceOutput) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
sourceOutput : Output
"""
result["ConnectableAPI"].SetConnectedSources.func_doc = """**classmethod** SetConnectedSources(shadingAttr, sourceInfos) -> bool
Authors a list of connections for a given shading attribute
``shadingAttr`` .
``shadingAttr`` can represent a parameter, an input or an output.
``sourceInfos`` is a vector of structs that describes the upstream
source attributes with all the information necessary to make all the
connections. See the documentation for UsdShadeConnectionSourceInfo.
``true`` if all connection were created successfully. ``false`` if the
``shadingAttr`` or one of the sources are invalid.
A valid connection is one that has a valid
``UsdShadeConnectionSourceInfo`` , which requires the existence of the
upstream source prim. It does not require the existence of the source
attribute as it will be create if necessary.
Parameters
----------
shadingAttr : Attribute
sourceInfos : list[ConnectionSourceInfo]
"""
result["ConnectableAPI"].GetConnectedSource.func_doc = """**classmethod** GetConnectedSource(shadingAttr, source, sourceName, sourceType) -> bool
Deprecated
Shading attributes can have multiple connections and so using
GetConnectedSources is needed in general
Finds the source of a connection for the given shading attribute.
``shadingAttr`` is the shading attribute whose connection we want to
interrogate. ``source`` is an output parameter which will be set to
the source connectable prim. ``sourceName`` will be set to the name of
the source shading attribute, which may be an input or an output, as
specified by ``sourceType`` ``sourceType`` will have the type of the
source shading attribute, i.e. whether it is an ``Input`` or
``Output``
``true`` if the shading attribute is connected to a valid, defined
source attribute. ``false`` if the shading attribute is not connected
to a single, defined source attribute.
Previously this method would silently return false for multiple
connections. We are changing the behavior of this method to return the
result for the first connection and issue a TfWarn about it. We want
to encourage clients to use GetConnectedSources going forward.
The python wrapping for this method returns a (source, sourceName,
sourceType) tuple if the parameter is connected, else ``None``
Parameters
----------
shadingAttr : Attribute
source : ConnectableAPI
sourceName : str
sourceType : AttributeType
----------------------------------------------------------------------
GetConnectedSource(input, source, sourceName, sourceType) -> bool
Deprecated
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
source : ConnectableAPI
sourceName : str
sourceType : AttributeType
----------------------------------------------------------------------
GetConnectedSource(output, source, sourceName, sourceType) -> bool
Deprecated
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
source : ConnectableAPI
sourceName : str
sourceType : AttributeType
"""
result["ConnectableAPI"].GetConnectedSources.func_doc = """**classmethod** GetConnectedSources(shadingAttr, invalidSourcePaths) -> list[UsdShadeSourceInfo]
Finds the valid sources of connections for the given shading
attribute.
``shadingAttr`` is the shading attribute whose connections we want to
interrogate. ``invalidSourcePaths`` is an optional output parameter to
collect the invalid source paths that have not been reported in the
returned vector.
Returns a vector of ``UsdShadeConnectionSourceInfo`` structs with
information about each upsteam attribute. If the vector is empty,
there have been no connections.
A valid connection requires the existence of the source attribute and
also requires that the source prim is UsdShadeConnectableAPI
compatible.
The python wrapping returns a tuple with the valid connections first,
followed by the invalid source paths.
Parameters
----------
shadingAttr : Attribute
invalidSourcePaths : list[SdfPath]
----------------------------------------------------------------------
GetConnectedSources(input, invalidSourcePaths) -> list[UsdShadeSourceInfo]
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
invalidSourcePaths : list[SdfPath]
----------------------------------------------------------------------
GetConnectedSources(output, invalidSourcePaths) -> list[UsdShadeSourceInfo]
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
invalidSourcePaths : list[SdfPath]
"""
result["ConnectableAPI"].GetRawConnectedSourcePaths.func_doc = """**classmethod** GetRawConnectedSourcePaths(shadingAttr, sourcePaths) -> bool
Deprecated
Please us GetConnectedSources to retrieve multiple connections
Returns the"raw"(authored) connected source paths for the given
shading attribute.
Parameters
----------
shadingAttr : Attribute
sourcePaths : list[SdfPath]
----------------------------------------------------------------------
GetRawConnectedSourcePaths(input, sourcePaths) -> bool
Deprecated
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
sourcePaths : list[SdfPath]
----------------------------------------------------------------------
GetRawConnectedSourcePaths(output, sourcePaths) -> bool
Deprecated
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
sourcePaths : list[SdfPath]
"""
result["ConnectableAPI"].HasConnectedSource.func_doc = """**classmethod** HasConnectedSource(shadingAttr) -> bool
Returns true if and only if the shading attribute is currently
connected to at least one valid (defined) source.
If you will be calling GetConnectedSources() afterwards anyways, it
will be *much* faster to instead check if the returned vector is
empty:
.. code-block:: text
UsdShadeSourceInfoVector connections =
UsdShadeConnectableAPI::GetConnectedSources(attribute);
if (!connections.empty()){
// process connected attribute
} else {
// process unconnected attribute
}
Parameters
----------
shadingAttr : Attribute
----------------------------------------------------------------------
HasConnectedSource(input) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
----------------------------------------------------------------------
HasConnectedSource(output) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
"""
result["ConnectableAPI"].IsSourceConnectionFromBaseMaterial.func_doc = """**classmethod** IsSourceConnectionFromBaseMaterial(shadingAttr) -> bool
Returns true if the connection to the given shading attribute's
source, as returned by UsdShadeConnectableAPI::GetConnectedSource() ,
is authored across a specializes arc, which is used to denote a base
material.
Parameters
----------
shadingAttr : Attribute
----------------------------------------------------------------------
IsSourceConnectionFromBaseMaterial(input) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
----------------------------------------------------------------------
IsSourceConnectionFromBaseMaterial(output) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
"""
result["ConnectableAPI"].DisconnectSource.func_doc = """**classmethod** DisconnectSource(shadingAttr, sourceAttr) -> bool
Disconnect source for this shading attribute.
If ``sourceAttr`` is valid it will disconnect the connection to this
upstream attribute. Otherwise it will disconnect all connections by
authoring an empty list of connections for the attribute
``shadingAttr`` .
This may author more scene description than you might expect - we
define the behavior of disconnect to be that, even if a shading
attribute becomes connected in a weaker layer than the current
UsdEditTarget, the attribute will *still* be disconnected in the
composition, therefore we must"block"it in the current UsdEditTarget.
ConnectToSource() .
Parameters
----------
shadingAttr : Attribute
sourceAttr : Attribute
----------------------------------------------------------------------
DisconnectSource(input, sourceAttr) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
sourceAttr : Attribute
----------------------------------------------------------------------
DisconnectSource(output, sourceAttr) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
sourceAttr : Attribute
"""
result["ConnectableAPI"].ClearSources.func_doc = """**classmethod** ClearSources(shadingAttr) -> bool
Clears sources for this shading attribute in the current
UsdEditTarget.
Most of the time, what you probably want is DisconnectSource() rather
than this function.
DisconnectSource()
Parameters
----------
shadingAttr : Attribute
----------------------------------------------------------------------
ClearSources(input) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
----------------------------------------------------------------------
ClearSources(output) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
"""
result["ConnectableAPI"].ClearSource.func_doc = """**classmethod** ClearSource(shadingAttr) -> bool
Deprecated
This is the older version that only referenced a single source. Please
use ClearSources instead.
Parameters
----------
shadingAttr : Attribute
----------------------------------------------------------------------
ClearSource(input) -> bool
Deprecated
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
----------------------------------------------------------------------
ClearSource(output) -> bool
Deprecated
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
"""
result["ConnectableAPI"].HasConnectableAPI.func_doc = """**classmethod** HasConnectableAPI(schemaType) -> bool
Return true if the ``schemaType`` has a valid connectableAPIBehavior
registered, false otherwise.
To check if a prim's connectableAPI has a behavior defined, use
UsdSchemaBase::operator bool() .
Parameters
----------
schemaType : Type
----------------------------------------------------------------------
HasConnectableAPI() -> bool
Return true if the schema type ``T`` has a connectableAPIBehavior
registered, false otherwise.
"""
result["ConnectableAPI"].CreateOutput.func_doc = """CreateOutput(name, typeName) -> Output
Create an output, which represents and externally computed, typed
value.
Outputs on node-graphs can be connected.
The attribute representing an output is created in
the"outputs:"namespace.
Parameters
----------
name : str
typeName : ValueTypeName
"""
result["ConnectableAPI"].GetOutput.func_doc = """GetOutput(name) -> Output
Return the requested output if it exists.
``name`` is the unnamespaced base name.
Parameters
----------
name : str
"""
result["ConnectableAPI"].GetOutputs.func_doc = """GetOutputs(onlyAuthored) -> list[Output]
Returns all outputs on the connectable prim (i.e.
shader or node-graph). Outputs are represented by attributes in
the"outputs:"namespace. If ``onlyAuthored`` is true (the default),
then only return authored attributes; otherwise, this also returns un-
authored builtins.
Parameters
----------
onlyAuthored : bool
"""
result["ConnectableAPI"].CreateInput.func_doc = """CreateInput(name, typeName) -> Input
Create an input which can both have a value and be connected.
The attribute representing the input is created in
the"inputs:"namespace.
Parameters
----------
name : str
typeName : ValueTypeName
"""
result["ConnectableAPI"].GetInput.func_doc = """GetInput(name) -> Input
Return the requested input if it exists.
``name`` is the unnamespaced base name.
Parameters
----------
name : str
"""
result["ConnectableAPI"].GetInputs.func_doc = """GetInputs(onlyAuthored) -> list[Input]
Returns all inputs on the connectable prim (i.e.
shader or node-graph). Inputs are represented by attributes in
the"inputs:"namespace. If ``onlyAuthored`` is true (the default), then
only return authored attributes; otherwise, this also returns un-
authored builtins.
Parameters
----------
onlyAuthored : bool
"""
result["ConnectableAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdShadeConnectableAPI on UsdPrim ``prim`` .
Equivalent to UsdShadeConnectableAPI::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdShadeConnectableAPI on the prim held by ``schemaObj`` .
Should be preferred over UsdShadeConnectableAPI (schemaObj.GetPrim()),
as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["ConnectableAPI"].IsContainer.func_doc = """IsContainer() -> bool
Returns true if the prim is a container.
The underlying prim type may provide runtime behavior that defines
whether it is a container.
"""
result["ConnectableAPI"].RequiresEncapsulation.func_doc = """RequiresEncapsulation() -> bool
Returns true if container encapsulation rules should be respected when
evaluating connectibility behavior, false otherwise.
The underlying prim type may provide runtime behavior that defines if
encapsulation rules are respected or not.
"""
result["ConnectableAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["ConnectableAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> ConnectableAPI
Return a UsdShadeConnectableAPI holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdShadeConnectableAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["ConnectableAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["ConnectionSourceInfo"].__doc__ = """
A compact struct to represent a bundle of information about an
upstream source attribute.
"""
result["ConnectionSourceInfo"].__init__.func_doc = """__init__()
----------------------------------------------------------------------
__init__(source_, sourceName_, sourceType_, typeName_)
Parameters
----------
source_ : ConnectableAPI
sourceName_ : str
sourceType_ : AttributeType
typeName_ : ValueTypeName
----------------------------------------------------------------------
__init__(input)
Parameters
----------
input : Input
----------------------------------------------------------------------
__init__(output)
Parameters
----------
output : Output
----------------------------------------------------------------------
__init__(stage, sourcePath)
Construct the information for this struct from a property path.
The source attribute does not have to exist, but the ``sourcePath``
needs to have a valid prefix to identify the sourceType. The source
prim needs to exist and be UsdShadeConnectableAPI compatible
Parameters
----------
stage : Stage
sourcePath : Path
"""
result["ConnectionSourceInfo"].IsValid.func_doc = """IsValid() -> bool
Return true if this source info is valid for setting up a connection.
"""
result["CoordSysAPI"].__doc__ = """
UsdShadeCoordSysAPI provides a way to designate, name, and discover
coordinate systems.
Coordinate systems are implicitly established by UsdGeomXformable
prims, using their local space. That coordinate system may be bound
(i.e., named) from another prim. The binding is encoded as a single-
target relationship in the"coordSys:"namespace. Coordinate system
bindings apply to descendants of the prim where the binding is
expressed, but names may be re-bound by descendant prims.
Named coordinate systems are useful in shading workflows. An example
is projection paint, which projects a texture from a certain view (the
paint coordinate system). Using the paint coordinate frame avoids the
need to assign a UV set to the object, and can be a concise way to
project paint across a collection of objects with a single shared
paint coordinate system.
This is a non-applied API schema.
"""
result["CoordSysAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdShadeCoordSysAPI on UsdPrim ``prim`` .
Equivalent to UsdShadeCoordSysAPI::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdShadeCoordSysAPI on the prim held by ``schemaObj`` .
Should be preferred over UsdShadeCoordSysAPI (schemaObj.GetPrim()), as
it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["CoordSysAPI"].HasLocalBindings.func_doc = """HasLocalBindings() -> bool
Returns true if the prim has local coordinate system binding opinions.
Note that the resulting binding list may still be empty.
"""
result["CoordSysAPI"].GetLocalBindings.func_doc = """GetLocalBindings() -> list[Binding]
Get the list of coordinate system bindings local to this prim.
This does not process inherited bindings. It does not validate that a
prim exists at the indicated path. If the binding relationship has
multiple targets, only the first is used.
"""
result["CoordSysAPI"].FindBindingsWithInheritance.func_doc = """FindBindingsWithInheritance() -> list[Binding]
Find the list of coordinate system bindings that apply to this prim,
including inherited bindings.
This computation examines this prim and ancestors for the strongest
binding for each name. A binding expressed by a child prim supercedes
bindings on ancestors.
Note that this API does not validate the prims at the target paths;
they may be of incorrect type, or missing entirely.
Binding relationships with no resolved targets are skipped.
"""
result["CoordSysAPI"].Bind.func_doc = """Bind(name, path) -> bool
Bind the name to the given path.
The prim at the given path is expected to be UsdGeomXformable, in
order for the binding to be succesfully resolved.
Parameters
----------
name : str
path : Path
"""
result["CoordSysAPI"].ClearBinding.func_doc = """ClearBinding(name, removeSpec) -> bool
Clear the indicated coordinate system binding on this prim from the
current edit target.
Only remove the spec if ``removeSpec`` is true (leave the spec to
preserve meta-data we may have intentionally authored on the
relationship)
Parameters
----------
name : str
removeSpec : bool
"""
result["CoordSysAPI"].BlockBinding.func_doc = """BlockBinding(name) -> bool
Block the indicated coordinate system binding on this prim by blocking
targets on the underlying relationship.
Parameters
----------
name : str
"""
result["CoordSysAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["CoordSysAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> CoordSysAPI
Return a UsdShadeCoordSysAPI holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdShadeCoordSysAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["CoordSysAPI"].GetCoordSysRelationshipName.func_doc = """**classmethod** GetCoordSysRelationshipName(coordSysName) -> str
Returns the fully namespaced coordinate system relationship name,
given the coordinate system name.
Parameters
----------
coordSysName : str
"""
result["CoordSysAPI"].CanContainPropertyName.func_doc = """**classmethod** CanContainPropertyName(name) -> bool
Test whether a given ``name`` contains the"coordSys:"prefix.
Parameters
----------
name : str
"""
result["CoordSysAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["Input"].__doc__ = """
This class encapsulates a shader or node-graph input, which is a
connectable attribute representing a typed value.
"""
result["Input"].SetRenderType.func_doc = """SetRenderType(renderType) -> bool
Specify an alternative, renderer-specific type to use when
emitting/translating this Input, rather than translating based on its
GetTypeName()
For example, we set the renderType to"struct"for Inputs that are of
renderman custom struct types.
true on success.
Parameters
----------
renderType : str
"""
result["Input"].GetRenderType.func_doc = """GetRenderType() -> str
Return this Input's specialized renderType, or an empty token if none
was authored.
SetRenderType()
"""
result["Input"].HasRenderType.func_doc = """HasRenderType() -> bool
Return true if a renderType has been specified for this Input.
SetRenderType()
"""
result["Input"].GetSdrMetadata.func_doc = """GetSdrMetadata() -> NdrTokenMap
Returns this Input's composed"sdrMetadata"dictionary as a NdrTokenMap.
"""
result["Input"].GetSdrMetadataByKey.func_doc = """GetSdrMetadataByKey(key) -> str
Returns the value corresponding to ``key`` in the composed
**sdrMetadata** dictionary.
Parameters
----------
key : str
"""
result["Input"].SetSdrMetadata.func_doc = """SetSdrMetadata(sdrMetadata) -> None
Authors the given ``sdrMetadata`` value on this Input at the current
EditTarget.
Parameters
----------
sdrMetadata : NdrTokenMap
"""
result["Input"].SetSdrMetadataByKey.func_doc = """SetSdrMetadataByKey(key, value) -> None
Sets the value corresponding to ``key`` to the given string ``value``
, in the Input's"sdrMetadata"dictionary at the current EditTarget.
Parameters
----------
key : str
value : str
"""
result["Input"].HasSdrMetadata.func_doc = """HasSdrMetadata() -> bool
Returns true if the Input has a non-empty
composed"sdrMetadata"dictionary value.
"""
result["Input"].HasSdrMetadataByKey.func_doc = """HasSdrMetadataByKey(key) -> bool
Returns true if there is a value corresponding to the given ``key`` in
the composed"sdrMetadata"dictionary.
Parameters
----------
key : str
"""
result["Input"].ClearSdrMetadata.func_doc = """ClearSdrMetadata() -> None
Clears any"sdrMetadata"value authored on the Input in the current
EditTarget.
"""
result["Input"].ClearSdrMetadataByKey.func_doc = """ClearSdrMetadataByKey(key) -> None
Clears the entry corresponding to the given ``key`` in
the"sdrMetadata"dictionary authored in the current EditTarget.
Parameters
----------
key : str
"""
result["Input"].__init__.func_doc = """__init__(attr)
Speculative constructor that will produce a valid UsdShadeInput when
``attr`` already represents a shade Input, and produces an *invalid*
UsdShadeInput otherwise (i.e.
the explicit bool conversion operator will return false).
Parameters
----------
attr : Attribute
----------------------------------------------------------------------
__init__()
Default constructor returns an invalid Input.
Exists for the sake of container classes
----------------------------------------------------------------------
__init__(prim, name, typeName)
Parameters
----------
prim : Prim
name : str
typeName : ValueTypeName
"""
result["Input"].GetAttr.func_doc = """GetAttr() -> Attribute
Explicit UsdAttribute extractor.
"""
result["Input"].SetDocumentation.func_doc = """SetDocumentation(docs) -> bool
Set documentation string for this Input.
UsdObject::SetDocumentation()
Parameters
----------
docs : str
"""
result["Input"].GetDocumentation.func_doc = """GetDocumentation() -> str
Get documentation string for this Input.
UsdObject::GetDocumentation()
"""
result["Input"].SetDisplayGroup.func_doc = """SetDisplayGroup(displayGroup) -> bool
Set the displayGroup metadata for this Input, i.e.
hinting for the location and nesting of the attribute.
Note for an input representing a nested SdrShaderProperty, its
expected to have the scope delimited by a":".
UsdProperty::SetDisplayGroup() , UsdProperty::SetNestedDisplayGroup()
SdrShaderProperty::GetPage()
Parameters
----------
displayGroup : str
"""
result["Input"].GetDisplayGroup.func_doc = """GetDisplayGroup() -> str
Get the displayGroup metadata for this Input, i.e.
hint for the location and nesting of the attribute.
UsdProperty::GetDisplayGroup() , UsdProperty::GetNestedDisplayGroup()
"""
result["Input"].IsInput.func_doc = """**classmethod** IsInput(attr) -> bool
Test whether a given UsdAttribute represents a valid Input, which
implies that creating a UsdShadeInput from the attribute will succeed.
Success implies that ``attr.IsDefined()`` is true.
Parameters
----------
attr : Attribute
"""
result["Input"].IsInterfaceInputName.func_doc = """**classmethod** IsInterfaceInputName(name) -> bool
Test if this name has a namespace that indicates it could be an input.
Parameters
----------
name : str
"""
result["Input"].CanConnect.func_doc = """CanConnect(source) -> bool
Determines whether this Input can be connected to the given source
attribute, which can be an input or an output.
UsdShadeConnectableAPI::CanConnect
Parameters
----------
source : Attribute
----------------------------------------------------------------------
CanConnect(sourceInput) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
sourceInput : Input
----------------------------------------------------------------------
CanConnect(sourceOutput) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
sourceOutput : Output
"""
result["Input"].ConnectToSource.func_doc = """ConnectToSource(source, mod) -> bool
Authors a connection for this Input.
``source`` is a struct that describes the upstream source attribute
with all the information necessary to make a connection. See the
documentation for UsdShadeConnectionSourceInfo. ``mod`` describes the
operation that should be applied to the list of connections. By
default the new connection will replace any existing connections, but
it can add to the list of connections to represent multiple input
connections.
``true`` if a connection was created successfully. ``false`` if this
input or ``source`` is invalid.
This method does not verify the connectability of the shading
attribute to the source. Clients must invoke CanConnect() themselves
to ensure compatibility.
The source shading attribute is created if it doesn't exist already.
UsdShadeConnectableAPI::ConnectToSource
Parameters
----------
source : ConnectionSourceInfo
mod : ConnectionModification
----------------------------------------------------------------------
ConnectToSource(source, sourceName, sourceType, typeName) -> bool
Deprecated
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
source : ConnectableAPI
sourceName : str
sourceType : AttributeType
typeName : ValueTypeName
----------------------------------------------------------------------
ConnectToSource(sourcePath) -> bool
Authors a connection for this Input to the source at the given path.
UsdShadeConnectableAPI::ConnectToSource
Parameters
----------
sourcePath : Path
----------------------------------------------------------------------
ConnectToSource(sourceInput) -> bool
Connects this Input to the given input, ``sourceInput`` .
UsdShadeConnectableAPI::ConnectToSource
Parameters
----------
sourceInput : Input
----------------------------------------------------------------------
ConnectToSource(sourceOutput) -> bool
Connects this Input to the given output, ``sourceOutput`` .
UsdShadeConnectableAPI::ConnectToSource
Parameters
----------
sourceOutput : Output
"""
result["Input"].SetConnectedSources.func_doc = """SetConnectedSources(sourceInfos) -> bool
Connects this Input to the given sources, ``sourceInfos`` .
UsdShadeConnectableAPI::SetConnectedSources
Parameters
----------
sourceInfos : list[ConnectionSourceInfo]
"""
result["Input"].GetConnectedSources.func_doc = """GetConnectedSources(invalidSourcePaths) -> list[SourceInfo]
Finds the valid sources of connections for the Input.
``invalidSourcePaths`` is an optional output parameter to collect the
invalid source paths that have not been reported in the returned
vector.
Returns a vector of ``UsdShadeConnectionSourceInfo`` structs with
information about each upsteam attribute. If the vector is empty,
there have been no valid connections.
A valid connection requires the existence of the source attribute and
also requires that the source prim is UsdShadeConnectableAPI
compatible.
The python wrapping returns a tuple with the valid connections first,
followed by the invalid source paths.
UsdShadeConnectableAPI::GetConnectedSources
Parameters
----------
invalidSourcePaths : list[SdfPath]
"""
result["Input"].GetConnectedSource.func_doc = """GetConnectedSource(source, sourceName, sourceType) -> bool
Deprecated
Parameters
----------
source : ConnectableAPI
sourceName : str
sourceType : AttributeType
"""
result["Input"].GetRawConnectedSourcePaths.func_doc = """GetRawConnectedSourcePaths(sourcePaths) -> bool
Deprecated
Returns the"raw"(authored) connected source paths for this Input.
UsdShadeConnectableAPI::GetRawConnectedSourcePaths
Parameters
----------
sourcePaths : list[SdfPath]
"""
result["Input"].HasConnectedSource.func_doc = """HasConnectedSource() -> bool
Returns true if and only if this Input is currently connected to a
valid (defined) source.
UsdShadeConnectableAPI::HasConnectedSource
"""
result["Input"].IsSourceConnectionFromBaseMaterial.func_doc = """IsSourceConnectionFromBaseMaterial() -> bool
Returns true if the connection to this Input's source, as returned by
GetConnectedSource() , is authored across a specializes arc, which is
used to denote a base material.
UsdShadeConnectableAPI::IsSourceConnectionFromBaseMaterial
"""
result["Input"].DisconnectSource.func_doc = """DisconnectSource(sourceAttr) -> bool
Disconnect source for this Input.
If ``sourceAttr`` is valid, only a connection to the specified
attribute is disconnected, otherwise all connections are removed.
UsdShadeConnectableAPI::DisconnectSource
Parameters
----------
sourceAttr : Attribute
"""
result["Input"].ClearSources.func_doc = """ClearSources() -> bool
Clears sources for this Input in the current UsdEditTarget.
Most of the time, what you probably want is DisconnectSource() rather
than this function.
UsdShadeConnectableAPI::ClearSources
"""
result["Input"].ClearSource.func_doc = """ClearSource() -> bool
Deprecated
"""
result["Input"].SetConnectability.func_doc = """SetConnectability(connectability) -> bool
Set the connectability of the Input.
In certain shading data models, there is a need to distinguish which
inputs **can** vary over a surface from those that must be
**uniform**. This is accomplished in UsdShade by limiting the
connectability of the input. This is done by setting
the"connectability"metadata on the associated attribute.
Connectability of an Input can be set to UsdShadeTokens->full or
UsdShadeTokens->interfaceOnly.
- **full** implies that the Input can be connected to any other
Input or Output.
- **interfaceOnly** implies that the Input can only be connected to
a NodeGraph Input (which represents an interface override, not a
render-time dataflow connection), or another Input whose
connectability is also"interfaceOnly".
The default connectability of an input is UsdShadeTokens->full.
SetConnectability()
Parameters
----------
connectability : str
"""
result["Input"].GetConnectability.func_doc = """GetConnectability() -> str
Returns the connectability of the Input.
SetConnectability()
"""
result["Input"].ClearConnectability.func_doc = """ClearConnectability() -> bool
Clears any authored connectability on the Input.
"""
result["Input"].GetValueProducingAttributes.func_doc = """GetValueProducingAttributes(shaderOutputsOnly) -> list[UsdShadeAttribute]
Find what is connected to this Input recursively.
UsdShadeUtils::GetValueProducingAttributes
Parameters
----------
shaderOutputsOnly : bool
"""
result["Input"].GetValueProducingAttribute.func_doc = """GetValueProducingAttribute(attrType) -> Attribute
Deprecated
in favor of calling GetValueProducingAttributes
Parameters
----------
attrType : AttributeType
"""
result["Input"].GetFullName.func_doc = """GetFullName() -> str
Get the name of the attribute associated with the Input.
"""
result["Input"].GetBaseName.func_doc = """GetBaseName() -> str
Returns the name of the input.
We call this the base name since it strips off the"inputs:"namespace
prefix from the attribute name, and returns it.
"""
result["Input"].GetTypeName.func_doc = """GetTypeName() -> ValueTypeName
Get the"scene description"value type name of the attribute associated
with the Input.
"""
result["Input"].GetPrim.func_doc = """GetPrim() -> Prim
Get the prim that the input belongs to.
"""
result["Input"].Get.func_doc = """Get(value, time) -> bool
Convenience wrapper for the templated UsdAttribute::Get() .
Parameters
----------
value : T
time : TimeCode
----------------------------------------------------------------------
Get(value, time) -> bool
Convenience wrapper for VtValue version of UsdAttribute::Get() .
Parameters
----------
value : VtValue
time : TimeCode
"""
result["Input"].Set.func_doc = """Set(value, time) -> bool
Set a value for the Input at ``time`` .
Parameters
----------
value : VtValue
time : TimeCode
----------------------------------------------------------------------
Set(value, time) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Set a value of the Input at ``time`` .
Parameters
----------
value : T
time : TimeCode
"""
result["Material"].__doc__ = """
A Material provides a container into which multiple"render targets"can
add data that defines a"shading material"for a renderer. Typically
this consists of one or more UsdRelationship properties that target
other prims of type *Shader* - though a target/client is free to add
any data that is suitable. We **strongly advise** that all targets
adopt the convention that all properties be prefixed with a namespace
that identifies the target, e.g."rel ri:surface =</Shaders/mySurf>".
In the UsdShading model, geometry expresses a binding to a single
Material or to a set of Materials partitioned by UsdGeomSubsets
defined beneath the geometry; it is legal to bind a Material at the
root (or other sub-prim) of a model, and then bind a different
Material to individual gprims, but the meaning of inheritance
and"ancestral overriding"of Material bindings is left to each render-
target to determine. Since UsdGeom has no concept of shading, we
provide the API for binding and unbinding geometry on the API schema
UsdShadeMaterialBindingAPI.
The entire power of USD VariantSets and all the other composition
operators can leveraged when encoding shading variation.
UsdShadeMaterial provides facilities for a particular way of
building"Material variants"in which neither the identity of the
Materials themselves nor the geometry Material-bindings need to change
\\- instead we vary the targeted networks, interface values, and even
parameter values within a single variantSet. See Authoring Material
Variations for more details.
UsdShade requires that all of the shaders that"belong"to the Material
live under the Material in namespace. This supports powerful, easy
reuse of Materials, because it allows us to *reference* a Material
from one asset (the asset might be a module of Materials) into
another asset: USD references compose all descendant prims of the
reference target into the referencer's namespace, which means that all
of the referenced Material's shader networks will come along with the
Material. When referenced in this way, Materials can also be
instanced, for ease of deduplication and compactness. Finally,
Material encapsulation also allows us to specialize child materials
from parent materials.
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdShadeTokens. So to set an attribute to the value"rightHanded",
use UsdShadeTokens->rightHanded as the value.
"""
result["Material"].CreateSurfaceOutput.func_doc = """CreateSurfaceOutput(renderContext) -> Output
Creates and returns the"surface"output on this material for the
specified ``renderContext`` .
If the output already exists on the material, it is returned and no
authoring is performed. The returned output will always have the
requested renderContext.
Parameters
----------
renderContext : str
"""
result["Material"].GetSurfaceOutput.func_doc = """GetSurfaceOutput(renderContext) -> Output
Returns the"surface"output of this material for the specified
``renderContext`` .
The returned output will always have the requested renderContext.
An invalid output is returned if an output corresponding to the
requested specific-renderContext does not exist.
UsdShadeMaterial::ComputeSurfaceSource()
Parameters
----------
renderContext : str
"""
result["Material"].GetSurfaceOutputs.func_doc = """GetSurfaceOutputs() -> list[Output]
Returns the"surface"outputs of this material for all available
renderContexts.
The returned vector will include all authored"surface"outputs with the
*universal* renderContext output first, if present. Outputs are
returned regardless of whether they are connected to a valid source.
"""
result["Material"].ComputeSurfaceSource.func_doc = """ComputeSurfaceSource(renderContext, sourceName, sourceType) -> Shader
Deprecated
Use the form that takes a TfTokenVector or renderContexts.
Parameters
----------
renderContext : str
sourceName : str
sourceType : AttributeType
----------------------------------------------------------------------
ComputeSurfaceSource(contextVector, sourceName, sourceType) -> Shader
Computes the resolved"surface"output source for the given
``contextVector`` .
Using the earliest renderContext in the contextVector that produces a
valid Shader object.
If a"surface"output corresponding to each of the renderContexts does
not exist **or** is not connected to a valid source, then this checks
the *universal* surface output.
Returns an empty Shader object if there is no valid *surface* output
source for any of the renderContexts in the ``contextVector`` . The
python version of this method returns a tuple containing three
elements (the source surface shader, sourceName, sourceType).
Parameters
----------
contextVector : list[TfToken]
sourceName : str
sourceType : AttributeType
"""
result["Material"].CreateDisplacementOutput.func_doc = """CreateDisplacementOutput(renderContext) -> Output
Creates and returns the"displacement"output on this material for the
specified ``renderContext`` .
If the output already exists on the material, it is returned and no
authoring is performed. The returned output will always have the
requested renderContext.
Parameters
----------
renderContext : str
"""
result["Material"].GetDisplacementOutput.func_doc = """GetDisplacementOutput(renderContext) -> Output
Returns the"displacement"output of this material for the specified
renderContext.
The returned output will always have the requested renderContext.
An invalid output is returned if an output corresponding to the
requested specific-renderContext does not exist.
UsdShadeMaterial::ComputeDisplacementSource()
Parameters
----------
renderContext : str
"""
result["Material"].GetDisplacementOutputs.func_doc = """GetDisplacementOutputs() -> list[Output]
Returns the"displacement"outputs of this material for all available
renderContexts.
The returned vector will include all authored"displacement"outputs
with the *universal* renderContext output first, if present. Outputs
are returned regardless of whether they are connected to a valid
source.
"""
result["Material"].ComputeDisplacementSource.func_doc = """ComputeDisplacementSource(renderContext, sourceName, sourceType) -> Shader
Deprecated
Use the form that takes a TfTokenVector or renderContexts
Parameters
----------
renderContext : str
sourceName : str
sourceType : AttributeType
----------------------------------------------------------------------
ComputeDisplacementSource(contextVector, sourceName, sourceType) -> Shader
Computes the resolved"displacement"output source for the given
``contextVector`` .
Using the earliest renderContext in the contextVector that produces a
valid Shader object.
If a"displacement"output corresponding to each of the renderContexts
does not exist **or** is not connected to a valid source, then this
checks the *universal* displacement output.
Returns an empty Shader object if there is no valid *displacement*
output source for any of the renderContexts in the ``contextVector`` .
The python version of this method returns a tuple containing three
elements (the source displacement shader, sourceName, sourceType).
Parameters
----------
contextVector : list[TfToken]
sourceName : str
sourceType : AttributeType
"""
result["Material"].CreateVolumeOutput.func_doc = """CreateVolumeOutput(renderContext) -> Output
Creates and returns the"volume"output on this material for the
specified ``renderContext`` .
If the output already exists on the material, it is returned and no
authoring is performed. The returned output will always have the
requested renderContext.
Parameters
----------
renderContext : str
"""
result["Material"].GetVolumeOutput.func_doc = """GetVolumeOutput(renderContext) -> Output
Returns the"volume"output of this material for the specified
renderContext.
The returned output will always have the requested renderContext.
An invalid output is returned if an output corresponding to the
requested specific-renderContext does not exist.
UsdShadeMaterial::ComputeVolumeSource()
Parameters
----------
renderContext : str
"""
result["Material"].GetVolumeOutputs.func_doc = """GetVolumeOutputs() -> list[Output]
Returns the"volume"outputs of this material for all available
renderContexts.
The returned vector will include all authored"volume"outputs with the
*universal* renderContext output first, if present. Outputs are
returned regardless of whether they are connected to a valid source.
"""
result["Material"].ComputeVolumeSource.func_doc = """ComputeVolumeSource(renderContext, sourceName, sourceType) -> Shader
Deprecated
Use the form that takes a TfTokenVector or renderContexts
Parameters
----------
renderContext : str
sourceName : str
sourceType : AttributeType
----------------------------------------------------------------------
ComputeVolumeSource(contextVector, sourceName, sourceType) -> Shader
Computes the resolved"volume"output source for the given
``contextVector`` .
Using the earliest renderContext in the contextVector that produces a
valid Shader object.
If a"volume"output corresponding to each of the renderContexts does
not exist **or** is not connected to a valid source, then this checks
the *universal* volume output.
Returns an empty Shader object if there is no valid *volume* output
output source for any of the renderContexts in the ``contextVector`` .
The python version of this method returns a tuple containing three
elements (the source volume shader, sourceName, sourceType).
Parameters
----------
contextVector : list[TfToken]
sourceName : str
sourceType : AttributeType
"""
result["Material"].GetEditContextForVariant.func_doc = """GetEditContextForVariant(MaterialVariantName, layer) -> tuple[Stage, EditTarget]
Helper function for configuring a UsdStage 's UsdEditTarget to author
Material variations.
Takes care of creating the Material variantSet and specified variant,
if necessary.
Let's assume that we are authoring Materials into the Stage's current
UsdEditTarget, and that we are iterating over the variations of a
UsdShadeMaterial *clothMaterial*, and *currVariant* is the variant we
are processing (e.g."denim").
In C++, then, we would use the following pattern:
.. code-block:: text
{
UsdEditContext ctxt(clothMaterial.GetEditContextForVariant(currVariant));
// All USD mutation of the UsdStage on which clothMaterial sits will
// now go "inside" the currVariant of the "MaterialVariant" variantSet
}
In python, the pattern is:
.. code-block:: text
with clothMaterial.GetEditContextForVariant(currVariant):
# Now sending mutations to currVariant
If ``layer`` is specified, then we will use it, rather than the
stage's current UsdEditTarget 's layer as the destination layer for
the edit context we are building. If ``layer`` does not actually
contribute to the Material prim's definition, any editing will have no
effect on this Material.
**Note:** As just stated, using this method involves authoring a
selection for the MaterialVariant in the stage's current EditTarget.
When client is done authoring variations on this prim, they will
likely want to either UsdVariantSet::SetVariantSelection() to the
appropriate default selection, or possibly
UsdVariantSet::ClearVariantSelection() on the
UsdShadeMaterial::GetMaterialVariant() UsdVariantSet.
UsdVariantSet::GetVariantEditContext()
Parameters
----------
MaterialVariantName : str
layer : Layer
"""
result["Material"].GetMaterialVariant.func_doc = """GetMaterialVariant() -> VariantSet
Return a UsdVariantSet object for interacting with the Material
variant variantSet.
"""
result["Material"].CreateMasterMaterialVariant.func_doc = """**classmethod** CreateMasterMaterialVariant(masterPrim, MaterialPrims, masterVariantSetName) -> bool
Create a variantSet on ``masterPrim`` that will set the
MaterialVariant on each of the given *MaterialPrims*.
The variantSet, whose name can be specified with
``masterVariantSetName`` and defaults to the same MaterialVariant name
created on Materials by GetEditContextForVariant() , will have the
same variants as the Materials, and each Master variant will set every
``MaterialPrims'`` MaterialVariant selection to the same variant as
the master. Thus, it allows all Materials to be switched with a single
variant selection, on ``masterPrim`` .
If ``masterPrim`` is an ancestor of any given member of
``MaterialPrims`` , then we will author variant selections directly on
the MaterialPrims. However, it is often preferable to create a master
MaterialVariant in a separately rooted tree from the MaterialPrims, so
that it can be layered more strongly on top of the Materials.
Therefore, for any MaterialPrim in a different tree than masterPrim,
we will create"overs"as children of masterPrim that recreate the path
to the MaterialPrim, substituting masterPrim's full path for the
MaterialPrim's root path component.
Upon successful completion, the new variantSet we created on
``masterPrim`` will have its variant selection authored to
the"last"variant (determined lexicographically). It is up to the
calling client to either UsdVariantSet::ClearVariantSelection() on
``masterPrim`` , or set the selection to the desired default setting.
Return ``true`` on success. It is an error if any of ``Materials``
have a different set of variants for the MaterialVariant than the
others.
Parameters
----------
masterPrim : Prim
MaterialPrims : list[Prim]
masterVariantSetName : str
"""
result["Material"].GetBaseMaterial.func_doc = """GetBaseMaterial() -> Material
Get the path to the base Material of this Material.
If there is no base Material, an empty Material is returned
"""
result["Material"].GetBaseMaterialPath.func_doc = """GetBaseMaterialPath() -> Path
Get the base Material of this Material.
If there is no base Material, an empty path is returned
"""
result["Material"].SetBaseMaterial.func_doc = """SetBaseMaterial(baseMaterial) -> None
Set the base Material of this Material.
An empty Material is equivalent to clearing the base Material.
Parameters
----------
baseMaterial : Material
"""
result["Material"].SetBaseMaterialPath.func_doc = """SetBaseMaterialPath(baseMaterialPath) -> None
Set the path to the base Material of this Material.
An empty path is equivalent to clearing the base Material.
Parameters
----------
baseMaterialPath : Path
"""
result["Material"].ClearBaseMaterial.func_doc = """ClearBaseMaterial() -> None
Clear the base Material of this Material.
"""
result["Material"].HasBaseMaterial.func_doc = """HasBaseMaterial() -> bool
"""
result["Material"].__init__.func_doc = """__init__(prim)
Construct a UsdShadeMaterial on UsdPrim ``prim`` .
Equivalent to UsdShadeMaterial::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdShadeMaterial on the prim held by ``schemaObj`` .
Should be preferred over UsdShadeMaterial (schemaObj.GetPrim()), as it
preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["Material"].GetSurfaceAttr.func_doc = """GetSurfaceAttr() -> Attribute
Represents the universal"surface"output terminal of a material.
Declaration
``token outputs:surface``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
"""
result["Material"].CreateSurfaceAttr.func_doc = """CreateSurfaceAttr(defaultValue, writeSparsely) -> Attribute
See GetSurfaceAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Material"].GetDisplacementAttr.func_doc = """GetDisplacementAttr() -> Attribute
Represents the universal"displacement"output terminal of a material.
Declaration
``token outputs:displacement``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
"""
result["Material"].CreateDisplacementAttr.func_doc = """CreateDisplacementAttr(defaultValue, writeSparsely) -> Attribute
See GetDisplacementAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Material"].GetVolumeAttr.func_doc = """GetVolumeAttr() -> Attribute
Represents the universal"volume"output terminal of a material.
Declaration
``token outputs:volume``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
"""
result["Material"].CreateVolumeAttr.func_doc = """CreateVolumeAttr(defaultValue, writeSparsely) -> Attribute
See GetVolumeAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Material"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["Material"].Get.func_doc = """**classmethod** Get(stage, path) -> Material
Return a UsdShadeMaterial holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdShadeMaterial(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["Material"].Define.func_doc = """**classmethod** Define(stage, path) -> Material
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["Material"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["MaterialBindingAPI"].__doc__ = """
UsdShadeMaterialBindingAPI is an API schema that provides an interface
for binding materials to prims or collections of prims (represented by
UsdCollectionAPI objects).
In the USD shading model, each renderable gprim computes a single
**resolved Material** that will be used to shade the gprim
(exceptions, of course, for gprims that possess UsdGeomSubsets, as
each subset can be shaded by a different Material). A gprim **and each
of its ancestor prims** can possess, through the MaterialBindingAPI,
both a **direct** binding to a Material, and any number of
**collection-based** bindings to Materials; each binding can be
generic or declared for a particular **purpose**, and given a specific
**binding strength**. It is the process of"material resolution"(see
UsdShadeMaterialBindingAPI_MaterialResolution) that examines all of
these bindings, and selects the one Material that best matches the
client's needs.
The intent of **purpose** is that each gprim should be able to resolve
a Material for any given purpose, which implies it can have
differently bound materials for different purposes. There are two
*special* values of **purpose** defined in UsdShade, although the API
fully supports specifying arbitrary values for it, for the sake of
extensibility:
- **UsdShadeTokens->full** : to be used when the purpose of the
render is entirely to visualize the truest representation of a scene,
considering all lighting and material information, at highest
fidelity.
- **UsdShadeTokens->preview** : to be used when the render is in
service of a goal other than a high fidelity"full"render (such as
scene manipulation, modeling, or realtime playback). Latency and speed
are generally of greater concern for preview renders, therefore
preview materials are generally designed to be"lighterweight"compared
to full materials.
A binding can also have no specific purpose at all, in which case, it
is considered to be the fallback or all-purpose binding (denoted by
the empty-valued token **UsdShadeTokens->allPurpose**).
The **purpose** of a material binding is encoded in the name of the
binding relationship.
- In the case of a direct binding, the *allPurpose* binding is
represented by the relationship named **"material:binding"**. Special-
purpose direct bindings are represented by relationships named
**"material:binding: *purpose***. A direct binding relationship must
have a single target path that points to a **UsdShadeMaterial**.
- In the case of a collection-based binding, the *allPurpose*
binding is represented by a relationship
named"material:binding:collection:<i>bindingName</i>", where
**bindingName** establishes an identity for the binding that is unique
on the prim. Attempting to establish two collection bindings of the
same name on the same prim will result in the first binding simply
being overridden. A special-purpose collection-based binding is
represented by a relationship
named"material:binding:collection:<i>purpose:bindingName</i>". A
collection-based binding relationship must have exacly two targets,
one of which should be a collection-path (see ef
UsdCollectionAPI::GetCollectionPath() ) and the other should point to
a **UsdShadeMaterial**. In the future, we may allow a single
collection binding to target multiple collections, if we can establish
a reasonable round-tripping pattern for applications that only allow a
single collection to be associated with each Material.
**Note:** Both **bindingName** and **purpose** must be non-namespaced
tokens. This allows us to know the role of a binding relationship
simply from the number of tokens in it.
- **Two tokens** : the fallback,"all purpose", direct binding,
*material:binding*
- **Three tokens** : a purpose-restricted, direct, fallback
binding, e.g. material:binding:preview
- **Four tokens** : an all-purpose, collection-based binding, e.g.
material:binding:collection:metalBits
- **Five tokens** : a purpose-restricted, collection-based binding,
e.g. material:binding:collection:full:metalBits
A **binding-strength** value is used to specify whether a binding
authored on a prim should be weaker or stronger than bindings that
appear lower in namespace. We encode the binding strength with as
token-valued metadata **'bindMaterialAs'** for future flexibility,
even though for now, there are only two possible values:
*UsdShadeTokens->weakerThanDescendants* and
*UsdShadeTokens->strongerThanDescendants*. When binding-strength is
not authored (i.e. empty) on a binding-relationship, the default
behavior matches UsdShadeTokens->weakerThanDescendants.
If a material binding relationship is a built-in property defined as
part of a typed prim's schema, a fallback value should not be provided
for it. This is because the"material resolution"algorithm only
conisders *authored* properties.
"""
result["MaterialBindingAPI"].GetDirectBindingRel.func_doc = """GetDirectBindingRel(materialPurpose) -> Relationship
Returns the direct material-binding relationship on this prim for the
given material purpose.
The material purpose of the relationship that's returned will match
the specified ``materialPurpose`` .
Parameters
----------
materialPurpose : str
"""
result["MaterialBindingAPI"].GetCollectionBindingRel.func_doc = """GetCollectionBindingRel(bindingName, materialPurpose) -> Relationship
Returns the collection-based material-binding relationship with the
given ``bindingName`` and ``materialPurpose`` on this prim.
For info on ``bindingName`` , see UsdShadeMaterialBindingAPI::Bind() .
The material purpose of the relationship that's returned will match
the specified ``materialPurpose`` .
Parameters
----------
bindingName : str
materialPurpose : str
"""
result["MaterialBindingAPI"].GetCollectionBindingRels.func_doc = """GetCollectionBindingRels(materialPurpose) -> list[Relationship]
Returns the list of collection-based material binding relationships on
this prim for the given material purpose, ``materialPurpose`` .
The returned list of binding relationships will be in native property
order. See UsdPrim::GetPropertyOrder() , UsdPrim::SetPropertyOrder() .
Bindings that appear earlier in the property order are considered to
be stronger than the ones that come later. See rule #6 in
UsdShadeMaterialBindingAPI_MaterialResolution.
Parameters
----------
materialPurpose : str
"""
result["MaterialBindingAPI"].GetDirectBinding.func_doc = """GetDirectBinding(materialPurpose) -> DirectBinding
Computes and returns the direct binding for the given material purpose
on this prim.
The returned binding always has the specified ``materialPurpose``
(i.e. the all-purpose binding is not returned if a special purpose
binding is requested).
If the direct binding is to a prim that is not a Material, this does
not generate an error, but the returned Material will be invalid (i.e.
evaluate to false).
Parameters
----------
materialPurpose : str
"""
result["MaterialBindingAPI"].GetCollectionBindings.func_doc = """GetCollectionBindings(materialPurpose) -> list[CollectionBinding]
Returns all the collection-based bindings on this prim for the given
material purpose.
The returned CollectionBinding objects always have the specified
``materialPurpose`` (i.e. the all-purpose binding is not returned if a
special purpose binding is requested).
If one or more collection based bindings are to prims that are not
Materials, this does not generate an error, but the corresponding
Material(s) will be invalid (i.e. evaluate to false).
The python version of this API returns a tuple containing the vector
of CollectionBinding objects and the corresponding vector of binding
relationships.
The returned list of collection-bindings will be in native property
order of the associated binding relationships. See
UsdPrim::GetPropertyOrder() , UsdPrim::SetPropertyOrder() . Binding
relationships that come earlier in the list are considered to be
stronger than the ones that come later. See rule #6 in
UsdShadeMaterialBindingAPI_MaterialResolution.
Parameters
----------
materialPurpose : str
"""
result["MaterialBindingAPI"].GetMaterialBindingStrength.func_doc = """**classmethod** GetMaterialBindingStrength(bindingRel) -> str
Resolves the'bindMaterialAs'token-valued metadata on the given binding
relationship and returns it.
If the resolved value is empty, this returns the fallback value
UsdShadeTokens->weakerThanDescendants.
UsdShadeMaterialBindingAPI::SetMaterialBindingStrength()
Parameters
----------
bindingRel : Relationship
"""
result["MaterialBindingAPI"].SetMaterialBindingStrength.func_doc = """**classmethod** SetMaterialBindingStrength(bindingRel, bindingStrength) -> bool
Sets the'bindMaterialAs'token-valued metadata on the given binding
relationship.
If ``bindingStrength`` is *UsdShadeTokens->fallbackStrength*, the
value UsdShadeTokens->weakerThanDescendants is authored sparsely, i.e.
only when there is a different existing bindingStrength value. To
stamp out the bindingStrength value explicitly, clients can pass in
UsdShadeTokens->weakerThanDescendants or
UsdShadeTokens->strongerThanDescendants directly. Returns true on
success, false otherwise.
UsdShadeMaterialBindingAPI::GetMaterialBindingStrength()
Parameters
----------
bindingRel : Relationship
bindingStrength : str
"""
result["MaterialBindingAPI"].Bind.func_doc = """Bind(material, bindingStrength, materialPurpose) -> bool
Authors a direct binding to the given ``material`` on this prim.
If ``bindingStrength`` is UsdShadeTokens->fallbackStrength, the value
UsdShadeTokens->weakerThanDescendants is authored sparsely. To stamp
out the bindingStrength value explicitly, clients can pass in
UsdShadeTokens->weakerThanDescendants or
UsdShadeTokens->strongerThanDescendants directly.
If ``materialPurpose`` is specified and isn't equal to
UsdShadeTokens->allPurpose, the binding only applies to the specified
material purpose.
Note that UsdShadeMaterialBindingAPI is a SingleAppliedAPI schema
which when applied updates the prim definition accordingly. This
information on the prim definition is helpful in multiple queries and
more performant. Hence its recommended to call
UsdShadeMaterialBindingAPI::Apply() when Binding a material.
Returns true on success, false otherwise.
Parameters
----------
material : Material
bindingStrength : str
materialPurpose : str
----------------------------------------------------------------------
Bind(collection, material, bindingName, bindingStrength, materialPurpose) -> bool
Authors a collection-based binding, which binds the given ``material``
to the given ``collection`` on this prim.
``bindingName`` establishes an identity for the binding that is unique
on the prim. Attempting to establish two collection bindings of the
same name on the same prim will result in the first binding simply
being overridden. If ``bindingName`` is empty, it is set to the base-
name of the collection being bound (which is the collection-name with
any namespaces stripped out). If there are multiple collections with
the same base-name being bound at the same prim, clients should pass
in a unique binding name per binding, in order to preserve all
bindings. The binding name used in constructing the collection-binding
relationship name shoud not contain namespaces. Hence, a coding error
is issued and no binding is authored if the provided value of
``bindingName`` is non-empty and contains namespaces.
If ``bindingStrength`` is *UsdShadeTokens->fallbackStrength*, the
value UsdShadeTokens->weakerThanDescendants is authored sparsely, i.e.
only when there is an existing binding with a different
bindingStrength. To stamp out the bindingStrength value explicitly,
clients can pass in UsdShadeTokens->weakerThanDescendants or
UsdShadeTokens->strongerThanDescendants directly.
If ``materialPurpose`` is specified and isn't equal to
UsdShadeTokens->allPurpose, the binding only applies to the specified
material purpose.
Note that UsdShadeMaterialBindingAPI is a SingleAppliedAPI schema
which when applied updates the prim definition accordingly. This
information on the prim definition is helpful in multiple queries and
more performant. Hence its recommended to call
UsdShadeMaterialBindingAPI::Apply() when Binding a material.
Returns true on success, false otherwise.
Parameters
----------
collection : CollectionAPI
material : Material
bindingName : str
bindingStrength : str
materialPurpose : str
"""
result["MaterialBindingAPI"].UnbindDirectBinding.func_doc = """UnbindDirectBinding(materialPurpose) -> bool
Unbinds the direct binding for the given material purpose (
``materialPurpose`` ) on this prim.
It accomplishes this by blocking the targets of the binding
relationship in the current edit target.
Parameters
----------
materialPurpose : str
"""
result["MaterialBindingAPI"].UnbindCollectionBinding.func_doc = """UnbindCollectionBinding(bindingName, materialPurpose) -> bool
Unbinds the collection-based binding with the given ``bindingName`` ,
for the given ``materialPurpose`` on this prim.
It accomplishes this by blocking the targets of the associated binding
relationship in the current edit target.
If a binding was created without specifying a ``bindingName`` , then
the correct ``bindingName`` to use for unbinding is the instance name
of the targetted collection.
Parameters
----------
bindingName : str
materialPurpose : str
"""
result["MaterialBindingAPI"].UnbindAllBindings.func_doc = """UnbindAllBindings() -> bool
Unbinds all direct and collection-based bindings on this prim.
"""
result["MaterialBindingAPI"].RemovePrimFromBindingCollection.func_doc = """RemovePrimFromBindingCollection(prim, bindingName, materialPurpose) -> bool
Removes the specified ``prim`` from the collection targeted by the
binding relationship corresponding to given ``bindingName`` and
``materialPurpose`` .
If the collection-binding relationship doesn't exist or if the
targeted collection does not include the ``prim`` , then this does
nothing and returns true.
If the targeted collection includes ``prim`` , then this modifies the
collection by removing the prim from it (by invoking
UsdCollectionAPI::RemovePrim()). This method can be used in
conjunction with the Unbind\\*() methods (if desired) to guarantee
that a prim has no resolved material binding.
Parameters
----------
prim : Prim
bindingName : str
materialPurpose : str
"""
result["MaterialBindingAPI"].AddPrimToBindingCollection.func_doc = """AddPrimToBindingCollection(prim, bindingName, materialPurpose) -> bool
Adds the specified ``prim`` to the collection targeted by the binding
relationship corresponding to given ``bindingName`` and
``materialPurpose`` .
If the collection-binding relationship doesn't exist or if the
targeted collection already includes the ``prim`` , then this does
nothing and returns true.
If the targeted collection does not include ``prim`` (or excludes it
explicitly), then this modifies the collection by adding the prim to
it (by invoking UsdCollectionAPI::AddPrim()).
Parameters
----------
prim : Prim
bindingName : str
materialPurpose : str
"""
result["MaterialBindingAPI"].ComputeBoundMaterial.func_doc = """ComputeBoundMaterial(bindingsCache, collectionQueryCache, materialPurpose, bindingRel) -> Material
Computes the resolved bound material for this prim, for the given
material purpose.
This overload of ComputeBoundMaterial makes use of the BindingsCache (
``bindingsCache`` ) and CollectionQueryCache (
``collectionQueryCache`` ) that are passed in, to avoid redundant
binding computations and computations of MembershipQuery objects for
collections. It would be beneficial to make use of these when
resolving bindings for a tree of prims. These caches are populated
lazily as more and more bindings are resolved.
When the goal is to compute the bound material for a range (or list)
of prims, it is recommended to use this version of
ComputeBoundMaterial() . Here's how you could compute the bindings of
a range of prims efficiently in C++:
.. code-block:: text
std::vector<std::pair<UsdPrim, UsdShadeMaterial> primBindings;
UsdShadeMaterialBindingAPI::BindingsCache bindingsCache;
UsdShadeMaterialBindingAPI::CollectionQueryCache collQueryCache;
for (auto prim : UsdPrimRange(rootPrim)) {
UsdShadeMaterial boundMaterial =
UsdShadeMaterialBindingAPI(prim).ComputeBoundMaterial(
& bindingsCache, & collQueryCache);
if (boundMaterial) {
primBindings.emplace_back({prim, boundMaterial});
}
}
If ``bindingRel`` is not null, then it is set to the"winning"binding
relationship.
Note the resolved bound material is considered valid if the target
path of the binding relationship is a valid non-empty prim path. This
makes sure winning binding relationship and the bound material remain
consistent consistent irrespective of the presence/absence of prim at
material path. For ascenario where ComputeBoundMaterial returns a
invalid UsdShadeMaterial with a valid winning bindingRel, clients can
use the static method
UsdShadeMaterialBindingAPI::GetResolvedTargetPathFromBindingRel to get
the path of the resolved target identified by the winning bindingRel.
See Bound Material Resolution for details on the material resolution
process.
The python version of this method returns a tuple containing the bound
material and the"winning"binding relationship.
Parameters
----------
bindingsCache : BindingsCache
collectionQueryCache : CollectionQueryCache
materialPurpose : str
bindingRel : Relationship
----------------------------------------------------------------------
ComputeBoundMaterial(materialPurpose, bindingRel) -> Material
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Computes the resolved bound material for this prim, for the given
material purpose.
This overload does not utilize cached MembershipQuery object. However,
it only computes the MembershipQuery of every collection that bound in
the ancestor chain at most once.
If ``bindingRel`` is not null, then it is set to the winning binding
relationship.
See Bound Material Resolution for details on the material resolution
process.
The python version of this method returns a tuple containing the bound
material and the"winning"binding relationship.
Parameters
----------
materialPurpose : str
bindingRel : Relationship
"""
result["MaterialBindingAPI"].GetMaterialPurposes.func_doc = """**classmethod** GetMaterialPurposes() -> list[TfToken]
Returns a vector of the possible values for the'material purpose'.
"""
result["MaterialBindingAPI"].GetResolvedTargetPathFromBindingRel.func_doc = """**classmethod** GetResolvedTargetPathFromBindingRel(bindingRel) -> Path
returns the path of the resolved target identified by ``bindingRel`` .
Parameters
----------
bindingRel : Relationship
"""
result["MaterialBindingAPI"].ComputeBoundMaterials.func_doc = """**classmethod** ComputeBoundMaterials(prims, materialPurpose, bindingRels) -> list[Material]
Static API for efficiently and concurrently computing the resolved
material bindings for a vector of UsdPrims, ``prims`` for the given
``materialPurpose`` .
The size of the returned vector always matches the size of the input
vector, ``prims`` . If a prim is not bound to any material, an invalid
or empty UsdShadeMaterial is returned at the index corresponding to
it.
If the pointer ``bindingRels`` points to a valid vector, then it is
populated with the set of all"winning"binding relationships.
The python version of this method returns a tuple containing two lists
\\- the bound materials and the corresponding"winning"binding
relationships.
Parameters
----------
prims : list[Prim]
materialPurpose : str
bindingRels : list[Relationship]
"""
result["MaterialBindingAPI"].CreateMaterialBindSubset.func_doc = """CreateMaterialBindSubset(subsetName, indices, elementType) -> Subset
Creates a GeomSubset named ``subsetName`` with element type,
``elementType`` and familyName **materialBind **below this prim.****
If a GeomSubset named ``subsetName`` already exists, then
its"familyName"is updated to be UsdShadeTokens->materialBind and its
indices (at *default* timeCode) are updated with the provided
``indices`` value before returning.
This method forces the familyType of the"materialBind"family of
subsets to UsdGeomTokens->nonOverlapping if it's unset or explicitly
set to UsdGeomTokens->unrestricted.
The default value ``elementType`` is UsdGeomTokens->face, as we expect
materials to be bound most often to subsets of faces on meshes.
Parameters
----------
subsetName : str
indices : IntArray
elementType : str
"""
result["MaterialBindingAPI"].GetMaterialBindSubsets.func_doc = """GetMaterialBindSubsets() -> list[Subset]
Returns all the existing GeomSubsets with
familyName=UsdShadeTokens->materialBind below this prim.
"""
result["MaterialBindingAPI"].SetMaterialBindSubsetsFamilyType.func_doc = """SetMaterialBindSubsetsFamilyType(familyType) -> bool
Author the *familyType* of the"materialBind"family of GeomSubsets on
this prim.
The default ``familyType`` is *UsdGeomTokens->nonOverlapping *. It can
be set to *UsdGeomTokens->partition* to indicate that the entire
imageable prim is included in the union of all
the"materialBind"subsets. The family type should never be set to
UsdGeomTokens->unrestricted, since it is invalid for a single piece of
geometry (in this case, a subset) to be bound to more than one
material. Hence, a coding error is issued if ``familyType`` is
UsdGeomTokens->unrestricted.**
**
UsdGeomSubset::SetFamilyType**
Parameters
----------
familyType : str
"""
result["MaterialBindingAPI"].GetMaterialBindSubsetsFamilyType.func_doc = """GetMaterialBindSubsetsFamilyType() -> str
Returns the familyType of the family of"materialBind"GeomSubsets on
this prim.
By default, materialBind subsets have familyType="nonOverlapping", but
they can also be tagged as a"partition", using
SetMaterialBindFaceSubsetsFamilyType().
UsdGeomSubset::GetFamilyNameAttr
"""
result["MaterialBindingAPI"].CanContainPropertyName.func_doc = """**classmethod** CanContainPropertyName(name) -> bool
Test whether a given ``name`` contains the"material:binding:"prefix.
Parameters
----------
name : str
"""
result["MaterialBindingAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdShadeMaterialBindingAPI on UsdPrim ``prim`` .
Equivalent to UsdShadeMaterialBindingAPI::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdShadeMaterialBindingAPI on the prim held by
``schemaObj`` .
Should be preferred over UsdShadeMaterialBindingAPI
(schemaObj.GetPrim()), as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["MaterialBindingAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["MaterialBindingAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> MaterialBindingAPI
Return a UsdShadeMaterialBindingAPI holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdShadeMaterialBindingAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["MaterialBindingAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["MaterialBindingAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> MaterialBindingAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"MaterialBindingAPI"to the token-
valued, listOp metadata *apiSchemas* on the prim.
A valid UsdShadeMaterialBindingAPI object is returned upon success. An
invalid (or empty) UsdShadeMaterialBindingAPI object is returned upon
failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["MaterialBindingAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["NodeDefAPI"].__doc__ = """
UsdShadeNodeDefAPI is an API schema that provides attributes for a
prim to select a corresponding Shader Node Definition ("Sdr Node"), as
well as to look up a runtime entry for that shader node in the form of
an SdrShaderNode.
UsdShadeNodeDefAPI is intended to be a pre-applied API schema for any
prim type that wants to refer to the SdrRegistry for further
implementation details about the behavior of that prim. The primary
use in UsdShade itself is as UsdShadeShader, which is a basis for
material shading networks (UsdShadeMaterial), but this is intended to
be used in other domains that also use the Sdr node mechanism.
This schema provides properties that allow a prim to identify an
external node definition, either by a direct identifier key into the
SdrRegistry (info:id), an asset to be parsed by a suitable
NdrParserPlugin (info:sourceAsset), or an inline source code that must
also be parsed (info:sourceCode); as well as a selector attribute to
determine which specifier is active (info:implementationSource).
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdShadeTokens. So to set an attribute to the value"rightHanded",
use UsdShadeTokens->rightHanded as the value.
"""
result["NodeDefAPI"].GetImplementationSource.func_doc = """GetImplementationSource() -> str
Reads the value of info:implementationSource attribute and returns a
token identifying the attribute that must be consulted to identify the
shader's source program.
This returns
- **id**, to indicate that the"info:id"attribute must be consulted.
- **sourceAsset** to indicate that the asset-
valued"info:{sourceType}:sourceAsset"attribute associated with the
desired **sourceType** should be consulted to locate the asset with
the shader's source.
- **sourceCode** to indicate that the string-
valued"info:{sourceType}:sourceCode"attribute associated with the
desired **sourceType** should be read to get shader's source.
This issues a warning and returns **id** if the
*info:implementationSource* attribute has an invalid value.
*{sourceType}* above is a place holder for a token that identifies the
type of shader source or its implementation. For example: osl, glslfx,
riCpp etc. This allows a shader to specify different sourceAsset (or
sourceCode) values for different sourceTypes. The sourceType tokens
usually correspond to the sourceType value of the NdrParserPlugin
that's used to parse the shader source (NdrParserPlugin::SourceType).
When sourceType is empty, the corresponding sourceAsset or sourceCode
is considered to be"universal"(or fallback), which is represented by
the empty-valued token UsdShadeTokens->universalSourceType. When the
sourceAsset (or sourceCode) corresponding to a specific, requested
sourceType is unavailable, the universal sourceAsset (or sourceCode)
is returned by GetSourceAsset (and GetSourceCode} API, if present.
GetShaderId()
GetSourceAsset()
GetSourceCode()
"""
result["NodeDefAPI"].SetShaderId.func_doc = """SetShaderId(id) -> bool
Sets the shader's ID value.
This also sets the *info:implementationSource* attribute on the shader
to **UsdShadeTokens->id**, if the existing value is different.
Parameters
----------
id : str
"""
result["NodeDefAPI"].GetShaderId.func_doc = """GetShaderId(id) -> bool
Fetches the shader's ID value from the *info:id* attribute, if the
shader's *info:implementationSource* is **id**.
Returns **true** if the shader's implementation source is **id** and
the value was fetched properly into ``id`` . Returns false otherwise.
GetImplementationSource()
Parameters
----------
id : str
"""
result["NodeDefAPI"].SetSourceAsset.func_doc = """SetSourceAsset(sourceAsset, sourceType) -> bool
Sets the shader's source-asset path value to ``sourceAsset`` for the
given source type, ``sourceType`` .
This also sets the *info:implementationSource* attribute on the shader
to **UsdShadeTokens->sourceAsset**.
Parameters
----------
sourceAsset : AssetPath
sourceType : str
"""
result["NodeDefAPI"].GetSourceAsset.func_doc = """GetSourceAsset(sourceAsset, sourceType) -> bool
Fetches the shader's source asset value for the specified
``sourceType`` value from the **info: *sourceType*: sourceAsset**
attribute, if the shader's *info:implementationSource* is
**sourceAsset**.
If the *sourceAsset* attribute corresponding to the requested
*sourceType* isn't present on the shader, then the *universal*
*fallback* sourceAsset attribute, i.e. *info:sourceAsset* is
consulted, if present, to get the source asset path.
Returns **true** if the shader's implementation source is
**sourceAsset** and the source asset path value was fetched
successfully into ``sourceAsset`` . Returns false otherwise.
GetImplementationSource()
Parameters
----------
sourceAsset : AssetPath
sourceType : str
"""
result["NodeDefAPI"].SetSourceAssetSubIdentifier.func_doc = """SetSourceAssetSubIdentifier(subIdentifier, sourceType) -> bool
Set a sub-identifier to be used with a source asset of the given
source type.
This sets the **info: *sourceType*: sourceAsset:subIdentifier**.
This also sets the *info:implementationSource* attribute on the shader
to **UsdShadeTokens->sourceAsset**
Parameters
----------
subIdentifier : str
sourceType : str
"""
result["NodeDefAPI"].GetSourceAssetSubIdentifier.func_doc = """GetSourceAssetSubIdentifier(subIdentifier, sourceType) -> bool
Fetches the shader's sub-identifier for the source asset with the
specified ``sourceType`` value from the **info: *sourceType*:
sourceAsset:subIdentifier** attribute, if the shader's *info:
implementationSource* is **sourceAsset**.
If the *subIdentifier* attribute corresponding to the requested
*sourceType* isn't present on the shader, then the *universal*
*fallback* sub-identifier attribute, i.e. *info:sourceAsset:
subIdentifier* is consulted, if present, to get the sub-identifier
name.
Returns **true** if the shader's implementation source is
**sourceAsset** and the sub-identifier for the given source type was
fetched successfully into ``subIdentifier`` . Returns false otherwise.
Parameters
----------
subIdentifier : str
sourceType : str
"""
result["NodeDefAPI"].SetSourceCode.func_doc = """SetSourceCode(sourceCode, sourceType) -> bool
Sets the shader's source-code value to ``sourceCode`` for the given
source type, ``sourceType`` .
This also sets the *info:implementationSource* attribute on the shader
to **UsdShadeTokens->sourceCode**.
Parameters
----------
sourceCode : str
sourceType : str
"""
result["NodeDefAPI"].GetSourceCode.func_doc = """GetSourceCode(sourceCode, sourceType) -> bool
Fetches the shader's source code for the specified ``sourceType``
value by reading the **info: *sourceType*: sourceCode** attribute, if
the shader's *info:implementationSource* is **sourceCode**.
If the *sourceCode* attribute corresponding to the requested
*sourceType* isn't present on the shader, then the *universal* or
*fallback* sourceCode attribute (i.e. *info:sourceCode*) is consulted,
if present, to get the source code.
Returns **true** if the shader's implementation source is
**sourceCode** and the source code string was fetched successfully
into ``sourceCode`` . Returns false otherwise.
GetImplementationSource()
Parameters
----------
sourceCode : str
sourceType : str
"""
result["NodeDefAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdShadeNodeDefAPI on UsdPrim ``prim`` .
Equivalent to UsdShadeNodeDefAPI::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdShadeNodeDefAPI on the prim held by ``schemaObj`` .
Should be preferred over UsdShadeNodeDefAPI (schemaObj.GetPrim()), as
it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["NodeDefAPI"].GetImplementationSourceAttr.func_doc = """GetImplementationSourceAttr() -> Attribute
Specifies the attribute that should be consulted to get the shader's
implementation or its source code.
- If set to"id", the"info:id"attribute's value is used to determine
the shader source from the shader registry.
- If set to"sourceAsset", the resolved value of
the"info:sourceAsset"attribute corresponding to the desired
implementation (or source-type) is used to locate the shader source. A
source asset file may also specify multiple shader definitions, so
there is an optional attribute"info:sourceAsset:subIdentifier"whose
value should be used to indicate a particular shader definition from a
source asset file.
- If set to"sourceCode", the value of"info:sourceCode"attribute
corresponding to the desired implementation (or source type) is used
as the shader source.
Declaration
``uniform token info:implementationSource ="id"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
id, sourceAsset, sourceCode
"""
result["NodeDefAPI"].CreateImplementationSourceAttr.func_doc = """CreateImplementationSourceAttr(defaultValue, writeSparsely) -> Attribute
See GetImplementationSourceAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["NodeDefAPI"].GetIdAttr.func_doc = """GetIdAttr() -> Attribute
The id is an identifier for the type or purpose of the shader.
E.g.: Texture or FractalFloat. The use of this id will depend on the
render target: some will turn it into an actual shader path, some will
use it to generate shader source code dynamically.
SetShaderId()
Declaration
``uniform token info:id``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
"""
result["NodeDefAPI"].CreateIdAttr.func_doc = """CreateIdAttr(defaultValue, writeSparsely) -> Attribute
See GetIdAttr() , and also Create vs Get Property Methods for when to
use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["NodeDefAPI"].GetShaderNodeForSourceType.func_doc = """GetShaderNodeForSourceType(sourceType) -> ShaderNode
This method attempts to ensure that there is a ShaderNode in the
shader registry (i.e.
SdrRegistry) representing this shader for the given ``sourceType`` .
It may return a null pointer if none could be found or created.
Parameters
----------
sourceType : str
"""
result["NodeDefAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["NodeDefAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> NodeDefAPI
Return a UsdShadeNodeDefAPI holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdShadeNodeDefAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["NodeDefAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["NodeDefAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> NodeDefAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"NodeDefAPI"to the token-valued,
listOp metadata *apiSchemas* on the prim.
A valid UsdShadeNodeDefAPI object is returned upon success. An invalid
(or empty) UsdShadeNodeDefAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["NodeDefAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["NodeGraph"].__doc__ = """
A node-graph is a container for shading nodes, as well as other node-
graphs. It has a public input interface and provides a list of public
outputs.
**Node Graph Interfaces**
One of the most important functions of a node-graph is to host
the"interface"with which clients of already-built shading networks
will interact. Please see Interface Inputs for a detailed explanation
of what the interface provides, and how to construct and use it, to
effectively share/instance shader networks.
**Node Graph Outputs**
These behave like outputs on a shader and are typically connected to
an output on a shader inside the node-graph.
"""
result["NodeGraph"].CreateOutput.func_doc = """CreateOutput(name, typeName) -> Output
Create an output which can either have a value or can be connected.
The attribute representing the output is created in
the"outputs:"namespace.
Parameters
----------
name : str
typeName : ValueTypeName
"""
result["NodeGraph"].GetOutput.func_doc = """GetOutput(name) -> Output
Return the requested output if it exists.
Parameters
----------
name : str
"""
result["NodeGraph"].GetOutputs.func_doc = """GetOutputs(onlyAuthored) -> list[Output]
Outputs are represented by attributes in the"outputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
result["NodeGraph"].ComputeOutputSource.func_doc = """ComputeOutputSource(outputName, sourceName, sourceType) -> Shader
Deprecated
in favor of GetValueProducingAttributes on UsdShadeOutput Resolves the
connection source of the requested output, identified by
``outputName`` to a shader output.
``sourceName`` is an output parameter that is set to the name of the
resolved output, if the node-graph output is connected to a valid
shader source.
``sourceType`` is an output parameter that is set to the type of the
resolved output, if the node-graph output is connected to a valid
shader source.
Returns a valid shader object if the specified output exists and is
connected to one. Return an empty shader object otherwise. The python
version of this method returns a tuple containing three elements (the
source shader, sourceName, sourceType).
Parameters
----------
outputName : str
sourceName : str
sourceType : AttributeType
"""
result["NodeGraph"].CreateInput.func_doc = """CreateInput(name, typeName) -> Input
Create an Input which can either have a value or can be connected.
The attribute representing the input is created in
the"inputs:"namespace.
Parameters
----------
name : str
typeName : ValueTypeName
"""
result["NodeGraph"].GetInput.func_doc = """GetInput(name) -> Input
Return the requested input if it exists.
Parameters
----------
name : str
"""
result["NodeGraph"].GetInputs.func_doc = """GetInputs(onlyAuthored) -> list[Input]
Returns all inputs present on the node-graph.
These are represented by attributes in the"inputs:"namespace. If
``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
result["NodeGraph"].GetInterfaceInputs.func_doc = """GetInterfaceInputs() -> list[Input]
Returns all the"Interface Inputs"of the node-graph.
This is the same as GetInputs() , but is provided as a convenience, to
allow clients to distinguish between inputs on shaders vs. interface-
inputs on node-graphs.
"""
result["NodeGraph"].ComputeInterfaceInputConsumersMap.func_doc = """ComputeInterfaceInputConsumersMap(computeTransitiveConsumers) -> InterfaceInputConsumersMap
Walks the namespace subtree below the node-graph and computes a map
containing the list of all inputs on the node-graph and the associated
vector of consumers of their values.
The consumers can be inputs on shaders within the node-graph or on
nested node-graphs).
If ``computeTransitiveConsumers`` is true, then value consumers
belonging to **node-graphs** are resolved transitively to compute the
transitive mapping from inputs on the node-graph to inputs on shaders
inside the material. Note that inputs on node-graphs that don't have
value consumers will continue to be included in the result.
This API is provided for use by DCC's that want to present node-graph
interface / shader connections in the opposite direction than they are
encoded in USD.
Parameters
----------
computeTransitiveConsumers : bool
"""
result["NodeGraph"].__init__.func_doc = """__init__(prim)
Construct a UsdShadeNodeGraph on UsdPrim ``prim`` .
Equivalent to UsdShadeNodeGraph::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdShadeNodeGraph on the prim held by ``schemaObj`` .
Should be preferred over UsdShadeNodeGraph (schemaObj.GetPrim()), as
it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
----------------------------------------------------------------------
__init__(connectable)
Constructor that takes a ConnectableAPI object.
Allow implicit (auto) conversion of UsdShadeConnectableAPI to
UsdShadeNodeGraph, so that a ConnectableAPI can be passed into any
function that accepts a NodeGraph.
that the conversion may produce an invalid NodeGraph object, because
not all UsdShadeConnectableAPI s are UsdShadeNodeGraph s
Parameters
----------
connectable : ConnectableAPI
"""
result["NodeGraph"].ConnectableAPI.func_doc = """ConnectableAPI() -> ConnectableAPI
Contructs and returns a UsdShadeConnectableAPI object with this node-
graph.
Note that most tasks can be accomplished without explicitly
constructing a UsdShadeConnectable API, since connection-related API
such as UsdShadeConnectableAPI::ConnectToSource() are static methods,
and UsdShadeNodeGraph will auto-convert to a UsdShadeConnectableAPI
when passed to functions that want to act generically on a connectable
UsdShadeConnectableAPI object.
"""
result["NodeGraph"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["NodeGraph"].Get.func_doc = """**classmethod** Get(stage, path) -> NodeGraph
Return a UsdShadeNodeGraph holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdShadeNodeGraph(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["NodeGraph"].Define.func_doc = """**classmethod** Define(stage, path) -> NodeGraph
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["NodeGraph"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["Output"].__doc__ = """
This class encapsulates a shader or node-graph output, which is a
connectable attribute representing a typed, externally computed value.
"""
result["Output"].SetRenderType.func_doc = """SetRenderType(renderType) -> bool
Specify an alternative, renderer-specific type to use when
emitting/translating this output, rather than translating based on its
GetTypeName()
For example, we set the renderType to"struct"for outputs that are of
renderman custom struct types.
true on success
Parameters
----------
renderType : str
"""
result["Output"].GetRenderType.func_doc = """GetRenderType() -> str
Return this output's specialized renderType, or an empty token if none
was authored.
SetRenderType()
"""
result["Output"].HasRenderType.func_doc = """HasRenderType() -> bool
Return true if a renderType has been specified for this output.
SetRenderType()
"""
result["Output"].GetSdrMetadata.func_doc = """GetSdrMetadata() -> NdrTokenMap
Returns this Output's composed"sdrMetadata"dictionary as a
NdrTokenMap.
"""
result["Output"].GetSdrMetadataByKey.func_doc = """GetSdrMetadataByKey(key) -> str
Returns the value corresponding to ``key`` in the composed
**sdrMetadata** dictionary.
Parameters
----------
key : str
"""
result["Output"].SetSdrMetadata.func_doc = """SetSdrMetadata(sdrMetadata) -> None
Authors the given ``sdrMetadata`` value on this Output at the current
EditTarget.
Parameters
----------
sdrMetadata : NdrTokenMap
"""
result["Output"].SetSdrMetadataByKey.func_doc = """SetSdrMetadataByKey(key, value) -> None
Sets the value corresponding to ``key`` to the given string ``value``
, in the Output's"sdrMetadata"dictionary at the current EditTarget.
Parameters
----------
key : str
value : str
"""
result["Output"].HasSdrMetadata.func_doc = """HasSdrMetadata() -> bool
Returns true if the Output has a non-empty
composed"sdrMetadata"dictionary value.
"""
result["Output"].HasSdrMetadataByKey.func_doc = """HasSdrMetadataByKey(key) -> bool
Returns true if there is a value corresponding to the given ``key`` in
the composed"sdrMetadata"dictionary.
Parameters
----------
key : str
"""
result["Output"].ClearSdrMetadata.func_doc = """ClearSdrMetadata() -> None
Clears any"sdrMetadata"value authored on the Output in the current
EditTarget.
"""
result["Output"].ClearSdrMetadataByKey.func_doc = """ClearSdrMetadataByKey(key) -> None
Clears the entry corresponding to the given ``key`` in
the"sdrMetadata"dictionary authored in the current EditTarget.
Parameters
----------
key : str
"""
result["Output"].__init__.func_doc = """__init__(attr)
Speculative constructor that will produce a valid UsdShadeOutput when
``attr`` already represents a shade Output, and produces an *invalid*
UsdShadeOutput otherwise (i.e.
the explicit bool conversion operator will return false).
Parameters
----------
attr : Attribute
----------------------------------------------------------------------
__init__()
Default constructor returns an invalid Output.
Exists for container classes
----------------------------------------------------------------------
__init__(prim, name, typeName)
Parameters
----------
prim : Prim
name : str
typeName : ValueTypeName
"""
result["Output"].GetAttr.func_doc = """GetAttr() -> Attribute
Explicit UsdAttribute extractor.
"""
result["Output"].IsOutput.func_doc = """**classmethod** IsOutput(attr) -> bool
Test whether a given UsdAttribute represents a valid Output, which
implies that creating a UsdShadeOutput from the attribute will
succeed.
Success implies that ``attr.IsDefined()`` is true.
Parameters
----------
attr : Attribute
"""
result["Output"].CanConnect.func_doc = """CanConnect(source) -> bool
Determines whether this Output can be connected to the given source
attribute, which can be an input or an output.
An output is considered to be connectable only if it belongs to a
node-graph. Shader outputs are not connectable.
UsdShadeConnectableAPI::CanConnect
Parameters
----------
source : Attribute
----------------------------------------------------------------------
CanConnect(sourceInput) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
sourceInput : Input
----------------------------------------------------------------------
CanConnect(sourceOutput) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
sourceOutput : Output
"""
result["Output"].ConnectToSource.func_doc = """ConnectToSource(source, mod) -> bool
Authors a connection for this Output.
``source`` is a struct that describes the upstream source attribute
with all the information necessary to make a connection. See the
documentation for UsdShadeConnectionSourceInfo. ``mod`` describes the
operation that should be applied to the list of connections. By
default the new connection will replace any existing connections, but
it can add to the list of connections to represent multiple input
connections.
``true`` if a connection was created successfully. ``false`` if
``shadingAttr`` or ``source`` is invalid.
This method does not verify the connectability of the shading
attribute to the source. Clients must invoke CanConnect() themselves
to ensure compatibility.
The source shading attribute is created if it doesn't exist already.
UsdShadeConnectableAPI::ConnectToSource
Parameters
----------
source : ConnectionSourceInfo
mod : ConnectionModification
----------------------------------------------------------------------
ConnectToSource(source, sourceName, sourceType, typeName) -> bool
Deprecated
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
source : ConnectableAPI
sourceName : str
sourceType : AttributeType
typeName : ValueTypeName
----------------------------------------------------------------------
ConnectToSource(sourcePath) -> bool
Authors a connection for this Output to the source at the given path.
UsdShadeConnectableAPI::ConnectToSource
Parameters
----------
sourcePath : Path
----------------------------------------------------------------------
ConnectToSource(sourceInput) -> bool
Connects this Output to the given input, ``sourceInput`` .
UsdShadeConnectableAPI::ConnectToSource
Parameters
----------
sourceInput : Input
----------------------------------------------------------------------
ConnectToSource(sourceOutput) -> bool
Connects this Output to the given output, ``sourceOutput`` .
UsdShadeConnectableAPI::ConnectToSource
Parameters
----------
sourceOutput : Output
"""
result["Output"].SetConnectedSources.func_doc = """SetConnectedSources(sourceInfos) -> bool
Connects this Output to the given sources, ``sourceInfos`` .
UsdShadeConnectableAPI::SetConnectedSources
Parameters
----------
sourceInfos : list[ConnectionSourceInfo]
"""
result["Output"].GetConnectedSources.func_doc = """GetConnectedSources(invalidSourcePaths) -> list[SourceInfo]
Finds the valid sources of connections for the Output.
``invalidSourcePaths`` is an optional output parameter to collect the
invalid source paths that have not been reported in the returned
vector.
Returns a vector of ``UsdShadeConnectionSourceInfo`` structs with
information about each upsteam attribute. If the vector is empty,
there have been no valid connections.
A valid connection requires the existence of the source attribute and
also requires that the source prim is UsdShadeConnectableAPI
compatible.
The python wrapping returns a tuple with the valid connections first,
followed by the invalid source paths.
UsdShadeConnectableAPI::GetConnectedSources
Parameters
----------
invalidSourcePaths : list[SdfPath]
"""
result["Output"].GetConnectedSource.func_doc = """GetConnectedSource(source, sourceName, sourceType) -> bool
Deprecated
Please use GetConnectedSources instead
Parameters
----------
source : ConnectableAPI
sourceName : str
sourceType : AttributeType
"""
result["Output"].GetRawConnectedSourcePaths.func_doc = """GetRawConnectedSourcePaths(sourcePaths) -> bool
Deprecated
Returns the"raw"(authored) connected source paths for this Output.
UsdShadeConnectableAPI::GetRawConnectedSourcePaths
Parameters
----------
sourcePaths : list[SdfPath]
"""
result["Output"].HasConnectedSource.func_doc = """HasConnectedSource() -> bool
Returns true if and only if this Output is currently connected to a
valid (defined) source.
UsdShadeConnectableAPI::HasConnectedSource
"""
result["Output"].IsSourceConnectionFromBaseMaterial.func_doc = """IsSourceConnectionFromBaseMaterial() -> bool
Returns true if the connection to this Output's source, as returned by
GetConnectedSource() , is authored across a specializes arc, which is
used to denote a base material.
UsdShadeConnectableAPI::IsSourceConnectionFromBaseMaterial
"""
result["Output"].DisconnectSource.func_doc = """DisconnectSource(sourceAttr) -> bool
Disconnect source for this Output.
If ``sourceAttr`` is valid, only a connection to the specified
attribute is disconnected, otherwise all connections are removed.
UsdShadeConnectableAPI::DisconnectSource
Parameters
----------
sourceAttr : Attribute
"""
result["Output"].ClearSources.func_doc = """ClearSources() -> bool
Clears sources for this Output in the current UsdEditTarget.
Most of the time, what you probably want is DisconnectSource() rather
than this function.
UsdShadeConnectableAPI::ClearSources
"""
result["Output"].ClearSource.func_doc = """ClearSource() -> bool
Deprecated
"""
result["Output"].GetValueProducingAttributes.func_doc = """GetValueProducingAttributes(shaderOutputsOnly) -> list[UsdShadeAttribute]
Find what is connected to this Output recursively.
UsdShadeUtils::GetValueProducingAttributes
Parameters
----------
shaderOutputsOnly : bool
"""
result["Output"].GetFullName.func_doc = """GetFullName() -> str
Get the name of the attribute associated with the output.
"""
result["Output"].GetBaseName.func_doc = """GetBaseName() -> str
Returns the name of the output.
We call this the base name since it strips off the"outputs:"namespace
prefix from the attribute name, and returns it.
"""
result["Output"].GetPrim.func_doc = """GetPrim() -> Prim
Get the prim that the output belongs to.
"""
result["Output"].GetTypeName.func_doc = """GetTypeName() -> ValueTypeName
Get the"scene description"value type name of the attribute associated
with the output.
"""
result["Output"].Set.func_doc = """Set(value, time) -> bool
Set a value for the output.
It's unusual to be setting a value on an output since it represents an
externally computed value. The Set API is provided here just for the
sake of completeness and uniformity with other property schema.
Parameters
----------
value : VtValue
time : TimeCode
----------------------------------------------------------------------
Set(value, time) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Set the attribute value of the Output at ``time`` .
Parameters
----------
value : T
time : TimeCode
"""
result["Shader"].__doc__ = """
Base class for all USD shaders. Shaders are the building blocks of
shading networks. While UsdShadeShader objects are not target
specific, each renderer or application target may derive its own
renderer-specific shader object types from this base, if needed.
Objects of this class generally represent a single shading object,
whether it exists in the target renderer or not. For example, a
texture, a fractal, or a mix node.
The UsdShadeNodeDefAPI provides attributes to uniquely identify the
type of this node. The id resolution into a renderable shader target
type of this node. The id resolution into a renderable shader target
is deferred to the consuming application.
The purpose of representing them in Usd is two-fold:
- To represent, via"connections"the topology of the shading network
that must be reconstructed in the renderer. Facilities for authoring
and manipulating connections are encapsulated in the API schema
UsdShadeConnectableAPI.
- To present a (partial or full) interface of typed input
parameters whose values can be set and overridden in Usd, to be
provided later at render-time as parameter values to the actual render
shader objects. Shader input parameters are encapsulated in the
property schema UsdShadeInput.
"""
result["Shader"].__init__.func_doc = """__init__(connectable)
Constructor that takes a ConnectableAPI object.
Allow implicit (auto) conversion of UsdShadeConnectableAPI to
UsdShadeShader, so that a ConnectableAPI can be passed into any
function that accepts a Shader.
that the conversion may produce an invalid Shader object, because not
all UsdShadeConnectableAPI s are Shaders
Parameters
----------
connectable : ConnectableAPI
----------------------------------------------------------------------
__init__(prim)
Construct a UsdShadeShader on UsdPrim ``prim`` .
Equivalent to UsdShadeShader::Get (prim.GetStage(), prim.GetPath())
for a *valid* ``prim`` , but will not immediately throw an error for
an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdShadeShader on the prim held by ``schemaObj`` .
Should be preferred over UsdShadeShader (schemaObj.GetPrim()), as it
preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["Shader"].ConnectableAPI.func_doc = """ConnectableAPI() -> ConnectableAPI
Contructs and returns a UsdShadeConnectableAPI object with this
shader.
Note that most tasks can be accomplished without explicitly
constructing a UsdShadeConnectable API, since connection-related API
such as UsdShadeConnectableAPI::ConnectToSource() are static methods,
and UsdShadeShader will auto-convert to a UsdShadeConnectableAPI when
passed to functions that want to act generically on a connectable
UsdShadeConnectableAPI object.
"""
result["Shader"].CreateOutput.func_doc = """CreateOutput(name, typeName) -> Output
Create an output which can either have a value or can be connected.
The attribute representing the output is created in
the"outputs:"namespace. Outputs on a shader cannot be connected, as
their value is assumed to be computed externally.
Parameters
----------
name : str
typeName : ValueTypeName
"""
result["Shader"].GetOutput.func_doc = """GetOutput(name) -> Output
Return the requested output if it exists.
Parameters
----------
name : str
"""
result["Shader"].GetOutputs.func_doc = """GetOutputs(onlyAuthored) -> list[Output]
Outputs are represented by attributes in the"outputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
result["Shader"].CreateInput.func_doc = """CreateInput(name, typeName) -> Input
Create an input which can either have a value or can be connected.
The attribute representing the input is created in
the"inputs:"namespace. Inputs on both shaders and node-graphs are
connectable.
Parameters
----------
name : str
typeName : ValueTypeName
"""
result["Shader"].GetInput.func_doc = """GetInput(name) -> Input
Return the requested input if it exists.
Parameters
----------
name : str
"""
result["Shader"].GetInputs.func_doc = """GetInputs(onlyAuthored) -> list[Input]
Inputs are represented by attributes in the"inputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
result["Shader"].GetImplementationSourceAttr.func_doc = """GetImplementationSourceAttr() -> Attribute
Forwards to UsdShadeNodeDefAPI(prim).
"""
result["Shader"].CreateImplementationSourceAttr.func_doc = """CreateImplementationSourceAttr(defaultValue, writeSparsely) -> Attribute
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Shader"].GetIdAttr.func_doc = """GetIdAttr() -> Attribute
Forwards to UsdShadeNodeDefAPI(prim).
"""
result["Shader"].CreateIdAttr.func_doc = """CreateIdAttr(defaultValue, writeSparsely) -> Attribute
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["Shader"].GetImplementationSource.func_doc = """GetImplementationSource() -> str
Forwards to UsdShadeNodeDefAPI(prim).
"""
result["Shader"].SetShaderId.func_doc = """SetShaderId(id) -> bool
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
id : str
"""
result["Shader"].GetShaderId.func_doc = """GetShaderId(id) -> bool
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
id : str
"""
result["Shader"].SetSourceAsset.func_doc = """SetSourceAsset(sourceAsset, sourceType) -> bool
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
sourceAsset : AssetPath
sourceType : str
"""
result["Shader"].GetSourceAsset.func_doc = """GetSourceAsset(sourceAsset, sourceType) -> bool
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
sourceAsset : AssetPath
sourceType : str
"""
result["Shader"].SetSourceAssetSubIdentifier.func_doc = """SetSourceAssetSubIdentifier(subIdentifier, sourceType) -> bool
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
subIdentifier : str
sourceType : str
"""
result["Shader"].GetSourceAssetSubIdentifier.func_doc = """GetSourceAssetSubIdentifier(subIdentifier, sourceType) -> bool
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
subIdentifier : str
sourceType : str
"""
result["Shader"].SetSourceCode.func_doc = """SetSourceCode(sourceCode, sourceType) -> bool
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
sourceCode : str
sourceType : str
"""
result["Shader"].GetSourceCode.func_doc = """GetSourceCode(sourceCode, sourceType) -> bool
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
sourceCode : str
sourceType : str
"""
result["Shader"].GetShaderNodeForSourceType.func_doc = """GetShaderNodeForSourceType(sourceType) -> ShaderNode
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
sourceType : str
"""
result["Shader"].GetSdrMetadata.func_doc = """GetSdrMetadata() -> NdrTokenMap
Returns this shader's composed"sdrMetadata"dictionary as a
NdrTokenMap.
"""
result["Shader"].GetSdrMetadataByKey.func_doc = """GetSdrMetadataByKey(key) -> str
Returns the value corresponding to ``key`` in the composed
**sdrMetadata** dictionary.
Parameters
----------
key : str
"""
result["Shader"].SetSdrMetadata.func_doc = """SetSdrMetadata(sdrMetadata) -> None
Authors the given ``sdrMetadata`` on this shader at the current
EditTarget.
Parameters
----------
sdrMetadata : NdrTokenMap
"""
result["Shader"].SetSdrMetadataByKey.func_doc = """SetSdrMetadataByKey(key, value) -> None
Sets the value corresponding to ``key`` to the given string ``value``
, in the shader's"sdrMetadata"dictionary at the current EditTarget.
Parameters
----------
key : str
value : str
"""
result["Shader"].HasSdrMetadata.func_doc = """HasSdrMetadata() -> bool
Returns true if the shader has a non-empty
composed"sdrMetadata"dictionary value.
"""
result["Shader"].HasSdrMetadataByKey.func_doc = """HasSdrMetadataByKey(key) -> bool
Returns true if there is a value corresponding to the given ``key`` in
the composed"sdrMetadata"dictionary.
Parameters
----------
key : str
"""
result["Shader"].ClearSdrMetadata.func_doc = """ClearSdrMetadata() -> None
Clears any"sdrMetadata"value authored on the shader in the current
EditTarget.
"""
result["Shader"].ClearSdrMetadataByKey.func_doc = """ClearSdrMetadataByKey(key) -> None
Clears the entry corresponding to the given ``key`` in
the"sdrMetadata"dictionary authored in the current EditTarget.
Parameters
----------
key : str
"""
result["Shader"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["Shader"].Get.func_doc = """**classmethod** Get(stage, path) -> Shader
Return a UsdShadeShader holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdShadeShader(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["Shader"].Define.func_doc = """**classmethod** Define(stage, path) -> Shader
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
result["Shader"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
"""
result["ShaderDefParserPlugin"].__doc__ = """
Parses shader definitions represented using USD scene description
using the schemas provided by UsdShade.
"""
result["ShaderDefParserPlugin"].__init__.func_doc = """__init__()
"""
result["ShaderDefParserPlugin"].Parse.func_doc = """Parse(discoveryResult) -> NdrNodeUnique
Takes the specified ``NdrNodeDiscoveryResult`` instance, which was a
result of the discovery process, and generates a new ``NdrNode`` .
The node's name, source type, and family must match.
Parameters
----------
discoveryResult : NodeDiscoveryResult
"""
result["ShaderDefParserPlugin"].GetDiscoveryTypes.func_doc = """GetDiscoveryTypes() -> NdrTokenVec
Returns the types of nodes that this plugin can parse.
"Type"here is the discovery type (in the case of files, this will
probably be the file extension, but in other systems will be data that
can be determined during discovery). This type should only be used to
match up a ``NdrNodeDiscoveryResult`` to its parser plugin; this value
is not exposed in the node's API.
"""
result["ShaderDefParserPlugin"].GetSourceType.func_doc = """GetSourceType() -> str
Returns the source type that this parser operates on.
A source type is the most general type for a node. The parser plugin
is responsible for parsing all discovery results that have the types
declared under ``GetDiscoveryTypes()`` , and those types are
collectively identified as one"source type".
"""
result["ShaderDefUtils"].__doc__ = """
This class contains a set of utility functions used for populating the
shader registry with shaders definitions specified using UsdShade
schemas.
"""
result["ShaderDefUtils"].GetNodeDiscoveryResults.func_doc = """**classmethod** GetNodeDiscoveryResults(shaderDef, sourceUri) -> NdrNodeDiscoveryResultVec
Returns the list of NdrNodeDiscoveryResult objects that must be added
to the shader registry for the given shader ``shaderDef`` , assuming
it is found in a shader definition file found by an Ndr discovery
plugin.
To enable the shaderDef parser to find and parse this shader,
``sourceUri`` should have the resolved path to the usd file containing
this shader prim.
Parameters
----------
shaderDef : Shader
sourceUri : str
"""
result["ShaderDefUtils"].GetShaderProperties.func_doc = """**classmethod** GetShaderProperties(shaderDef) -> NdrPropertyUniquePtrVec
Gets all input and output properties of the given ``shaderDef`` and
translates them into NdrProperties that can be used as the properties
for an SdrShaderNode.
Parameters
----------
shaderDef : ConnectableAPI
"""
result["ShaderDefUtils"].GetPrimvarNamesMetadataString.func_doc = """**classmethod** GetPrimvarNamesMetadataString(metadata, shaderDef) -> str
Collects all the names of valid primvar inputs of the given
``metadata`` and the given ``shaderDef`` and returns the string used
to represent them in SdrShaderNode metadata.
Parameters
----------
metadata : NdrTokenMap
shaderDef : ConnectableAPI
"""
result["Utils"].__doc__ = """
This class contains a set of utility functions used when authoring and
querying shading networks.
"""
result["Utils"].GetPrefixForAttributeType.func_doc = """**classmethod** GetPrefixForAttributeType(sourceType) -> str
Returns the namespace prefix of the USD attribute associated with the
given shading attribute type.
Parameters
----------
sourceType : AttributeType
"""
result["Utils"].GetConnectedSourcePath.func_doc = """**classmethod** GetConnectedSourcePath(srcInfo) -> Path
For a valid UsdShadeConnectionSourceInfo, return the complete path to
the source property; otherwise the empty path.
Parameters
----------
srcInfo : ConnectionSourceInfo
"""
result["Utils"].GetBaseNameAndType.func_doc = """**classmethod** GetBaseNameAndType(fullName) -> tuple[str, AttributeType]
Given the full name of a shading attribute, returns it's base name and
shading attribute type.
Parameters
----------
fullName : str
"""
result["Utils"].GetType.func_doc = """**classmethod** GetType(fullName) -> AttributeType
Given the full name of a shading attribute, returns its shading
attribute type.
Parameters
----------
fullName : str
"""
result["Utils"].GetFullName.func_doc = """**classmethod** GetFullName(baseName, type) -> str
Returns the full shading attribute name given the basename and the
shading attribute type.
``baseName`` is the name of the input or output on the shading node.
``type`` is the UsdShadeAttributeType of the shading attribute.
Parameters
----------
baseName : str
type : AttributeType
"""
result["Utils"].GetValueProducingAttributes.func_doc = """**classmethod** GetValueProducingAttributes(input, shaderOutputsOnly) -> list[UsdShadeAttribute]
Find what is connected to an Input or Output recursively.
GetValueProducingAttributes implements the UsdShade connectivity rules
described in Connection Resolution Utilities.
When tracing connections within networks that contain containers like
UsdShadeNodeGraph nodes, the actual output(s) or value(s) at the end
of an input or output might be multiple connections removed. The
methods below resolves this across multiple physical connections.
An UsdShadeInput is getting its value from one of these sources:
- If the input is not connected the UsdAttribute for this input is
returned, but only if it has an authored value. The input attribute
itself carries the value for this input.
- If the input is connected we follow the connection(s) until we
reach a valid output of a UsdShadeShader node or if we reach a valid
UsdShadeInput attribute of a UsdShadeNodeGraph or UsdShadeMaterial
that has an authored value.
An UsdShadeOutput on a container can get its value from the same type
of sources as a UsdShadeInput on either a UsdShadeShader or
UsdShadeNodeGraph. Outputs on non-containers (UsdShadeShaders) cannot
be connected.
This function returns a vector of UsdAttributes. The vector is empty
if no valid attribute was found. The type of each attribute can be
determined with the ``UsdShadeUtils::GetType`` function.
If ``shaderOutputsOnly`` is true, it will only report attributes that
are outputs of non-containers (UsdShadeShaders). This is a bit faster
and what is need when determining the connections for Material
terminals.
This will return the last attribute along the connection chain that
has an authored value, which might not be the last attribute in the
chain itself.
When the network contains multi-connections, this function can return
multiple attributes for a single input or output. The list of
attributes is build by a depth-first search, following the underlying
connection paths in order. The list can contain both UsdShadeOutput
and UsdShadeInput attributes. It is up to the caller to decide how to
process such a mixture.
Parameters
----------
input : Input
shaderOutputsOnly : bool
----------------------------------------------------------------------
GetValueProducingAttributes(output, shaderOutputsOnly) -> list[UsdShadeAttribute]
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
shaderOutputsOnly : bool
""" | 144,470 | Python | 22.335649 | 165 | 0.726075 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdShade/__init__.pyi | from __future__ import annotations
import pxr.UsdShade._usdShade
import typing
import Boost.Python
import pxr.Usd
import pxr.UsdShade
__all__ = [
"AttributeType",
"ConnectableAPI",
"ConnectionModification",
"ConnectionSourceInfo",
"CoordSysAPI",
"Input",
"Material",
"MaterialBindingAPI",
"NodeDefAPI",
"NodeGraph",
"Output",
"Shader",
"ShaderDefParserPlugin",
"ShaderDefUtils",
"Tokens",
"Utils"
]
class AttributeType(Boost.Python.enum, int):
Input = pxr.UsdShade.AttributeType.Input
Invalid = pxr.UsdShade.AttributeType.Invalid
Output = pxr.UsdShade.AttributeType.Output
__slots__ = ()
names = {'Invalid': pxr.UsdShade.AttributeType.Invalid, 'Input': pxr.UsdShade.AttributeType.Input, 'Output': pxr.UsdShade.AttributeType.Output}
values = {0: pxr.UsdShade.AttributeType.Invalid, 1: pxr.UsdShade.AttributeType.Input, 2: pxr.UsdShade.AttributeType.Output}
pass
class ConnectableAPI(pxr.Usd.APISchemaBase, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
UsdShadeConnectableAPI is an API schema that provides a common
interface for creating outputs and making connections between shading
parameters and outputs. The interface is common to all UsdShade
schemas that support Inputs and Outputs, which currently includes
UsdShadeShader, UsdShadeNodeGraph, and UsdShadeMaterial.
One can construct a UsdShadeConnectableAPI directly from a UsdPrim, or
from objects of any of the schema classes listed above. If it seems
onerous to need to construct a secondary schema object to interact
with Inputs and Outputs, keep in mind that any function whose purpose
is either to walk material/shader networks via their connections, or
to create such networks, can typically be written entirely in terms of
UsdShadeConnectableAPI objects, without needing to care what the
underlying prim type is.
Additionally, the most common UsdShadeConnectableAPI behaviors
(creating Inputs and Outputs, and making connections) are wrapped as
convenience methods on the prim schema classes (creation) and
UsdShadeInput and UsdShadeOutput.
"""
@staticmethod
@typing.overload
def CanConnect(input, sourceInput) -> bool:
"""
**classmethod** CanConnect(input, source) -> bool
Determines whether the given input can be connected to the given
source attribute, which can be an input or an output.
The result depends on the"connectability"of the input and the source
attributes. Depending on the prim type, this may require the plugin
that defines connectability behavior for that prim type be loaded.
UsdShadeInput::SetConnectability
UsdShadeInput::GetConnectability
Parameters
----------
input : Input
source : Attribute
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
sourceInput : Input
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
sourceOutput : Output
----------------------------------------------------------------------
Determines whether the given output can be connected to the given
source attribute, which can be an input or an output.
An output is considered to be connectable only if it belongs to a
node-graph. Shader outputs are not connectable.
``source`` is an optional argument. If a valid UsdAttribute is
supplied for it, this method will return true only if the source
attribute is owned by a descendant of the node-graph owning the
output.
Parameters
----------
output : Output
source : Attribute
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
sourceInput : Input
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
sourceOutput : Output
"""
@staticmethod
@typing.overload
def CanConnect(input, sourceOutput) -> bool: ...
@staticmethod
@typing.overload
def CanConnect(output, source) -> bool: ...
@staticmethod
@typing.overload
def CanConnect(output, sourceInput) -> bool: ...
@staticmethod
@typing.overload
def CanConnect(output, sourceOutput) -> bool: ...
@staticmethod
@typing.overload
def ClearSource(input) -> bool:
"""
**classmethod** ClearSource(shadingAttr) -> bool
Deprecated
This is the older version that only referenced a single source. Please
use ClearSources instead.
Parameters
----------
shadingAttr : Attribute
----------------------------------------------------------------------
Deprecated
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
----------------------------------------------------------------------
Deprecated
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
"""
@staticmethod
@typing.overload
def ClearSource(output) -> bool: ...
@staticmethod
@typing.overload
def ClearSources(input) -> bool:
"""
**classmethod** ClearSources(shadingAttr) -> bool
Clears sources for this shading attribute in the current
UsdEditTarget.
Most of the time, what you probably want is DisconnectSource() rather
than this function.
Parameters
----------
shadingAttr : Attribute
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
"""
@staticmethod
@typing.overload
def ClearSources(output) -> bool: ...
@staticmethod
@typing.overload
def ConnectToSource(input, source, mod) -> bool:
"""
**classmethod** ConnectToSource(shadingAttr, source, mod) -> bool
Authors a connection for a given shading attribute ``shadingAttr`` .
``shadingAttr`` can represent a parameter, an input or an output.
``source`` is a struct that describes the upstream source attribute
with all the information necessary to make a connection. See the
documentation for UsdShadeConnectionSourceInfo. ``mod`` describes the
operation that should be applied to the list of connections. By
default the new connection will replace any existing connections, but
it can add to the list of connections to represent multiple input
connections.
``true`` if a connection was created successfully. ``false`` if
``shadingAttr`` or ``source`` is invalid.
This method does not verify the connectability of the shading
attribute to the source. Clients must invoke CanConnect() themselves
to ensure compatibility.
The source shading attribute is created if it doesn't exist already.
Parameters
----------
shadingAttr : Attribute
source : ConnectionSourceInfo
mod : ConnectionModification
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
source : ConnectionSourceInfo
mod : ConnectionModification
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
source : ConnectionSourceInfo
mod : ConnectionModification
----------------------------------------------------------------------
Deprecated
Please use the versions that take a UsdShadeConnectionSourceInfo to
describe the upstream source This is an overloaded member function,
provided for convenience. It differs from the above function only in
what argument(s) it accepts.
Parameters
----------
shadingAttr : Attribute
source : ConnectableAPI
sourceName : str
sourceType : AttributeType
typeName : ValueTypeName
----------------------------------------------------------------------
Deprecated
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
source : ConnectableAPI
sourceName : str
sourceType : AttributeType
typeName : ValueTypeName
----------------------------------------------------------------------
Deprecated
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
source : ConnectableAPI
sourceName : str
sourceType : AttributeType
typeName : ValueTypeName
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Connect the given shading attribute to the source at path,
``sourcePath`` .
``sourcePath`` should be the fully namespaced property path.
This overload is provided for convenience, for use in contexts where
the prim types are unknown or unavailable.
Parameters
----------
shadingAttr : Attribute
sourcePath : Path
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
sourcePath : Path
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
sourcePath : Path
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Connect the given shading attribute to the given source input.
Parameters
----------
shadingAttr : Attribute
sourceInput : Input
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
sourceInput : Input
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
sourceInput : Input
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Connect the given shading attribute to the given source output.
Parameters
----------
shadingAttr : Attribute
sourceOutput : Output
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
sourceOutput : Output
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
sourceOutput : Output
"""
@staticmethod
@typing.overload
def ConnectToSource(output, source, mod) -> bool: ...
@staticmethod
@typing.overload
def ConnectToSource(shadingAttr, source, sourceName, sourceType, typeName) -> bool: ...
@staticmethod
@typing.overload
def ConnectToSource(input, source, sourceName, sourceType, typeName) -> bool: ...
@staticmethod
@typing.overload
def ConnectToSource(output, source, sourceName, sourceType, typeName) -> bool: ...
@staticmethod
@typing.overload
def ConnectToSource(shadingAttr, sourcePath) -> bool: ...
@staticmethod
@typing.overload
def ConnectToSource(input, sourcePath) -> bool: ...
@staticmethod
@typing.overload
def ConnectToSource(output, sourcePath) -> bool: ...
@staticmethod
@typing.overload
def ConnectToSource(shadingAttr, sourceInput) -> bool: ...
@staticmethod
@typing.overload
def ConnectToSource(input, sourceInput) -> bool: ...
@staticmethod
@typing.overload
def ConnectToSource(output, sourceInput) -> bool: ...
@staticmethod
@typing.overload
def ConnectToSource(shadingAttr, sourceOutput) -> bool: ...
@staticmethod
@typing.overload
def ConnectToSource(input, sourceOutput) -> bool: ...
@staticmethod
@typing.overload
def ConnectToSource(output, sourceOutput) -> bool: ...
@staticmethod
def CreateInput(name, typeName) -> Input:
"""
CreateInput(name, typeName) -> Input
Create an input which can both have a value and be connected.
The attribute representing the input is created in
the"inputs:"namespace.
Parameters
----------
name : str
typeName : ValueTypeName
"""
@staticmethod
def CreateOutput(name, typeName) -> Output:
"""
CreateOutput(name, typeName) -> Output
Create an output, which represents and externally computed, typed
value.
Outputs on node-graphs can be connected.
The attribute representing an output is created in
the"outputs:"namespace.
Parameters
----------
name : str
typeName : ValueTypeName
"""
@staticmethod
@typing.overload
def DisconnectSource(input, sourceAttr) -> bool:
"""
**classmethod** DisconnectSource(shadingAttr, sourceAttr) -> bool
Disconnect source for this shading attribute.
If ``sourceAttr`` is valid it will disconnect the connection to this
upstream attribute. Otherwise it will disconnect all connections by
authoring an empty list of connections for the attribute
``shadingAttr`` .
This may author more scene description than you might expect - we
define the behavior of disconnect to be that, even if a shading
attribute becomes connected in a weaker layer than the current
UsdEditTarget, the attribute will *still* be disconnected in the
composition, therefore we must"block"it in the current UsdEditTarget.
Parameters
----------
shadingAttr : Attribute
sourceAttr : Attribute
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
sourceAttr : Attribute
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
sourceAttr : Attribute
"""
@staticmethod
@typing.overload
def DisconnectSource(output, sourceAttr) -> bool: ...
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> ConnectableAPI
Return a UsdShadeConnectableAPI holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdShadeConnectableAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
@typing.overload
def GetConnectedSource(input, source, sourceName, sourceType) -> bool:
"""
**classmethod** GetConnectedSource(shadingAttr, source, sourceName, sourceType) -> bool
Deprecated
Shading attributes can have multiple connections and so using
GetConnectedSources is needed in general
Finds the source of a connection for the given shading attribute.
``shadingAttr`` is the shading attribute whose connection we want to
interrogate. ``source`` is an output parameter which will be set to
the source connectable prim. ``sourceName`` will be set to the name of
the source shading attribute, which may be an input or an output, as
specified by ``sourceType`` ``sourceType`` will have the type of the
source shading attribute, i.e. whether it is an ``Input`` or
``Output``
``true`` if the shading attribute is connected to a valid, defined
source attribute. ``false`` if the shading attribute is not connected
to a single, defined source attribute.
Previously this method would silently return false for multiple
connections. We are changing the behavior of this method to return the
result for the first connection and issue a TfWarn about it. We want
to encourage clients to use GetConnectedSources going forward.
The python wrapping for this method returns a (source, sourceName,
sourceType) tuple if the parameter is connected, else ``None``
Parameters
----------
shadingAttr : Attribute
source : ConnectableAPI
sourceName : str
sourceType : AttributeType
----------------------------------------------------------------------
Deprecated
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
source : ConnectableAPI
sourceName : str
sourceType : AttributeType
----------------------------------------------------------------------
Deprecated
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
source : ConnectableAPI
sourceName : str
sourceType : AttributeType
"""
@staticmethod
@typing.overload
def GetConnectedSource(output, source, sourceName, sourceType) -> bool: ...
@staticmethod
@typing.overload
def GetConnectedSources(input, invalidSourcePaths) -> list[UsdShadeSourceInfo]:
"""
**classmethod** GetConnectedSources(shadingAttr, invalidSourcePaths) -> list[UsdShadeSourceInfo]
Finds the valid sources of connections for the given shading
attribute.
``shadingAttr`` is the shading attribute whose connections we want to
interrogate. ``invalidSourcePaths`` is an optional output parameter to
collect the invalid source paths that have not been reported in the
returned vector.
Returns a vector of ``UsdShadeConnectionSourceInfo`` structs with
information about each upsteam attribute. If the vector is empty,
there have been no connections.
A valid connection requires the existence of the source attribute and
also requires that the source prim is UsdShadeConnectableAPI
compatible.
The python wrapping returns a tuple with the valid connections first,
followed by the invalid source paths.
Parameters
----------
shadingAttr : Attribute
invalidSourcePaths : list[SdfPath]
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
invalidSourcePaths : list[SdfPath]
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
invalidSourcePaths : list[SdfPath]
"""
@staticmethod
@typing.overload
def GetConnectedSources(output, invalidSourcePaths) -> list[UsdShadeSourceInfo]: ...
@staticmethod
def GetInput(name) -> Input:
"""
GetInput(name) -> Input
Return the requested input if it exists.
``name`` is the unnamespaced base name.
Parameters
----------
name : str
"""
@staticmethod
def GetInputs(onlyAuthored) -> list[Input]:
"""
GetInputs(onlyAuthored) -> list[Input]
Returns all inputs on the connectable prim (i.e.
shader or node-graph). Inputs are represented by attributes in
the"inputs:"namespace. If ``onlyAuthored`` is true (the default), then
only return authored attributes; otherwise, this also returns un-
authored builtins.
Parameters
----------
onlyAuthored : bool
"""
@staticmethod
def GetOutput(name) -> Output:
"""
GetOutput(name) -> Output
Return the requested output if it exists.
``name`` is the unnamespaced base name.
Parameters
----------
name : str
"""
@staticmethod
def GetOutputs(onlyAuthored) -> list[Output]:
"""
GetOutputs(onlyAuthored) -> list[Output]
Returns all outputs on the connectable prim (i.e.
shader or node-graph). Outputs are represented by attributes in
the"outputs:"namespace. If ``onlyAuthored`` is true (the default),
then only return authored attributes; otherwise, this also returns un-
authored builtins.
Parameters
----------
onlyAuthored : bool
"""
@staticmethod
@typing.overload
def GetRawConnectedSourcePaths(input, sourcePaths) -> bool:
"""
**classmethod** GetRawConnectedSourcePaths(shadingAttr, sourcePaths) -> bool
Deprecated
Please us GetConnectedSources to retrieve multiple connections
Returns the"raw"(authored) connected source paths for the given
shading attribute.
Parameters
----------
shadingAttr : Attribute
sourcePaths : list[SdfPath]
----------------------------------------------------------------------
Deprecated
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
sourcePaths : list[SdfPath]
----------------------------------------------------------------------
Deprecated
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
sourcePaths : list[SdfPath]
"""
@staticmethod
@typing.overload
def GetRawConnectedSourcePaths(output, sourcePaths) -> bool: ...
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def HasConnectableAPI() -> bool:
"""
**classmethod** HasConnectableAPI(schemaType) -> bool
Return true if the ``schemaType`` has a valid connectableAPIBehavior
registered, false otherwise.
To check if a prim's connectableAPI has a behavior defined, use
UsdSchemaBase::operator bool() .
Parameters
----------
schemaType : Type
----------------------------------------------------------------------
Return true if the schema type ``T`` has a connectableAPIBehavior
registered, false otherwise.
"""
@staticmethod
@typing.overload
def HasConnectedSource(input) -> bool:
"""
**classmethod** HasConnectedSource(shadingAttr) -> bool
Returns true if and only if the shading attribute is currently
connected to at least one valid (defined) source.
If you will be calling GetConnectedSources() afterwards anyways, it
will be *much* faster to instead check if the returned vector is
empty:
.. code-block:: text
UsdShadeSourceInfoVector connections =
UsdShadeConnectableAPI::GetConnectedSources(attribute);
if (!connections.empty()){
// process connected attribute
} else {
// process unconnected attribute
}
Parameters
----------
shadingAttr : Attribute
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
"""
@staticmethod
@typing.overload
def HasConnectedSource(output) -> bool: ...
@staticmethod
def IsContainer() -> bool:
"""
IsContainer() -> bool
Returns true if the prim is a container.
The underlying prim type may provide runtime behavior that defines
whether it is a container.
"""
@staticmethod
@typing.overload
def IsSourceConnectionFromBaseMaterial(input) -> bool:
"""
**classmethod** IsSourceConnectionFromBaseMaterial(shadingAttr) -> bool
Returns true if the connection to the given shading attribute's
source, as returned by UsdShadeConnectableAPI::GetConnectedSource() ,
is authored across a specializes arc, which is used to denote a base
material.
Parameters
----------
shadingAttr : Attribute
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
input : Input
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
"""
@staticmethod
@typing.overload
def IsSourceConnectionFromBaseMaterial(output) -> bool: ...
@staticmethod
def RequiresEncapsulation() -> bool:
"""
RequiresEncapsulation() -> bool
Returns true if container encapsulation rules should be respected when
evaluating connectibility behavior, false otherwise.
The underlying prim type may provide runtime behavior that defines if
encapsulation rules are respected or not.
"""
@staticmethod
def SetConnectedSources(*args, **kwargs) -> None:
"""
**classmethod** SetConnectedSources(shadingAttr, sourceInfos) -> bool
Authors a list of connections for a given shading attribute
``shadingAttr`` .
``shadingAttr`` can represent a parameter, an input or an output.
``sourceInfos`` is a vector of structs that describes the upstream
source attributes with all the information necessary to make all the
connections. See the documentation for UsdShadeConnectionSourceInfo.
``true`` if all connection were created successfully. ``false`` if the
``shadingAttr`` or one of the sources are invalid.
A valid connection is one that has a valid
``UsdShadeConnectionSourceInfo`` , which requires the existence of the
upstream source prim. It does not require the existence of the source
attribute as it will be create if necessary.
Parameters
----------
shadingAttr : Attribute
sourceInfos : list[ConnectionSourceInfo]
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 48
pass
class ConnectionModification(Boost.Python.enum, int):
Append = pxr.UsdShade.ConnectionModification.Append
Prepend = pxr.UsdShade.ConnectionModification.Prepend
Replace = pxr.UsdShade.ConnectionModification.Replace
__slots__ = ()
names = {'Replace': pxr.UsdShade.ConnectionModification.Replace, 'Prepend': pxr.UsdShade.ConnectionModification.Prepend, 'Append': pxr.UsdShade.ConnectionModification.Append}
values = {0: pxr.UsdShade.ConnectionModification.Replace, 1: pxr.UsdShade.ConnectionModification.Prepend, 2: pxr.UsdShade.ConnectionModification.Append}
pass
class ConnectionSourceInfo(Boost.Python.instance):
"""
A compact struct to represent a bundle of information about an
upstream source attribute.
"""
@staticmethod
def IsValid() -> bool:
"""
IsValid() -> bool
Return true if this source info is valid for setting up a connection.
"""
@property
def source(self) -> None:
"""
:type: None
"""
@property
def sourceName(self) -> None:
"""
:type: None
"""
@property
def sourceType(self) -> None:
"""
:type: None
"""
@property
def typeName(self) -> None:
"""
:type: None
"""
__instance_size__ = 72
pass
class CoordSysAPI(pxr.Usd.APISchemaBase, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
UsdShadeCoordSysAPI provides a way to designate, name, and discover
coordinate systems.
Coordinate systems are implicitly established by UsdGeomXformable
prims, using their local space. That coordinate system may be bound
(i.e., named) from another prim. The binding is encoded as a single-
target relationship in the"coordSys:"namespace. Coordinate system
bindings apply to descendants of the prim where the binding is
expressed, but names may be re-bound by descendant prims.
Named coordinate systems are useful in shading workflows. An example
is projection paint, which projects a texture from a certain view (the
paint coordinate system). Using the paint coordinate frame avoids the
need to assign a UV set to the object, and can be a concise way to
project paint across a collection of objects with a single shared
paint coordinate system.
This is a non-applied API schema.
"""
@staticmethod
def Bind(name, path) -> bool:
"""
Bind(name, path) -> bool
Bind the name to the given path.
The prim at the given path is expected to be UsdGeomXformable, in
order for the binding to be succesfully resolved.
Parameters
----------
name : str
path : Path
"""
@staticmethod
def BlockBinding(name) -> bool:
"""
BlockBinding(name) -> bool
Block the indicated coordinate system binding on this prim by blocking
targets on the underlying relationship.
Parameters
----------
name : str
"""
@staticmethod
def CanContainPropertyName(*args, **kwargs) -> None:
"""
**classmethod** CanContainPropertyName(name) -> bool
Test whether a given ``name`` contains the"coordSys:"prefix.
Parameters
----------
name : str
"""
@staticmethod
def ClearBinding(name, removeSpec) -> bool:
"""
ClearBinding(name, removeSpec) -> bool
Clear the indicated coordinate system binding on this prim from the
current edit target.
Only remove the spec if ``removeSpec`` is true (leave the spec to
preserve meta-data we may have intentionally authored on the
relationship)
Parameters
----------
name : str
removeSpec : bool
"""
@staticmethod
def FindBindingsWithInheritance() -> list[Binding]:
"""
FindBindingsWithInheritance() -> list[Binding]
Find the list of coordinate system bindings that apply to this prim,
including inherited bindings.
This computation examines this prim and ancestors for the strongest
binding for each name. A binding expressed by a child prim supercedes
bindings on ancestors.
Note that this API does not validate the prims at the target paths;
they may be of incorrect type, or missing entirely.
Binding relationships with no resolved targets are skipped.
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> CoordSysAPI
Return a UsdShadeCoordSysAPI holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdShadeCoordSysAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetCoordSysRelationshipName(*args, **kwargs) -> None:
"""
**classmethod** GetCoordSysRelationshipName(coordSysName) -> str
Returns the fully namespaced coordinate system relationship name,
given the coordinate system name.
Parameters
----------
coordSysName : str
"""
@staticmethod
def GetLocalBindings() -> list[Binding]:
"""
GetLocalBindings() -> list[Binding]
Get the list of coordinate system bindings local to this prim.
This does not process inherited bindings. It does not validate that a
prim exists at the indicated path. If the binding relationship has
multiple targets, only the first is used.
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def HasLocalBindings() -> bool:
"""
HasLocalBindings() -> bool
Returns true if the prim has local coordinate system binding opinions.
Note that the resulting binding list may still be empty.
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 48
pass
class Input(Boost.Python.instance):
"""
This class encapsulates a shader or node-graph input, which is a
connectable attribute representing a typed value.
"""
@staticmethod
@typing.overload
def CanConnect(source) -> bool:
"""
CanConnect(source) -> bool
Determines whether this Input can be connected to the given source
attribute, which can be an input or an output.
UsdShadeConnectableAPI::CanConnect
Parameters
----------
source : Attribute
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
sourceInput : Input
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
sourceOutput : Output
"""
@staticmethod
@typing.overload
def CanConnect(sourceInput) -> bool: ...
@staticmethod
@typing.overload
def CanConnect(sourceOutput) -> bool: ...
@staticmethod
def ClearConnectability() -> bool:
"""
ClearConnectability() -> bool
Clears any authored connectability on the Input.
"""
@staticmethod
def ClearSdrMetadata() -> None:
"""
ClearSdrMetadata() -> None
Clears any"sdrMetadata"value authored on the Input in the current
EditTarget.
"""
@staticmethod
def ClearSdrMetadataByKey(key) -> None:
"""
ClearSdrMetadataByKey(key) -> None
Clears the entry corresponding to the given ``key`` in
the"sdrMetadata"dictionary authored in the current EditTarget.
Parameters
----------
key : str
"""
@staticmethod
def ClearSource() -> bool:
"""
ClearSource() -> bool
Deprecated
"""
@staticmethod
def ClearSources() -> bool:
"""
ClearSources() -> bool
Clears sources for this Input in the current UsdEditTarget.
Most of the time, what you probably want is DisconnectSource() rather
than this function.
UsdShadeConnectableAPI::ClearSources
"""
@staticmethod
@typing.overload
def ConnectToSource(source, mod) -> bool:
"""
ConnectToSource(source, mod) -> bool
Authors a connection for this Input.
``source`` is a struct that describes the upstream source attribute
with all the information necessary to make a connection. See the
documentation for UsdShadeConnectionSourceInfo. ``mod`` describes the
operation that should be applied to the list of connections. By
default the new connection will replace any existing connections, but
it can add to the list of connections to represent multiple input
connections.
``true`` if a connection was created successfully. ``false`` if this
input or ``source`` is invalid.
This method does not verify the connectability of the shading
attribute to the source. Clients must invoke CanConnect() themselves
to ensure compatibility.
The source shading attribute is created if it doesn't exist already.
UsdShadeConnectableAPI::ConnectToSource
Parameters
----------
source : ConnectionSourceInfo
mod : ConnectionModification
----------------------------------------------------------------------
Deprecated
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
source : ConnectableAPI
sourceName : str
sourceType : AttributeType
typeName : ValueTypeName
----------------------------------------------------------------------
Authors a connection for this Input to the source at the given path.
UsdShadeConnectableAPI::ConnectToSource
Parameters
----------
sourcePath : Path
----------------------------------------------------------------------
Connects this Input to the given input, ``sourceInput`` .
UsdShadeConnectableAPI::ConnectToSource
Parameters
----------
sourceInput : Input
----------------------------------------------------------------------
Connects this Input to the given output, ``sourceOutput`` .
UsdShadeConnectableAPI::ConnectToSource
Parameters
----------
sourceOutput : Output
"""
@staticmethod
@typing.overload
def ConnectToSource(source, sourceName, sourceType, typeName) -> bool: ...
@staticmethod
@typing.overload
def ConnectToSource(sourcePath) -> bool: ...
@staticmethod
@typing.overload
def ConnectToSource(sourceInput) -> bool: ...
@staticmethod
@typing.overload
def ConnectToSource(sourceOutput) -> bool: ...
@staticmethod
def DisconnectSource(sourceAttr) -> bool:
"""
DisconnectSource(sourceAttr) -> bool
Disconnect source for this Input.
If ``sourceAttr`` is valid, only a connection to the specified
attribute is disconnected, otherwise all connections are removed.
UsdShadeConnectableAPI::DisconnectSource
Parameters
----------
sourceAttr : Attribute
"""
@staticmethod
def Get(value, time) -> bool:
"""
Get(value, time) -> bool
Convenience wrapper for the templated UsdAttribute::Get() .
Parameters
----------
value : T
time : TimeCode
----------------------------------------------------------------------
Convenience wrapper for VtValue version of UsdAttribute::Get() .
Parameters
----------
value : VtValue
time : TimeCode
"""
@staticmethod
def GetAttr() -> Attribute:
"""
GetAttr() -> Attribute
Explicit UsdAttribute extractor.
"""
@staticmethod
def GetBaseName() -> str:
"""
GetBaseName() -> str
Returns the name of the input.
We call this the base name since it strips off the"inputs:"namespace
prefix from the attribute name, and returns it.
"""
@staticmethod
def GetConnectability() -> str:
"""
GetConnectability() -> str
Returns the connectability of the Input.
"""
@staticmethod
def GetConnectedSource(source, sourceName, sourceType) -> bool:
"""
GetConnectedSource(source, sourceName, sourceType) -> bool
Deprecated
Parameters
----------
source : ConnectableAPI
sourceName : str
sourceType : AttributeType
"""
@staticmethod
def GetConnectedSources(invalidSourcePaths) -> list[SourceInfo]:
"""
GetConnectedSources(invalidSourcePaths) -> list[SourceInfo]
Finds the valid sources of connections for the Input.
``invalidSourcePaths`` is an optional output parameter to collect the
invalid source paths that have not been reported in the returned
vector.
Returns a vector of ``UsdShadeConnectionSourceInfo`` structs with
information about each upsteam attribute. If the vector is empty,
there have been no valid connections.
A valid connection requires the existence of the source attribute and
also requires that the source prim is UsdShadeConnectableAPI
compatible.
The python wrapping returns a tuple with the valid connections first,
followed by the invalid source paths.
UsdShadeConnectableAPI::GetConnectedSources
Parameters
----------
invalidSourcePaths : list[SdfPath]
"""
@staticmethod
def GetDisplayGroup() -> str:
"""
GetDisplayGroup() -> str
Get the displayGroup metadata for this Input, i.e.
hint for the location and nesting of the attribute.
UsdProperty::GetDisplayGroup() , UsdProperty::GetNestedDisplayGroup()
"""
@staticmethod
def GetDocumentation() -> str:
"""
GetDocumentation() -> str
Get documentation string for this Input.
UsdObject::GetDocumentation()
"""
@staticmethod
def GetFullName() -> str:
"""
GetFullName() -> str
Get the name of the attribute associated with the Input.
"""
@staticmethod
def GetPrim() -> Prim:
"""
GetPrim() -> Prim
Get the prim that the input belongs to.
"""
@staticmethod
def GetRawConnectedSourcePaths(sourcePaths) -> bool:
"""
GetRawConnectedSourcePaths(sourcePaths) -> bool
Deprecated
Returns the"raw"(authored) connected source paths for this Input.
UsdShadeConnectableAPI::GetRawConnectedSourcePaths
Parameters
----------
sourcePaths : list[SdfPath]
"""
@staticmethod
def GetRenderType() -> str:
"""
GetRenderType() -> str
Return this Input's specialized renderType, or an empty token if none
was authored.
"""
@staticmethod
def GetSdrMetadata() -> NdrTokenMap:
"""
GetSdrMetadata() -> NdrTokenMap
Returns this Input's composed"sdrMetadata"dictionary as a NdrTokenMap.
"""
@staticmethod
def GetSdrMetadataByKey(key) -> str:
"""
GetSdrMetadataByKey(key) -> str
Returns the value corresponding to ``key`` in the composed
**sdrMetadata** dictionary.
Parameters
----------
key : str
"""
@staticmethod
def GetTypeName() -> ValueTypeName:
"""
GetTypeName() -> ValueTypeName
Get the"scene description"value type name of the attribute associated
with the Input.
"""
@staticmethod
def GetValueProducingAttribute(attrType) -> Attribute:
"""
GetValueProducingAttribute(attrType) -> Attribute
Deprecated
in favor of calling GetValueProducingAttributes
Parameters
----------
attrType : AttributeType
"""
@staticmethod
def GetValueProducingAttributes(shaderOutputsOnly) -> list[UsdShadeAttribute]:
"""
GetValueProducingAttributes(shaderOutputsOnly) -> list[UsdShadeAttribute]
Find what is connected to this Input recursively.
UsdShadeUtils::GetValueProducingAttributes
Parameters
----------
shaderOutputsOnly : bool
"""
@staticmethod
def HasConnectedSource() -> bool:
"""
HasConnectedSource() -> bool
Returns true if and only if this Input is currently connected to a
valid (defined) source.
UsdShadeConnectableAPI::HasConnectedSource
"""
@staticmethod
def HasRenderType() -> bool:
"""
HasRenderType() -> bool
Return true if a renderType has been specified for this Input.
"""
@staticmethod
def HasSdrMetadata() -> bool:
"""
HasSdrMetadata() -> bool
Returns true if the Input has a non-empty
composed"sdrMetadata"dictionary value.
"""
@staticmethod
def HasSdrMetadataByKey(key) -> bool:
"""
HasSdrMetadataByKey(key) -> bool
Returns true if there is a value corresponding to the given ``key`` in
the composed"sdrMetadata"dictionary.
Parameters
----------
key : str
"""
@staticmethod
def IsInput(*args, **kwargs) -> None:
"""
**classmethod** IsInput(attr) -> bool
Test whether a given UsdAttribute represents a valid Input, which
implies that creating a UsdShadeInput from the attribute will succeed.
Success implies that ``attr.IsDefined()`` is true.
Parameters
----------
attr : Attribute
"""
@staticmethod
def IsInterfaceInputName(*args, **kwargs) -> None:
"""
**classmethod** IsInterfaceInputName(name) -> bool
Test if this name has a namespace that indicates it could be an input.
Parameters
----------
name : str
"""
@staticmethod
def IsSourceConnectionFromBaseMaterial() -> bool:
"""
IsSourceConnectionFromBaseMaterial() -> bool
Returns true if the connection to this Input's source, as returned by
GetConnectedSource() , is authored across a specializes arc, which is
used to denote a base material.
UsdShadeConnectableAPI::IsSourceConnectionFromBaseMaterial
"""
@staticmethod
def Set(value, time) -> bool:
"""
Set(value, time) -> bool
Set a value for the Input at ``time`` .
Parameters
----------
value : VtValue
time : TimeCode
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Set a value of the Input at ``time`` .
Parameters
----------
value : T
time : TimeCode
"""
@staticmethod
def SetConnectability(connectability) -> bool:
"""
SetConnectability(connectability) -> bool
Set the connectability of the Input.
In certain shading data models, there is a need to distinguish which
inputs **can** vary over a surface from those that must be
**uniform**. This is accomplished in UsdShade by limiting the
connectability of the input. This is done by setting
the"connectability"metadata on the associated attribute.
Connectability of an Input can be set to UsdShadeTokens->full or
UsdShadeTokens->interfaceOnly.
- **full** implies that the Input can be connected to any other
Input or Output.
- **interfaceOnly** implies that the Input can only be connected to
a NodeGraph Input (which represents an interface override, not a
render-time dataflow connection), or another Input whose
connectability is also"interfaceOnly".
The default connectability of an input is UsdShadeTokens->full.
Parameters
----------
connectability : str
"""
@staticmethod
def SetConnectedSources(sourceInfos) -> bool:
"""
SetConnectedSources(sourceInfos) -> bool
Connects this Input to the given sources, ``sourceInfos`` .
UsdShadeConnectableAPI::SetConnectedSources
Parameters
----------
sourceInfos : list[ConnectionSourceInfo]
"""
@staticmethod
def SetDisplayGroup(displayGroup) -> bool:
"""
SetDisplayGroup(displayGroup) -> bool
Set the displayGroup metadata for this Input, i.e.
hinting for the location and nesting of the attribute.
Note for an input representing a nested SdrShaderProperty, its
expected to have the scope delimited by a":".
UsdProperty::SetDisplayGroup() , UsdProperty::SetNestedDisplayGroup()
SdrShaderProperty::GetPage()
Parameters
----------
displayGroup : str
"""
@staticmethod
def SetDocumentation(docs) -> bool:
"""
SetDocumentation(docs) -> bool
Set documentation string for this Input.
UsdObject::SetDocumentation()
Parameters
----------
docs : str
"""
@staticmethod
def SetRenderType(renderType) -> bool:
"""
SetRenderType(renderType) -> bool
Specify an alternative, renderer-specific type to use when
emitting/translating this Input, rather than translating based on its
GetTypeName()
For example, we set the renderType to"struct"for Inputs that are of
renderman custom struct types.
true on success.
Parameters
----------
renderType : str
"""
@staticmethod
def SetSdrMetadata(sdrMetadata) -> None:
"""
SetSdrMetadata(sdrMetadata) -> None
Authors the given ``sdrMetadata`` value on this Input at the current
EditTarget.
Parameters
----------
sdrMetadata : NdrTokenMap
"""
@staticmethod
def SetSdrMetadataByKey(key, value) -> None:
"""
SetSdrMetadataByKey(key, value) -> None
Sets the value corresponding to ``key`` to the given string ``value``
, in the Input's"sdrMetadata"dictionary at the current EditTarget.
Parameters
----------
key : str
value : str
"""
__instance_size__ = 48
pass
class Material(NodeGraph, pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
A Material provides a container into which multiple"render targets"can
add data that defines a"shading material"for a renderer. Typically
this consists of one or more UsdRelationship properties that target
other prims of type *Shader* - though a target/client is free to add
any data that is suitable. We **strongly advise** that all targets
adopt the convention that all properties be prefixed with a namespace
that identifies the target, e.g."rel ri:surface =</Shaders/mySurf>".
In the UsdShading model, geometry expresses a binding to a single
Material or to a set of Materials partitioned by UsdGeomSubsets
defined beneath the geometry; it is legal to bind a Material at the
root (or other sub-prim) of a model, and then bind a different
Material to individual gprims, but the meaning of inheritance
and"ancestral overriding"of Material bindings is left to each render-
target to determine. Since UsdGeom has no concept of shading, we
provide the API for binding and unbinding geometry on the API schema
UsdShadeMaterialBindingAPI.
The entire power of USD VariantSets and all the other composition
operators can leveraged when encoding shading variation.
UsdShadeMaterial provides facilities for a particular way of
building"Material variants"in which neither the identity of the
Materials themselves nor the geometry Material-bindings need to change
\- instead we vary the targeted networks, interface values, and even
parameter values within a single variantSet. See Authoring Material
Variations for more details.
UsdShade requires that all of the shaders that"belong"to the Material
live under the Material in namespace. This supports powerful, easy
reuse of Materials, because it allows us to *reference* a Material
from one asset (the asset might be a module of Materials) into
another asset: USD references compose all descendant prims of the
reference target into the referencer's namespace, which means that all
of the referenced Material's shader networks will come along with the
Material. When referenced in this way, Materials can also be
instanced, for ease of deduplication and compactness. Finally,
Material encapsulation also allows us to specialize child materials
from parent materials.
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdShadeTokens. So to set an attribute to the value"rightHanded",
use UsdShadeTokens->rightHanded as the value.
"""
@staticmethod
def ClearBaseMaterial() -> None:
"""
ClearBaseMaterial() -> None
Clear the base Material of this Material.
"""
@staticmethod
@typing.overload
def ComputeDisplacementSource(renderContext, sourceName, sourceType) -> Shader:
"""
ComputeDisplacementSource(renderContext, sourceName, sourceType) -> Shader
Deprecated
Use the form that takes a TfTokenVector or renderContexts
Parameters
----------
renderContext : str
sourceName : str
sourceType : AttributeType
----------------------------------------------------------------------
Computes the resolved"displacement"output source for the given
``contextVector`` .
Using the earliest renderContext in the contextVector that produces a
valid Shader object.
If a"displacement"output corresponding to each of the renderContexts
does not exist **or** is not connected to a valid source, then this
checks the *universal* displacement output.
Returns an empty Shader object if there is no valid *displacement*
output source for any of the renderContexts in the ``contextVector`` .
The python version of this method returns a tuple containing three
elements (the source displacement shader, sourceName, sourceType).
Parameters
----------
contextVector : list[TfToken]
sourceName : str
sourceType : AttributeType
"""
@staticmethod
@typing.overload
def ComputeDisplacementSource(contextVector, sourceName, sourceType) -> Shader: ...
@staticmethod
@typing.overload
def ComputeSurfaceSource(renderContext, sourceName, sourceType) -> Shader:
"""
ComputeSurfaceSource(renderContext, sourceName, sourceType) -> Shader
Deprecated
Use the form that takes a TfTokenVector or renderContexts.
Parameters
----------
renderContext : str
sourceName : str
sourceType : AttributeType
----------------------------------------------------------------------
Computes the resolved"surface"output source for the given
``contextVector`` .
Using the earliest renderContext in the contextVector that produces a
valid Shader object.
If a"surface"output corresponding to each of the renderContexts does
not exist **or** is not connected to a valid source, then this checks
the *universal* surface output.
Returns an empty Shader object if there is no valid *surface* output
source for any of the renderContexts in the ``contextVector`` . The
python version of this method returns a tuple containing three
elements (the source surface shader, sourceName, sourceType).
Parameters
----------
contextVector : list[TfToken]
sourceName : str
sourceType : AttributeType
"""
@staticmethod
@typing.overload
def ComputeSurfaceSource(contextVector, sourceName, sourceType) -> Shader: ...
@staticmethod
@typing.overload
def ComputeVolumeSource(renderContext, sourceName, sourceType) -> Shader:
"""
ComputeVolumeSource(renderContext, sourceName, sourceType) -> Shader
Deprecated
Use the form that takes a TfTokenVector or renderContexts
Parameters
----------
renderContext : str
sourceName : str
sourceType : AttributeType
----------------------------------------------------------------------
Computes the resolved"volume"output source for the given
``contextVector`` .
Using the earliest renderContext in the contextVector that produces a
valid Shader object.
If a"volume"output corresponding to each of the renderContexts does
not exist **or** is not connected to a valid source, then this checks
the *universal* volume output.
Returns an empty Shader object if there is no valid *volume* output
output source for any of the renderContexts in the ``contextVector`` .
The python version of this method returns a tuple containing three
elements (the source volume shader, sourceName, sourceType).
Parameters
----------
contextVector : list[TfToken]
sourceName : str
sourceType : AttributeType
"""
@staticmethod
@typing.overload
def ComputeVolumeSource(contextVector, sourceName, sourceType) -> Shader: ...
@staticmethod
def CreateDisplacementAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateDisplacementAttr(defaultValue, writeSparsely) -> Attribute
See GetDisplacementAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateDisplacementOutput(renderContext) -> Output:
"""
CreateDisplacementOutput(renderContext) -> Output
Creates and returns the"displacement"output on this material for the
specified ``renderContext`` .
If the output already exists on the material, it is returned and no
authoring is performed. The returned output will always have the
requested renderContext.
Parameters
----------
renderContext : str
"""
@staticmethod
def CreateMasterMaterialVariant(*args, **kwargs) -> None:
"""
**classmethod** CreateMasterMaterialVariant(masterPrim, MaterialPrims, masterVariantSetName) -> bool
Create a variantSet on ``masterPrim`` that will set the
MaterialVariant on each of the given *MaterialPrims*.
The variantSet, whose name can be specified with
``masterVariantSetName`` and defaults to the same MaterialVariant name
created on Materials by GetEditContextForVariant() , will have the
same variants as the Materials, and each Master variant will set every
``MaterialPrims'`` MaterialVariant selection to the same variant as
the master. Thus, it allows all Materials to be switched with a single
variant selection, on ``masterPrim`` .
If ``masterPrim`` is an ancestor of any given member of
``MaterialPrims`` , then we will author variant selections directly on
the MaterialPrims. However, it is often preferable to create a master
MaterialVariant in a separately rooted tree from the MaterialPrims, so
that it can be layered more strongly on top of the Materials.
Therefore, for any MaterialPrim in a different tree than masterPrim,
we will create"overs"as children of masterPrim that recreate the path
to the MaterialPrim, substituting masterPrim's full path for the
MaterialPrim's root path component.
Upon successful completion, the new variantSet we created on
``masterPrim`` will have its variant selection authored to
the"last"variant (determined lexicographically). It is up to the
calling client to either UsdVariantSet::ClearVariantSelection() on
``masterPrim`` , or set the selection to the desired default setting.
Return ``true`` on success. It is an error if any of ``Materials``
have a different set of variants for the MaterialVariant than the
others.
Parameters
----------
masterPrim : Prim
MaterialPrims : list[Prim]
masterVariantSetName : str
"""
@staticmethod
def CreateSurfaceAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateSurfaceAttr(defaultValue, writeSparsely) -> Attribute
See GetSurfaceAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateSurfaceOutput(renderContext) -> Output:
"""
CreateSurfaceOutput(renderContext) -> Output
Creates and returns the"surface"output on this material for the
specified ``renderContext`` .
If the output already exists on the material, it is returned and no
authoring is performed. The returned output will always have the
requested renderContext.
Parameters
----------
renderContext : str
"""
@staticmethod
def CreateVolumeAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateVolumeAttr(defaultValue, writeSparsely) -> Attribute
See GetVolumeAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateVolumeOutput(renderContext) -> Output:
"""
CreateVolumeOutput(renderContext) -> Output
Creates and returns the"volume"output on this material for the
specified ``renderContext`` .
If the output already exists on the material, it is returned and no
authoring is performed. The returned output will always have the
requested renderContext.
Parameters
----------
renderContext : str
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> Material
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> Material
Return a UsdShadeMaterial holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdShadeMaterial(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetBaseMaterial() -> Material:
"""
GetBaseMaterial() -> Material
Get the path to the base Material of this Material.
If there is no base Material, an empty Material is returned
"""
@staticmethod
def GetBaseMaterialPath() -> Path:
"""
GetBaseMaterialPath() -> Path
Get the base Material of this Material.
If there is no base Material, an empty path is returned
"""
@staticmethod
def GetDisplacementAttr() -> Attribute:
"""
GetDisplacementAttr() -> Attribute
Represents the universal"displacement"output terminal of a material.
Declaration
``token outputs:displacement``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
"""
@staticmethod
def GetDisplacementOutput(renderContext) -> Output:
"""
GetDisplacementOutput(renderContext) -> Output
Returns the"displacement"output of this material for the specified
renderContext.
The returned output will always have the requested renderContext.
An invalid output is returned if an output corresponding to the
requested specific-renderContext does not exist.
UsdShadeMaterial::ComputeDisplacementSource()
Parameters
----------
renderContext : str
"""
@staticmethod
def GetDisplacementOutputs() -> list[Output]:
"""
GetDisplacementOutputs() -> list[Output]
Returns the"displacement"outputs of this material for all available
renderContexts.
The returned vector will include all authored"displacement"outputs
with the *universal* renderContext output first, if present. Outputs
are returned regardless of whether they are connected to a valid
source.
"""
@staticmethod
def GetEditContextForVariant(MaterialVariantName, layer) -> tuple[Stage, EditTarget]:
"""
GetEditContextForVariant(MaterialVariantName, layer) -> tuple[Stage, EditTarget]
Helper function for configuring a UsdStage 's UsdEditTarget to author
Material variations.
Takes care of creating the Material variantSet and specified variant,
if necessary.
Let's assume that we are authoring Materials into the Stage's current
UsdEditTarget, and that we are iterating over the variations of a
UsdShadeMaterial *clothMaterial*, and *currVariant* is the variant we
are processing (e.g."denim").
In C++, then, we would use the following pattern:
.. code-block:: text
{
UsdEditContext ctxt(clothMaterial.GetEditContextForVariant(currVariant));
// All USD mutation of the UsdStage on which clothMaterial sits will
// now go "inside" the currVariant of the "MaterialVariant" variantSet
}
In python, the pattern is:
.. code-block:: text
with clothMaterial.GetEditContextForVariant(currVariant):
# Now sending mutations to currVariant
If ``layer`` is specified, then we will use it, rather than the
stage's current UsdEditTarget 's layer as the destination layer for
the edit context we are building. If ``layer`` does not actually
contribute to the Material prim's definition, any editing will have no
effect on this Material.
**Note:** As just stated, using this method involves authoring a
selection for the MaterialVariant in the stage's current EditTarget.
When client is done authoring variations on this prim, they will
likely want to either UsdVariantSet::SetVariantSelection() to the
appropriate default selection, or possibly
UsdVariantSet::ClearVariantSelection() on the
UsdShadeMaterial::GetMaterialVariant() UsdVariantSet.
UsdVariantSet::GetVariantEditContext()
Parameters
----------
MaterialVariantName : str
layer : Layer
"""
@staticmethod
def GetMaterialVariant() -> VariantSet:
"""
GetMaterialVariant() -> VariantSet
Return a UsdVariantSet object for interacting with the Material
variant variantSet.
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def GetSurfaceAttr() -> Attribute:
"""
GetSurfaceAttr() -> Attribute
Represents the universal"surface"output terminal of a material.
Declaration
``token outputs:surface``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
"""
@staticmethod
def GetSurfaceOutput(renderContext) -> Output:
"""
GetSurfaceOutput(renderContext) -> Output
Returns the"surface"output of this material for the specified
``renderContext`` .
The returned output will always have the requested renderContext.
An invalid output is returned if an output corresponding to the
requested specific-renderContext does not exist.
UsdShadeMaterial::ComputeSurfaceSource()
Parameters
----------
renderContext : str
"""
@staticmethod
def GetSurfaceOutputs() -> list[Output]:
"""
GetSurfaceOutputs() -> list[Output]
Returns the"surface"outputs of this material for all available
renderContexts.
The returned vector will include all authored"surface"outputs with the
*universal* renderContext output first, if present. Outputs are
returned regardless of whether they are connected to a valid source.
"""
@staticmethod
def GetVolumeAttr() -> Attribute:
"""
GetVolumeAttr() -> Attribute
Represents the universal"volume"output terminal of a material.
Declaration
``token outputs:volume``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
"""
@staticmethod
def GetVolumeOutput(renderContext) -> Output:
"""
GetVolumeOutput(renderContext) -> Output
Returns the"volume"output of this material for the specified
renderContext.
The returned output will always have the requested renderContext.
An invalid output is returned if an output corresponding to the
requested specific-renderContext does not exist.
UsdShadeMaterial::ComputeVolumeSource()
Parameters
----------
renderContext : str
"""
@staticmethod
def GetVolumeOutputs() -> list[Output]:
"""
GetVolumeOutputs() -> list[Output]
Returns the"volume"outputs of this material for all available
renderContexts.
The returned vector will include all authored"volume"outputs with the
*universal* renderContext output first, if present. Outputs are
returned regardless of whether they are connected to a valid source.
"""
@staticmethod
def HasBaseMaterial() -> bool:
"""
HasBaseMaterial() -> bool
"""
@staticmethod
def SetBaseMaterial(baseMaterial) -> None:
"""
SetBaseMaterial(baseMaterial) -> None
Set the base Material of this Material.
An empty Material is equivalent to clearing the base Material.
Parameters
----------
baseMaterial : Material
"""
@staticmethod
def SetBaseMaterialPath(baseMaterialPath) -> None:
"""
SetBaseMaterialPath(baseMaterialPath) -> None
Set the path to the base Material of this Material.
An empty path is equivalent to clearing the base Material.
Parameters
----------
baseMaterialPath : Path
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class MaterialBindingAPI(pxr.Usd.APISchemaBase, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
UsdShadeMaterialBindingAPI is an API schema that provides an interface
for binding materials to prims or collections of prims (represented by
UsdCollectionAPI objects).
In the USD shading model, each renderable gprim computes a single
**resolved Material** that will be used to shade the gprim
(exceptions, of course, for gprims that possess UsdGeomSubsets, as
each subset can be shaded by a different Material). A gprim **and each
of its ancestor prims** can possess, through the MaterialBindingAPI,
both a **direct** binding to a Material, and any number of
**collection-based** bindings to Materials; each binding can be
generic or declared for a particular **purpose**, and given a specific
**binding strength**. It is the process of"material resolution"(see
UsdShadeMaterialBindingAPI_MaterialResolution) that examines all of
these bindings, and selects the one Material that best matches the
client's needs.
The intent of **purpose** is that each gprim should be able to resolve
a Material for any given purpose, which implies it can have
differently bound materials for different purposes. There are two
*special* values of **purpose** defined in UsdShade, although the API
fully supports specifying arbitrary values for it, for the sake of
extensibility:
- **UsdShadeTokens->full** : to be used when the purpose of the
render is entirely to visualize the truest representation of a scene,
considering all lighting and material information, at highest
fidelity.
- **UsdShadeTokens->preview** : to be used when the render is in
service of a goal other than a high fidelity"full"render (such as
scene manipulation, modeling, or realtime playback). Latency and speed
are generally of greater concern for preview renders, therefore
preview materials are generally designed to be"lighterweight"compared
to full materials.
A binding can also have no specific purpose at all, in which case, it
is considered to be the fallback or all-purpose binding (denoted by
the empty-valued token **UsdShadeTokens->allPurpose**).
The **purpose** of a material binding is encoded in the name of the
binding relationship.
- In the case of a direct binding, the *allPurpose* binding is
represented by the relationship named **"material:binding"**. Special-
purpose direct bindings are represented by relationships named
**"material:binding: *purpose***. A direct binding relationship must
have a single target path that points to a **UsdShadeMaterial**.
- In the case of a collection-based binding, the *allPurpose*
binding is represented by a relationship
named"material:binding:collection:<i>bindingName</i>", where
**bindingName** establishes an identity for the binding that is unique
on the prim. Attempting to establish two collection bindings of the
same name on the same prim will result in the first binding simply
being overridden. A special-purpose collection-based binding is
represented by a relationship
named"material:binding:collection:<i>purpose:bindingName</i>". A
collection-based binding relationship must have exacly two targets,
one of which should be a collection-path (see ef
UsdCollectionAPI::GetCollectionPath() ) and the other should point to
a **UsdShadeMaterial**. In the future, we may allow a single
collection binding to target multiple collections, if we can establish
a reasonable round-tripping pattern for applications that only allow a
single collection to be associated with each Material.
**Note:** Both **bindingName** and **purpose** must be non-namespaced
tokens. This allows us to know the role of a binding relationship
simply from the number of tokens in it.
- **Two tokens** : the fallback,"all purpose", direct binding,
*material:binding*
- **Three tokens** : a purpose-restricted, direct, fallback
binding, e.g. material:binding:preview
- **Four tokens** : an all-purpose, collection-based binding, e.g.
material:binding:collection:metalBits
- **Five tokens** : a purpose-restricted, collection-based binding,
e.g. material:binding:collection:full:metalBits
A **binding-strength** value is used to specify whether a binding
authored on a prim should be weaker or stronger than bindings that
appear lower in namespace. We encode the binding strength with as
token-valued metadata **'bindMaterialAs'** for future flexibility,
even though for now, there are only two possible values:
*UsdShadeTokens->weakerThanDescendants* and
*UsdShadeTokens->strongerThanDescendants*. When binding-strength is
not authored (i.e. empty) on a binding-relationship, the default
behavior matches UsdShadeTokens->weakerThanDescendants.
If a material binding relationship is a built-in property defined as
part of a typed prim's schema, a fallback value should not be provided
for it. This is because the"material resolution"algorithm only
conisders *authored* properties.
"""
class CollectionBinding(Boost.Python.instance):
@staticmethod
def GetBindingRel(*args, **kwargs) -> None: ...
@staticmethod
def GetCollection(*args, **kwargs) -> None: ...
@staticmethod
def GetCollectionPath(*args, **kwargs) -> None: ...
@staticmethod
def GetMaterial(*args, **kwargs) -> None: ...
@staticmethod
def GetMaterialPath(*args, **kwargs) -> None: ...
@staticmethod
def IsCollectionBindingRel(*args, **kwargs) -> None: ...
@staticmethod
def IsValid(*args, **kwargs) -> None: ...
__instance_size__ = 64
pass
class DirectBinding(Boost.Python.instance):
@staticmethod
def GetBindingRel(*args, **kwargs) -> None: ...
@staticmethod
def GetMaterial(*args, **kwargs) -> None: ...
@staticmethod
def GetMaterialPath(*args, **kwargs) -> None: ...
@staticmethod
def GetMaterialPurpose(*args, **kwargs) -> None: ...
__instance_size__ = 64
pass
@staticmethod
def AddPrimToBindingCollection(prim, bindingName, materialPurpose) -> bool:
"""
AddPrimToBindingCollection(prim, bindingName, materialPurpose) -> bool
Adds the specified ``prim`` to the collection targeted by the binding
relationship corresponding to given ``bindingName`` and
``materialPurpose`` .
If the collection-binding relationship doesn't exist or if the
targeted collection already includes the ``prim`` , then this does
nothing and returns true.
If the targeted collection does not include ``prim`` (or excludes it
explicitly), then this modifies the collection by adding the prim to
it (by invoking UsdCollectionAPI::AddPrim()).
Parameters
----------
prim : Prim
bindingName : str
materialPurpose : str
"""
@staticmethod
def Apply(*args, **kwargs) -> None:
"""
**classmethod** Apply(prim) -> MaterialBindingAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"MaterialBindingAPI"to the token-
valued, listOp metadata *apiSchemas* on the prim.
A valid UsdShadeMaterialBindingAPI object is returned upon success. An
invalid (or empty) UsdShadeMaterialBindingAPI object is returned upon
failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
@staticmethod
@typing.overload
def Bind(material, bindingStrength, materialPurpose) -> bool:
"""
Bind(material, bindingStrength, materialPurpose) -> bool
Authors a direct binding to the given ``material`` on this prim.
If ``bindingStrength`` is UsdShadeTokens->fallbackStrength, the value
UsdShadeTokens->weakerThanDescendants is authored sparsely. To stamp
out the bindingStrength value explicitly, clients can pass in
UsdShadeTokens->weakerThanDescendants or
UsdShadeTokens->strongerThanDescendants directly.
If ``materialPurpose`` is specified and isn't equal to
UsdShadeTokens->allPurpose, the binding only applies to the specified
material purpose.
Note that UsdShadeMaterialBindingAPI is a SingleAppliedAPI schema
which when applied updates the prim definition accordingly. This
information on the prim definition is helpful in multiple queries and
more performant. Hence its recommended to call
UsdShadeMaterialBindingAPI::Apply() when Binding a material.
Returns true on success, false otherwise.
Parameters
----------
material : Material
bindingStrength : str
materialPurpose : str
----------------------------------------------------------------------
Authors a collection-based binding, which binds the given ``material``
to the given ``collection`` on this prim.
``bindingName`` establishes an identity for the binding that is unique
on the prim. Attempting to establish two collection bindings of the
same name on the same prim will result in the first binding simply
being overridden. If ``bindingName`` is empty, it is set to the base-
name of the collection being bound (which is the collection-name with
any namespaces stripped out). If there are multiple collections with
the same base-name being bound at the same prim, clients should pass
in a unique binding name per binding, in order to preserve all
bindings. The binding name used in constructing the collection-binding
relationship name shoud not contain namespaces. Hence, a coding error
is issued and no binding is authored if the provided value of
``bindingName`` is non-empty and contains namespaces.
If ``bindingStrength`` is *UsdShadeTokens->fallbackStrength*, the
value UsdShadeTokens->weakerThanDescendants is authored sparsely, i.e.
only when there is an existing binding with a different
bindingStrength. To stamp out the bindingStrength value explicitly,
clients can pass in UsdShadeTokens->weakerThanDescendants or
UsdShadeTokens->strongerThanDescendants directly.
If ``materialPurpose`` is specified and isn't equal to
UsdShadeTokens->allPurpose, the binding only applies to the specified
material purpose.
Note that UsdShadeMaterialBindingAPI is a SingleAppliedAPI schema
which when applied updates the prim definition accordingly. This
information on the prim definition is helpful in multiple queries and
more performant. Hence its recommended to call
UsdShadeMaterialBindingAPI::Apply() when Binding a material.
Returns true on success, false otherwise.
Parameters
----------
collection : CollectionAPI
material : Material
bindingName : str
bindingStrength : str
materialPurpose : str
"""
@staticmethod
@typing.overload
def Bind(collection, material, bindingName, bindingStrength, materialPurpose) -> bool: ...
@staticmethod
def CanApply(*args, **kwargs) -> None:
"""
**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
@staticmethod
def CanContainPropertyName(*args, **kwargs) -> None:
"""
**classmethod** CanContainPropertyName(name) -> bool
Test whether a given ``name`` contains the"material:binding:"prefix.
Parameters
----------
name : str
"""
@staticmethod
@typing.overload
def ComputeBoundMaterial(bindingsCache, collectionQueryCache, materialPurpose, bindingRel) -> Material:
"""
ComputeBoundMaterial(bindingsCache, collectionQueryCache, materialPurpose, bindingRel) -> Material
Computes the resolved bound material for this prim, for the given
material purpose.
This overload of ComputeBoundMaterial makes use of the BindingsCache (
``bindingsCache`` ) and CollectionQueryCache (
``collectionQueryCache`` ) that are passed in, to avoid redundant
binding computations and computations of MembershipQuery objects for
collections. It would be beneficial to make use of these when
resolving bindings for a tree of prims. These caches are populated
lazily as more and more bindings are resolved.
When the goal is to compute the bound material for a range (or list)
of prims, it is recommended to use this version of
ComputeBoundMaterial() . Here's how you could compute the bindings of
a range of prims efficiently in C++:
.. code-block:: text
std::vector<std::pair<UsdPrim, UsdShadeMaterial> primBindings;
UsdShadeMaterialBindingAPI::BindingsCache bindingsCache;
UsdShadeMaterialBindingAPI::CollectionQueryCache collQueryCache;
for (auto prim : UsdPrimRange(rootPrim)) {
UsdShadeMaterial boundMaterial =
UsdShadeMaterialBindingAPI(prim).ComputeBoundMaterial(
& bindingsCache, & collQueryCache);
if (boundMaterial) {
primBindings.emplace_back({prim, boundMaterial});
}
}
If ``bindingRel`` is not null, then it is set to the"winning"binding
relationship.
Note the resolved bound material is considered valid if the target
path of the binding relationship is a valid non-empty prim path. This
makes sure winning binding relationship and the bound material remain
consistent consistent irrespective of the presence/absence of prim at
material path. For ascenario where ComputeBoundMaterial returns a
invalid UsdShadeMaterial with a valid winning bindingRel, clients can
use the static method
UsdShadeMaterialBindingAPI::GetResolvedTargetPathFromBindingRel to get
the path of the resolved target identified by the winning bindingRel.
See Bound Material Resolution for details on the material resolution
process.
The python version of this method returns a tuple containing the bound
material and the"winning"binding relationship.
Parameters
----------
bindingsCache : BindingsCache
collectionQueryCache : CollectionQueryCache
materialPurpose : str
bindingRel : Relationship
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Computes the resolved bound material for this prim, for the given
material purpose.
This overload does not utilize cached MembershipQuery object. However,
it only computes the MembershipQuery of every collection that bound in
the ancestor chain at most once.
If ``bindingRel`` is not null, then it is set to the winning binding
relationship.
See Bound Material Resolution for details on the material resolution
process.
The python version of this method returns a tuple containing the bound
material and the"winning"binding relationship.
Parameters
----------
materialPurpose : str
bindingRel : Relationship
"""
@staticmethod
@typing.overload
def ComputeBoundMaterial(materialPurpose, bindingRel) -> Material: ...
@staticmethod
def ComputeBoundMaterials(*args, **kwargs) -> None:
"""
**classmethod** ComputeBoundMaterials(prims, materialPurpose, bindingRels) -> list[Material]
Static API for efficiently and concurrently computing the resolved
material bindings for a vector of UsdPrims, ``prims`` for the given
``materialPurpose`` .
The size of the returned vector always matches the size of the input
vector, ``prims`` . If a prim is not bound to any material, an invalid
or empty UsdShadeMaterial is returned at the index corresponding to
it.
If the pointer ``bindingRels`` points to a valid vector, then it is
populated with the set of all"winning"binding relationships.
The python version of this method returns a tuple containing two lists
\- the bound materials and the corresponding"winning"binding
relationships.
Parameters
----------
prims : list[Prim]
materialPurpose : str
bindingRels : list[Relationship]
"""
@staticmethod
def CreateMaterialBindSubset(subsetName, indices, elementType) -> Subset:
"""
CreateMaterialBindSubset(subsetName, indices, elementType) -> Subset
Creates a GeomSubset named ``subsetName`` with element type,
``elementType`` and familyName **materialBind **below this prim.****
If a GeomSubset named ``subsetName`` already exists, then
its"familyName"is updated to be UsdShadeTokens->materialBind and its
indices (at *default* timeCode) are updated with the provided
``indices`` value before returning.
This method forces the familyType of the"materialBind"family of
subsets to UsdGeomTokens->nonOverlapping if it's unset or explicitly
set to UsdGeomTokens->unrestricted.
The default value ``elementType`` is UsdGeomTokens->face, as we expect
materials to be bound most often to subsets of faces on meshes.
Parameters
----------
subsetName : str
indices : IntArray
elementType : str
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> MaterialBindingAPI
Return a UsdShadeMaterialBindingAPI holding the prim adhering to this
schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdShadeMaterialBindingAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetCollectionBindingRel(bindingName, materialPurpose) -> Relationship:
"""
GetCollectionBindingRel(bindingName, materialPurpose) -> Relationship
Returns the collection-based material-binding relationship with the
given ``bindingName`` and ``materialPurpose`` on this prim.
For info on ``bindingName`` , see UsdShadeMaterialBindingAPI::Bind() .
The material purpose of the relationship that's returned will match
the specified ``materialPurpose`` .
Parameters
----------
bindingName : str
materialPurpose : str
"""
@staticmethod
def GetCollectionBindingRels(materialPurpose) -> list[Relationship]:
"""
GetCollectionBindingRels(materialPurpose) -> list[Relationship]
Returns the list of collection-based material binding relationships on
this prim for the given material purpose, ``materialPurpose`` .
The returned list of binding relationships will be in native property
order. See UsdPrim::GetPropertyOrder() , UsdPrim::SetPropertyOrder() .
Bindings that appear earlier in the property order are considered to
be stronger than the ones that come later. See rule #6 in
UsdShadeMaterialBindingAPI_MaterialResolution.
Parameters
----------
materialPurpose : str
"""
@staticmethod
def GetCollectionBindings(materialPurpose) -> list[CollectionBinding]:
"""
GetCollectionBindings(materialPurpose) -> list[CollectionBinding]
Returns all the collection-based bindings on this prim for the given
material purpose.
The returned CollectionBinding objects always have the specified
``materialPurpose`` (i.e. the all-purpose binding is not returned if a
special purpose binding is requested).
If one or more collection based bindings are to prims that are not
Materials, this does not generate an error, but the corresponding
Material(s) will be invalid (i.e. evaluate to false).
The python version of this API returns a tuple containing the vector
of CollectionBinding objects and the corresponding vector of binding
relationships.
The returned list of collection-bindings will be in native property
order of the associated binding relationships. See
UsdPrim::GetPropertyOrder() , UsdPrim::SetPropertyOrder() . Binding
relationships that come earlier in the list are considered to be
stronger than the ones that come later. See rule #6 in
UsdShadeMaterialBindingAPI_MaterialResolution.
Parameters
----------
materialPurpose : str
"""
@staticmethod
def GetDirectBinding(materialPurpose) -> DirectBinding:
"""
GetDirectBinding(materialPurpose) -> DirectBinding
Computes and returns the direct binding for the given material purpose
on this prim.
The returned binding always has the specified ``materialPurpose``
(i.e. the all-purpose binding is not returned if a special purpose
binding is requested).
If the direct binding is to a prim that is not a Material, this does
not generate an error, but the returned Material will be invalid (i.e.
evaluate to false).
Parameters
----------
materialPurpose : str
"""
@staticmethod
def GetDirectBindingRel(materialPurpose) -> Relationship:
"""
GetDirectBindingRel(materialPurpose) -> Relationship
Returns the direct material-binding relationship on this prim for the
given material purpose.
The material purpose of the relationship that's returned will match
the specified ``materialPurpose`` .
Parameters
----------
materialPurpose : str
"""
@staticmethod
def GetMaterialBindSubsets() -> list[Subset]:
"""
GetMaterialBindSubsets() -> list[Subset]
Returns all the existing GeomSubsets with
familyName=UsdShadeTokens->materialBind below this prim.
"""
@staticmethod
def GetMaterialBindSubsetsFamilyType() -> str:
"""
GetMaterialBindSubsetsFamilyType() -> str
Returns the familyType of the family of"materialBind"GeomSubsets on
this prim.
By default, materialBind subsets have familyType="nonOverlapping", but
they can also be tagged as a"partition", using
SetMaterialBindFaceSubsetsFamilyType().
UsdGeomSubset::GetFamilyNameAttr
"""
@staticmethod
def GetMaterialBindingStrength(*args, **kwargs) -> None:
"""
**classmethod** GetMaterialBindingStrength(bindingRel) -> str
Resolves the'bindMaterialAs'token-valued metadata on the given binding
relationship and returns it.
If the resolved value is empty, this returns the fallback value
UsdShadeTokens->weakerThanDescendants.
UsdShadeMaterialBindingAPI::SetMaterialBindingStrength()
Parameters
----------
bindingRel : Relationship
"""
@staticmethod
def GetMaterialPurposes(*args, **kwargs) -> None:
"""
**classmethod** GetMaterialPurposes() -> list[TfToken]
Returns a vector of the possible values for the'material purpose'.
"""
@staticmethod
def GetResolvedTargetPathFromBindingRel(*args, **kwargs) -> None:
"""
**classmethod** GetResolvedTargetPathFromBindingRel(bindingRel) -> Path
returns the path of the resolved target identified by ``bindingRel`` .
Parameters
----------
bindingRel : Relationship
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def RemovePrimFromBindingCollection(prim, bindingName, materialPurpose) -> bool:
"""
RemovePrimFromBindingCollection(prim, bindingName, materialPurpose) -> bool
Removes the specified ``prim`` from the collection targeted by the
binding relationship corresponding to given ``bindingName`` and
``materialPurpose`` .
If the collection-binding relationship doesn't exist or if the
targeted collection does not include the ``prim`` , then this does
nothing and returns true.
If the targeted collection includes ``prim`` , then this modifies the
collection by removing the prim from it (by invoking
UsdCollectionAPI::RemovePrim()). This method can be used in
conjunction with the Unbind\*() methods (if desired) to guarantee
that a prim has no resolved material binding.
Parameters
----------
prim : Prim
bindingName : str
materialPurpose : str
"""
@staticmethod
def SetMaterialBindSubsetsFamilyType(familyType) -> bool:
"""
SetMaterialBindSubsetsFamilyType(familyType) -> bool
Author the *familyType* of the"materialBind"family of GeomSubsets on
this prim.
The default ``familyType`` is *UsdGeomTokens->nonOverlapping *. It can
be set to *UsdGeomTokens->partition* to indicate that the entire
imageable prim is included in the union of all
the"materialBind"subsets. The family type should never be set to
UsdGeomTokens->unrestricted, since it is invalid for a single piece of
geometry (in this case, a subset) to be bound to more than one
material. Hence, a coding error is issued if ``familyType`` is
UsdGeomTokens->unrestricted.**
**
UsdGeomSubset::SetFamilyType**
Parameters
----------
familyType : str
"""
@staticmethod
def SetMaterialBindingStrength(*args, **kwargs) -> None:
"""
**classmethod** SetMaterialBindingStrength(bindingRel, bindingStrength) -> bool
Sets the'bindMaterialAs'token-valued metadata on the given binding
relationship.
If ``bindingStrength`` is *UsdShadeTokens->fallbackStrength*, the
value UsdShadeTokens->weakerThanDescendants is authored sparsely, i.e.
only when there is a different existing bindingStrength value. To
stamp out the bindingStrength value explicitly, clients can pass in
UsdShadeTokens->weakerThanDescendants or
UsdShadeTokens->strongerThanDescendants directly. Returns true on
success, false otherwise.
UsdShadeMaterialBindingAPI::GetMaterialBindingStrength()
Parameters
----------
bindingRel : Relationship
bindingStrength : str
"""
@staticmethod
def UnbindAllBindings() -> bool:
"""
UnbindAllBindings() -> bool
Unbinds all direct and collection-based bindings on this prim.
"""
@staticmethod
def UnbindCollectionBinding(bindingName, materialPurpose) -> bool:
"""
UnbindCollectionBinding(bindingName, materialPurpose) -> bool
Unbinds the collection-based binding with the given ``bindingName`` ,
for the given ``materialPurpose`` on this prim.
It accomplishes this by blocking the targets of the associated binding
relationship in the current edit target.
If a binding was created without specifying a ``bindingName`` , then
the correct ``bindingName`` to use for unbinding is the instance name
of the targetted collection.
Parameters
----------
bindingName : str
materialPurpose : str
"""
@staticmethod
def UnbindDirectBinding(materialPurpose) -> bool:
"""
UnbindDirectBinding(materialPurpose) -> bool
Unbinds the direct binding for the given material purpose (
``materialPurpose`` ) on this prim.
It accomplishes this by blocking the targets of the binding
relationship in the current edit target.
Parameters
----------
materialPurpose : str
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 48
pass
class NodeDefAPI(pxr.Usd.APISchemaBase, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
UsdShadeNodeDefAPI is an API schema that provides attributes for a
prim to select a corresponding Shader Node Definition ("Sdr Node"), as
well as to look up a runtime entry for that shader node in the form of
an SdrShaderNode.
UsdShadeNodeDefAPI is intended to be a pre-applied API schema for any
prim type that wants to refer to the SdrRegistry for further
implementation details about the behavior of that prim. The primary
use in UsdShade itself is as UsdShadeShader, which is a basis for
material shading networks (UsdShadeMaterial), but this is intended to
be used in other domains that also use the Sdr node mechanism.
This schema provides properties that allow a prim to identify an
external node definition, either by a direct identifier key into the
SdrRegistry (info:id), an asset to be parsed by a suitable
NdrParserPlugin (info:sourceAsset), or an inline source code that must
also be parsed (info:sourceCode); as well as a selector attribute to
determine which specifier is active (info:implementationSource).
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdShadeTokens. So to set an attribute to the value"rightHanded",
use UsdShadeTokens->rightHanded as the value.
"""
@staticmethod
def Apply(*args, **kwargs) -> None:
"""
**classmethod** Apply(prim) -> NodeDefAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"NodeDefAPI"to the token-valued,
listOp metadata *apiSchemas* on the prim.
A valid UsdShadeNodeDefAPI object is returned upon success. An invalid
(or empty) UsdShadeNodeDefAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
@staticmethod
def CanApply(*args, **kwargs) -> None:
"""
**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
@staticmethod
def CreateIdAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateIdAttr(defaultValue, writeSparsely) -> Attribute
See GetIdAttr() , and also Create vs Get Property Methods for when to
use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateImplementationSourceAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateImplementationSourceAttr(defaultValue, writeSparsely) -> Attribute
See GetImplementationSourceAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> NodeDefAPI
Return a UsdShadeNodeDefAPI holding the prim adhering to this schema
at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdShadeNodeDefAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetIdAttr() -> Attribute:
"""
GetIdAttr() -> Attribute
The id is an identifier for the type or purpose of the shader.
E.g.: Texture or FractalFloat. The use of this id will depend on the
render target: some will turn it into an actual shader path, some will
use it to generate shader source code dynamically.
Declaration
``uniform token info:id``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
"""
@staticmethod
def GetImplementationSource() -> str:
"""
GetImplementationSource() -> str
Reads the value of info:implementationSource attribute and returns a
token identifying the attribute that must be consulted to identify the
shader's source program.
This returns
- **id**, to indicate that the"info:id"attribute must be consulted.
- **sourceAsset** to indicate that the asset-
valued"info:{sourceType}:sourceAsset"attribute associated with the
desired **sourceType** should be consulted to locate the asset with
the shader's source.
- **sourceCode** to indicate that the string-
valued"info:{sourceType}:sourceCode"attribute associated with the
desired **sourceType** should be read to get shader's source.
This issues a warning and returns **id** if the
*info:implementationSource* attribute has an invalid value.
*{sourceType}* above is a place holder for a token that identifies the
type of shader source or its implementation. For example: osl, glslfx,
riCpp etc. This allows a shader to specify different sourceAsset (or
sourceCode) values for different sourceTypes. The sourceType tokens
usually correspond to the sourceType value of the NdrParserPlugin
that's used to parse the shader source (NdrParserPlugin::SourceType).
When sourceType is empty, the corresponding sourceAsset or sourceCode
is considered to be"universal"(or fallback), which is represented by
the empty-valued token UsdShadeTokens->universalSourceType. When the
sourceAsset (or sourceCode) corresponding to a specific, requested
sourceType is unavailable, the universal sourceAsset (or sourceCode)
is returned by GetSourceAsset (and GetSourceCode} API, if present.
"""
@staticmethod
def GetImplementationSourceAttr() -> Attribute:
"""
GetImplementationSourceAttr() -> Attribute
Specifies the attribute that should be consulted to get the shader's
implementation or its source code.
- If set to"id", the"info:id"attribute's value is used to determine
the shader source from the shader registry.
- If set to"sourceAsset", the resolved value of
the"info:sourceAsset"attribute corresponding to the desired
implementation (or source-type) is used to locate the shader source. A
source asset file may also specify multiple shader definitions, so
there is an optional attribute"info:sourceAsset:subIdentifier"whose
value should be used to indicate a particular shader definition from a
source asset file.
- If set to"sourceCode", the value of"info:sourceCode"attribute
corresponding to the desired implementation (or source type) is used
as the shader source.
Declaration
``uniform token info:implementationSource ="id"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
id, sourceAsset, sourceCode
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def GetShaderId(id) -> bool:
"""
GetShaderId(id) -> bool
Fetches the shader's ID value from the *info:id* attribute, if the
shader's *info:implementationSource* is **id**.
Returns **true** if the shader's implementation source is **id** and
the value was fetched properly into ``id`` . Returns false otherwise.
Parameters
----------
id : str
"""
@staticmethod
def GetShaderNodeForSourceType(sourceType) -> ShaderNode:
"""
GetShaderNodeForSourceType(sourceType) -> ShaderNode
This method attempts to ensure that there is a ShaderNode in the
shader registry (i.e.
SdrRegistry) representing this shader for the given ``sourceType`` .
It may return a null pointer if none could be found or created.
Parameters
----------
sourceType : str
"""
@staticmethod
def GetSourceAsset(sourceAsset, sourceType) -> bool:
"""
GetSourceAsset(sourceAsset, sourceType) -> bool
Fetches the shader's source asset value for the specified
``sourceType`` value from the **info: *sourceType*: sourceAsset**
attribute, if the shader's *info:implementationSource* is
**sourceAsset**.
If the *sourceAsset* attribute corresponding to the requested
*sourceType* isn't present on the shader, then the *universal*
*fallback* sourceAsset attribute, i.e. *info:sourceAsset* is
consulted, if present, to get the source asset path.
Returns **true** if the shader's implementation source is
**sourceAsset** and the source asset path value was fetched
successfully into ``sourceAsset`` . Returns false otherwise.
Parameters
----------
sourceAsset : AssetPath
sourceType : str
"""
@staticmethod
def GetSourceAssetSubIdentifier(subIdentifier, sourceType) -> bool:
"""
GetSourceAssetSubIdentifier(subIdentifier, sourceType) -> bool
Fetches the shader's sub-identifier for the source asset with the
specified ``sourceType`` value from the **info: *sourceType*:
sourceAsset:subIdentifier** attribute, if the shader's *info:
implementationSource* is **sourceAsset**.
If the *subIdentifier* attribute corresponding to the requested
*sourceType* isn't present on the shader, then the *universal*
*fallback* sub-identifier attribute, i.e. *info:sourceAsset:
subIdentifier* is consulted, if present, to get the sub-identifier
name.
Returns **true** if the shader's implementation source is
**sourceAsset** and the sub-identifier for the given source type was
fetched successfully into ``subIdentifier`` . Returns false otherwise.
Parameters
----------
subIdentifier : str
sourceType : str
"""
@staticmethod
def GetSourceCode(sourceCode, sourceType) -> bool:
"""
GetSourceCode(sourceCode, sourceType) -> bool
Fetches the shader's source code for the specified ``sourceType``
value by reading the **info: *sourceType*: sourceCode** attribute, if
the shader's *info:implementationSource* is **sourceCode**.
If the *sourceCode* attribute corresponding to the requested
*sourceType* isn't present on the shader, then the *universal* or
*fallback* sourceCode attribute (i.e. *info:sourceCode*) is consulted,
if present, to get the source code.
Returns **true** if the shader's implementation source is
**sourceCode** and the source code string was fetched successfully
into ``sourceCode`` . Returns false otherwise.
Parameters
----------
sourceCode : str
sourceType : str
"""
@staticmethod
def SetShaderId(id) -> bool:
"""
SetShaderId(id) -> bool
Sets the shader's ID value.
This also sets the *info:implementationSource* attribute on the shader
to **UsdShadeTokens->id**, if the existing value is different.
Parameters
----------
id : str
"""
@staticmethod
def SetSourceAsset(sourceAsset, sourceType) -> bool:
"""
SetSourceAsset(sourceAsset, sourceType) -> bool
Sets the shader's source-asset path value to ``sourceAsset`` for the
given source type, ``sourceType`` .
This also sets the *info:implementationSource* attribute on the shader
to **UsdShadeTokens->sourceAsset**.
Parameters
----------
sourceAsset : AssetPath
sourceType : str
"""
@staticmethod
def SetSourceAssetSubIdentifier(subIdentifier, sourceType) -> bool:
"""
SetSourceAssetSubIdentifier(subIdentifier, sourceType) -> bool
Set a sub-identifier to be used with a source asset of the given
source type.
This sets the **info: *sourceType*: sourceAsset:subIdentifier**.
This also sets the *info:implementationSource* attribute on the shader
to **UsdShadeTokens->sourceAsset**
Parameters
----------
subIdentifier : str
sourceType : str
"""
@staticmethod
def SetSourceCode(sourceCode, sourceType) -> bool:
"""
SetSourceCode(sourceCode, sourceType) -> bool
Sets the shader's source-code value to ``sourceCode`` for the given
source type, ``sourceType`` .
This also sets the *info:implementationSource* attribute on the shader
to **UsdShadeTokens->sourceCode**.
Parameters
----------
sourceCode : str
sourceType : str
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 48
pass
class NodeGraph(pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
A node-graph is a container for shading nodes, as well as other node-
graphs. It has a public input interface and provides a list of public
outputs.
**Node Graph Interfaces**
One of the most important functions of a node-graph is to host
the"interface"with which clients of already-built shading networks
will interact. Please see Interface Inputs for a detailed explanation
of what the interface provides, and how to construct and use it, to
effectively share/instance shader networks.
**Node Graph Outputs**
These behave like outputs on a shader and are typically connected to
an output on a shader inside the node-graph.
"""
@staticmethod
def ComputeInterfaceInputConsumersMap(computeTransitiveConsumers) -> InterfaceInputConsumersMap:
"""
ComputeInterfaceInputConsumersMap(computeTransitiveConsumers) -> InterfaceInputConsumersMap
Walks the namespace subtree below the node-graph and computes a map
containing the list of all inputs on the node-graph and the associated
vector of consumers of their values.
The consumers can be inputs on shaders within the node-graph or on
nested node-graphs).
If ``computeTransitiveConsumers`` is true, then value consumers
belonging to **node-graphs** are resolved transitively to compute the
transitive mapping from inputs on the node-graph to inputs on shaders
inside the material. Note that inputs on node-graphs that don't have
value consumers will continue to be included in the result.
This API is provided for use by DCC's that want to present node-graph
interface / shader connections in the opposite direction than they are
encoded in USD.
Parameters
----------
computeTransitiveConsumers : bool
"""
@staticmethod
def ComputeOutputSource(outputName, sourceName, sourceType) -> Shader:
"""
ComputeOutputSource(outputName, sourceName, sourceType) -> Shader
Deprecated
in favor of GetValueProducingAttributes on UsdShadeOutput Resolves the
connection source of the requested output, identified by
``outputName`` to a shader output.
``sourceName`` is an output parameter that is set to the name of the
resolved output, if the node-graph output is connected to a valid
shader source.
``sourceType`` is an output parameter that is set to the type of the
resolved output, if the node-graph output is connected to a valid
shader source.
Returns a valid shader object if the specified output exists and is
connected to one. Return an empty shader object otherwise. The python
version of this method returns a tuple containing three elements (the
source shader, sourceName, sourceType).
Parameters
----------
outputName : str
sourceName : str
sourceType : AttributeType
"""
@staticmethod
def ConnectableAPI() -> ConnectableAPI:
"""
ConnectableAPI() -> ConnectableAPI
Contructs and returns a UsdShadeConnectableAPI object with this node-
graph.
Note that most tasks can be accomplished without explicitly
constructing a UsdShadeConnectable API, since connection-related API
such as UsdShadeConnectableAPI::ConnectToSource() are static methods,
and UsdShadeNodeGraph will auto-convert to a UsdShadeConnectableAPI
when passed to functions that want to act generically on a connectable
UsdShadeConnectableAPI object.
"""
@staticmethod
def CreateInput(name, typeName) -> Input:
"""
CreateInput(name, typeName) -> Input
Create an Input which can either have a value or can be connected.
The attribute representing the input is created in
the"inputs:"namespace.
Parameters
----------
name : str
typeName : ValueTypeName
"""
@staticmethod
def CreateOutput(name, typeName) -> Output:
"""
CreateOutput(name, typeName) -> Output
Create an output which can either have a value or can be connected.
The attribute representing the output is created in
the"outputs:"namespace.
Parameters
----------
name : str
typeName : ValueTypeName
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> NodeGraph
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> NodeGraph
Return a UsdShadeNodeGraph holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdShadeNodeGraph(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetInput(name) -> Input:
"""
GetInput(name) -> Input
Return the requested input if it exists.
Parameters
----------
name : str
"""
@staticmethod
def GetInputs(onlyAuthored) -> list[Input]:
"""
GetInputs(onlyAuthored) -> list[Input]
Returns all inputs present on the node-graph.
These are represented by attributes in the"inputs:"namespace. If
``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
@staticmethod
def GetInterfaceInputs() -> list[Input]:
"""
GetInterfaceInputs() -> list[Input]
Returns all the"Interface Inputs"of the node-graph.
This is the same as GetInputs() , but is provided as a convenience, to
allow clients to distinguish between inputs on shaders vs. interface-
inputs on node-graphs.
"""
@staticmethod
def GetOutput(name) -> Output:
"""
GetOutput(name) -> Output
Return the requested output if it exists.
Parameters
----------
name : str
"""
@staticmethod
def GetOutputs(onlyAuthored) -> list[Output]:
"""
GetOutputs(onlyAuthored) -> list[Output]
Outputs are represented by attributes in the"outputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class Output(Boost.Python.instance):
"""
This class encapsulates a shader or node-graph output, which is a
connectable attribute representing a typed, externally computed value.
"""
@staticmethod
@typing.overload
def CanConnect(source) -> bool:
"""
CanConnect(source) -> bool
Determines whether this Output can be connected to the given source
attribute, which can be an input or an output.
An output is considered to be connectable only if it belongs to a
node-graph. Shader outputs are not connectable.
UsdShadeConnectableAPI::CanConnect
Parameters
----------
source : Attribute
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
sourceInput : Input
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
sourceOutput : Output
"""
@staticmethod
@typing.overload
def CanConnect(sourceInput) -> bool: ...
@staticmethod
@typing.overload
def CanConnect(sourceOutput) -> bool: ...
@staticmethod
def ClearSdrMetadata() -> None:
"""
ClearSdrMetadata() -> None
Clears any"sdrMetadata"value authored on the Output in the current
EditTarget.
"""
@staticmethod
def ClearSdrMetadataByKey(key) -> None:
"""
ClearSdrMetadataByKey(key) -> None
Clears the entry corresponding to the given ``key`` in
the"sdrMetadata"dictionary authored in the current EditTarget.
Parameters
----------
key : str
"""
@staticmethod
def ClearSource() -> bool:
"""
ClearSource() -> bool
Deprecated
"""
@staticmethod
def ClearSources() -> bool:
"""
ClearSources() -> bool
Clears sources for this Output in the current UsdEditTarget.
Most of the time, what you probably want is DisconnectSource() rather
than this function.
UsdShadeConnectableAPI::ClearSources
"""
@staticmethod
@typing.overload
def ConnectToSource(source, mod) -> bool:
"""
ConnectToSource(source, mod) -> bool
Authors a connection for this Output.
``source`` is a struct that describes the upstream source attribute
with all the information necessary to make a connection. See the
documentation for UsdShadeConnectionSourceInfo. ``mod`` describes the
operation that should be applied to the list of connections. By
default the new connection will replace any existing connections, but
it can add to the list of connections to represent multiple input
connections.
``true`` if a connection was created successfully. ``false`` if
``shadingAttr`` or ``source`` is invalid.
This method does not verify the connectability of the shading
attribute to the source. Clients must invoke CanConnect() themselves
to ensure compatibility.
The source shading attribute is created if it doesn't exist already.
UsdShadeConnectableAPI::ConnectToSource
Parameters
----------
source : ConnectionSourceInfo
mod : ConnectionModification
----------------------------------------------------------------------
Deprecated
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
source : ConnectableAPI
sourceName : str
sourceType : AttributeType
typeName : ValueTypeName
----------------------------------------------------------------------
Authors a connection for this Output to the source at the given path.
UsdShadeConnectableAPI::ConnectToSource
Parameters
----------
sourcePath : Path
----------------------------------------------------------------------
Connects this Output to the given input, ``sourceInput`` .
UsdShadeConnectableAPI::ConnectToSource
Parameters
----------
sourceInput : Input
----------------------------------------------------------------------
Connects this Output to the given output, ``sourceOutput`` .
UsdShadeConnectableAPI::ConnectToSource
Parameters
----------
sourceOutput : Output
"""
@staticmethod
@typing.overload
def ConnectToSource(source, sourceName, sourceType, typeName) -> bool: ...
@staticmethod
@typing.overload
def ConnectToSource(sourcePath) -> bool: ...
@staticmethod
@typing.overload
def ConnectToSource(sourceInput) -> bool: ...
@staticmethod
@typing.overload
def ConnectToSource(sourceOutput) -> bool: ...
@staticmethod
def DisconnectSource(sourceAttr) -> bool:
"""
DisconnectSource(sourceAttr) -> bool
Disconnect source for this Output.
If ``sourceAttr`` is valid, only a connection to the specified
attribute is disconnected, otherwise all connections are removed.
UsdShadeConnectableAPI::DisconnectSource
Parameters
----------
sourceAttr : Attribute
"""
@staticmethod
def GetAttr() -> Attribute:
"""
GetAttr() -> Attribute
Explicit UsdAttribute extractor.
"""
@staticmethod
def GetBaseName() -> str:
"""
GetBaseName() -> str
Returns the name of the output.
We call this the base name since it strips off the"outputs:"namespace
prefix from the attribute name, and returns it.
"""
@staticmethod
def GetConnectedSource(source, sourceName, sourceType) -> bool:
"""
GetConnectedSource(source, sourceName, sourceType) -> bool
Deprecated
Please use GetConnectedSources instead
Parameters
----------
source : ConnectableAPI
sourceName : str
sourceType : AttributeType
"""
@staticmethod
def GetConnectedSources(invalidSourcePaths) -> list[SourceInfo]:
"""
GetConnectedSources(invalidSourcePaths) -> list[SourceInfo]
Finds the valid sources of connections for the Output.
``invalidSourcePaths`` is an optional output parameter to collect the
invalid source paths that have not been reported in the returned
vector.
Returns a vector of ``UsdShadeConnectionSourceInfo`` structs with
information about each upsteam attribute. If the vector is empty,
there have been no valid connections.
A valid connection requires the existence of the source attribute and
also requires that the source prim is UsdShadeConnectableAPI
compatible.
The python wrapping returns a tuple with the valid connections first,
followed by the invalid source paths.
UsdShadeConnectableAPI::GetConnectedSources
Parameters
----------
invalidSourcePaths : list[SdfPath]
"""
@staticmethod
def GetFullName() -> str:
"""
GetFullName() -> str
Get the name of the attribute associated with the output.
"""
@staticmethod
def GetPrim() -> Prim:
"""
GetPrim() -> Prim
Get the prim that the output belongs to.
"""
@staticmethod
def GetRawConnectedSourcePaths(sourcePaths) -> bool:
"""
GetRawConnectedSourcePaths(sourcePaths) -> bool
Deprecated
Returns the"raw"(authored) connected source paths for this Output.
UsdShadeConnectableAPI::GetRawConnectedSourcePaths
Parameters
----------
sourcePaths : list[SdfPath]
"""
@staticmethod
def GetRenderType() -> str:
"""
GetRenderType() -> str
Return this output's specialized renderType, or an empty token if none
was authored.
"""
@staticmethod
def GetSdrMetadata() -> NdrTokenMap:
"""
GetSdrMetadata() -> NdrTokenMap
Returns this Output's composed"sdrMetadata"dictionary as a
NdrTokenMap.
"""
@staticmethod
def GetSdrMetadataByKey(key) -> str:
"""
GetSdrMetadataByKey(key) -> str
Returns the value corresponding to ``key`` in the composed
**sdrMetadata** dictionary.
Parameters
----------
key : str
"""
@staticmethod
def GetTypeName() -> ValueTypeName:
"""
GetTypeName() -> ValueTypeName
Get the"scene description"value type name of the attribute associated
with the output.
"""
@staticmethod
def GetValueProducingAttributes(shaderOutputsOnly) -> list[UsdShadeAttribute]:
"""
GetValueProducingAttributes(shaderOutputsOnly) -> list[UsdShadeAttribute]
Find what is connected to this Output recursively.
UsdShadeUtils::GetValueProducingAttributes
Parameters
----------
shaderOutputsOnly : bool
"""
@staticmethod
def HasConnectedSource() -> bool:
"""
HasConnectedSource() -> bool
Returns true if and only if this Output is currently connected to a
valid (defined) source.
UsdShadeConnectableAPI::HasConnectedSource
"""
@staticmethod
def HasRenderType() -> bool:
"""
HasRenderType() -> bool
Return true if a renderType has been specified for this output.
"""
@staticmethod
def HasSdrMetadata() -> bool:
"""
HasSdrMetadata() -> bool
Returns true if the Output has a non-empty
composed"sdrMetadata"dictionary value.
"""
@staticmethod
def HasSdrMetadataByKey(key) -> bool:
"""
HasSdrMetadataByKey(key) -> bool
Returns true if there is a value corresponding to the given ``key`` in
the composed"sdrMetadata"dictionary.
Parameters
----------
key : str
"""
@staticmethod
def IsOutput(*args, **kwargs) -> None:
"""
**classmethod** IsOutput(attr) -> bool
Test whether a given UsdAttribute represents a valid Output, which
implies that creating a UsdShadeOutput from the attribute will
succeed.
Success implies that ``attr.IsDefined()`` is true.
Parameters
----------
attr : Attribute
"""
@staticmethod
def IsSourceConnectionFromBaseMaterial() -> bool:
"""
IsSourceConnectionFromBaseMaterial() -> bool
Returns true if the connection to this Output's source, as returned by
GetConnectedSource() , is authored across a specializes arc, which is
used to denote a base material.
UsdShadeConnectableAPI::IsSourceConnectionFromBaseMaterial
"""
@staticmethod
def Set(value, time) -> bool:
"""
Set(value, time) -> bool
Set a value for the output.
It's unusual to be setting a value on an output since it represents an
externally computed value. The Set API is provided here just for the
sake of completeness and uniformity with other property schema.
Parameters
----------
value : VtValue
time : TimeCode
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Set the attribute value of the Output at ``time`` .
Parameters
----------
value : T
time : TimeCode
"""
@staticmethod
def SetConnectedSources(sourceInfos) -> bool:
"""
SetConnectedSources(sourceInfos) -> bool
Connects this Output to the given sources, ``sourceInfos`` .
UsdShadeConnectableAPI::SetConnectedSources
Parameters
----------
sourceInfos : list[ConnectionSourceInfo]
"""
@staticmethod
def SetRenderType(renderType) -> bool:
"""
SetRenderType(renderType) -> bool
Specify an alternative, renderer-specific type to use when
emitting/translating this output, rather than translating based on its
GetTypeName()
For example, we set the renderType to"struct"for outputs that are of
renderman custom struct types.
true on success
Parameters
----------
renderType : str
"""
@staticmethod
def SetSdrMetadata(sdrMetadata) -> None:
"""
SetSdrMetadata(sdrMetadata) -> None
Authors the given ``sdrMetadata`` value on this Output at the current
EditTarget.
Parameters
----------
sdrMetadata : NdrTokenMap
"""
@staticmethod
def SetSdrMetadataByKey(key, value) -> None:
"""
SetSdrMetadataByKey(key, value) -> None
Sets the value corresponding to ``key`` to the given string ``value``
, in the Output's"sdrMetadata"dictionary at the current EditTarget.
Parameters
----------
key : str
value : str
"""
__instance_size__ = 48
pass
class Shader(pxr.Usd.Typed, pxr.Usd.SchemaBase, Boost.Python.instance):
"""
Base class for all USD shaders. Shaders are the building blocks of
shading networks. While UsdShadeShader objects are not target
specific, each renderer or application target may derive its own
renderer-specific shader object types from this base, if needed.
Objects of this class generally represent a single shading object,
whether it exists in the target renderer or not. For example, a
texture, a fractal, or a mix node.
The UsdShadeNodeDefAPI provides attributes to uniquely identify the
type of this node. The id resolution into a renderable shader target
type of this node. The id resolution into a renderable shader target
is deferred to the consuming application.
The purpose of representing them in Usd is two-fold:
- To represent, via"connections"the topology of the shading network
that must be reconstructed in the renderer. Facilities for authoring
and manipulating connections are encapsulated in the API schema
UsdShadeConnectableAPI.
- To present a (partial or full) interface of typed input
parameters whose values can be set and overridden in Usd, to be
provided later at render-time as parameter values to the actual render
shader objects. Shader input parameters are encapsulated in the
property schema UsdShadeInput.
"""
@staticmethod
def ClearSdrMetadata() -> None:
"""
ClearSdrMetadata() -> None
Clears any"sdrMetadata"value authored on the shader in the current
EditTarget.
"""
@staticmethod
def ClearSdrMetadataByKey(key) -> None:
"""
ClearSdrMetadataByKey(key) -> None
Clears the entry corresponding to the given ``key`` in
the"sdrMetadata"dictionary authored in the current EditTarget.
Parameters
----------
key : str
"""
@staticmethod
def ConnectableAPI() -> ConnectableAPI:
"""
ConnectableAPI() -> ConnectableAPI
Contructs and returns a UsdShadeConnectableAPI object with this
shader.
Note that most tasks can be accomplished without explicitly
constructing a UsdShadeConnectable API, since connection-related API
such as UsdShadeConnectableAPI::ConnectToSource() are static methods,
and UsdShadeShader will auto-convert to a UsdShadeConnectableAPI when
passed to functions that want to act generically on a connectable
UsdShadeConnectableAPI object.
"""
@staticmethod
def CreateIdAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateIdAttr(defaultValue, writeSparsely) -> Attribute
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateImplementationSourceAttr(defaultValue, writeSparsely) -> Attribute:
"""
CreateImplementationSourceAttr(defaultValue, writeSparsely) -> Attribute
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
@staticmethod
def CreateInput(name, typeName) -> Input:
"""
CreateInput(name, typeName) -> Input
Create an input which can either have a value or can be connected.
The attribute representing the input is created in
the"inputs:"namespace. Inputs on both shaders and node-graphs are
connectable.
Parameters
----------
name : str
typeName : ValueTypeName
"""
@staticmethod
def CreateOutput(name, typeName) -> Output:
"""
CreateOutput(name, typeName) -> Output
Create an output which can either have a value or can be connected.
The attribute representing the output is created in
the"outputs:"namespace. Outputs on a shader cannot be connected, as
their value is assumed to be computed externally.
Parameters
----------
name : str
typeName : ValueTypeName
"""
@staticmethod
def Define(*args, **kwargs) -> None:
"""
**classmethod** Define(stage, path) -> Shader
Attempt to ensure a *UsdPrim* adhering to this schema at ``path`` is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at ``path`` is already defined on
this stage, return that prim. Otherwise author an *SdfPrimSpec* with
*specifier* == *SdfSpecifierDef* and this schema's prim type name for
the prim at ``path`` at the current EditTarget. Author *SdfPrimSpec* s
with ``specifier`` == *SdfSpecifierDef* and empty typeName at the
current EditTarget for any nonexistent, or existing but not *Defined*
ancestors.
The given *path* must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case *path* cannot map to the current UsdEditTarget 's
namespace) issue an error and return an invalid *UsdPrim*.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get(stage, path) -> Shader
Return a UsdShadeShader holding the prim adhering to this schema at
``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdShadeShader(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
@staticmethod
def GetIdAttr() -> Attribute:
"""
GetIdAttr() -> Attribute
Forwards to UsdShadeNodeDefAPI(prim).
"""
@staticmethod
def GetImplementationSource() -> str:
"""
GetImplementationSource() -> str
Forwards to UsdShadeNodeDefAPI(prim).
"""
@staticmethod
def GetImplementationSourceAttr() -> Attribute:
"""
GetImplementationSourceAttr() -> Attribute
Forwards to UsdShadeNodeDefAPI(prim).
"""
@staticmethod
def GetInput(name) -> Input:
"""
GetInput(name) -> Input
Return the requested input if it exists.
Parameters
----------
name : str
"""
@staticmethod
def GetInputs(onlyAuthored) -> list[Input]:
"""
GetInputs(onlyAuthored) -> list[Input]
Inputs are represented by attributes in the"inputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
@staticmethod
def GetOutput(name) -> Output:
"""
GetOutput(name) -> Output
Return the requested output if it exists.
Parameters
----------
name : str
"""
@staticmethod
def GetOutputs(onlyAuthored) -> list[Output]:
"""
GetOutputs(onlyAuthored) -> list[Output]
Outputs are represented by attributes in the"outputs:"namespace.
If ``onlyAuthored`` is true (the default), then only return authored
attributes; otherwise, this also returns un-authored builtins.
Parameters
----------
onlyAuthored : bool
"""
@staticmethod
def GetSchemaAttributeNames(*args, **kwargs) -> None:
"""
**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
@staticmethod
def GetSdrMetadata() -> NdrTokenMap:
"""
GetSdrMetadata() -> NdrTokenMap
Returns this shader's composed"sdrMetadata"dictionary as a
NdrTokenMap.
"""
@staticmethod
def GetSdrMetadataByKey(key) -> str:
"""
GetSdrMetadataByKey(key) -> str
Returns the value corresponding to ``key`` in the composed
**sdrMetadata** dictionary.
Parameters
----------
key : str
"""
@staticmethod
def GetShaderId(id) -> bool:
"""
GetShaderId(id) -> bool
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
id : str
"""
@staticmethod
def GetShaderNodeForSourceType(sourceType) -> ShaderNode:
"""
GetShaderNodeForSourceType(sourceType) -> ShaderNode
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
sourceType : str
"""
@staticmethod
def GetSourceAsset(sourceAsset, sourceType) -> bool:
"""
GetSourceAsset(sourceAsset, sourceType) -> bool
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
sourceAsset : AssetPath
sourceType : str
"""
@staticmethod
def GetSourceAssetSubIdentifier(subIdentifier, sourceType) -> bool:
"""
GetSourceAssetSubIdentifier(subIdentifier, sourceType) -> bool
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
subIdentifier : str
sourceType : str
"""
@staticmethod
def GetSourceCode(sourceCode, sourceType) -> bool:
"""
GetSourceCode(sourceCode, sourceType) -> bool
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
sourceCode : str
sourceType : str
"""
@staticmethod
def HasSdrMetadata() -> bool:
"""
HasSdrMetadata() -> bool
Returns true if the shader has a non-empty
composed"sdrMetadata"dictionary value.
"""
@staticmethod
def HasSdrMetadataByKey(key) -> bool:
"""
HasSdrMetadataByKey(key) -> bool
Returns true if there is a value corresponding to the given ``key`` in
the composed"sdrMetadata"dictionary.
Parameters
----------
key : str
"""
@staticmethod
def SetSdrMetadata(sdrMetadata) -> None:
"""
SetSdrMetadata(sdrMetadata) -> None
Authors the given ``sdrMetadata`` on this shader at the current
EditTarget.
Parameters
----------
sdrMetadata : NdrTokenMap
"""
@staticmethod
def SetSdrMetadataByKey(key, value) -> None:
"""
SetSdrMetadataByKey(key, value) -> None
Sets the value corresponding to ``key`` to the given string ``value``
, in the shader's"sdrMetadata"dictionary at the current EditTarget.
Parameters
----------
key : str
value : str
"""
@staticmethod
def SetShaderId(id) -> bool:
"""
SetShaderId(id) -> bool
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
id : str
"""
@staticmethod
def SetSourceAsset(sourceAsset, sourceType) -> bool:
"""
SetSourceAsset(sourceAsset, sourceType) -> bool
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
sourceAsset : AssetPath
sourceType : str
"""
@staticmethod
def SetSourceAssetSubIdentifier(subIdentifier, sourceType) -> bool:
"""
SetSourceAssetSubIdentifier(subIdentifier, sourceType) -> bool
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
subIdentifier : str
sourceType : str
"""
@staticmethod
def SetSourceCode(sourceCode, sourceType) -> bool:
"""
SetSourceCode(sourceCode, sourceType) -> bool
Forwards to UsdShadeNodeDefAPI(prim).
Parameters
----------
sourceCode : str
sourceType : str
"""
@staticmethod
def _GetStaticTfType(*args, **kwargs) -> None:
"""
**classmethod** _GetStaticTfType() -> Type
"""
__instance_size__ = 40
pass
class ShaderDefParserPlugin(Boost.Python.instance):
"""
Parses shader definitions represented using USD scene description
using the schemas provided by UsdShade.
"""
@staticmethod
def GetDiscoveryTypes() -> NdrTokenVec:
"""
GetDiscoveryTypes() -> NdrTokenVec
Returns the types of nodes that this plugin can parse.
"Type"here is the discovery type (in the case of files, this will
probably be the file extension, but in other systems will be data that
can be determined during discovery). This type should only be used to
match up a ``NdrNodeDiscoveryResult`` to its parser plugin; this value
is not exposed in the node's API.
"""
@staticmethod
def GetSourceType() -> str:
"""
GetSourceType() -> str
Returns the source type that this parser operates on.
A source type is the most general type for a node. The parser plugin
is responsible for parsing all discovery results that have the types
declared under ``GetDiscoveryTypes()`` , and those types are
collectively identified as one"source type".
"""
@staticmethod
def Parse(discoveryResult) -> NdrNodeUnique:
"""
Parse(discoveryResult) -> NdrNodeUnique
Takes the specified ``NdrNodeDiscoveryResult`` instance, which was a
result of the discovery process, and generates a new ``NdrNode`` .
The node's name, source type, and family must match.
Parameters
----------
discoveryResult : NodeDiscoveryResult
"""
__instance_size__ = 32
pass
class ShaderDefUtils(Boost.Python.instance):
"""
This class contains a set of utility functions used for populating the
shader registry with shaders definitions specified using UsdShade
schemas.
"""
@staticmethod
def GetNodeDiscoveryResults(*args, **kwargs) -> None:
"""
**classmethod** GetNodeDiscoveryResults(shaderDef, sourceUri) -> NdrNodeDiscoveryResultVec
Returns the list of NdrNodeDiscoveryResult objects that must be added
to the shader registry for the given shader ``shaderDef`` , assuming
it is found in a shader definition file found by an Ndr discovery
plugin.
To enable the shaderDef parser to find and parse this shader,
``sourceUri`` should have the resolved path to the usd file containing
this shader prim.
Parameters
----------
shaderDef : Shader
sourceUri : str
"""
@staticmethod
def GetPrimvarNamesMetadataString(*args, **kwargs) -> None:
"""
**classmethod** GetPrimvarNamesMetadataString(metadata, shaderDef) -> str
Collects all the names of valid primvar inputs of the given
``metadata`` and the given ``shaderDef`` and returns the string used
to represent them in SdrShaderNode metadata.
Parameters
----------
metadata : NdrTokenMap
shaderDef : ConnectableAPI
"""
@staticmethod
def GetShaderProperties(*args, **kwargs) -> None:
"""
**classmethod** GetShaderProperties(shaderDef) -> NdrPropertyUniquePtrVec
Gets all input and output properties of the given ``shaderDef`` and
translates them into NdrProperties that can be used as the properties
for an SdrShaderNode.
Parameters
----------
shaderDef : ConnectableAPI
"""
pass
class Tokens(Boost.Python.instance):
allPurpose = ''
bindMaterialAs = 'bindMaterialAs'
coordSys = 'coordSys:'
displacement = 'displacement'
fallbackStrength = 'fallbackStrength'
full = 'full'
id = 'id'
infoId = 'info:id'
infoImplementationSource = 'info:implementationSource'
inputs = 'inputs:'
interfaceOnly = 'interfaceOnly'
materialBind = 'materialBind'
materialBinding = 'material:binding'
materialBindingCollection = 'material:binding:collection'
materialVariant = 'materialVariant'
outputs = 'outputs:'
outputsDisplacement = 'outputs:displacement'
outputsSurface = 'outputs:surface'
outputsVolume = 'outputs:volume'
preview = 'preview'
sdrMetadata = 'sdrMetadata'
sourceAsset = 'sourceAsset'
sourceCode = 'sourceCode'
strongerThanDescendants = 'strongerThanDescendants'
subIdentifier = 'subIdentifier'
surface = 'surface'
universalRenderContext = ''
universalSourceType = ''
volume = 'volume'
weakerThanDescendants = 'weakerThanDescendants'
pass
class Utils(Boost.Python.instance):
"""
This class contains a set of utility functions used when authoring and
querying shading networks.
"""
@staticmethod
def GetBaseNameAndType(*args, **kwargs) -> None:
"""
**classmethod** GetBaseNameAndType(fullName) -> tuple[str, AttributeType]
Given the full name of a shading attribute, returns it's base name and
shading attribute type.
Parameters
----------
fullName : str
"""
@staticmethod
def GetConnectedSourcePath(*args, **kwargs) -> None:
"""
**classmethod** GetConnectedSourcePath(srcInfo) -> Path
For a valid UsdShadeConnectionSourceInfo, return the complete path to
the source property; otherwise the empty path.
Parameters
----------
srcInfo : ConnectionSourceInfo
"""
@staticmethod
def GetFullName(*args, **kwargs) -> None:
"""
**classmethod** GetFullName(baseName, type) -> str
Returns the full shading attribute name given the basename and the
shading attribute type.
``baseName`` is the name of the input or output on the shading node.
``type`` is the UsdShadeAttributeType of the shading attribute.
Parameters
----------
baseName : str
type : AttributeType
"""
@staticmethod
def GetPrefixForAttributeType(*args, **kwargs) -> None:
"""
**classmethod** GetPrefixForAttributeType(sourceType) -> str
Returns the namespace prefix of the USD attribute associated with the
given shading attribute type.
Parameters
----------
sourceType : AttributeType
"""
@staticmethod
def GetType(*args, **kwargs) -> None:
"""
**classmethod** GetType(fullName) -> AttributeType
Given the full name of a shading attribute, returns its shading
attribute type.
Parameters
----------
fullName : str
"""
@staticmethod
def GetValueProducingAttributes(output, shaderOutputsOnly) -> list[UsdShadeAttribute]:
"""
**classmethod** GetValueProducingAttributes(input, shaderOutputsOnly) -> list[UsdShadeAttribute]
Find what is connected to an Input or Output recursively.
GetValueProducingAttributes implements the UsdShade connectivity rules
described in Connection Resolution Utilities.
When tracing connections within networks that contain containers like
UsdShadeNodeGraph nodes, the actual output(s) or value(s) at the end
of an input or output might be multiple connections removed. The
methods below resolves this across multiple physical connections.
An UsdShadeInput is getting its value from one of these sources:
- If the input is not connected the UsdAttribute for this input is
returned, but only if it has an authored value. The input attribute
itself carries the value for this input.
- If the input is connected we follow the connection(s) until we
reach a valid output of a UsdShadeShader node or if we reach a valid
UsdShadeInput attribute of a UsdShadeNodeGraph or UsdShadeMaterial
that has an authored value.
An UsdShadeOutput on a container can get its value from the same type
of sources as a UsdShadeInput on either a UsdShadeShader or
UsdShadeNodeGraph. Outputs on non-containers (UsdShadeShaders) cannot
be connected.
This function returns a vector of UsdAttributes. The vector is empty
if no valid attribute was found. The type of each attribute can be
determined with the ``UsdShadeUtils::GetType`` function.
If ``shaderOutputsOnly`` is true, it will only report attributes that
are outputs of non-containers (UsdShadeShaders). This is a bit faster
and what is need when determining the connections for Material
terminals.
This will return the last attribute along the connection chain that
has an authored value, which might not be the last attribute in the
chain itself.
When the network contains multi-connections, this function can return
multiple attributes for a single input or output. The list of
attributes is build by a depth-first search, following the underlying
connection paths in order. The list can contain both UsdShadeOutput
and UsdShadeInput attributes. It is up to the caller to decide how to
process such a mixture.
Parameters
----------
input : Input
shaderOutputsOnly : bool
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
output : Output
shaderOutputsOnly : bool
"""
pass
class _CanApplyResult(Boost.Python.instance):
@property
def whyNot(self) -> None:
"""
:type: None
"""
__instance_size__ = 56
pass
__MFB_FULL_PACKAGE_NAME = 'usdShade'
| 172,234 | unknown | 27.454485 | 178 | 0.617027 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdUtils/complianceChecker.py | #
# Copyright 2018 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
from __future__ import print_function
from pxr import Ar
from pxr.UsdUtils.constantsGroup import ConstantsGroup
class NodeTypes(ConstantsGroup):
UsdPreviewSurface = "UsdPreviewSurface"
UsdUVTexture = "UsdUVTexture"
UsdTransform2d = "UsdTransform2d"
UsdPrimvarReader = "UsdPrimvarReader"
class ShaderProps(ConstantsGroup):
Bias = "bias"
Scale = "scale"
SourceColorSpace = "sourceColorSpace"
Normal = "normal"
File = "file"
def _IsPackageOrPackagedLayer(layer):
return layer.GetFileFormat().IsPackage() or \
Ar.IsPackageRelativePath(layer.identifier)
class BaseRuleChecker(object):
"""This is Base class for all the rule-checkers."""
def __init__(self, verbose, consumerLevelChecks, assetLevelChecks):
self._verbose = verbose
self._consumerLevelChecks = consumerLevelChecks
self._assetLevelChecks = assetLevelChecks
self._failedChecks = []
self._errors = []
self._warnings = []
def _AddFailedCheck(self, msg):
self._failedChecks.append(msg)
def _AddError(self, msg):
self._errors.append(msg)
def _AddWarning(self, msg):
self._warnings.append(msg)
def _Msg(self, msg):
if self._verbose:
print(msg)
def GetFailedChecks(self):
return self._failedChecks
def GetErrors(self):
return self._errors
def GetWarnings(self):
return self._warnings
# -------------------------------------------------------------------------
# Virtual methods that any derived rule-checker may want to override.
# Default implementations do nothing.
#
# A rule-checker may choose to override one or more of the virtual methods.
# The callbacks are invoked in the order they are defined here (i.e.
# CheckStage is invoked first, followed by CheckDiagnostics, followed by
# CheckUnresolvedPaths and so on until CheckPrim). Some of the callbacks may
# be invoked multiple times per-rule with different parameters, for example,
# CheckLayer, CheckPrim and CheckZipFile.
def CheckStage(self, usdStage):
""" Check the given usdStage. """
pass
def CheckDiagnostics(self, diagnostics):
""" Check the diagnostic messages that were generated when opening the
USD stage. The diagnostic messages are collected using a
UsdUtilsCoalescingDiagnosticDelegate.
"""
pass
def CheckUnresolvedPaths(self, unresolvedPaths):
""" Check or process any unresolved asset paths that were found when
analysing the dependencies.
"""
pass
def CheckDependencies(self, usdStage, layerDeps, assetDeps):
""" Check usdStage's layer and asset dependencies that were gathered
using UsdUtils.ComputeAllDependencies().
"""
pass
def CheckLayer(self, layer):
""" Check the given SdfLayer. """
pass
def CheckZipFile(self, zipFile, packagePath):
""" Check the zipFile object created by opening the package at path
packagePath.
"""
pass
def CheckPrim(self, prim):
""" Check the given prim, which may only exist is a specific combination
of variant selections on the UsdStage.
"""
pass
def ResetCaches(self):
""" Reset any caches the rule owns. Called whenever stage authoring
occurs, such as when we iterate through VariantSet combinations.
"""
pass
# -------------------------------------------------------------------------
class ByteAlignmentChecker(BaseRuleChecker):
@staticmethod
def GetDescription():
return "Files within a usdz package must be laid out properly, "\
"i.e. they should be aligned to 64 bytes."
def __init__(self, verbose, consumerLevelChecks, assetLevelChecks):
super(ByteAlignmentChecker, self).__init__(verbose,
consumerLevelChecks,
assetLevelChecks)
def CheckZipFile(self, zipFile, packagePath):
fileNames = zipFile.GetFileNames()
for fileName in fileNames:
fileExt = Ar.GetResolver().GetExtension(fileName)
fileInfo = zipFile.GetFileInfo(fileName)
offset = fileInfo.dataOffset
if offset % 64 != 0:
self._AddFailedCheck("File '%s' in package '%s' has an "
"invalid offset %s." %
(fileName, packagePath, offset))
class CompressionChecker(BaseRuleChecker):
@staticmethod
def GetDescription():
return "Files within a usdz package should not be compressed or "\
"encrypted."
def __init__(self, verbose, consumerLevelChecks, assetLevelChecks):
super(CompressionChecker, self).__init__(verbose,
consumerLevelChecks,
assetLevelChecks)
def CheckZipFile(self, zipFile, packagePath):
fileNames = zipFile.GetFileNames()
for fileName in fileNames:
fileExt = Ar.GetResolver().GetExtension(fileName)
fileInfo = zipFile.GetFileInfo(fileName)
if fileInfo.compressionMethod != 0:
self._AddFailedCheck("File '%s' in package '%s' has "
"compression. Compression method is '%s', actual size "
"is %s. Uncompressed size is %s." % (
fileName, packagePath, fileInfo.compressionMethod,
fileInfo.size, fileInfo.uncompressedSize))
class MissingReferenceChecker(BaseRuleChecker):
@staticmethod
def GetDescription():
return "The composed USD stage should not contain any unresolvable"\
" asset dependencies (in every possible variation of the "\
"asset), when using the default asset resolver. "
def __init__(self, verbose, consumerLevelChecks, assetLevelChecks):
super(MissingReferenceChecker, self).__init__(verbose,
consumerLevelChecks,
assetLevelChecks)
def CheckDiagnostics(self, diagnostics):
for diag in diagnostics:
# "_ReportErrors" is the name of the function that issues
# warnings about unresolved references, sublayers and other
# composition arcs.
if '_ReportErrors' in diag.sourceFunction and \
'usd/stage.cpp' in diag.sourceFileName:
self._AddFailedCheck(diag.commentary)
def CheckUnresolvedPaths(self, unresolvedPaths):
for unresolvedPath in unresolvedPaths:
self._AddFailedCheck("Found unresolvable external dependency "
"'%s'." % unresolvedPath)
class StageMetadataChecker(BaseRuleChecker):
@staticmethod
def GetDescription():
return """All stages should declare their 'upAxis' and 'metersPerUnit'.
Stages that can be consumed as referencable assets should furthermore have
a valid 'defaultPrim' declared, and stages meant for consumer-level packaging
should always have upAxis set to 'Y'"""
def __init__(self, verbose, consumerLevelChecks, assetLevelChecks):
super(StageMetadataChecker, self).__init__(verbose,
consumerLevelChecks,
assetLevelChecks)
def CheckStage(self, usdStage):
from pxr import UsdGeom
if not usdStage.HasAuthoredMetadata(UsdGeom.Tokens.upAxis):
self._AddFailedCheck("Stage does not specify an upAxis.")
elif self._consumerLevelChecks:
upAxis = UsdGeom.GetStageUpAxis(usdStage)
if upAxis != UsdGeom.Tokens.y:
self._AddFailedCheck("Stage specifies upAxis '%s'. upAxis should"
" be '%s'." % (upAxis, UsdGeom.Tokens.y))
if not usdStage.HasAuthoredMetadata(UsdGeom.Tokens.metersPerUnit):
self._AddFailedCheck("Stage does not specify its linear scale "
"in metersPerUnit.")
if self._assetLevelChecks:
defaultPrim = usdStage.GetDefaultPrim()
if not defaultPrim:
self._AddFailedCheck("Stage has missing or invalid defaultPrim.")
class TextureChecker(BaseRuleChecker):
# The most basic formats are those published in the USDZ spec
_basicUSDZImageFormats = ("jpg", "png")
# In non-consumer-content (arkit) mode, OIIO can allow us to
# additionaly read other formats from USDZ packages
_extraUSDZ_OIIOImageFormats = (".exr")
# Include a list of "unsupported" image formats to provide better error
# messages when we find one of these. Our builtin image decoder
# _can_ decode these, but they are not considered portable consumer-level
_unsupportedImageFormats = ["bmp", "tga", "hdr", "exr", "tif", "zfile",
"tx"]
@staticmethod
def GetDescription():
return """Texture files should be readable by intended client
(only .jpg or .png for consumer-level USDZ)."""
def __init__(self, verbose, consumerLevelChecks, assetLevelChecks):
# Check if the prim has an allowed type.
super(TextureChecker, self).__init__(verbose, consumerLevelChecks,
assetLevelChecks)
# a None value for _allowedFormats indicates all formats are allowed
self._allowedFormats = None
def CheckStage(self, usdStage):
# This is the point at which we can determine whether we have a USDZ
# archive, and so have enough information to set the allowed formats.
rootLayer = usdStage.GetRootLayer()
if rootLayer.GetFileFormat().IsPackage() or self._consumerLevelChecks:
self._allowedFormats = list(TextureChecker._basicUSDZImageFormats)
if not self._consumerLevelChecks:
self._allowedFormats.append(TextureChecker._extraUSDZ_OIIOImageFormats)
else:
self._Msg("Not performing texture format checks for general "
"USD asset")
def _CheckTexture(self, texAssetPath, inputPath):
self._Msg("Checking texture <%s>." % texAssetPath)
texFileExt = Ar.GetResolver().GetExtension(texAssetPath).lower()
if (self._consumerLevelChecks and
texFileExt in TextureChecker._unsupportedImageFormats):
self._AddFailedCheck("Texture <%s> with asset @%s@ has non-portable "
"file format." % (inputPath, texAssetPath))
elif texFileExt not in self._allowedFormats:
self._AddFailedCheck("Texture <%s> with asset @%s@ has unknown "
"file format." % (inputPath, texAssetPath))
def CheckPrim(self, prim):
# Right now, we find texture referenced by looking at the asset-valued
# inputs on Connectable prims.
from pxr import Sdf, Usd, UsdShade
# Nothing to do if we are allowing all formats, or if
# we are an untyped prim
if self._allowedFormats is None or not prim.GetTypeName():
return
# Check if the prim is Connectable.
connectable = UsdShade.ConnectableAPI(prim)
if not connectable:
return
shaderInputs = connectable.GetInputs()
for ip in shaderInputs:
attrPath = ip.GetAttr().GetPath()
if ip.GetTypeName() == Sdf.ValueTypeNames.Asset:
texFilePath = ip.Get(Usd.TimeCode.EarliestTime())
# ip may be unauthored and/or connected
if texFilePath:
self._CheckTexture(texFilePath.path, attrPath)
elif ip.GetTypeName() == Sdf.ValueTypeNames.AssetArray:
texPathArray = ip.Get(Usd.TimeCode.EarliestTime())
if texPathArray:
for texPath in texPathArray:
self._CheckTexture(texPath, attrPath)
class PrimEncapsulationChecker(BaseRuleChecker):
@staticmethod
def GetDescription():
return """Check for basic prim encapsulation rules:
- Boundables may not be nested under Gprims
- Connectable prims (e.g. Shader, Material, etc) can only be nested
inside other Container-like Connectable prims. Container-like prims
include Material, NodeGraph, Light, LightFilter, and *exclude Shader*"""
def __init__(self, verbose, consumerLevelChecks, assetLevelChecks):
super(PrimEncapsulationChecker, self).__init__(verbose,
consumerLevelChecks,
assetLevelChecks)
self.ResetCaches()
def _HasGprimAncestor(self, prim):
from pxr import Sdf, UsdGeom
path = prim.GetPath()
if path in self._hasGprimInPathMap:
return self._hasGprimInPathMap[path]
elif path == Sdf.Path.absoluteRootPath:
self._hasGprimInPathMap[path] = False
return False
else:
val = (self._HasGprimAncestor(prim.GetParent()) or
prim.IsA(UsdGeom.Gprim))
self._hasGprimInPathMap[path] = val
return val
def _FindConnectableAncestor(self, prim):
from pxr import Sdf, UsdShade
path = prim.GetPath()
if path in self._connectableAncestorMap:
return self._connectableAncestorMap[path]
elif path == Sdf.Path.absoluteRootPath:
self._connectableAncestorMap[path] = None
return None
else:
val = self._FindConnectableAncestor(prim.GetParent())
# The GetTypeName() check is to work around a bug in
# ConnectableAPIBehavior registry.
if prim.GetTypeName() and not val:
conn = UsdShade.ConnectableAPI(prim)
if conn:
val = prim
self._connectableAncestorMap[path] = val
return val
def CheckPrim(self, prim):
from pxr import UsdGeom, UsdShade
parent = prim.GetParent()
# Of course we must allow Boundables under other Boundables, so that
# schemas like UsdGeom.Pointinstancer can nest their prototypes. But
# we disallow a PointInstancer under a Mesh just as we disallow a Mesh
# under a Mesh, for the same reason: we cannot then independently
# adjust visibility for the two objects, nor can we reasonably compute
# the parent Mesh's extent.
if prim.IsA(UsdGeom.Boundable):
if parent:
if self._HasGprimAncestor(parent):
self._AddFailedCheck("Gprim <%s> has an ancestor prim that "
"is also a Gprim, which is not allowed."
% prim.GetPath())
connectable = UsdShade.ConnectableAPI(prim)
# The GetTypeName() check is to work around a bug in
# ConnectableAPIBehavior registry.
if prim.GetTypeName() and connectable:
if parent:
pConnectable = UsdShade.ConnectableAPI(parent)
if not parent.GetTypeName():
pConnectable = None
if pConnectable and not pConnectable.IsContainer():
# XXX This should be a failure as it is a violation of the
# UsdShade OM. But pragmatically, there are many
# authoring tools currently producing this structure, which
# does not _currently_ perturb Hydra, so we need to start
# with a warning
self._AddWarning("Connectable %s <%s> cannot reside "
"under a non-Container Connectable %s"
% (prim.GetTypeName(),
prim.GetPath(),
parent.GetTypeName()))
elif not pConnectable:
# it's only OK to have a non-connectable parent if all
# the rest of your ancestors are also non-connectable. The
# error message we give is targeted at the most common
# infraction, using Scope or other grouping prims inside
# a Container like a Material
connAnstr = self._FindConnectableAncestor(parent)
if connAnstr is not None:
self._AddFailedCheck("Connectable %s <%s> can only have"
" Connectable Container ancestors"
" up to %s ancestor <%s>, but its"
" parent %s is a %s." %
(prim.GetTypeName(),
prim.GetPath(),
connAnstr.GetTypeName(),
connAnstr.GetPath(),
parent.GetName(),
parent.GetTypeName()))
def ResetCaches(self):
self._connectableAncestorMap = dict()
self._hasGprimInPathMap = dict()
class NormalMapTextureChecker(BaseRuleChecker):
@staticmethod
def GetDescription():
return """UsdUVTexture nodes that feed the _inputs:normals_ of a
UsdPreviewSurface must ensure that the data is encoded and scaled properly.
Specifically:
- Since normals are expected to be in the range [(-1,-1,-1), (1,1,1)],
the Texture node must transform 8-bit textures from their [0..1] range by
setting its _inputs:scale_ to [2, 2, 2, 1] and
_inputs:bias_ to [-1, -1, -1, 0]
- Normal map data is commonly expected to be linearly encoded. However, many
image-writing tools automatically set the profile of three-channel, 8-bit
images to SRGB. To prevent an unwanted transformation, the UsdUVTexture's
_inputs:sourceColorSpace_ must be set to "raw". This program cannot
currently read the texture metadata itself, so for now we emit warnings
about this potential infraction for all 8 bit image formats.
"""
def __init__(self, verbose, consumerLevelChecks, assetLevelChecks):
super(NormalMapTextureChecker, self).__init__(verbose,
consumerLevelChecks,
assetLevelChecks)
def _GetShaderId(self, shader):
# We might someday try harder to find an identifier...
return shader.GetShaderId()
def _TextureIs8Bit(self, asset):
# Eventually we hope to leverage HioImage through a plugin system,
# when Imaging is present, to answer this and other image queries
# more definitively
from pxr import Ar
ext = Ar.GetResolver().GetExtension(asset.resolvedPath)
# not an exhaustive list, but ones we typically can read
return ext in ["bmp", "tga", "jpg", "png", "tif"]
def _GetInputValue(self, shader, inputName):
from pxr import Usd
input = shader.GetInput(inputName)
if not input:
return None
return input.Get(Usd.TimeCode.EarliestTime())
def CheckPrim(self, prim):
from pxr import UsdShade, Gf
from pxr.UsdShade import Utils as ShadeUtils
if not prim.IsA(UsdShade.Shader):
return
shader = UsdShade.Shader(prim)
if not shader:
self._AddError("Invalid shader prim <%s>." % prim.GetPath())
return
shaderId = self._GetShaderId(shader)
# We may have failed to fetch an identifier for asset/source-based
# nodes. We are only interested in UsdPreviewSurface nodes identified via
# info:id, so it's not an error
if not shaderId or shaderId != NodeTypes.UsdPreviewSurface:
return
normalInput = shader.GetInput(ShaderProps.Normal)
if not normalInput:
return
valueProducingAttrs = ShadeUtils.GetValueProducingAttributes(normalInput)
if not valueProducingAttrs or valueProducingAttrs[0].GetPrim() == prim:
return
sourcePrim = valueProducingAttrs[0].GetPrim()
sourceShader = UsdShade.Shader(sourcePrim)
if not sourceShader:
# In theory, could be connected to an interface attribute of a
# parent connectable... not useful, but not an error
if UsdShade.ConnectableAPI(sourcePrim):
return
self._AddFailedCheck("%s.%s on prim <%s> is connected to a"
" non-Shader prim." % \
(NodeTypes.UsdPreviewSurface,
ShaderProps.Normal))
return
sourceId = self._GetShaderId(sourceShader)
# We may have failed to fetch an identifier for asset/source-based
# nodes. OR, we could potentially be driven by a UsdPrimvarReader,
# in which case we'd have nothing to validate
if not sourceId or sourceId != NodeTypes.UsdUVTexture:
return
texAsset = self._GetInputValue(sourceShader, ShaderProps.File)
if not texAsset or not texAsset.resolvedPath:
self._AddFailedCheck("%s prim <%s> has invalid or unresolvable "
"inputs:file of @%s@" % \
(NodeTypes.UsdUVTexture,
sourcePrim.GetPath(),
texAsset.path if texAsset else ""))
return
if not self._TextureIs8Bit(texAsset):
# really nothing more is required for image depths > 8 bits,
# which we assume FOR NOW, are floating point
return
if not self._GetInputValue(sourceShader, ShaderProps.SourceColorSpace):
self._AddWarning("%s prim <%s> that reads Normal Map @%s@ may need "
"to set inputs:sourceColorSpace to 'raw' as some "
"8-bit image writers always indicate an SRGB "
"encoding." % \
(NodeTypes.UsdUVTexture,
sourcePrim.GetPath(),
texAsset.path))
bias = self._GetInputValue(sourceShader, ShaderProps.Bias)
scale = self._GetInputValue(sourceShader, ShaderProps.Scale)
if not (bias and scale and
isinstance(bias, Gf.Vec4f) and isinstance(scale, Gf.Vec4f)):
# XXX This should be a failure, as it results in broken normal
# maps in Storm and hdPrman, at least. But for the same reason
# as the shader-under-shader check, we cannot fail until at least
# the major authoring tools have been updated.
self._AddWarning("%s prim <%s> reads 8 bit Normal Map @%s@, "
"which requires that inputs:scale be set to "
"[2, 2, 2, 1] and inputs:bias be set to "
"[-1, -1, -1, 0] for proper interpretation." %\
(NodeTypes.UsdUVTexture,
sourcePrim.GetPath(),
texAsset.path))
return
# don't really care about fourth components...
if (bias[0] != -1 or bias[1] != -1 or bias[2] != -1 or
scale[0] != 2 or scale[1] != 2 or scale[2] != 2):
self._AddWarning("%s prim <%s> reads an 8 bit Normal Map, "
"but has non-standard inputs:scale and "
"inputs:bias values of %s and %s" %\
(NodeTypes.UsdUVTexture,
sourcePrim.GetPath(),
str(scale), str(bias)))
class MaterialBindingAPIAppliedChecker(BaseRuleChecker):
@staticmethod
def GetDescription():
return "A prim providing a material binding, must have "\
"MaterialBindingAPI applied on the prim."
def __init__(self, verbose, consumerLevelChecks, assetLevelChecks):
super(MaterialBindingAPIAppliedChecker, self).__init__(verbose,
consumerLevelChecks,
assetLevelChecks)
def CheckPrim(self, prim):
from pxr import UsdShade
numMaterialBindings = len([rel for rel in prim.GetRelationships() \
if rel.GetName().startswith(UsdShade.Tokens.materialBinding)])
if ( (numMaterialBindings > 0) and
not prim.HasAPI(UsdShade.MaterialBindingAPI)):
self._AddFailedCheck("Found material bindings but no " \
"MaterialBindingAPI applied on the prim <%s>." \
% prim.GetPath())
class ARKitPackageEncapsulationChecker(BaseRuleChecker):
@staticmethod
def GetDescription():
return "If the root layer is a package, then the composed stage "\
"should not contain references to files outside the package. "\
"In other words, the package should be entirely self-contained."
def __init__(self, verbose, consumerLevelChecks, assetLevelChecks):
super(ARKitPackageEncapsulationChecker, self).\
__init__(verbose, consumerLevelChecks, assetLevelChecks)
def CheckDependencies(self, usdStage, layerDeps, assetDeps):
rootLayer = usdStage.GetRootLayer()
if not _IsPackageOrPackagedLayer(rootLayer):
return
packagePath = usdStage.GetRootLayer().realPath
if packagePath:
if Ar.IsPackageRelativePath(packagePath):
packagePath = Ar.SplitPackageRelativePathOuter(
packagePath)[0]
for layer in layerDeps:
# In-memory layers like session layers (which we must skip when
# doing this check) won't have a real path.
if layer.realPath:
if not layer.realPath.startswith(packagePath):
self._AddFailedCheck("Found loaded layer '%s' that "
"does not belong to the package '%s'." %
(layer.identifier, packagePath))
for asset in assetDeps:
if not asset.startswith(packagePath):
self._AddFailedCheck("Found asset reference '%s' that "
"does not belong to the package '%s'." %
(asset, packagePath))
class ARKitLayerChecker(BaseRuleChecker):
# Only core USD file formats are allowed.
_allowedLayerFormatIds = ('usd', 'usda', 'usdc', 'usdz')
@staticmethod
def GetDescription():
return "All included layers that participate in composition should"\
" have one of the core supported file formats."
def __init__(self, verbose, consumerLevelChecks, assetLevelChecks):
# Check if the prim has an allowed type.
super(ARKitLayerChecker, self).__init__(verbose,
consumerLevelChecks,
assetLevelChecks)
def CheckLayer(self, layer):
self._Msg("Checking layer <%s>." % layer.identifier)
formatId = layer.GetFileFormat().formatId
if not formatId in \
ARKitLayerChecker._allowedLayerFormatIds:
self._AddFailedCheck("Layer '%s' has unsupported formatId "
"'%s'." % (layer.identifier, formatId))
class ARKitPrimTypeChecker(BaseRuleChecker):
# All core prim types other than UsdGeomPointInstancers, Curve types, Nurbs,
# and the types in UsdLux are allowed.
_allowedPrimTypeNames = ('', 'Scope', 'Xform', 'Camera',
'Shader', 'Material',
'Mesh', 'Sphere', 'Cube', 'Cylinder', 'Cone',
'Capsule', 'GeomSubset', 'Points',
'SkelRoot', 'Skeleton', 'SkelAnimation',
'BlendShape', 'SpatialAudio')
@staticmethod
def GetDescription():
return "UsdGeomPointInstancers and custom schemas not provided by "\
"core USD are not allowed."
def __init__(self, verbose, consumerLevelChecks, assetLevelChecks):
# Check if the prim has an allowed type.
super(ARKitPrimTypeChecker, self).__init__(verbose,
consumerLevelChecks,
assetLevelChecks)
def CheckPrim(self, prim):
self._Msg("Checking prim <%s>." % prim.GetPath())
if prim.GetTypeName() not in \
ARKitPrimTypeChecker._allowedPrimTypeNames:
self._AddFailedCheck("Prim <%s> has unsupported type '%s'." %
(prim.GetPath(), prim.GetTypeName()))
class ARKitShaderChecker(BaseRuleChecker):
@staticmethod
def GetDescription():
return "Shader nodes must have \"id\" as the implementationSource, " \
"with id values that begin with \"Usd*\". Also, shader inputs "\
"with connections must each have a single, valid connection " \
"source."
def __init__(self, verbose, consumerLevelChecks, assetLevelChecks):
super(ARKitShaderChecker, self).__init__(verbose, consumerLevelChecks,
assetLevelChecks)
def CheckPrim(self, prim):
from pxr import UsdShade
if not prim.IsA(UsdShade.Shader):
return
shader = UsdShade.Shader(prim)
if not shader:
# Error has already been issued by a Base-level checker
return
self._Msg("Checking shader <%s>." % prim.GetPath())
implSource = shader.GetImplementationSource()
if implSource != UsdShade.Tokens.id:
self._AddFailedCheck("Shader <%s> has non-id implementation "
"source '%s'." % (prim.GetPath(), implSource))
shaderId = shader.GetShaderId()
if not shaderId or \
not (shaderId in [NodeTypes.UsdPreviewSurface,
NodeTypes.UsdUVTexture,
NodeTypes.UsdTransform2d] or
shaderId.startswith(NodeTypes.UsdPrimvarReader)) :
self._AddFailedCheck("Shader <%s> has unsupported info:id '%s'."
% (prim.GetPath(), shaderId))
# Check shader input connections
shaderInputs = shader.GetInputs()
for shdInput in shaderInputs:
connections = shdInput.GetAttr().GetConnections()
# If an input has one or more connections, ensure that the
# connections are valid.
if len(connections) > 0:
if len(connections) > 1:
self._AddFailedCheck("Shader input <%s> has %s connection "
"sources, but only one is allowed." %
(shdInput.GetAttr.GetPath(), len(connections)))
connectedSource = shdInput.GetConnectedSource()
if connectedSource is None:
self._AddFailedCheck("Connection source <%s> for shader "
"input <%s> is missing." % (connections[0],
shdInput.GetAttr().GetPath()))
else:
# The source must be a valid shader or material prim.
source = connectedSource[0]
if not source.GetPrim().IsA(UsdShade.Shader) and \
not source.GetPrim().IsA(UsdShade.Material):
self._AddFailedCheck("Shader input <%s> has an invalid "
"connection source prim of type '%s'." %
(shdInput.GetAttr().GetPath(),
source.GetPrim().GetTypeName()))
class ARKitMaterialBindingChecker(BaseRuleChecker):
@staticmethod
def GetDescription():
return "All material binding relationships must have valid targets."
def __init__(self, verbose, consumerLevelChecks, assetLevelChecks):
super(ARKitMaterialBindingChecker, self).__init__(verbose,
consumerLevelChecks,
assetLevelChecks)
def CheckPrim(self, prim):
from pxr import UsdShade
relationships = prim.GetRelationships()
bindingRels = [rel for rel in relationships if
rel.GetName().startswith(UsdShade.Tokens.materialBinding)]
for bindingRel in bindingRels:
targets = bindingRel.GetTargets()
if len(targets) == 1:
directBinding = UsdShade.MaterialBindingAPI.DirectBinding(
bindingRel)
if not directBinding.GetMaterial():
self._AddFailedCheck("Direct material binding <%s> targets "
"an invalid material <%s>." % (bindingRel.GetPath(),
directBinding.GetMaterialPath()))
elif len(targets) == 2:
collBinding = UsdShade.MaterialBindingAPI.CollectionBinding(
bindingRel)
if not collBinding.GetMaterial():
self._AddFailedCheck("Collection-based material binding "
"<%s> targets an invalid material <%s>." %
(bindingRel.GetPath(), collBinding.GetMaterialPath()))
if not collBinding.GetCollection():
self._AddFailedCheck("Collection-based material binding "
"<%s> targets an invalid collection <%s>." %
(bindingRel.GetPath(), collBinding.GetCollectionPath()))
class ARKitFileExtensionChecker(BaseRuleChecker):
_allowedFileExtensions = \
ARKitLayerChecker._allowedLayerFormatIds + \
TextureChecker._basicUSDZImageFormats
@staticmethod
def GetDescription():
return "Only layer files and textures are allowed in a package."
def __init__(self, verbose, consumerLevelChecks, assetLevelChecks):
super(ARKitFileExtensionChecker, self).__init__(verbose,
consumerLevelChecks,
assetLevelChecks)
def CheckZipFile(self, zipFile, packagePath):
fileNames = zipFile.GetFileNames()
for fileName in fileNames:
fileExt = Ar.GetResolver().GetExtension(fileName)
if fileExt not in ARKitFileExtensionChecker._allowedFileExtensions:
self._AddFailedCheck("File '%s' in package '%s' has an "
"unknown or unsupported extension '%s'." %
(fileName, packagePath, fileExt))
class ARKitRootLayerChecker(BaseRuleChecker):
@staticmethod
def GetDescription():
return "The root layer of the package must be a usdc file and " \
"must not include any external dependencies that participate in "\
"stage composition."
def __init__(self, verbose, consumerLevelChecks, assetLevelChecks):
super(ARKitRootLayerChecker, self).__init__(verbose,
consumerLevelChecks,
assetLevelChecks)
def CheckStage(self, usdStage):
usedLayers = usdStage.GetUsedLayers()
# This list excludes any session layers.
usedLayersOnDisk = [i for i in usedLayers if i.realPath]
if len(usedLayersOnDisk) > 1:
self._AddFailedCheck("The stage uses %s layers. It should "
"contain a single usdc layer to be compatible with ARKit's "
"implementation of usdz." % len(usedLayersOnDisk))
rootLayerRealPath = usdStage.GetRootLayer().realPath
if rootLayerRealPath.endswith(".usdz"):
# Check if the root layer in the package is a usdc.
from pxr import Usd
zipFile = Usd.ZipFile.Open(rootLayerRealPath)
if not zipFile:
self._AddError("Could not open package at path '%s'." %
resolvedPath)
return
fileNames = zipFile.GetFileNames()
if not fileNames[0].endswith(".usdc"):
self._AddFailedCheck("First file (%s) in usdz package '%s' "
"does not have the .usdc extension." % (fileNames[0],
rootLayerRealPath))
elif not rootLayerRealPath.endswith(".usdc"):
self._AddFailedCheck("Root layer of the stage '%s' does not "
"have the '.usdc' extension." % (rootLayerRealPath))
class ComplianceChecker(object):
""" A utility class for checking compliance of a given USD asset or a USDZ
package.
Since usdz files are zip files, someone could use generic zip tools to
create an archive and just change the extension, producing a .usdz file that
does not honor the additional constraints that usdz files require. Even if
someone does use our official archive creation tools, though, we
intentionally allow creation of usdz files that can be very "permissive" in
their contents for internal studio uses, where portability outside the
studio is not a concern. For content meant to be delivered over the web
(eg. ARKit assets), however, we must be much more restrictive.
This class provides two levels of compliance checking:
* "structural" validation that is represented by a set of base rules.
* "ARKit" compatibility validation, which includes many more restrictions.
Calling ComplianceChecker.DumpAllRules() will print an enumeration of the
various rules in the two categories of compliance checking.
"""
@staticmethod
def GetBaseRules():
return [ByteAlignmentChecker, CompressionChecker,
MissingReferenceChecker, StageMetadataChecker, TextureChecker,
PrimEncapsulationChecker, NormalMapTextureChecker,
MaterialBindingAPIAppliedChecker]
@staticmethod
def GetARKitRules(skipARKitRootLayerCheck=False):
arkitRules = [ARKitLayerChecker, ARKitPrimTypeChecker,
ARKitShaderChecker,
ARKitMaterialBindingChecker,
ARKitFileExtensionChecker,
ARKitPackageEncapsulationChecker]
if not skipARKitRootLayerCheck:
arkitRules.append(ARKitRootLayerChecker)
return arkitRules
@staticmethod
def GetRules(arkit=False, skipARKitRootLayerCheck=False):
allRules = ComplianceChecker.GetBaseRules()
if arkit:
arkitRules = ComplianceChecker.GetARKitRules(
skipARKitRootLayerCheck=skipARKitRootLayerCheck)
allRules += arkitRules
return allRules
@staticmethod
def DumpAllRules():
print('Base rules:')
for ruleNum, rule in enumerate(GetBaseRules()):
print('[%s] %s' % (ruleNum + 1, rule.GetDescription()))
print('-' * 30)
print('ARKit rules: ')
for ruleNum, rule in enumerate(GetBaseRules()):
print('[%s] %s' % (ruleNum + 1, rule.GetDescription()))
print('-' * 30)
def __init__(self, arkit=False, skipARKitRootLayerCheck=False,
rootPackageOnly=False, skipVariants=False, verbose=False,
assetLevelChecks=True):
self._rootPackageOnly = rootPackageOnly
self._doVariants = not skipVariants
self._verbose = verbose
self._errors = []
self._warnings = []
# Once a package has been checked, it goes into this set.
self._checkedPackages = set()
# Instantiate an instance of every rule checker and store in a list.
self._rules = [Rule(self._verbose, arkit, assetLevelChecks) for Rule in
ComplianceChecker.GetRules(arkit, skipARKitRootLayerCheck)]
def _Msg(self, msg):
if self._verbose:
print(msg)
def _AddError(self, errMsg):
self._errors.append(errMsg)
def _AddWarning(self, errMsg):
self._warnings.append(errMsg)
def GetErrors(self):
errors = self._errors
for rule in self._rules:
errs = rule.GetErrors()
for err in errs:
errors.append("Error checking rule '%s': %s" %
(type(rule).__name__, err))
return errors
def GetWarnings(self):
warnings = self._warnings
for rule in self._rules:
advisories = rule.GetWarnings()
for ad in advisories:
warnings.append("%s (may violate '%s')" % (ad,
type(rule).__name__))
return warnings
def DumpRules(self):
print('Checking rules: ')
for rule in self._rules:
print('-' * 30)
print('[%s]:\n %s' % (type(rule).__name__, rule.GetDescription()))
print('-' * 30)
def GetFailedChecks(self):
failedChecks = []
for rule in self._rules:
fcs = rule.GetFailedChecks()
for fc in fcs:
failedChecks.append("%s (fails '%s')" % (fc,
type(rule).__name__))
return failedChecks
def CheckCompliance(self, inputFile):
from pxr import Sdf, Usd, UsdUtils
if not Usd.Stage.IsSupportedFile(inputFile):
_AddError("Cannot open file '%s' on a USD stage." % args.inputFile)
return
# Collect all warnings using a diagnostic delegate.
delegate = UsdUtils.CoalescingDiagnosticDelegate()
usdStage = Usd.Stage.Open(inputFile)
stageOpenDiagnostics = delegate.TakeUncoalescedDiagnostics()
for rule in self._rules:
rule.CheckStage(usdStage)
rule.CheckDiagnostics(stageOpenDiagnostics)
with Ar.ResolverContextBinder(usdStage.GetPathResolverContext()):
# This recursively computes all of inputFiles's external
# dependencies.
(allLayers, allAssets, unresolvedPaths) = \
UsdUtils.ComputeAllDependencies(Sdf.AssetPath(inputFile))
for rule in self._rules:
rule.CheckUnresolvedPaths(unresolvedPaths)
rule.CheckDependencies(usdStage, allLayers, allAssets)
if self._rootPackageOnly:
rootLayer = usdStage.GetRootLayer()
if rootLayer.GetFileFormat().IsPackage():
packagePath = Ar.SplitPackageRelativePathInner(
rootLayer.identifier)[0]
self._CheckPackage(packagePath)
else:
self._AddError("Root layer of the USD stage (%s) doesn't belong to "
"a package, but 'rootPackageOnly' is True!" %
Usd.Describe(usdStage))
else:
# Process every package just once by storing them all in a set.
packages = set()
for layer in allLayers:
if _IsPackageOrPackagedLayer(layer):
packagePath = Ar.SplitPackageRelativePathInner(
layer.identifier)[0]
packages.add(packagePath)
self._CheckLayer(layer)
for package in packages:
self._CheckPackage(package)
# Traverse the entire stage and check every prim.
from pxr import Usd
# Author all variant switches in the session layer.
usdStage.SetEditTarget(usdStage.GetSessionLayer())
allPrimsIt = iter(Usd.PrimRange.Stage(usdStage,
Usd.TraverseInstanceProxies()))
self._TraverseRange(allPrimsIt, isStageRoot=True)
def _CheckPackage(self, packagePath):
self._Msg("Checking package <%s>." % packagePath)
# XXX: Should we open the package on a stage to ensure that it is valid
# and entirely self-contained.
from pxr import Usd
pkgExt = Ar.GetResolver().GetExtension(packagePath)
if pkgExt != "usdz":
self._AddError("Package at path %s has an invalid extension."
% packagePath)
return
# Check the parent package first.
if Ar.IsPackageRelativePath(packagePath):
parentPackagePath = Ar.SplitPackageRelativePathInner(packagePath)[0]
self._CheckPackage(parentPackagePath)
# Avoid checking the same parent package multiple times.
if packagePath in self._checkedPackages:
return
self._checkedPackages.add(packagePath)
resolvedPath = Ar.GetResolver().Resolve(packagePath)
if not resolvedPath:
self._AddError("Failed to resolve package path '%s'." % packagePath)
return
zipFile = Usd.ZipFile.Open(resolvedPath)
if not zipFile:
self._AddError("Could not open package at path '%s'." %
resolvedPath)
return
for rule in self._rules:
rule.CheckZipFile(zipFile, packagePath)
def _CheckLayer(self, layer):
for rule in self._rules:
rule.CheckLayer(layer)
def _CheckPrim(self, prim):
for rule in self._rules:
rule.CheckPrim(prim)
def _TraverseRange(self, primRangeIt, isStageRoot):
primsWithVariants = []
rootPrim = primRangeIt.GetCurrentPrim()
for prim in primRangeIt:
# Skip variant set check on the root prim if it is the stage'.
if not self._doVariants or (not isStageRoot and prim == rootPrim):
self._CheckPrim(prim)
continue
vSets = prim.GetVariantSets()
vSetNames = vSets.GetNames()
if len(vSetNames) == 0:
self._CheckPrim(prim)
else:
primsWithVariants.append(prim)
primRangeIt.PruneChildren()
for prim in primsWithVariants:
self._TraverseVariants(prim)
def _TraverseVariants(self, prim):
from pxr import Usd
if prim.IsInstanceProxy():
return True
vSets = prim.GetVariantSets()
vSetNames = vSets.GetNames()
allVariantNames = []
for vSetName in vSetNames:
vSet = vSets.GetVariantSet(vSetName)
vNames = vSet.GetVariantNames()
allVariantNames.append(vNames)
import itertools
allVariations = itertools.product(*allVariantNames)
for variation in allVariations:
self._Msg("Testing variation %s of prim <%s>" %
(variation, prim.GetPath()))
for (idx, sel) in enumerate(variation):
vSets.SetSelection(vSetNames[idx], sel)
for rule in self._rules:
rule.ResetCaches()
primRangeIt = iter(Usd.PrimRange(prim,
Usd.TraverseInstanceProxies()))
self._TraverseRange(primRangeIt, isStageRoot=False)
| 49,090 | Python | 43.027803 | 88 | 0.581605 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdUtils/usdzUtils.py | #
# Copyright 2022 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
# - method to extract usdz package contents to a given location
# this should be trivial and just use zipfile module to extract all contents
from __future__ import print_function
import sys
import os
import glob
import zipfile
import shutil
import tempfile
from contextlib import contextmanager
def _Print(msg):
print(msg)
def _Err(msg):
sys.stderr.write(msg + '\n')
def _AllowedUsdzExtensions():
return [".usdz"]
def _AllowedUsdExtensions():
return [".usd", ".usda", ".usdc"]
# Runs UsdUtils.ComplianceChecker on the given layer
def CheckUsdzCompliance(rootLayer, arkit=False):
"""
Runs UsdUtils.ComplianceChecker on the given layer and reports errors.
Returns True if no errors or failed checks were reported, False otherwise.
"""
from pxr import UsdUtils
checker = UsdUtils.ComplianceChecker(arkit=arkit,
# We're going to flatten the USD stage and convert the root layer to
# crate file format before packaging, if necessary. Hence, skip these
# checks.
skipARKitRootLayerCheck=True)
checker.CheckCompliance(rootLayer)
errors = checker.GetErrors()
failedChecks = checker.GetFailedChecks()
warnings = checker.GetWarnings()
for msg in errors + failedChecks:
_Err(msg)
if len(warnings) > 0:
_Err("*********************************************\n"
"Possible correctness problems to investigate:\n"
"*********************************************\n")
for msg in warnings:
_Err(msg)
return len(errors) == 0 and len(failedChecks) == 0
# Creates a usdz package under usdzFile
def CreateUsdzPackage(usdzFile, filesToAdd, recurse, checkCompliance, verbose):
"""
Creates a usdz package with the files provided in filesToAdd and saves as
the usdzFile.
If filesToAdd contains nested subdirectories, recurse flag can be specified,
which will make sure to recurse through the directory structure and include
the files in the usdz archive.
Specifying checkCompliance, will make sure run UsdUtils.ComplianceChecker on
the rootLayer of the usdz package being created.
"""
if (not usdzFile.endswith('.usdz')):
return False
from pxr import Usd, Tf
with Usd.ZipFileWriter.CreateNew(usdzFile) as usdzWriter:
fileList = []
while filesToAdd:
# Pop front (first file) from the list of files to add.
f = filesToAdd[0]
filesToAdd = filesToAdd[1:]
if os.path.isdir(f):
# If a directory is specified, add all files in the directory.
filesInDir = glob.glob(os.path.join(f, '*'))
# If the recurse flag is not specified, remove sub-directories.
if not recurse:
filesInDir = [f for f in filesInDir if not os.path.isdir(f)]
# glob.glob returns files in arbitrary order. Hence, sort them
# here to get consistent ordering of files in the package.
filesInDir.sort()
filesToAdd += filesInDir
else:
if verbose:
print('.. adding: %s' % f)
if os.path.getsize(f) > 0:
fileList.append(f)
else:
_Err("Skipping empty file '%s'." % f)
if checkCompliance and len(fileList) > 0:
rootLayer = fileList[0]
if not CheckUsdzCompliance(rootLayer):
return False
for f in fileList:
try:
usdzWriter.AddFile(f)
except Tf.ErrorException as e:
_Err('Failed to add file \'%s\' to package. Discarding '
'package.' % f)
# When the "with" block exits, Discard() will be called on
# usdzWriter automatically if an exception occurs.
raise
return True
def ExtractUsdzPackage(usdzFile, extractDir, recurse, verbose, force):
"""
Given a usdz package usdzFile, extracts the contents of the archive under
the extractDir directory. Since usdz packages can contain other usdz
packages, recurse flag can be used to extract the nested structure
appropriately.
"""
if (not usdzFile.endswith('.usdz')):
_Print("\'%s\' does not have .usdz extension" % usdzFile)
return False
if (not os.path.exists(usdzFile)):
_Print("usdz file \'%s\' does not exist." % usdzFile)
if (not extractDir):
_Print("No extract dir specified")
return False
if force and os.path.isdir(os.path.abspath(extractDir)):
shutil.rmtree(os.path.abspath(extractDir))
if os.path.isdir(extractDir):
_Print("Extract Dir: \'%s\' already exists." % extractDir)
return False
def _ExtractZip(zipFile, extractedDir, recurse, verbose):
with zipfile.ZipFile(zipFile) as usdzArchive:
if verbose:
_Print("Extracting usdz file \'%s\' to \'%s\'" \
%(zipFile, extractedDir))
usdzArchive.extractall(extractedDir)
if recurse:
for item in os.listdir(extractedDir):
if item.endswith('.usdz'):
_Print("Extracting item \'%s\'." %item)
itemPath = os.path.join(extractedDir, item)
_ExtractZip(itemPath, os.path.splitext(itemPath)[0],
recurse, verbose)
os.remove(os.path.abspath(itemPath))
# Extract to a temp directory then move to extractDir, this makes sure
# in-complete extraction does not dirty the extractDir and only all
# extracted contents are moved to extractDir
tmpExtractPath = tempfile.mkdtemp()
try:
_ExtractZip(usdzFile, tmpExtractPath, recurse, verbose)
shutil.move(os.path.abspath(tmpExtractPath), os.path.abspath(extractDir))
except:
shutil.rmtree(tmpExtractPath)
return True
class UsdzAssetIterator(object):
"""
Class that provides an iterator for usdz assets. Within context, it
extracts the contents of the usdz package, provides gennerators for all usd
files and all assets and on exit packs the extracted files back recursively
into a usdz package.
"""
def __init__(self, usdzFile, verbose, parentDir=None):
# If a parentDir is provided extractDir is created under the parent dir,
# else a temp directory is created which is cleared on exit. This is
# specially useful when iterating on a nested usdz package.
if parentDir:
self._tmpDir = None
else:
self._tmpDir = tempfile.mkdtemp()
usdzFileDir = os.path.splitext(usdzFile)[0]
self.extractDir = os.path.join(parentDir, usdzFileDir) if parentDir \
else os.path.join(self._tmpDir, usdzFileDir)
self.usdzFile = os.path.abspath(usdzFile)
self.verbose = verbose
if self.verbose:
_Print("Initializing UsdzAssetIterator for (%s) with (%s) temp " \
"extract dir" %(self.usdzFile, self.extractDir))
def _ExtractedFiles(self):
return [os.path.relpath(os.path.join(root, f), self.extractDir) \
for root, dirs, files in os.walk(self.extractDir) \
for f in files]
def __enter__(self):
# unpacks usdz into the extractDir set in the constructor
ExtractUsdzPackage(self.usdzFile, self.extractDir, False, self.verbose,
True)
return self
def __exit__(self, excType, excVal, excTB):
# repacks (modified) files to original usdz package
from pxr import Tf
# If extraction failed, we won't have a extractDir, exit early
if not os.path.exists(self.extractDir):
return
os.chdir(self.extractDir)
filesToAdd = self._ExtractedFiles()
try:
if self.verbose:
_Print("Packing files [%s] in (%s) directory as (%s) usdz " \
"package." %(", ".join(filesToAdd), self.extractDir,
self.usdzFile))
# Package creation can error out
packed = CreateUsdzPackage(self.usdzFile, filesToAdd, True, True,
self.verbose)
except Tf.ErrorException as e:
_Err("Failed to pack files [%s] as usdzFile '%s' because following "
"exception was thrown: (%s)" %(",".join(filesToAdd), \
self.usdzFile, e))
finally:
# Make sure context is not on the directory being removed
os.chdir(os.path.dirname(self.extractDir))
shutil.rmtree(self.extractDir)
def UsdAssets(self):
"""
Generator for UsdAssets respecting nested usdz assets.
"""
if not os.path.exists(self.extractDir):
yield
return
# generator that yields all usd, usda, usdz assets from the package
allowedExtensions = _AllowedUsdzExtensions() + _AllowedUsdExtensions()
extractedFiles = [f for f in self._ExtractedFiles() if \
os.path.splitext(f)[1] in allowedExtensions]
os.chdir(self.extractDir)
for extractedFile in extractedFiles:
if os.path.splitext(extractedFile)[1] in _AllowedUsdzExtensions():
if self.verbose:
_Print("Iterating nested usdz asset: %s" %extractedFile)
# Create another UsdzAssetIterator to handle nested usdz package
with UsdzAssetIterator(extractedFile, self.verbose,
self.extractDir) as nestedUsdz:
# On python3.5+ we can use "yield from" instead of
# iterating on the nested yield's results
for nestedUsdAsset in nestedUsdz.UsdAssets():
yield nestedUsdAsset
else:
if self.verbose:
_Print("Iterating usd asset: %s" %extractedFile)
yield extractedFile
def AllAssets(self):
"""
Generator for all assets packed in the usdz package, respecting nested
usdz assets.
"""
if not os.path.exists(self.extractDir):
yield
return
# generator that yields all assets
extractedFiles = self._ExtractedFiles()
os.chdir(self.extractDir)
for extractedFile in extractedFiles:
if os.path.splitext(extractedFile)[1] in _AllowedUsdzExtensions():
if self.verbose:
_Print("Iterating nested usdz asset: %s" %extractedFile)
with UsdzAssetIterator(extractedFile, self.verbose,
self.extractDir) as nestedUsdz:
# On python3.5+ we can use "yield from" instead of
# iterating on the nested yield's results
for nestedAllAsset in nestedUsdz.AllAssets():
yield nestedAllAsset
else:
if self.verbose:
_Print("Iterating usd asset: %s" %extractedFile)
yield extractedFile
| 12,355 | Python | 40.743243 | 81 | 0.606799 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdUtils/updateSchemaWithSdrNode.py | #!/pxrpythonsubst
#
# Copyright 2021 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
from pxr import Tf, Sdf, Sdr, Usd, UsdShade, Vt
from pxr.UsdUtils.constantsGroup import ConstantsGroup
class SchemaDefiningKeys(ConstantsGroup):
API_SCHEMAS_FOR_ATTR_PRUNING = "apiSchemasForAttrPruning"
API_SCHEMA_AUTO_APPLY_TO = "apiSchemaAutoApplyTo"
API_SCHEMA_CAN_ONLY_APPLY_TO = "apiSchemaCanOnlyApplyTo"
IS_USD_SHADE_CONTAINER = "isUsdShadeContainer"
SCHEMA_PROPERTY_NS_PREFIX_OVERRIDE = "schemaPropertyNSPrefixOverride"
PROVIDES_USD_SHADE_CONNECTABLE_API_BEHAVIOR = \
"providesUsdShadeConnectableAPIBehavior"
REQUIRES_USD_SHADE_ENCAPSULATION = "requiresUsdShadeEncapsulation"
SCHEMA_BASE = "schemaBase"
SCHEMA_KIND = "schemaKind"
SCHEMA_NAME = "schemaName"
TF_TYPENAME_SUFFIX = "tfTypeNameSuffix"
TYPED_SCHEMA_FOR_ATTR_PRUNING = "typedSchemaForAttrPruning"
class SchemaDefiningMiscConstants(ConstantsGroup):
API_SCHEMA_BASE = "APISchemaBase"
API_STRING = "API"
NodeDefAPI = "NodeDefAPI"
SINGLE_APPLY_SCHEMA = "singleApply"
TYPED_SCHEMA = "Typed"
USD_SOURCE_TYPE = "USD"
class PropertyDefiningKeys(ConstantsGroup):
CONNECTABILITY = "connectability"
INTERNAL_DISPLAY_GROUP = "Internal"
NULL_VALUE = "null"
PROPERTY_NS_PREFIX_OVERRIDE = "propertyNSPrefixOverride"
SDF_VARIABILITY_UNIFORM_STRING = "Uniform"
SHADER_ID = "shaderId"
USD_SUPPRESS_PROPERTY = "usdSuppressProperty"
USD_VARIABILITY = "usdVariability"
WIDGET = "widget"
def _IsNSPrefixConnectableAPICompliant(nsPrefix):
return (nsPrefix == UsdShade.Tokens.inputs[:1] or \
nsPrefix == UsdShade.Tokens.outputs[:1])
def _CreateAttrSpecFromNodeAttribute(primSpec, prop, primDefForAttrPruning,
schemaPropertyNSPrefixOverride, isSdrInput=True):
propMetadata = prop.GetMetadata()
# Early out if the property should be suppressed from being translated to
# propertySpec
if ((PropertyDefiningKeys.USD_SUPPRESS_PROPERTY in propMetadata) and
propMetadata[PropertyDefiningKeys.USD_SUPPRESS_PROPERTY] == "True"):
return
propertyNSPrefixOverride = schemaPropertyNSPrefixOverride
if PropertyDefiningKeys.PROPERTY_NS_PREFIX_OVERRIDE in propMetadata:
propertyNSPrefixOverride = \
propMetadata[PropertyDefiningKeys.PROPERTY_NS_PREFIX_OVERRIDE]
propName = prop.GetName()
# Error out if trying to use an explicit propertyNSPrefixOverride on an
# output attr
if (not isSdrInput and propertyNSPrefixOverride is not None and \
propertyNSPrefixOverride != UsdShade.Tokens.outputs[:-1]):
Tf.RaiseRuntimeError("Presence of (%s) output parameter contradicts " \
"the presence of propertyNSPrefixOverride (\"%s\"), as it is " \
"illegal for non-shader nodes to contain output parameters, or " \
"shader nodes' outputs to not have the \"outputs\" namespace " \
"prefix." %(propName, propertyNSPrefixOverride))
attrType = prop.GetTypeAsSdfType()[0]
if not Sdf.Path.IsValidNamespacedIdentifier(propName):
Tf.RaiseRuntimeError("Property name (%s) for schema (%s) is an " \
"invalid namespace identifier." %(propName, primSpec.name))
# if propertyNSPrefixOverride is provided and we are an output then already
# thrown exception
# Note that UsdShade inputs and outputs tokens contain the ":" delimiter, so
# we need to strip this to be used with JoinIdentifier
if propertyNSPrefixOverride is None:
propertyNSPrefixOverride = UsdShade.Tokens.inputs[:-1] if isSdrInput \
else UsdShade.Tokens.outputs[:-1]
# Apply propertyNSPrefixOverride
propName = Sdf.Path.JoinIdentifier([propertyNSPrefixOverride, propName])
# error and early out if duplicate property on primDefForAttrPruning exists
# and has different types
if primDefForAttrPruning:
primDefAttr = primDefForAttrPruning.GetSchemaAttributeSpec(propName)
if primDefAttr:
usdAttrType = primDefAttr.typeName
if (usdAttrType != attrType):
Tf.Warn("Generated schema's property type '%s', "
"differs usd schema's property type '%s', for "
"duplicated property '%s'" %(attrType, usdAttrType,
propName))
return
# Copy over property parameters
options = prop.GetOptions()
if options and attrType == Sdf.ValueTypeNames.String:
attrType = Sdf.ValueTypeNames.Token
attrVariability = Sdf.VariabilityUniform \
if ((PropertyDefiningKeys.USD_VARIABILITY in propMetadata) and
propMetadata[PropertyDefiningKeys.USD_VARIABILITY] ==
PropertyDefiningKeys.SDF_VARIABILITY_UNIFORM_STRING) \
else Sdf.VariabilityVarying
attrSpec = Sdf.AttributeSpec(primSpec, propName, attrType,
attrVariability)
if PropertyDefiningKeys.WIDGET in prop.GetMetadata().keys():
if (prop.GetMetadata()[PropertyDefiningKeys.WIDGET] == \
PropertyDefiningKeys.NULL_VALUE):
attrSpec.hidden = True
if prop.GetHelp():
attrSpec.documentation = prop.GetHelp()
elif prop.GetLabel(): # fallback documentation can be label
attrSpec.documentation = prop.GetLabel()
if prop.GetPage():
attrSpec.displayGroup = prop.GetPage()
if prop.GetLabel():
attrSpec.displayName = prop.GetLabel()
if options and attrType == Sdf.ValueTypeNames.Token:
# If the value for token list is empty then use the name
# If options list has a mix of empty and non-empty value thats an error.
tokenList = []
hasEmptyValue = len(options[0][1]) == 0
for option in options:
if len(option[1]) == 0:
if not hasEmptyValue:
Tf.Warn("Property (%s) for schema (%s) has mix of empty " \
"non-empty values for token options (%s)." \
%(propName, primSpec.name, options))
hasEmptyValue = True
tokenList.append(option[0])
else:
if hasEmptyValue:
Tf.Warn("Property (%s) for schema (%s) has mix of empty " \
"non-empty values for token options (%s)." \
%(propName, primSpec.name, options))
hasEmptyValue = False
tokenList.append(option[1])
attrSpec.allowedTokens = tokenList
defaultValue = prop.GetDefaultValueAsSdfType()
if (attrType == Sdf.ValueTypeNames.String or
attrType == Sdf.ValueTypeNames.Token) and defaultValue is not None:
attrSpec.default = defaultValue.replace('"', r'\"')
else:
attrSpec.default = defaultValue
# The input property should remain connectable (interfaceOnly)
# even if sdrProperty marks the input as not connectable
if propertyNSPrefixOverride == UsdShade.Tokens.inputs[:-1] and \
not prop.IsConnectable():
attrSpec.SetInfo(PropertyDefiningKeys.CONNECTABILITY,
UsdShade.Tokens.interfaceOnly)
def UpdateSchemaWithSdrNode(schemaLayer, sdrNode, renderContext="",
overrideIdentifier=""):
"""
Updates the given schemaLayer with primSpec and propertySpecs from sdrNode
metadata.
A renderContext can be provided which is used in determining the
shaderId namespace, which follows the pattern:
"<renderContext>:<SdrShaderNodeContext>:shaderId". Note that we are using a
node's context (SDR_NODE_CONTEXT_TOKENS) here to construct the shaderId
namespace, so shader parsers should make sure to use appropriate
SDR_NODE_CONTEXT_TOKENS in the node definitions.
overrideIdentifier parameter is the identifier which should be used when
the identifier of the node being processed differs from the one Sdr will
discover at runtime, such as when this function is def a node constructed
from an explicit asset path. This should only be used when clients know the
identifier being passed is the true identifier which sdr Runtime will
provide when querying using GetShaderNodeByIdentifierAndType, etc.
It consumes the following attributes (that manifest as Sdr
metadata) in addition to many of the standard Sdr metadata
specified and parsed (via its parser plugin).
Node Level Metadata:
- "schemaName": Name of the new schema populated from the given sdrNode
(Required)
- "schemaKind": Specifies the UsdSchemaKind for the schema being
populated from the sdrNode. (Note that this does not support
multiple apply schema kinds).
- "schemaBase": Base schema from which the new schema should inherit
from. Note this defaults to "APISchemaBase" for an API schema or
"Typed" for a concrete scheme.
- "apiSchemasForAttrPruning": A list of core API schemas which will be
composed together and any shared shader property from this prim
definition is pruned from the resultant schema.
- "typedSchemaForAttrPruning": A core typed schema which will be
composed together with the apiSchemasForAttrPruning and any shared
shader property from this prim definition is pruned from the
resultant schema. If no typedSchemaForAttrPruning is provided then
only the apiSchemasForAttrPruning are composed to create a prim
definition. This will only be used when creating an APISchema.
- "apiSchemaAutoApplyTo": The schemas to which the sdrNode populated
API schema will autoApply to.
- "apiSchemaCanOnlyApplyTo": If specified, the API schema generated
from the sdrNode can only be validly applied to this set of schemas.
- "providesUsdShadeConnectableAPIBehavior": Used to enable a
connectability behavior for an API schema.
- "isUsdShadeContainer": Only used when
providesUsdShadeConnectableAPIBehavior is set to true. Marks the
connectable prim as a UsdShade container type.
- "requiresUsdShadeEncapsulation": Only used when
providesUsdShadeConnectableAPIBehavior is set to true. Configures the
UsdShade encapsulation rules governing its connectableBehavior.
- "tfTypeNameSuffix": Class name which will get registered with TfType
system. This gets appended to the domain name to register with TfType.
- "schemaPropertyNSPrefixOverride": Node level metadata which can drive
all node's properties namespace prefix. This can be useful for
non connectable nodes which should not get UsdShade inputs and outputs
namespace prefix.
Property Level Metadata:
- "usdVariability": Property level metadata which specifies a specific
sdrNodeProperty should have its USD variability set to Uniform or
Varying
- "usdSuppressProperty": A property level metadata which determines if
the property should be suppressed from translation from args to
property spec.
- "propertyNSPrefixOverride": Provides a way to override a property's
namespace from the default (inputs:/outputs:) or from a node's
schemaPropertyNSPrefixOverride metadata.
Sdr Property Metadata to SdfPropertySpec Translations
- A "null" value for Widget sdrProperty metadata translates to
SdfPropertySpec Hidden metadata.
- SdrProperty's Help metadata (Label metadata if Help metadata not
provided) translates to SdfPropertySpec's Documentation string
metadata.
- SdrProperty's Page metadata translates to SdfPropertySpec's
DisplayGroup metadata.
- SdrProperty's Label metadata translates to SdfPropertySpec's
DisplayName metadata.
- SdrProperty's Options translates to SdfPropertySpec's AllowedTokens.
- SdrProperty's Default value translates to SdfPropertySpec's Default
value.
- Connectable input properties translates to InterfaceOnly
SdfPropertySpec's CONNECTABILITY.
"""
import distutils.util
import os
# Early exit on invalid parameters
if not schemaLayer:
Tf.Warn("No Schema Layer provided")
return
if sdrNode is None:
# This is a workaround to iterate through invalid sdrNodes (nodes not
# having any input or output properties). Currently these nodes return
# false when queried for IsValid().
# Refer: pxr/usd/ndr/node.h#140-149
Tf.Warn("No valid sdrNode provided")
return
sdrNodeMetadata = sdrNode.GetMetadata()
if SchemaDefiningKeys.SCHEMA_NAME not in sdrNodeMetadata:
Tf.Warn("Sdr Node (%s) does not define a schema name metadata." \
%(sdrNode.GetName()))
return
schemaName = sdrNodeMetadata[SchemaDefiningKeys.SCHEMA_NAME]
if not Tf.IsValidIdentifier(schemaName):
Tf.RaiseRuntimeError("schemaName (%s) is an invalid identifier; "
"Provide a valid USD identifer for schemaName, example (%s) "
%(schemaName, Tf.MakeValidIdentifier(schemaName)))
tfTypeNameSuffix = None
if SchemaDefiningKeys.TF_TYPENAME_SUFFIX in sdrNodeMetadata:
tfTypeNameSuffix = sdrNodeMetadata[SchemaDefiningKeys.TF_TYPENAME_SUFFIX]
if not Tf.IsValidIdentifier(tfTypeNameSuffix):
Tf.RaiseRuntimeError("tfTypeNameSuffix (%s) is an invalid " \
"identifier" %(tfTypeNameSuffix))
if SchemaDefiningKeys.SCHEMA_KIND not in sdrNodeMetadata:
schemaKind = SchemaDefiningMiscConstants.TYPED_SCHEMA
else:
schemaKind = sdrNodeMetadata[SchemaDefiningKeys.SCHEMA_KIND]
# Note: We are not working on dynamic multiple apply schemas right now.
isAPI = schemaKind == SchemaDefiningMiscConstants.SINGLE_APPLY_SCHEMA
# Fix schemaName and warn if needed
if isAPI and \
not schemaName.endswith(SchemaDefiningMiscConstants.API_STRING):
Tf.Warn("node metadata implies the generated schema being created is "
"an API schema, fixing schemaName to reflect that")
schemaName = schemaName + SchemaDefiningMiscConstants.API_STRING
if isAPI and tfTypeNameSuffix and \
not tfTypeNameSuffix.endswith(SchemaDefiningMiscConstants.API_STRING):
Tf.Warn("node metadata implies the generated schema being created "
"is an API schema, fixing tfTypeNameSuffix to reflect that")
tfTypeNameSuffix = tfTypeNameSuffix + \
SchemaDefiningMiscConstants.API_STRING
if SchemaDefiningKeys.SCHEMA_BASE not in sdrNodeMetadata:
Tf.Warn("No schemaBase specified in node metadata, defaulting to "
"APISchemaBase for API schemas else Typed")
schemaBase = SchemaDefiningMiscConstants.API_SCHEMA_BASE if isAPI \
else SchemaDefiningMiscConstants.TYPED_SCHEMA
else:
schemaBase = sdrNodeMetadata[SchemaDefiningKeys.SCHEMA_BASE]
apiSchemaAutoApplyTo = None
if SchemaDefiningKeys.API_SCHEMA_AUTO_APPLY_TO in sdrNodeMetadata:
apiSchemaAutoApplyTo = \
sdrNodeMetadata[SchemaDefiningKeys.API_SCHEMA_AUTO_APPLY_TO] \
.split('|')
apiSchemaCanOnlyApplyTo = None
if SchemaDefiningKeys.API_SCHEMA_CAN_ONLY_APPLY_TO in sdrNodeMetadata:
apiSchemaCanOnlyApplyTo = \
sdrNodeMetadata[SchemaDefiningKeys.API_SCHEMA_CAN_ONLY_APPLY_TO] \
.split('|')
providesUsdShadeConnectableAPIBehavior = False
if SchemaDefiningKeys.PROVIDES_USD_SHADE_CONNECTABLE_API_BEHAVIOR in \
sdrNodeMetadata:
providesUsdShadeConnectableAPIBehavior = \
distutils.util.strtobool(sdrNodeMetadata[SchemaDefiningKeys. \
PROVIDES_USD_SHADE_CONNECTABLE_API_BEHAVIOR])
apiSchemasForAttrPruning = None
if SchemaDefiningKeys.API_SCHEMAS_FOR_ATTR_PRUNING in sdrNodeMetadata:
apiSchemasForAttrPruning = \
sdrNodeMetadata[SchemaDefiningKeys.API_SCHEMAS_FOR_ATTR_PRUNING] \
.split('|')
typedSchemaForAttrPruning = ""
if isAPI and \
SchemaDefiningKeys.TYPED_SCHEMA_FOR_ATTR_PRUNING in sdrNodeMetadata:
typedSchemaForAttrPruning = \
sdrNodeMetadata[SchemaDefiningKeys.TYPED_SCHEMA_FOR_ATTR_PRUNING]
schemaPropertyNSPrefixOverride = None
if SchemaDefiningKeys.SCHEMA_PROPERTY_NS_PREFIX_OVERRIDE in sdrNodeMetadata:
schemaPropertyNSPrefixOverride = \
sdrNodeMetadata[ \
SchemaDefiningKeys.SCHEMA_PROPERTY_NS_PREFIX_OVERRIDE]
usdSchemaReg = Usd.SchemaRegistry()
# determine if the node being processed provides UsdShade-Connectability,
# this helps in determining what namespace to use and also to report error
# if a non-connectable node has outputs properties, which is malformed.
# - Does the node derive from a schemaBase which provides connectable
# behavior. Warn if schemaPropertyNSPrefixOverride is also specified, as
# these metadata won't be used.
# - If no schemaBase then we default to UsdShade connectable node's
# inputs:/outputs: namespace prefix, unless schemaPropertyNSPrefixOverride
# is provided.
# - We also report an error if schemaPropertyNSPrefixOverride is provided
# and an output property is found on the node being processed.
schemaBaseProvidesConnectability = UsdShade.ConnectableAPI. \
HasConnectableAPI(usdSchemaReg.GetTypeFromName(schemaBase))
emitSdrOutput = True
for outputName in sdrNode.GetOutputNames():
if PropertyDefiningKeys.USD_SUPPRESS_PROPERTY in \
sdrNode.GetOutput(outputName).GetMetadata():
emitSdrOutput = False
break;
if (emitSdrOutput and \
len(sdrNode.GetOutputNames()) > 0 and \
schemaPropertyNSPrefixOverride is not None and \
not _IsNSPrefixConnectableAPICompliant( \
schemaPropertyNSPrefixOverride)):
Tf.RaiseRuntimeError("Presence of (%s) output parameters contradicts " \
"the presence of schemaPropertyNSPrefixOverride (\"%s\"), as it " \
"is illegal for non-connectable nodes to contain output " \
"parameters, or shader nodes' outputs to not have the \"outputs\"" \
"namespace prefix." %(len(sdrNode.GetOutputNames()), \
schemaPropertyNSPrefixOverride))
if (schemaBaseProvidesConnectability and \
schemaPropertyNSPrefixOverride is not None and \
not _IsNSPrefixConnectableAPICompliant( \
schemaPropertyNSPrefixOverride)):
Tf.Warn("Node %s provides UsdShade-Connectability as it derives from " \
"%s, schemaPropertyNSPrefixOverride \"%s\" will not be used." \
%(schemaName, schemaBase, schemaPropertyNSPrefixOverride))
# set schemaPropertyNSPrefixOverride to "inputs", assuming default
# UsdShade Connectability namespace prefix
schemaPropertyNSPrefixOverride = "inputs"
primSpec = schemaLayer.GetPrimAtPath(schemaName)
if (primSpec):
# if primSpec already exist, remove entirely and recreate using the
# parsed sdr node
if primSpec.nameParent:
del primSpec.nameParent.nameChildren[primSpec.name]
else:
del primSpec.nameRoot.nameChildren[primSpec.name]
primSpec = Sdf.PrimSpec(schemaLayer, schemaName, Sdf.SpecifierClass,
"" if isAPI else schemaName)
primSpec.inheritPathList.explicitItems = ["/" + schemaBase]
primSpecCustomData = {}
if isAPI:
primSpecCustomData["apiSchemaType"] = schemaKind
if tfTypeNameSuffix:
# Defines this classname for TfType system
# can help avoid duplicate prefix with domain and className
# Tf type system will automatically pick schemaName as tfTypeName if
# this is not set!
primSpecCustomData["className"] = tfTypeNameSuffix
if apiSchemaAutoApplyTo:
primSpecCustomData['apiSchemaAutoApplyTo'] = \
Vt.TokenArray(apiSchemaAutoApplyTo)
if apiSchemaCanOnlyApplyTo:
primSpecCustomData['apiSchemaCanOnlyApplyTo'] = \
Vt.TokenArray(apiSchemaCanOnlyApplyTo)
if providesUsdShadeConnectableAPIBehavior:
extraPlugInfo = {
SchemaDefiningKeys.PROVIDES_USD_SHADE_CONNECTABLE_API_BEHAVIOR \
: True
}
for propKey in [SchemaDefiningKeys.IS_USD_SHADE_CONTAINER, \
SchemaDefiningKeys.REQUIRES_USD_SHADE_ENCAPSULATION]:
if propKey in sdrNodeMetadata:
# Since we want to assign the types for these to bool and
# because in python boolean type is a subset of int, we need to
# do following instead of assign the propValue directly.
propValue = distutils.util.strtobool(sdrNodeMetadata[propKey])
extraPlugInfo[propKey] = bool(propValue)
primSpecCustomData['extraPlugInfo'] = extraPlugInfo
primSpec.customData = primSpecCustomData
doc = sdrNode.GetHelp()
if doc != "":
primSpec.documentation = doc
# gather properties from a prim definition generated by composing apiSchemas
# provided by apiSchemasForAttrPruning metadata.
primDefForAttrPruning = None
if apiSchemasForAttrPruning:
primDefForAttrPruning = usdSchemaReg.BuildComposedPrimDefinition(
typedSchemaForAttrPruning, apiSchemasForAttrPruning)
else:
primDefForAttrPruning = \
usdSchemaReg.FindConcretePrimDefinition(typedSchemaForAttrPruning)
# Create attrSpecs from input parameters
for propName in sdrNode.GetInputNames():
_CreateAttrSpecFromNodeAttribute(primSpec, sdrNode.GetInput(propName),
primDefForAttrPruning, schemaPropertyNSPrefixOverride)
# Create attrSpecs from output parameters
# Note that we always want outputs: namespace prefix for output attributes.
for propName in sdrNode.GetOutputNames():
_CreateAttrSpecFromNodeAttribute(primSpec, sdrNode.GetOutput(propName),
primDefForAttrPruning, UsdShade.Tokens.outputs[:-1], False)
# Create token shaderId attrSpec -- only for shader nodes
if (schemaBaseProvidesConnectability or \
schemaPropertyNSPrefixOverride is None or \
_IsNSPrefixConnectableAPICompliant(schemaPropertyNSPrefixOverride)):
shaderIdAttrName = Sdf.Path.JoinIdentifier( \
[renderContext, sdrNode.GetContext(),
PropertyDefiningKeys.SHADER_ID])
shaderIdAttrSpec = Sdf.AttributeSpec(primSpec, shaderIdAttrName,
Sdf.ValueTypeNames.Token, Sdf.VariabilityUniform)
# Since users shouldn't need to be aware of shaderId attribute, we put
# this in "Internal" displayGroup.
shaderIdAttrSpec.displayGroup = \
PropertyDefiningKeys.INTERNAL_DISPLAY_GROUP
# Use the identifier if explicitly provided, (it could be a shader node
# queried using an explicit path), else use sdrNode's registered
# identifier.
nodeIdentifier = overrideIdentifier if overrideIdentifier else \
sdrNode.GetIdentifier()
shaderIdAttrSpec.default = nodeIdentifier
# Extra attrSpec
schemaBasePrimDefinition = \
Usd.SchemaRegistry().FindConcretePrimDefinition(schemaBase)
if schemaBasePrimDefinition and \
SchemaDefiningMiscConstants.NodeDefAPI in \
schemaBasePrimDefinition.GetAppliedAPISchemas():
infoIdAttrSpec = Sdf.AttributeSpec(primSpec, \
UsdShade.Tokens.infoId, Sdf.ValueTypeNames.Token, \
Sdf.VariabilityUniform)
infoIdAttrSpec.default = nodeIdentifier
schemaLayer.Save()
| 25,069 | Python | 46.212806 | 81 | 0.69201 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdUtils/fixBrokenPixarSchemas.py | #
# Copyright 2022 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
class FixBrokenPixarSchemas(object):
"""
A class which takes a usdLayer and clients can apply appropriate fixes
defined as utility methods of this class, example FixupMaterialBindingAPI.
Every Fixup method iterates on each prim in the layer and applies specific
fixes.
"""
def __init__(self, usdLayer):
self._usdLayer = usdLayer
self._skelBindingAPIProps = None
# Keeps track if the Layer was updated by any of the Fixer method
self._layerUpdated = False
def _ApplyAPI(self, listOp, apiSchema):
if listOp.isExplicit:
items = listOp.explicitItems
items.append(apiSchema)
listOp.explicitItems = items
else:
items = listOp.prependedItems
items.append(apiSchema)
listOp.prependedItems = items
return listOp
def IsLayerUpdated(self):
"""
Returns the update status of the usdLayer, an instance of
FixBrokenPixarSchemas is holding. Fixer methods will set
self._layerUpdated to True if any of the Fixer methods applies fixes to
the layer.
"""
return self._layerUpdated
def FixupMaterialBindingAPI(self):
"""
Makes sure MaterialBindingAPI is applied on the prim, which defines a
material:binding property spec. Marks the layer updated if fixes are
applied.
"""
def _PrimSpecProvidesMaterialBinding(path):
if not path.IsPrimPath():
return
primSpec = self._usdLayer.GetPrimAtPath(path)
hasMaterialBindingRel = \
any(prop.name.startswith("material:binding") \
for prop in primSpec.properties)
apiSchemas = primSpec.GetInfo("apiSchemas")
hasMaterialBindingAPI = "MaterialBindingAPI" in \
apiSchemas.GetAddedOrExplicitItems()
if hasMaterialBindingRel and not hasMaterialBindingAPI:
self._layerUpdated = True
newApiSchemas = self._ApplyAPI(apiSchemas, "MaterialBindingAPI")
primSpec.SetInfo("apiSchemas", newApiSchemas)
self._usdLayer.Traverse("/", _PrimSpecProvidesMaterialBinding)
def FixupSkelBindingAPI(self):
"""
Makes sure SkelBindingAPI is applied on the prim, which defines
appropriate UsdSkel properties which are imparted by SkelBindingAPI.
Marks the layer as updated if fixes are applied.
"""
def _PrimSpecProvidesSkelBindingProperties(path):
if not path.IsPrimPath():
return
# get skelBindingAPI props if not already populated
if not self._skelBindingAPIProps:
from pxr import Usd, UsdSkel
usdSchemaRegistry = Usd.SchemaRegistry()
primDef = usdSchemaRegistry.BuildComposedPrimDefinition("",
["SkelBindingAPI"])
self._skelBindingAPIProps = primDef.GetPropertyNames()
primSpec = self._usdLayer.GetPrimAtPath(path)
primSpecProps = [prop.name for prop in primSpec.properties]
apiSchemas = primSpec.GetInfo("apiSchemas")
hasSkelBindingAPI = "SkelBindingAPI" in \
apiSchemas.GetAddedOrExplicitItems()
for skelProperty in self._skelBindingAPIProps:
if (skelProperty in primSpecProps) and not hasSkelBindingAPI:
self._layerUpdated = True
newApiSchemas = self._ApplyAPI(apiSchemas, "SkelBindingAPI")
primSpec.SetInfo("apiSchemas", newApiSchemas)
return
self._usdLayer.Traverse("/", _PrimSpecProvidesSkelBindingProperties)
def FixupUpAxis(self):
"""
Makes sure the layer specifies a upAxis metadata, and if not upAxis
metadata is set to the default provided by UsdGeom. Marks the layer as
updated if fixes are applied.
"""
from pxr import Usd, UsdGeom
usdStage = Usd.Stage.Open(self._usdLayer)
if not usdStage.HasAuthoredMetadata(UsdGeom.Tokens.upAxis):
self._layerUpdated = True
usdStage.SetMetadata(UsdGeom.Tokens.upAxis,
UsdGeom.GetFallbackUpAxis())
| 5,398 | Python | 40.852713 | 80 | 0.650241 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdUtils/__init__.py | #
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
from pxr import Tf
Tf.PreparePythonModule()
del Tf
from .complianceChecker import ComplianceChecker
from .updateSchemaWithSdrNode import UpdateSchemaWithSdrNode, \
SchemaDefiningKeys, SchemaDefiningMiscConstants, PropertyDefiningKeys
from .fixBrokenPixarSchemas import FixBrokenPixarSchemas
from .usdzUtils import CheckUsdzCompliance, CreateUsdzPackage, \
ExtractUsdzPackage, UsdzAssetIterator
| 1,471 | Python | 42.294116 | 77 | 0.78722 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdUtils/__DOC.py | def Execute(result):
result["CoalescingDiagnosticDelegate"].__doc__ = """
A class which collects warnings and statuses from the Tf diagnostic
manager system in a thread safe manner.
This class allows clients to get both the unfiltered results, as well
as a compressed view which deduplicates diagnostic events by their
source line number, function and file from which they occurred.
"""
result["CoalescingDiagnosticDelegate"].__init__.func_doc = """__init__()
"""
result["CoalescingDiagnosticDelegate"].DumpUncoalescedDiagnostics.func_doc = """DumpUncoalescedDiagnostics(ostr) -> None
Print all pending diagnostics without any coalescing to ``ostr`` .
This method clears the pending diagnostics.
Parameters
----------
ostr : ostream
"""
result["CoalescingDiagnosticDelegate"].TakeCoalescedDiagnostics.func_doc = """TakeCoalescedDiagnostics() -> list[UsdUtilsCoalescingDiagnosticDelegate]
Get all pending diagnostics in a coalesced form.
This method clears the pending diagnostics.
"""
result["CoalescingDiagnosticDelegate"].TakeUncoalescedDiagnostics.func_doc = """TakeUncoalescedDiagnostics() -> list[TfDiagnosticBase]
Get all pending diagnostics without any coalescing.
This method clears the pending diagnostics.
"""
result["CoalescingDiagnosticDelegateItem"].__doc__ = """
An item used in coalesced results, containing a shared component: the
file/function/line number, and a set of unshared components: the call
context and commentary.
"""
result["CoalescingDiagnosticDelegateSharedItem"].__doc__ = """
The shared component in a coalesced result This type can be thought of
as the key by which we coalesce our diagnostics.
"""
result["CoalescingDiagnosticDelegateUnsharedItem"].__doc__ = """
The unshared component in a coalesced result.
"""
result["ConditionalAbortDiagnosticDelegate"].__doc__ = """
A class that allows client application to instantiate a diagnostic
delegate that can be used to abort operations for a non fatal USD
error or warning based on immutable include exclude rules defined for
this instance.
These rules are regex strings where case sensitive matching is done on
error/warning text or the location of the code path where the
error/warning occured. Note that these rules will be respected only
during the lifetime of the delegate. Include Rules determine what
errors or warnings will cause a fatal abort. Exclude Rules determine
what errors or warnings matched from the Include Rules should not
cause the fatal abort. Example: to abort on all errors and warnings
coming from"\\*pxr\\*"codepath but not
from"\\*ConditionalAbortDiagnosticDelegate\\*", a client can create
the following delegate:
.. code-block:: text
UsdUtilsConditionalAbortDiagnosticDelegateErrorFilters includeFilters;
UsdUtilsConditionalAbortDiagnosticDelegateErrorFilters excludeFilters;
includeFilters.SetCodePathFilters({"\\*pxr\\*"});
excludeFilters.SetCodePathFilters({"\\*ConditionalAbortDiagnosticDelegate\\*"});
UsdUtilsConditionalAbortDiagnosticDelegate delegate =
UsdUtilsConditionalAbortDiagnosticDelegate(includeFilters,
excludeFilters);
"""
result["ConditionalAbortDiagnosticDelegate"].__init__.func_doc = """__init__(includeFilters, excludeFilters)
Constructor to initialize conditionalAbortDiagnosticDelegate.
Responsible for adding this delegate instance to TfDiagnosticMgr and
also sets the ``includeFilters`` and ``excludeFilters``
The _includeFilters and _excludeFilters are immutable
Parameters
----------
includeFilters : ConditionalAbortDiagnosticDelegateErrorFilters
excludeFilters : ConditionalAbortDiagnosticDelegateErrorFilters
----------------------------------------------------------------------
__init__()
----------------------------------------------------------------------
__init__(delegate)
Parameters
----------
delegate : ConditionalAbortDiagnosticDelegate
"""
result["ConditionalAbortDiagnosticDelegateErrorFilters"].__doc__ = """
A class which represents the inclusion exclusion filters on which
errors will be matched stringFilters: matching and filtering will be
done on explicit string of the error/warning codePathFilters: matching
and filtering will be done on errors/warnings coming from a specific
usd code path.
"""
result["ConditionalAbortDiagnosticDelegateErrorFilters"].__init__.func_doc = """__init__()
----------------------------------------------------------------------
__init__(stringFilters, codePathFilters)
Parameters
----------
stringFilters : list[str]
codePathFilters : list[str]
"""
result["ConditionalAbortDiagnosticDelegateErrorFilters"].GetStringFilters.func_doc = """GetStringFilters() -> list[str]
"""
result["ConditionalAbortDiagnosticDelegateErrorFilters"].GetCodePathFilters.func_doc = """GetCodePathFilters() -> list[str]
"""
result["ConditionalAbortDiagnosticDelegateErrorFilters"].SetStringFilters.func_doc = """SetStringFilters(stringFilters) -> None
Parameters
----------
stringFilters : list[str]
"""
result["ConditionalAbortDiagnosticDelegateErrorFilters"].SetCodePathFilters.func_doc = """SetCodePathFilters(codePathFilters) -> None
Parameters
----------
codePathFilters : list[str]
"""
result["RegisteredVariantSet"].SelectionExportPolicy.__doc__ = """
This specifies how the variantSet should be treated during export.
Note, in the plugInfo.json, the values for these enum's are
lowerCamelCase.
"""
result["SparseAttrValueWriter"].__doc__ = """
A utility class for authoring time-varying attribute values with
simple run-length encoding, by skipping any redundant time-samples.
Time-samples that are close enough to each other, with relative
difference smaller than a fixed epsilon value are considered to be
equivalent. This is to avoid unnecessary authoring of time-samples
caused by numerical fuzz in certain computations.
For vectors, matrices, and other composite types (like quaternions and
arrays), each component is compared with the corresponding component
for closeness. The chosen epsilon value for double precision floating
point numbers is 1e-12. For single-precision, it is 1e-6 and for half-
precision, it is 1e-2.
Example c++ usage:
.. code-block:: text
UsdGeomSphere sphere = UsdGeomSphere::Define(stage, SdfPath("/Sphere"));
UsdAttribute radius = sphere.CreateRadiusAttr();
UsdUtilsSparseAttrValueWriter attrValueWriter(radius,
/\\*defaultValue\\*/ VtValue(1.0));
attrValueWriter.SetTimeSample(VtValue(10.0), UsdTimeCode(1.0));
attrValueWriter.SetTimeSample(VtValue(10.0), UsdTimeCode(2.0));
attrValueWriter.SetTimeSample(VtValue(10.0), UsdTimeCode(3.0));
attrValueWriter.SetTimeSample(VtValue(20.0), UsdTimeCode(4.0));
Equivalent python example:
.. code-block:: text
sphere = UsdGeom.Sphere.Define(stage, Sdf.Path("/Sphere"))
radius = sphere.CreateRadiusAttr()
attrValueWriter = UsdUtils.SparseAttrValueWriter(radius, defaultValue=1.0)
attrValueWriter.SetTimeSample(10.0, 1.0)
attrValueWriter.SetTimeSample(10.0, 2.0)
attrValueWriter.SetTimeSample(10.0, 3.0)
attrValueWriter.SetTimeSample(20.0, 4.0)
In the above examples, the specified default value of radius (1.0)
will not be authored into scene description since it matches the
fallback value. Additionally, the time-sample authored at time=2.0
will be skipped since it is redundant. Also note that for correct
behavior, the calls to SetTimeSample() must be made with sequentially
increasing time values. If not, a coding error is issued and the
authored animation may be incorrect.
"""
result["SparseAttrValueWriter"].__init__.func_doc = """__init__(attr, defaultValue)
The constructor initializes the data required for run-length encoding
of time-samples.
It also sets the default value of ``attr`` to ``defaultValue`` , if
``defaultValue`` is non-empty and different from the existing default
value of ``attr`` .
``defaultValue`` can be unspecified (or left empty) if you don't care
about authoring a default value. In this case, the sparse authoring
logic is initialized with the existing authored default value or the
fallback value, if ``attr`` has one.
Parameters
----------
attr : Attribute
defaultValue : VtValue
----------------------------------------------------------------------
__init__(attr, defaultValue)
The constructor initializes the data required for run-length encoding
of time-samples.
It also sets the default value of ``attr`` to ``defaultValue`` , if
``defaultValue`` is non-empty and different from the existing default
value of ``attr`` .
It ``defaultValue`` is null or points to an empty VtValue, the sparse
authoring logic is initialized with the existing authored default
value or the fallback value, if ``attr`` has one.
For efficiency, this function swaps out the given ``defaultValue`` ,
leaving it empty.
Parameters
----------
attr : Attribute
defaultValue : VtValue
"""
result["SparseAttrValueWriter"].SetTimeSample.func_doc = """SetTimeSample(value, time) -> bool
Sets a new time-sample on the attribute with given ``value`` at the
given ``time`` .
The time-sample is only authored if it's different from the previously
set time-sample, in which case the previous time-sample is also
authored, in order to to end the previous run of contiguous identical
values and start a new run.
This incurs a copy of ``value`` . Also, the value will be held in
memory at least until the next time-sample is written or until the
SparseAttrValueWriter instance is destroyed.
Parameters
----------
value : VtValue
time : TimeCode
----------------------------------------------------------------------
SetTimeSample(value, time) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
For efficiency, this function swaps out the given ``value`` , leaving
it empty.
The value will be held in memory at least until the next time-sample
is written or until the SparseAttrValueWriter instance is destroyed.
Parameters
----------
value : VtValue
time : TimeCode
"""
result["SparseValueWriter"].__doc__ = """
Utility class that manages sparse authoring of a set of UsdAttributes.
It does this by maintaining a map of UsdAttributes to their
corresponding UsdUtilsSparseAttrValueWriter objects.
To use this class, simply instantiate an instance of it and invoke the
SetAttribute() method with various attributes and their associated
time-samples.
If the attribute has a default value, SetAttribute() must be called
with time=Default first (multiple times, if necessary), followed by
calls to author time-samples in sequentially increasing time order.
This class is not threadsafe. In general, authoring to a single USD
layer from multiple threads isn't threadsafe. Hence, there is little
value in making this class threadsafe. Example c++ usage:
.. code-block:: text
UsdGeomCylinder cylinder = UsdGeomCylinder::Define(stage, SdfPath("/Cylinder"));
UsdAttribute radius = cylinder.CreateRadiusAttr();
UsdAttribute height = cylinder.CreateHeightAttr();
UsdUtilsSparseValueWriter valueWriter;
valueWriter.SetAttribute(radius, 2.0, UsdTimeCode::Default());
valueWriter.SetAttribute(height, 2.0, UsdTimeCode::Default());
valueWriter.SetAttribute(radius, 10.0, UsdTimeCode(1.0));
valueWriter.SetAttribute(radius, 20.0, UsdTimeCode(2.0));
valueWriter.SetAttribute(radius, 20.0, UsdTimeCode(3.0));
valueWriter.SetAttribute(radius, 20.0, UsdTimeCode(4.0));
valueWriter.SetAttribute(height, 2.0, UsdTimeCode(1.0));
valueWriter.SetAttribute(height, 2.0, UsdTimeCode(2.0));
valueWriter.SetAttribute(height, 3.0, UsdTimeCode(3.0));
valueWriter.SetAttribute(height, 3.0, UsdTimeCode(4.0));
Equivalent python code:
.. code-block:: text
cylinder = UsdGeom.Cylinder.Define(stage, Sdf.Path("/Cylinder"))
radius = cylinder.CreateRadiusAttr()
height = cylinder.CreateHeightAttr()
valueWriter = UsdUtils.SparseValueWriter()
valueWriter.SetAttribute(radius, 2.0, Usd.TimeCode.Default())
valueWriter.SetAttribute(height, 2.0, Usd.TimeCode.Default())
valueWriter.SetAttribute(radius, 10.0, 1.0)
valueWriter.SetAttribute(radius, 20.0, 2.0)
valueWriter.SetAttribute(radius, 20.0, 3.0)
valueWriter.SetAttribute(radius, 20.0, 4.0)
valueWriter.SetAttribute(height, 2.0, 1.0)
valueWriter.SetAttribute(height, 2.0, 2.0)
valueWriter.SetAttribute(height, 3.0, 3.0)
valueWriter.SetAttribute(height, 3.0, 4.0)
In the above example,
- The default value of the"height"attribute is not authored into
scene description since it matches the fallback value.
- Time-samples at time=3.0 and time=4.0 will be skipped for the
radius attribute.
- For the"height"attribute, the first timesample at time=1.0 will
be skipped since it matches the default value.
- The last time-sample at time=4.0 will also be skipped
for"height"since it matches the previously written value at time=3.0.
"""
result["SparseValueWriter"].SetAttribute.func_doc = """SetAttribute(attr, value, time) -> bool
Sets the value of ``attr`` to ``value`` at time ``time`` .
The value is written sparsely, i.e., the default value is authored
only if it is different from the fallback value or the existing
default value, and any redundant time-samples are skipped when the
attribute value does not change significantly between consecutive
time-samples.
Parameters
----------
attr : Attribute
value : VtValue
time : TimeCode
----------------------------------------------------------------------
SetAttribute(attr, value, time) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
For efficiency, this function swaps out the given ``value`` , leaving
it empty.
The value will be held in memory at least until the next time-sample
is written or until the SparseAttrValueWriter instance is destroyed.
Parameters
----------
attr : Attribute
value : VtValue
time : TimeCode
----------------------------------------------------------------------
SetAttribute(attr, value, time) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
attr : Attribute
value : T
time : TimeCode
"""
result["SparseValueWriter"].GetSparseAttrValueWriters.func_doc = """GetSparseAttrValueWriters() -> list[SparseAttrValueWriter]
Returns a new vector of UsdUtilsSparseAttrValueWriter populated from
the attrValueWriter map.
"""
result["StageCache"].__doc__ = """
The UsdUtilsStageCache class provides a simple interface for handling
a singleton usd stage cache for use by all USD clients. This way code
from any location can make use of the same cache to maximize stage
reuse.
"""
result["StageCache"].Get.func_doc = """**classmethod** Get() -> StageCache
Returns the singleton stage cache.
"""
result["StageCache"].GetSessionLayerForVariantSelections.func_doc = """**classmethod** GetSessionLayerForVariantSelections(modelName, variantSelections) -> Layer
Given variant selections as a vector of pairs (vector in case order
matters to the client), constructs a session layer with overs on the
given root modelName with the variant selections, or returns a cached
session layer with those opinions.
Parameters
----------
modelName : str
variantSelections : list[tuple[str, str]]
"""
result["TimeCodeRange"].__doc__ = """
Represents a range of UsdTimeCode values as start and end time codes
and a stride value.
A UsdUtilsTimeCodeRange can be iterated to retrieve all time code
values in the range. The range may be empty, it may contain a single
time code, or it may represent multiple time codes from start to end.
The interval defined by the start and end time codes is closed on both
ends.
Note that when constructing a UsdUtilsTimeCodeRange,
UsdTimeCode::EarliestTime() and UsdTimeCode::Default() cannot be used
as the start or end time codes. Also, the end time code cannot be less
than the start time code for positive stride values, and the end time
code cannot be greater than the start time code for negative stride
values. Finally, the stride value cannot be zero. If any of these
conditions are not satisfied, then an invalid empty range will be
returned.
"""
result["TimeCodeRange"].CreateFromFrameSpec.func_doc = """**classmethod** CreateFromFrameSpec(frameSpec) -> TimeCodeRange
Create a time code range from ``frameSpec`` .
A FrameSpec is a compact string representation of a time code range. A
FrameSpec may contain up to three floating point values for the start
time code, end time code, and stride values of a time code range.
A FrameSpec containing just a single floating point value represents a
time code range containing only that time code.
A FrameSpec containing two floating point values separated by the
range separator (':') represents a time code range from the first
value as the start time code to the second values as the end time
code.
A FrameSpec that specifies both a start and end time code value may
also optionally specify a third floating point value as the stride,
separating it from the first two values using the stride separator
('x').
The following are examples of valid FrameSpecs: 123 101:105 105:101
101:109x2 101:110x2 101:104x0.5
An empty string corresponds to an invalid empty time code range.
A coding error will be issued if the given string is malformed.
Parameters
----------
frameSpec : str
"""
result["TimeCodeRange"].__init__.func_doc = """__init__()
Construct an invalid empty range.
The start time code will be initialized to zero, and any iteration of
the range will yield no time codes.
----------------------------------------------------------------------
__init__(timeCode)
Construct a range containing only the given ``timeCode`` .
An iteration of the range will yield only that time code.
Parameters
----------
timeCode : TimeCode
----------------------------------------------------------------------
__init__(startTimeCode, endTimeCode)
Construct a range containing the time codes from ``startTimeCode`` to
``endTimeCode`` .
If ``endTimeCode`` is greater than or equal to ``startTimeCode`` ,
then the stride will be 1.0. Otherwise, the stride will be -1.0.
Parameters
----------
startTimeCode : TimeCode
endTimeCode : TimeCode
----------------------------------------------------------------------
__init__(startTimeCode, endTimeCode, stride)
Construct a range containing the time codes from ``startTimeCode`` to
``endTimeCode`` using the stride value ``stride`` .
UsdTimeCode::EarliestTime() and UsdTimeCode::Default() cannot be used
as ``startTimeCode`` or ``endTimeCode`` . If ``stride`` is a positive
value, then ``endTimeCode`` cannot be less than ``startTimeCode`` . If
``stride`` is a negative value, then ``endTimeCode`` cannot be greater
than ``startTimeCode`` . Finally, the stride value cannot be zero. If
any of these conditions are not satisfied, then a coding error will be
issued and an invalid empty range will be returned.
Parameters
----------
startTimeCode : TimeCode
endTimeCode : TimeCode
stride : float
"""
result["TimeCodeRange"].empty.func_doc = """empty() -> bool
Return true if this range contains no time codes, or false otherwise.
"""
result["TimeCodeRange"].IsValid.func_doc = """IsValid() -> bool
Return true if this range contains one or more time codes, or false
otherwise.
"""
result["TimeCodeRange"].startTimeCode = property(result["TimeCodeRange"].startTimeCode.fget, result["TimeCodeRange"].startTimeCode.fset, result["TimeCodeRange"].startTimeCode.fdel, """type : TimeCode
Return the start time code of this range.
""")
result["TimeCodeRange"].endTimeCode = property(result["TimeCodeRange"].endTimeCode.fget, result["TimeCodeRange"].endTimeCode.fset, result["TimeCodeRange"].endTimeCode.fdel, """type : TimeCode
Return the end time code of this range.
""")
result["TimeCodeRange"].stride = property(result["TimeCodeRange"].stride.fget, result["TimeCodeRange"].stride.fset, result["TimeCodeRange"].stride.fdel, """type : float
Return the stride value of this range.
""") | 20,274 | Python | 27.840683 | 202 | 0.732071 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdUtils/constantsGroup.py | #
# Copyright 2017 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
"""A module for creating groups of constants. This is similar to the enum
module, but enum is not available in Python 2's standard library.
"""
import sys
import types
class _MetaConstantsGroup(type):
"""A meta-class which handles the creation and behavior of ConstantsGroups.
"""
def __new__(metacls, cls, bases, classdict):
"""Discover constants and create a new ConstantsGroup class."""
# If this is just the base ConstantsGroup class, simply create it and do
# not search for constants.
if cls == "ConstantsGroup":
return super(_MetaConstantsGroup, metacls).__new__(metacls, cls, bases, classdict)
# Search through the class-level properties and convert them into
# constants.
allConstants = list()
for key, value in classdict.items():
if (key.startswith("_") or isinstance(value, classmethod) or
isinstance(value, staticmethod)):
# Ignore variables which start with an underscore, and
# static/class methods.
pass
else:
# Found a new constant.
allConstants.append(value)
# If the constant is a function/lambda, ensure that it is not
# converted into a method.
if isinstance(value, types.FunctionType):
classdict[key] = staticmethod(value)
# All constants discovered, now create the `_all` property.
classdict["_all"] = tuple(allConstants)
# Finally, create the new ConstantsGroup class.
return super(_MetaConstantsGroup, metacls).__new__(metacls, cls, bases, classdict)
def __setattr__(cls, name, value):
"""Prevent modification of properties after a group is created."""
raise AttributeError("Constant groups cannot be modified.")
def __delattr__(cls, name):
"""Prevent deletion of properties after a group is created."""
raise AttributeError("Constant groups cannot be modified.")
def __len__(self):
"""Get the number of constants in the group."""
return len(self._all)
def __contains__(self, value):
"""Check if a constant exists in the group."""
return (value in self._all)
def __iter__(self):
"""Iterate over each constant in the group."""
return iter(self._all)
# We want to define a ConstantsGroup class that uses _MetaConstantsGroup
# as its metaclass. The syntax for doing so in Python 3 is not backwards
# compatible for Python 2, so we cannot just conditionally define one
# form or the other because that will cause syntax errors when compiling
# this file. To avoid this we add a layer of indirection through exec().
if sys.version_info.major >= 3:
defineConstantsGroup = '''
class ConstantsGroup(object, metaclass=_MetaConstantsGroup):
"""The base constant group class, intended to be inherited by actual groups
of constants.
"""
def __new__(cls, *args, **kwargs):
raise TypeError("ConstantsGroup objects cannot be created.")
'''
else:
defineConstantsGroup = '''
class ConstantsGroup(object):
"""The base constant group class, intended to be inherited by actual groups
of constants.
"""
__metaclass__ = _MetaConstantsGroup
def __new__(cls, *args, **kwargs):
raise TypeError("ConstantsGroup objects cannot be created.")
'''
exec(defineConstantsGroup)
| 4,517 | Python | 38.286956 | 94 | 0.67412 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdUtils/__init__.pyi | from __future__ import annotations
import pxr.UsdUtils._usdUtils
import typing
import Boost.Python
__all__ = [
"AuthorCollection",
"CoalescingDiagnosticDelegate",
"CoalescingDiagnosticDelegateItem",
"CoalescingDiagnosticDelegateSharedItem",
"CoalescingDiagnosticDelegateUnsharedItem",
"ComputeAllDependencies",
"ComputeCollectionIncludesAndExcludes",
"ComputeUsdStageStats",
"ConditionalAbortDiagnosticDelegate",
"ConditionalAbortDiagnosticDelegateErrorFilters",
"CopyLayerMetadata",
"CreateCollections",
"CreateNewARKitUsdzPackage",
"CreateNewUsdzPackage",
"ExtractExternalReferences",
"FlattenLayerStack",
"FlattenLayerStackResolveAssetPath",
"GenerateClipManifestName",
"GenerateClipTopologyName",
"GetAlphaAttributeNameForColor",
"GetDirtyLayers",
"GetMaterialsScopeName",
"GetModelNameFromRootLayer",
"GetPrefName",
"GetPrimAtPathWithForwarding",
"GetPrimaryCameraName",
"GetPrimaryUVSetName",
"GetRegisteredVariantSets",
"ModifyAssetPaths",
"RegisteredVariantSet",
"SparseAttrValueWriter",
"SparseValueWriter",
"StageCache",
"StitchClips",
"StitchClipsManifest",
"StitchClipsTemplate",
"StitchClipsTopology",
"StitchInfo",
"StitchLayers",
"TimeCodeRange",
"UninstancePrimAtPath",
"UsdStageStatsKeys"
]
class CoalescingDiagnosticDelegate(Boost.Python.instance):
"""
A class which collects warnings and statuses from the Tf diagnostic
manager system in a thread safe manner.
This class allows clients to get both the unfiltered results, as well
as a compressed view which deduplicates diagnostic events by their
source line number, function and file from which they occurred.
"""
@staticmethod
def DumpCoalescedDiagnosticsToStderr(*args, **kwargs) -> None: ...
@staticmethod
def DumpCoalescedDiagnosticsToStdout(*args, **kwargs) -> None: ...
@staticmethod
def DumpUncoalescedDiagnostics(ostr) -> None:
"""
DumpUncoalescedDiagnostics(ostr) -> None
Print all pending diagnostics without any coalescing to ``ostr`` .
This method clears the pending diagnostics.
Parameters
----------
ostr : ostream
"""
@staticmethod
def TakeCoalescedDiagnostics() -> list[UsdUtilsCoalescingDiagnosticDelegate]:
"""
TakeCoalescedDiagnostics() -> list[UsdUtilsCoalescingDiagnosticDelegate]
Get all pending diagnostics in a coalesced form.
This method clears the pending diagnostics.
"""
@staticmethod
def TakeUncoalescedDiagnostics() -> list[TfDiagnosticBase]:
"""
TakeUncoalescedDiagnostics() -> list[TfDiagnosticBase]
Get all pending diagnostics without any coalescing.
This method clears the pending diagnostics.
"""
__instance_size__ = 48
pass
class CoalescingDiagnosticDelegateItem(Boost.Python.instance):
"""
An item used in coalesced results, containing a shared component: the
file/function/line number, and a set of unshared components: the call
context and commentary.
"""
@property
def sharedItem(self) -> None:
"""
:type: None
"""
@property
def unsharedItems(self) -> None:
"""
:type: None
"""
pass
class CoalescingDiagnosticDelegateSharedItem(Boost.Python.instance):
"""
The shared component in a coalesced result This type can be thought of
as the key by which we coalesce our diagnostics.
"""
@property
def sourceFileName(self) -> None:
"""
:type: None
"""
@property
def sourceFunction(self) -> None:
"""
:type: None
"""
@property
def sourceLineNumber(self) -> None:
"""
:type: None
"""
pass
class CoalescingDiagnosticDelegateUnsharedItem(Boost.Python.instance):
"""
The unshared component in a coalesced result.
"""
@property
def commentary(self) -> None:
"""
:type: None
"""
@property
def context(self) -> None:
"""
:type: None
"""
pass
class ConditionalAbortDiagnosticDelegate(Boost.Python.instance):
"""
A class that allows client application to instantiate a diagnostic
delegate that can be used to abort operations for a non fatal USD
error or warning based on immutable include exclude rules defined for
this instance.
These rules are regex strings where case sensitive matching is done on
error/warning text or the location of the code path where the
error/warning occured. Note that these rules will be respected only
during the lifetime of the delegate. Include Rules determine what
errors or warnings will cause a fatal abort. Exclude Rules determine
what errors or warnings matched from the Include Rules should not
cause the fatal abort. Example: to abort on all errors and warnings
coming from"\*pxr\*"codepath but not
from"\*ConditionalAbortDiagnosticDelegate\*", a client can create
the following delegate:
.. code-block:: text
UsdUtilsConditionalAbortDiagnosticDelegateErrorFilters includeFilters;
UsdUtilsConditionalAbortDiagnosticDelegateErrorFilters excludeFilters;
includeFilters.SetCodePathFilters({"\*pxr\*"});
excludeFilters.SetCodePathFilters({"\*ConditionalAbortDiagnosticDelegate\*"});
UsdUtilsConditionalAbortDiagnosticDelegate delegate =
UsdUtilsConditionalAbortDiagnosticDelegate(includeFilters,
excludeFilters);
"""
__instance_size__ = 120
pass
class ConditionalAbortDiagnosticDelegateErrorFilters(Boost.Python.instance):
"""
A class which represents the inclusion exclusion filters on which
errors will be matched stringFilters: matching and filtering will be
done on explicit string of the error/warning codePathFilters: matching
and filtering will be done on errors/warnings coming from a specific
usd code path.
"""
@staticmethod
def GetCodePathFilters() -> list[str]:
"""
GetCodePathFilters() -> list[str]
"""
@staticmethod
def GetStringFilters() -> list[str]:
"""
GetStringFilters() -> list[str]
"""
@staticmethod
def SetCodePathFilters(codePathFilters) -> None:
"""
SetCodePathFilters(codePathFilters) -> None
Parameters
----------
codePathFilters : list[str]
"""
@staticmethod
def SetStringFilters(stringFilters) -> None:
"""
SetStringFilters(stringFilters) -> None
Parameters
----------
stringFilters : list[str]
"""
__instance_size__ = 64
pass
class RegisteredVariantSet(Boost.Python.instance):
"""
Info for registered variant set
"""
class SelectionExportPolicy(Boost.Python.enum, int):
"""
This specifies how the variantSet should be treated during export.
Note, in the plugInfo.json, the values for these enum's are
lowerCamelCase.
"""
Always = pxr.UsdUtils.SelectionExportPolicy.Always
IfAuthored = pxr.UsdUtils.SelectionExportPolicy.IfAuthored
Never = pxr.UsdUtils.SelectionExportPolicy.Never
__slots__ = ()
names = {'IfAuthored': pxr.UsdUtils.SelectionExportPolicy.IfAuthored, 'Always': pxr.UsdUtils.SelectionExportPolicy.Always, 'Never': pxr.UsdUtils.SelectionExportPolicy.Never}
values = {1: pxr.UsdUtils.SelectionExportPolicy.IfAuthored, 2: pxr.UsdUtils.SelectionExportPolicy.Always, 0: pxr.UsdUtils.SelectionExportPolicy.Never}
pass
@property
def name(self) -> None:
"""
:type: None
"""
@property
def selectionExportPolicy(self) -> None:
"""
:type: None
"""
pass
class SparseAttrValueWriter(Boost.Python.instance):
"""
A utility class for authoring time-varying attribute values with
simple run-length encoding, by skipping any redundant time-samples.
Time-samples that are close enough to each other, with relative
difference smaller than a fixed epsilon value are considered to be
equivalent. This is to avoid unnecessary authoring of time-samples
caused by numerical fuzz in certain computations.
For vectors, matrices, and other composite types (like quaternions and
arrays), each component is compared with the corresponding component
for closeness. The chosen epsilon value for double precision floating
point numbers is 1e-12. For single-precision, it is 1e-6 and for half-
precision, it is 1e-2.
Example c++ usage:
.. code-block:: text
UsdGeomSphere sphere = UsdGeomSphere::Define(stage, SdfPath("/Sphere"));
UsdAttribute radius = sphere.CreateRadiusAttr();
UsdUtilsSparseAttrValueWriter attrValueWriter(radius,
/\*defaultValue\*/ VtValue(1.0));
attrValueWriter.SetTimeSample(VtValue(10.0), UsdTimeCode(1.0));
attrValueWriter.SetTimeSample(VtValue(10.0), UsdTimeCode(2.0));
attrValueWriter.SetTimeSample(VtValue(10.0), UsdTimeCode(3.0));
attrValueWriter.SetTimeSample(VtValue(20.0), UsdTimeCode(4.0));
Equivalent python example:
.. code-block:: text
sphere = UsdGeom.Sphere.Define(stage, Sdf.Path("/Sphere"))
radius = sphere.CreateRadiusAttr()
attrValueWriter = UsdUtils.SparseAttrValueWriter(radius, defaultValue=1.0)
attrValueWriter.SetTimeSample(10.0, 1.0)
attrValueWriter.SetTimeSample(10.0, 2.0)
attrValueWriter.SetTimeSample(10.0, 3.0)
attrValueWriter.SetTimeSample(20.0, 4.0)
In the above examples, the specified default value of radius (1.0)
will not be authored into scene description since it matches the
fallback value. Additionally, the time-sample authored at time=2.0
will be skipped since it is redundant. Also note that for correct
behavior, the calls to SetTimeSample() must be made with sequentially
increasing time values. If not, a coding error is issued and the
authored animation may be incorrect.
"""
@staticmethod
def SetTimeSample(value, time) -> bool:
"""
SetTimeSample(value, time) -> bool
Sets a new time-sample on the attribute with given ``value`` at the
given ``time`` .
The time-sample is only authored if it's different from the previously
set time-sample, in which case the previous time-sample is also
authored, in order to to end the previous run of contiguous identical
values and start a new run.
This incurs a copy of ``value`` . Also, the value will be held in
memory at least until the next time-sample is written or until the
SparseAttrValueWriter instance is destroyed.
Parameters
----------
value : VtValue
time : TimeCode
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
For efficiency, this function swaps out the given ``value`` , leaving
it empty.
The value will be held in memory at least until the next time-sample
is written or until the SparseAttrValueWriter instance is destroyed.
Parameters
----------
value : VtValue
time : TimeCode
"""
pass
class SparseValueWriter(Boost.Python.instance):
"""
Utility class that manages sparse authoring of a set of UsdAttributes.
It does this by maintaining a map of UsdAttributes to their
corresponding UsdUtilsSparseAttrValueWriter objects.
To use this class, simply instantiate an instance of it and invoke the
SetAttribute() method with various attributes and their associated
time-samples.
If the attribute has a default value, SetAttribute() must be called
with time=Default first (multiple times, if necessary), followed by
calls to author time-samples in sequentially increasing time order.
This class is not threadsafe. In general, authoring to a single USD
layer from multiple threads isn't threadsafe. Hence, there is little
value in making this class threadsafe. Example c++ usage:
.. code-block:: text
UsdGeomCylinder cylinder = UsdGeomCylinder::Define(stage, SdfPath("/Cylinder"));
UsdAttribute radius = cylinder.CreateRadiusAttr();
UsdAttribute height = cylinder.CreateHeightAttr();
UsdUtilsSparseValueWriter valueWriter;
valueWriter.SetAttribute(radius, 2.0, UsdTimeCode::Default());
valueWriter.SetAttribute(height, 2.0, UsdTimeCode::Default());
valueWriter.SetAttribute(radius, 10.0, UsdTimeCode(1.0));
valueWriter.SetAttribute(radius, 20.0, UsdTimeCode(2.0));
valueWriter.SetAttribute(radius, 20.0, UsdTimeCode(3.0));
valueWriter.SetAttribute(radius, 20.0, UsdTimeCode(4.0));
valueWriter.SetAttribute(height, 2.0, UsdTimeCode(1.0));
valueWriter.SetAttribute(height, 2.0, UsdTimeCode(2.0));
valueWriter.SetAttribute(height, 3.0, UsdTimeCode(3.0));
valueWriter.SetAttribute(height, 3.0, UsdTimeCode(4.0));
Equivalent python code:
.. code-block:: text
cylinder = UsdGeom.Cylinder.Define(stage, Sdf.Path("/Cylinder"))
radius = cylinder.CreateRadiusAttr()
height = cylinder.CreateHeightAttr()
valueWriter = UsdUtils.SparseValueWriter()
valueWriter.SetAttribute(radius, 2.0, Usd.TimeCode.Default())
valueWriter.SetAttribute(height, 2.0, Usd.TimeCode.Default())
valueWriter.SetAttribute(radius, 10.0, 1.0)
valueWriter.SetAttribute(radius, 20.0, 2.0)
valueWriter.SetAttribute(radius, 20.0, 3.0)
valueWriter.SetAttribute(radius, 20.0, 4.0)
valueWriter.SetAttribute(height, 2.0, 1.0)
valueWriter.SetAttribute(height, 2.0, 2.0)
valueWriter.SetAttribute(height, 3.0, 3.0)
valueWriter.SetAttribute(height, 3.0, 4.0)
In the above example,
- The default value of the"height"attribute is not authored into
scene description since it matches the fallback value.
- Time-samples at time=3.0 and time=4.0 will be skipped for the
radius attribute.
- For the"height"attribute, the first timesample at time=1.0 will
be skipped since it matches the default value.
- The last time-sample at time=4.0 will also be skipped
for"height"since it matches the previously written value at time=3.0.
"""
@staticmethod
def GetSparseAttrValueWriters() -> list[SparseAttrValueWriter]:
"""
GetSparseAttrValueWriters() -> list[SparseAttrValueWriter]
Returns a new vector of UsdUtilsSparseAttrValueWriter populated from
the attrValueWriter map.
"""
@staticmethod
def SetAttribute(attr, value, time) -> bool:
"""
SetAttribute(attr, value, time) -> bool
Sets the value of ``attr`` to ``value`` at time ``time`` .
The value is written sparsely, i.e., the default value is authored
only if it is different from the fallback value or the existing
default value, and any redundant time-samples are skipped when the
attribute value does not change significantly between consecutive
time-samples.
Parameters
----------
attr : Attribute
value : VtValue
time : TimeCode
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
For efficiency, this function swaps out the given ``value`` , leaving
it empty.
The value will be held in memory at least until the next time-sample
is written or until the SparseAttrValueWriter instance is destroyed.
Parameters
----------
attr : Attribute
value : VtValue
time : TimeCode
----------------------------------------------------------------------
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
----------
attr : Attribute
value : T
time : TimeCode
"""
__instance_size__ = 80
pass
class StageCache(Boost.Python.instance):
"""
The UsdUtilsStageCache class provides a simple interface for handling
a singleton usd stage cache for use by all USD clients. This way code
from any location can make use of the same cache to maximize stage
reuse.
"""
@staticmethod
def Get(*args, **kwargs) -> None:
"""
**classmethod** Get() -> StageCache
Returns the singleton stage cache.
"""
@staticmethod
def GetSessionLayerForVariantSelections(*args, **kwargs) -> None:
"""
**classmethod** GetSessionLayerForVariantSelections(modelName, variantSelections) -> Layer
Given variant selections as a vector of pairs (vector in case order
matters to the client), constructs a session layer with overs on the
given root modelName with the variant selections, or returns a cached
session layer with those opinions.
Parameters
----------
modelName : str
variantSelections : list[tuple[str, str]]
"""
__instance_size__ = 24
pass
class TimeCodeRange(Boost.Python.instance):
"""
Represents a range of UsdTimeCode values as start and end time codes
and a stride value.
A UsdUtilsTimeCodeRange can be iterated to retrieve all time code
values in the range. The range may be empty, it may contain a single
time code, or it may represent multiple time codes from start to end.
The interval defined by the start and end time codes is closed on both
ends.
Note that when constructing a UsdUtilsTimeCodeRange,
UsdTimeCode::EarliestTime() and UsdTimeCode::Default() cannot be used
as the start or end time codes. Also, the end time code cannot be less
than the start time code for positive stride values, and the end time
code cannot be greater than the start time code for negative stride
values. Finally, the stride value cannot be zero. If any of these
conditions are not satisfied, then an invalid empty range will be
returned.
"""
class Tokens(Boost.Python.instance):
EmptyTimeCodeRange = 'NONE'
RangeSeparator = ':'
StrideSeparator = 'x'
pass
class _Iterator(Boost.Python.instance):
pass
@staticmethod
def CreateFromFrameSpec(*args, **kwargs) -> None:
"""
**classmethod** CreateFromFrameSpec(frameSpec) -> TimeCodeRange
Create a time code range from ``frameSpec`` .
A FrameSpec is a compact string representation of a time code range. A
FrameSpec may contain up to three floating point values for the start
time code, end time code, and stride values of a time code range.
A FrameSpec containing just a single floating point value represents a
time code range containing only that time code.
A FrameSpec containing two floating point values separated by the
range separator (':') represents a time code range from the first
value as the start time code to the second values as the end time
code.
A FrameSpec that specifies both a start and end time code value may
also optionally specify a third floating point value as the stride,
separating it from the first two values using the stride separator
('x').
The following are examples of valid FrameSpecs: 123 101:105 105:101
101:109x2 101:110x2 101:104x0.5
An empty string corresponds to an invalid empty time code range.
A coding error will be issued if the given string is malformed.
Parameters
----------
frameSpec : str
"""
@staticmethod
def IsValid() -> bool:
"""
IsValid() -> bool
Return true if this range contains one or more time codes, or false
otherwise.
"""
@staticmethod
def empty() -> bool:
"""
empty() -> bool
Return true if this range contains no time codes, or false otherwise.
"""
@property
def endTimeCode(self) -> None:
"""
type : TimeCode
Return the end time code of this range.
:type: None
"""
@property
def frameSpec(self) -> None:
"""
:type: None
"""
@property
def startTimeCode(self) -> None:
"""
type : TimeCode
Return the start time code of this range.
:type: None
"""
@property
def stride(self) -> None:
"""
type : float
Return the stride value of this range.
:type: None
"""
__instance_size__ = 40
pass
class UsdStageStatsKeys(Boost.Python.instance):
activePrimCount = 'activePrimCount'
approxMemoryInMb = 'approxMemoryInMb'
assetCount = 'assetCount'
inactivePrimCount = 'inactivePrimCount'
instanceCount = 'instanceCount'
instancedModelCount = 'instancedModelCount'
modelCount = 'modelCount'
primCounts = 'primCounts'
primCountsByType = 'primCountsByType'
primary = 'primary'
prototypeCount = 'prototypeCount'
prototypes = 'prototypes'
pureOverCount = 'pureOverCount'
totalInstanceCount = 'totalInstanceCount'
totalPrimCount = 'totalPrimCount'
untyped = 'untyped'
usedLayerCount = 'usedLayerCount'
pass
def AuthorCollection(*args, **kwargs) -> None:
pass
def ComputeAllDependencies(*args, **kwargs) -> None:
pass
def ComputeCollectionIncludesAndExcludes(*args, **kwargs) -> None:
pass
def ComputeUsdStageStats(*args, **kwargs) -> None:
pass
def CopyLayerMetadata(*args, **kwargs) -> None:
pass
def CreateCollections(*args, **kwargs) -> None:
pass
def CreateNewARKitUsdzPackage(*args, **kwargs) -> None:
pass
def CreateNewUsdzPackage(*args, **kwargs) -> None:
pass
def ExtractExternalReferences(*args, **kwargs) -> None:
pass
def FlattenLayerStack(*args, **kwargs) -> None:
pass
def FlattenLayerStackResolveAssetPath(*args, **kwargs) -> None:
pass
def GenerateClipManifestName(*args, **kwargs) -> None:
pass
def GenerateClipTopologyName(*args, **kwargs) -> None:
pass
def GetAlphaAttributeNameForColor(*args, **kwargs) -> None:
pass
def GetDirtyLayers(*args, **kwargs) -> None:
pass
def GetMaterialsScopeName(*args, **kwargs) -> None:
pass
def GetModelNameFromRootLayer(*args, **kwargs) -> None:
pass
def GetPrefName(*args, **kwargs) -> None:
pass
def GetPrimAtPathWithForwarding(*args, **kwargs) -> None:
pass
def GetPrimaryCameraName(*args, **kwargs) -> None:
pass
def GetPrimaryUVSetName(*args, **kwargs) -> None:
pass
def GetRegisteredVariantSets(*args, **kwargs) -> None:
pass
def ModifyAssetPaths(*args, **kwargs) -> None:
pass
def StitchClips(*args, **kwargs) -> None:
pass
def StitchClipsManifest(*args, **kwargs) -> None:
pass
def StitchClipsTemplate(*args, **kwargs) -> None:
pass
def StitchClipsTopology(*args, **kwargs) -> None:
pass
def StitchInfo(*args, **kwargs) -> None:
pass
def StitchLayers(*args, **kwargs) -> None:
pass
def UninstancePrimAtPath(*args, **kwargs) -> None:
pass
__MFB_FULL_PACKAGE_NAME = 'usdUtils'
| 23,828 | unknown | 31.157895 | 181 | 0.662918 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Sdr/__init__.py | #
# Copyright 2018 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
"""Python bindings for libSdr"""
from pxr import Tf
Tf.PreparePythonModule()
del Tf
| 1,145 | Python | 37.199999 | 74 | 0.763319 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Sdr/__DOC.py | def Execute(result):
result["Registry"].__doc__ = """
The shading-specialized version of ``NdrRegistry`` .
"""
result["Registry"].GetShaderNodeByIdentifier.func_doc = """GetShaderNodeByIdentifier(identifier, typePriority) -> ShaderNode
Exactly like ``NdrRegistry::GetNodeByIdentifier()`` , but returns a
``SdrShaderNode`` pointer instead of a ``NdrNode`` pointer.
Parameters
----------
identifier : NdrIdentifier
typePriority : NdrTokenVec
"""
result["Registry"].GetShaderNodeByIdentifierAndType.func_doc = """GetShaderNodeByIdentifierAndType(identifier, nodeType) -> ShaderNode
Exactly like ``NdrRegistry::GetNodeByIdentifierAndType()`` , but
returns a ``SdrShaderNode`` pointer instead of a ``NdrNode`` pointer.
Parameters
----------
identifier : NdrIdentifier
nodeType : str
"""
result["Registry"].GetShaderNodeByName.func_doc = """GetShaderNodeByName(name, typePriority, filter) -> ShaderNode
Exactly like ``NdrRegistry::GetNodeByName()`` , but returns a
``SdrShaderNode`` pointer instead of a ``NdrNode`` pointer.
Parameters
----------
name : str
typePriority : NdrTokenVec
filter : VersionFilter
"""
result["Registry"].GetShaderNodeByNameAndType.func_doc = """GetShaderNodeByNameAndType(name, nodeType, filter) -> ShaderNode
Exactly like ``NdrRegistry::GetNodeByNameAndType()`` , but returns a
``SdrShaderNode`` pointer instead of a ``NdrNode`` pointer.
Parameters
----------
name : str
nodeType : str
filter : VersionFilter
"""
result["Registry"].GetShaderNodeFromAsset.func_doc = """GetShaderNodeFromAsset(shaderAsset, metadata, subIdentifier, sourceType) -> ShaderNode
Wrapper method for NdrRegistry::GetNodeFromAsset() .
Returns a valid SdrShaderNode pointer upon success.
Parameters
----------
shaderAsset : AssetPath
metadata : NdrTokenMap
subIdentifier : str
sourceType : str
"""
result["Registry"].GetShaderNodeFromSourceCode.func_doc = """GetShaderNodeFromSourceCode(sourceCode, sourceType, metadata) -> ShaderNode
Wrapper method for NdrRegistry::GetNodeFromSourceCode() .
Returns a valid SdrShaderNode pointer upon success.
Parameters
----------
sourceCode : str
sourceType : str
metadata : NdrTokenMap
"""
result["Registry"].GetShaderNodesByIdentifier.func_doc = """GetShaderNodesByIdentifier(identifier) -> SdrShaderNodePtrVec
Exactly like ``NdrRegistry::GetNodesByIdentifier()`` , but returns a
vector of ``SdrShaderNode`` pointers instead of a vector of
``NdrNode`` pointers.
Parameters
----------
identifier : NdrIdentifier
"""
result["Registry"].GetShaderNodesByName.func_doc = """GetShaderNodesByName(name, filter) -> SdrShaderNodePtrVec
Exactly like ``NdrRegistry::GetNodesByName()`` , but returns a vector
of ``SdrShaderNode`` pointers instead of a vector of ``NdrNode``
pointers.
Parameters
----------
name : str
filter : VersionFilter
"""
result["Registry"].GetShaderNodesByFamily.func_doc = """GetShaderNodesByFamily(family, filter) -> SdrShaderNodePtrVec
Exactly like ``NdrRegistry::GetNodesByFamily()`` , but returns a
vector of ``SdrShaderNode`` pointers instead of a vector of
``NdrNode`` pointers.
Parameters
----------
family : str
filter : VersionFilter
"""
result["Registry"].__init__.func_doc = """__init__()
"""
result["ShaderNode"].__doc__ = """
A specialized version of ``NdrNode`` which holds shading information.
"""
result["ShaderNode"].GetShaderInput.func_doc = """GetShaderInput(inputName) -> ShaderProperty
Get a shader input property by name.
``nullptr`` is returned if an input with the given name does not
exist.
Parameters
----------
inputName : str
"""
result["ShaderNode"].GetShaderOutput.func_doc = """GetShaderOutput(outputName) -> ShaderProperty
Get a shader output property by name.
``nullptr`` is returned if an output with the given name does not
exist.
Parameters
----------
outputName : str
"""
result["ShaderNode"].GetAssetIdentifierInputNames.func_doc = """GetAssetIdentifierInputNames() -> NdrTokenVec
Returns the list of all inputs that are tagged as asset identifier
inputs.
"""
result["ShaderNode"].GetDefaultInput.func_doc = """GetDefaultInput() -> ShaderProperty
Returns the first shader input that is tagged as the default input.
A default input and its value can be used to acquire a fallback value
for a node when the node is considered'disabled'or otherwise incapable
of producing an output value.
"""
result["ShaderNode"].GetLabel.func_doc = """GetLabel() -> str
The label assigned to this node, if any.
Distinct from the name returned from ``GetName()`` . In the context of
a UI, the label value might be used as the display name for the node
instead of the name.
"""
result["ShaderNode"].GetCategory.func_doc = """GetCategory() -> str
The category assigned to this node, if any.
Distinct from the family returned from ``GetFamily()`` .
"""
result["ShaderNode"].GetRole.func_doc = """GetRole() -> str
Returns the role of this node.
This is used to annotate the role that the shader node plays inside a
shader network. We can tag certain shaders to indicate their role
within a shading network. We currently tag primvar reading nodes,
texture reading nodes and nodes that access volume fields (like
extinction or scattering). This is done to identify resources used by
a shading network.
"""
result["ShaderNode"].GetHelp.func_doc = """GetHelp() -> str
The help message assigned to this node, if any.
"""
result["ShaderNode"].GetDepartments.func_doc = """GetDepartments() -> NdrTokenVec
The departments this node is associated with, if any.
"""
result["ShaderNode"].GetPages.func_doc = """GetPages() -> NdrTokenVec
Gets the pages on which the node's properties reside (an aggregate of
the unique ``SdrShaderProperty::GetPage()`` values for all of the
node's properties).
Nodes themselves do not reside on pages. In an example scenario,
properties might be divided into two pages,'Simple'and'Advanced'.
"""
result["ShaderNode"].GetPrimvars.func_doc = """GetPrimvars() -> NdrTokenVec
The list of primvars this node knows it requires / uses.
For example, a shader node may require the'normals'primvar to function
correctly. Additional, user specified primvars may have been authored
on the node. These can be queried via
``GetAdditionalPrimvarProperties()`` . Together, ``GetPrimvars()`` and
``GetAdditionalPrimvarProperties()`` , provide the complete list of
primvar requirements for the node.
"""
result["ShaderNode"].GetAdditionalPrimvarProperties.func_doc = """GetAdditionalPrimvarProperties() -> NdrTokenVec
The list of string input properties whose values provide the names of
additional primvars consumed by this node.
For example, this may return a token named ``varname`` . This
indicates that the client should query the value of a (presumed to be
string-valued) input attribute named varname from its scene
description to determine the name of a primvar the node will consume.
See ``GetPrimvars()`` for additional information.
"""
result["ShaderNode"].GetImplementationName.func_doc = """GetImplementationName() -> str
Returns the implementation name of this node.
The name of the node is how to refer to the node in shader networks.
The label is how to present this node to users. The implementation
name is the name of the function (or something) this node represents
in the implementation. Any client using the implementation **must**
call this method to get the correct name; using ``getName()`` is not
correct.
"""
result["ShaderNode"].GetPropertyNamesForPage.func_doc = """GetPropertyNamesForPage(pageName) -> NdrTokenVec
Gets the names of the properties on a certain page (one that was
returned by ``GetPages()`` ).
To get properties that are not assigned to a page, an empty string can
be used for ``pageName`` .
Parameters
----------
pageName : str
"""
result["ShaderNode"].GetAllVstructNames.func_doc = """GetAllVstructNames() -> NdrTokenVec
Gets all vstructs that are present in the shader.
"""
result["ShaderProperty"].__doc__ = """
A specialized version of ``NdrProperty`` which holds shading
information.
"""
result["ShaderProperty"].GetLabel.func_doc = """GetLabel() -> str
The label assigned to this property, if any.
Distinct from the name returned from ``GetName()`` . In the context of
a UI, the label value might be used as the display name for the
property instead of the name.
"""
result["ShaderProperty"].GetHelp.func_doc = """GetHelp() -> str
The help message assigned to this property, if any.
"""
result["ShaderProperty"].GetPage.func_doc = """GetPage() -> str
The page (group), eg"Advanced", this property appears on, if any.
Note that the page for a shader property can be nested, delimited
by":", representing the hierarchy of sub-pages a property is defined
in.
"""
result["ShaderProperty"].GetWidget.func_doc = """GetWidget() -> str
The widget"hint"that indicates the widget that can best display the
type of data contained in this property, if any.
Examples of this value could include"number","slider", etc.
"""
result["ShaderProperty"].GetHints.func_doc = """GetHints() -> NdrTokenMap
Any UI"hints"that are associated with this property.
"Hints"are simple key/value pairs.
"""
result["ShaderProperty"].GetOptions.func_doc = """GetOptions() -> NdrOptionVec
If the property has a set of valid values that are pre-determined,
this will return the valid option names and corresponding string
values (if the option was specified with a value).
"""
result["ShaderProperty"].GetImplementationName.func_doc = """GetImplementationName() -> str
Returns the implementation name of this property.
The name of the property is how to refer to the property in shader
networks. The label is how to present this property to users. The
implementation name is the name of the parameter this property
represents in the implementation. Any client using the implementation
**must** call this method to get the correct name; using ``getName()``
is not correct.
"""
result["ShaderProperty"].GetVStructMemberOf.func_doc = """GetVStructMemberOf() -> str
If this field is part of a vstruct, this is the name of the struct.
"""
result["ShaderProperty"].GetVStructMemberName.func_doc = """GetVStructMemberName() -> str
If this field is part of a vstruct, this is its name in the struct.
"""
result["ShaderProperty"].IsVStructMember.func_doc = """IsVStructMember() -> bool
Returns true if this field is part of a vstruct.
"""
result["ShaderProperty"].IsVStruct.func_doc = """IsVStruct() -> bool
Returns true if the field is the head of a vstruct.
"""
result["ShaderProperty"].GetVStructConditionalExpr.func_doc = """GetVStructConditionalExpr() -> str
If this field is part of a vstruct, this is the conditional
expression.
"""
result["ShaderProperty"].IsConnectable.func_doc = """IsConnectable() -> bool
Whether this property can be connected to other properties.
If this returns ``true`` , connectability to a specific property can
be tested via ``CanConnectTo()`` .
"""
result["ShaderProperty"].GetValidConnectionTypes.func_doc = """GetValidConnectionTypes() -> NdrTokenVec
Gets the list of valid connection types for this property.
This value comes from shader metadata, and may not be specified. The
value from ``NdrProperty::GetType()`` can be used as a fallback, or
you can use the connectability test in ``CanConnectTo()`` .
"""
result["ShaderProperty"].CanConnectTo.func_doc = """CanConnectTo(other) -> bool
Determines if this property can be connected to the specified
property.
Parameters
----------
other : Property
"""
result["ShaderProperty"].GetTypeAsSdfType.func_doc = """GetTypeAsSdfType() -> NdrSdfTypeIndicator
Converts the property's type from ``GetType()`` into a
``SdfValueTypeName`` .
Two scenarios can result: an exact mapping from property type to Sdf
type, and an inexact mapping. In the first scenario, the first element
in the pair will be the cleanly-mapped Sdf type, and the second
element, a TfToken, will be empty. In the second scenario, the Sdf
type will be set to ``Token`` to indicate an unclean mapping, and the
second element will be set to the original type returned by
``GetType()`` .
GetDefaultValueAsSdfType
"""
result["ShaderProperty"].GetDefaultValueAsSdfType.func_doc = """GetDefaultValueAsSdfType() -> VtValue
Accessor for default value corresponding to the SdfValueTypeName
returned by GetTypeAsSdfType.
Note that this is different than GetDefaultValue which returns the
default value associated with the SdrPropertyType and may differ from
the SdfValueTypeName, example when sdrUsdDefinitionType metadata is
specified for a sdr property.
GetTypeAsSdfType
"""
result["ShaderProperty"].IsAssetIdentifier.func_doc = """IsAssetIdentifier() -> bool
Determines if the value held by this property is an asset identifier
(eg, a file path); the logic for this is left up to the parser.
Note: The type returned from ``GetTypeAsSdfType()`` will be ``Asset``
if this method returns ``true`` (even though its true underlying data
type is string).
"""
result["ShaderProperty"].IsDefaultInput.func_doc = """IsDefaultInput() -> bool
Determines if the value held by this property is the default input for
this node.
""" | 13,369 | Python | 21.738095 | 145 | 0.735582 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Sdr/__init__.pyi | from __future__ import annotations
import pxr.Sdr._sdr
import typing
import Boost.Python
import pxr.Ndr
__all__ = [
"NodeContext",
"NodeMetadata",
"NodeRole",
"PropertyMetadata",
"PropertyRole",
"PropertyTypes",
"Registry",
"ShaderNode",
"ShaderNodeList",
"ShaderProperty"
]
class NodeContext(Boost.Python.instance):
Displacement = 'displacement'
Light = 'light'
LightFilter = 'lightFilter'
Pattern = 'pattern'
PixelFilter = 'pixelFilter'
SampleFilter = 'sampleFilter'
Surface = 'surface'
Volume = 'volume'
pass
class NodeMetadata(Boost.Python.instance):
Category = 'category'
Departments = 'departments'
Help = 'help'
ImplementationName = '__SDR__implementationName'
Label = 'label'
Pages = 'pages'
Primvars = 'primvars'
Role = 'role'
SdrDefinitionNameFallbackPrefix = 'sdrDefinitionNameFallbackPrefix'
SdrUsdEncodingVersion = 'sdrUsdEncodingVersion'
Target = '__SDR__target'
pass
class NodeRole(Boost.Python.instance):
Field = 'field'
Math = 'math'
Primvar = 'primvar'
Texture = 'texture'
pass
class PropertyMetadata(Boost.Python.instance):
Colorspace = '__SDR__colorspace'
Connectable = 'connectable'
DefaultInput = '__SDR__defaultinput'
Help = 'help'
Hints = 'hints'
ImplementationName = '__SDR__implementationName'
IsAssetIdentifier = '__SDR__isAssetIdentifier'
IsDynamicArray = 'isDynamicArray'
Label = 'label'
Options = 'options'
Page = 'page'
RenderType = 'renderType'
Role = 'role'
SdrUsdDefinitionType = 'sdrUsdDefinitionType'
Target = '__SDR__target'
ValidConnectionTypes = 'validConnectionTypes'
VstructConditionalExpr = 'vstructConditionalExpr'
VstructMemberName = 'vstructMemberName'
VstructMemberOf = 'vstructMemberOf'
Widget = 'widget'
pass
class PropertyRole(Boost.Python.instance):
None = 'none'
pass
class PropertyTypes(Boost.Python.instance):
Color = 'color'
Color4 = 'color4'
Float = 'float'
Int = 'int'
Matrix = 'matrix'
Normal = 'normal'
Point = 'point'
String = 'string'
Struct = 'struct'
Terminal = 'terminal'
Unknown = 'unknown'
Vector = 'vector'
Vstruct = 'vstruct'
pass
class Registry(Boost.Python.instance):
"""
The shading-specialized version of ``NdrRegistry`` .
"""
@staticmethod
def GetShaderNodeByIdentifier(identifier, typePriority) -> ShaderNode:
"""
GetShaderNodeByIdentifier(identifier, typePriority) -> ShaderNode
Exactly like ``NdrRegistry::GetNodeByIdentifier()`` , but returns a
``SdrShaderNode`` pointer instead of a ``NdrNode`` pointer.
Parameters
----------
identifier : NdrIdentifier
typePriority : NdrTokenVec
"""
@staticmethod
def GetShaderNodeByIdentifierAndType(identifier, nodeType) -> ShaderNode:
"""
GetShaderNodeByIdentifierAndType(identifier, nodeType) -> ShaderNode
Exactly like ``NdrRegistry::GetNodeByIdentifierAndType()`` , but
returns a ``SdrShaderNode`` pointer instead of a ``NdrNode`` pointer.
Parameters
----------
identifier : NdrIdentifier
nodeType : str
"""
@staticmethod
def GetShaderNodeByName(name, typePriority, filter) -> ShaderNode:
"""
GetShaderNodeByName(name, typePriority, filter) -> ShaderNode
Exactly like ``NdrRegistry::GetNodeByName()`` , but returns a
``SdrShaderNode`` pointer instead of a ``NdrNode`` pointer.
Parameters
----------
name : str
typePriority : NdrTokenVec
filter : VersionFilter
"""
@staticmethod
def GetShaderNodeByNameAndType(name, nodeType, filter) -> ShaderNode:
"""
GetShaderNodeByNameAndType(name, nodeType, filter) -> ShaderNode
Exactly like ``NdrRegistry::GetNodeByNameAndType()`` , but returns a
``SdrShaderNode`` pointer instead of a ``NdrNode`` pointer.
Parameters
----------
name : str
nodeType : str
filter : VersionFilter
"""
@staticmethod
def GetShaderNodeFromAsset(shaderAsset, metadata, subIdentifier, sourceType) -> ShaderNode:
"""
GetShaderNodeFromAsset(shaderAsset, metadata, subIdentifier, sourceType) -> ShaderNode
Wrapper method for NdrRegistry::GetNodeFromAsset() .
Returns a valid SdrShaderNode pointer upon success.
Parameters
----------
shaderAsset : AssetPath
metadata : NdrTokenMap
subIdentifier : str
sourceType : str
"""
@staticmethod
def GetShaderNodeFromSourceCode(sourceCode, sourceType, metadata) -> ShaderNode:
"""
GetShaderNodeFromSourceCode(sourceCode, sourceType, metadata) -> ShaderNode
Wrapper method for NdrRegistry::GetNodeFromSourceCode() .
Returns a valid SdrShaderNode pointer upon success.
Parameters
----------
sourceCode : str
sourceType : str
metadata : NdrTokenMap
"""
@staticmethod
def GetShaderNodesByFamily(family, filter) -> SdrShaderNodePtrVec:
"""
GetShaderNodesByFamily(family, filter) -> SdrShaderNodePtrVec
Exactly like ``NdrRegistry::GetNodesByFamily()`` , but returns a
vector of ``SdrShaderNode`` pointers instead of a vector of
``NdrNode`` pointers.
Parameters
----------
family : str
filter : VersionFilter
"""
@staticmethod
def GetShaderNodesByIdentifier(identifier) -> SdrShaderNodePtrVec:
"""
GetShaderNodesByIdentifier(identifier) -> SdrShaderNodePtrVec
Exactly like ``NdrRegistry::GetNodesByIdentifier()`` , but returns a
vector of ``SdrShaderNode`` pointers instead of a vector of
``NdrNode`` pointers.
Parameters
----------
identifier : NdrIdentifier
"""
@staticmethod
def GetShaderNodesByName(name, filter) -> SdrShaderNodePtrVec:
"""
GetShaderNodesByName(name, filter) -> SdrShaderNodePtrVec
Exactly like ``NdrRegistry::GetNodesByName()`` , but returns a vector
of ``SdrShaderNode`` pointers instead of a vector of ``NdrNode``
pointers.
Parameters
----------
name : str
filter : VersionFilter
"""
@property
def expired(self) -> None:
"""
True if this object has expired, False otherwise.
:type: None
"""
pass
class ShaderNode(pxr.Ndr.Node, Boost.Python.instance):
"""
A specialized version of ``NdrNode`` which holds shading information.
"""
@staticmethod
def GetAdditionalPrimvarProperties() -> NdrTokenVec:
"""
GetAdditionalPrimvarProperties() -> NdrTokenVec
The list of string input properties whose values provide the names of
additional primvars consumed by this node.
For example, this may return a token named ``varname`` . This
indicates that the client should query the value of a (presumed to be
string-valued) input attribute named varname from its scene
description to determine the name of a primvar the node will consume.
See ``GetPrimvars()`` for additional information.
"""
@staticmethod
def GetAllVstructNames() -> NdrTokenVec:
"""
GetAllVstructNames() -> NdrTokenVec
Gets all vstructs that are present in the shader.
"""
@staticmethod
def GetAssetIdentifierInputNames() -> NdrTokenVec:
"""
GetAssetIdentifierInputNames() -> NdrTokenVec
Returns the list of all inputs that are tagged as asset identifier
inputs.
"""
@staticmethod
def GetCategory() -> str:
"""
GetCategory() -> str
The category assigned to this node, if any.
Distinct from the family returned from ``GetFamily()`` .
"""
@staticmethod
def GetDefaultInput() -> ShaderProperty:
"""
GetDefaultInput() -> ShaderProperty
Returns the first shader input that is tagged as the default input.
A default input and its value can be used to acquire a fallback value
for a node when the node is considered'disabled'or otherwise incapable
of producing an output value.
"""
@staticmethod
def GetDepartments() -> NdrTokenVec:
"""
GetDepartments() -> NdrTokenVec
The departments this node is associated with, if any.
"""
@staticmethod
def GetHelp() -> str:
"""
GetHelp() -> str
The help message assigned to this node, if any.
"""
@staticmethod
def GetImplementationName() -> str:
"""
GetImplementationName() -> str
Returns the implementation name of this node.
The name of the node is how to refer to the node in shader networks.
The label is how to present this node to users. The implementation
name is the name of the function (or something) this node represents
in the implementation. Any client using the implementation **must**
call this method to get the correct name; using ``getName()`` is not
correct.
"""
@staticmethod
def GetLabel() -> str:
"""
GetLabel() -> str
The label assigned to this node, if any.
Distinct from the name returned from ``GetName()`` . In the context of
a UI, the label value might be used as the display name for the node
instead of the name.
"""
@staticmethod
def GetPages() -> NdrTokenVec:
"""
GetPages() -> NdrTokenVec
Gets the pages on which the node's properties reside (an aggregate of
the unique ``SdrShaderProperty::GetPage()`` values for all of the
node's properties).
Nodes themselves do not reside on pages. In an example scenario,
properties might be divided into two pages,'Simple'and'Advanced'.
"""
@staticmethod
def GetPrimvars() -> NdrTokenVec:
"""
GetPrimvars() -> NdrTokenVec
The list of primvars this node knows it requires / uses.
For example, a shader node may require the'normals'primvar to function
correctly. Additional, user specified primvars may have been authored
on the node. These can be queried via
``GetAdditionalPrimvarProperties()`` . Together, ``GetPrimvars()`` and
``GetAdditionalPrimvarProperties()`` , provide the complete list of
primvar requirements for the node.
"""
@staticmethod
def GetPropertyNamesForPage(pageName) -> NdrTokenVec:
"""
GetPropertyNamesForPage(pageName) -> NdrTokenVec
Gets the names of the properties on a certain page (one that was
returned by ``GetPages()`` ).
To get properties that are not assigned to a page, an empty string can
be used for ``pageName`` .
Parameters
----------
pageName : str
"""
@staticmethod
def GetRole() -> str:
"""
GetRole() -> str
Returns the role of this node.
This is used to annotate the role that the shader node plays inside a
shader network. We can tag certain shaders to indicate their role
within a shading network. We currently tag primvar reading nodes,
texture reading nodes and nodes that access volume fields (like
extinction or scattering). This is done to identify resources used by
a shading network.
"""
@staticmethod
def GetShaderInput(inputName) -> ShaderProperty:
"""
GetShaderInput(inputName) -> ShaderProperty
Get a shader input property by name.
``nullptr`` is returned if an input with the given name does not
exist.
Parameters
----------
inputName : str
"""
@staticmethod
def GetShaderOutput(outputName) -> ShaderProperty:
"""
GetShaderOutput(outputName) -> ShaderProperty
Get a shader output property by name.
``nullptr`` is returned if an output with the given name does not
exist.
Parameters
----------
outputName : str
"""
pass
class ShaderNodeList(Boost.Python.instance):
@staticmethod
def append(*args, **kwargs) -> None: ...
@staticmethod
def extend(*args, **kwargs) -> None: ...
__instance_size__ = 40
pass
class ShaderProperty(pxr.Ndr.Property, Boost.Python.instance):
"""
A specialized version of ``NdrProperty`` which holds shading
information.
"""
@staticmethod
def GetDefaultValueAsSdfType() -> VtValue:
"""
GetDefaultValueAsSdfType() -> VtValue
Accessor for default value corresponding to the SdfValueTypeName
returned by GetTypeAsSdfType.
Note that this is different than GetDefaultValue which returns the
default value associated with the SdrPropertyType and may differ from
the SdfValueTypeName, example when sdrUsdDefinitionType metadata is
specified for a sdr property.
GetTypeAsSdfType
"""
@staticmethod
def GetHelp() -> str:
"""
GetHelp() -> str
The help message assigned to this property, if any.
"""
@staticmethod
def GetHints() -> NdrTokenMap:
"""
GetHints() -> NdrTokenMap
Any UI"hints"that are associated with this property.
"Hints"are simple key/value pairs.
"""
@staticmethod
def GetImplementationName() -> str:
"""
GetImplementationName() -> str
Returns the implementation name of this property.
The name of the property is how to refer to the property in shader
networks. The label is how to present this property to users. The
implementation name is the name of the parameter this property
represents in the implementation. Any client using the implementation
**must** call this method to get the correct name; using ``getName()``
is not correct.
"""
@staticmethod
def GetLabel() -> str:
"""
GetLabel() -> str
The label assigned to this property, if any.
Distinct from the name returned from ``GetName()`` . In the context of
a UI, the label value might be used as the display name for the
property instead of the name.
"""
@staticmethod
def GetOptions() -> NdrOptionVec:
"""
GetOptions() -> NdrOptionVec
If the property has a set of valid values that are pre-determined,
this will return the valid option names and corresponding string
values (if the option was specified with a value).
"""
@staticmethod
def GetPage() -> str:
"""
GetPage() -> str
The page (group), eg"Advanced", this property appears on, if any.
Note that the page for a shader property can be nested, delimited
by":", representing the hierarchy of sub-pages a property is defined
in.
"""
@staticmethod
def GetVStructConditionalExpr() -> str:
"""
GetVStructConditionalExpr() -> str
If this field is part of a vstruct, this is the conditional
expression.
"""
@staticmethod
def GetVStructMemberName() -> str:
"""
GetVStructMemberName() -> str
If this field is part of a vstruct, this is its name in the struct.
"""
@staticmethod
def GetVStructMemberOf() -> str:
"""
GetVStructMemberOf() -> str
If this field is part of a vstruct, this is the name of the struct.
"""
@staticmethod
def GetValidConnectionTypes() -> NdrTokenVec:
"""
GetValidConnectionTypes() -> NdrTokenVec
Gets the list of valid connection types for this property.
This value comes from shader metadata, and may not be specified. The
value from ``NdrProperty::GetType()`` can be used as a fallback, or
you can use the connectability test in ``CanConnectTo()`` .
"""
@staticmethod
def GetWidget() -> str:
"""
GetWidget() -> str
The widget"hint"that indicates the widget that can best display the
type of data contained in this property, if any.
Examples of this value could include"number","slider", etc.
"""
@staticmethod
def IsAssetIdentifier() -> bool:
"""
IsAssetIdentifier() -> bool
Determines if the value held by this property is an asset identifier
(eg, a file path); the logic for this is left up to the parser.
Note: The type returned from ``GetTypeAsSdfType()`` will be ``Asset``
if this method returns ``true`` (even though its true underlying data
type is string).
"""
@staticmethod
def IsDefaultInput() -> bool:
"""
IsDefaultInput() -> bool
Determines if the value held by this property is the default input for
this node.
"""
@staticmethod
def IsVStruct() -> bool:
"""
IsVStruct() -> bool
Returns true if the field is the head of a vstruct.
"""
@staticmethod
def IsVStructMember() -> bool:
"""
IsVStructMember() -> bool
Returns true if this field is part of a vstruct.
"""
pass
__MFB_FULL_PACKAGE_NAME = 'sdr'
| 17,772 | unknown | 26.05175 | 96 | 0.617263 |
omniverse-code/kit/exts/omni.usd.libs/pxr/Sdr/shaderParserTestUtils.py | #!/pxrpythonsubst
#
# Copyright 2018 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
"""
Common utilities that shader-based parser plugins can use in their tests.
This is mostly focused on dealing with OSL and Args files. This may need to be
expanded/generalized to accommodate other types in the future.
"""
from __future__ import print_function
from pxr import Ndr
from pxr import Sdr
from pxr.Sdf import ValueTypeNames as SdfTypes
from pxr import Tf
def IsNodeOSL(node):
"""
Determines if the given node has an OSL source type.
"""
return node.GetSourceType() == "OSL"
# XXX Maybe rename this to GetSdfType (as opposed to the Sdr type)
def GetType(property):
"""
Given a property (SdrShaderProperty), return the SdfValueTypeName type.
"""
sdfTypeIndicator = property.GetTypeAsSdfType()
sdfValueTypeName = sdfTypeIndicator[0]
tfType = sdfValueTypeName.type
return tfType
def TestBasicProperties(node):
"""
Test the correctness of the properties on the specified node (only the
non-shading-specific aspects).
"""
isOSL = IsNodeOSL(node)
# Data that varies between OSL/Args
# --------------------------------------------------------------------------
metadata = {
"widget": "number",
"label": "inputA label",
"page": "inputs1",
"help": "inputA help message",
"uncategorized": "1"
}
if not isOSL:
metadata["name"] = "inputA"
metadata["default"] = "0.0"
metadata["type"] = "float"
# --------------------------------------------------------------------------
properties = {
"inputA": node.GetInput("inputA"),
"inputB": node.GetInput("inputB"),
"inputC": node.GetInput("inputC"),
"inputD": node.GetInput("inputD"),
"inputF2": node.GetInput("inputF2"),
"inputStrArray": node.GetInput("inputStrArray"),
"resultF": node.GetOutput("resultF"),
"resultI": node.GetOutput("resultI"),
}
assert properties["inputA"].GetName() == "inputA"
assert properties["inputA"].GetType() == "float"
assert properties["inputA"].GetDefaultValue() == 0.0
assert not properties["inputA"].IsOutput()
assert not properties["inputA"].IsArray()
assert not properties["inputA"].IsDynamicArray()
assert properties["inputA"].GetArraySize() == 0
assert properties["inputA"].GetInfoString() == "inputA (type: 'float'); input"
assert properties["inputA"].IsConnectable()
assert properties["inputA"].CanConnectTo(properties["resultF"])
assert not properties["inputA"].CanConnectTo(properties["resultI"])
assert properties["inputA"].GetMetadata() == metadata
# --------------------------------------------------------------------------
# Check some array variations
# --------------------------------------------------------------------------
assert properties["inputD"].IsDynamicArray()
assert properties["inputD"].GetArraySize() == 1 if isOSL else -1
assert properties["inputD"].IsArray()
assert list(properties["inputD"].GetDefaultValue()) == [1]
assert not properties["inputF2"].IsDynamicArray()
assert properties["inputF2"].GetArraySize() == 2
assert properties["inputF2"].IsArray()
assert not properties["inputF2"].IsConnectable()
assert list(properties["inputF2"].GetDefaultValue()) == [1.0, 2.0]
assert properties["inputStrArray"].GetArraySize() == 4
assert list(properties["inputStrArray"].GetDefaultValue()) == \
["test", "string", "array", "values"]
def TestShadingProperties(node):
"""
Test the correctness of the properties on the specified node (only the
shading-specific aspects).
"""
isOSL = IsNodeOSL(node)
properties = {
"inputA": node.GetShaderInput("inputA"),
"inputB": node.GetShaderInput("inputB"),
"inputC": node.GetShaderInput("inputC"),
"inputD": node.GetShaderInput("inputD"),
"inputF2": node.GetShaderInput("inputF2"),
"inputF3": node.GetShaderInput("inputF3"),
"inputF4": node.GetShaderInput("inputF4"),
"inputF5": node.GetShaderInput("inputF5"),
"inputInterp": node.GetShaderInput("inputInterp"),
"inputOptions": node.GetShaderInput("inputOptions"),
"inputPoint": node.GetShaderInput("inputPoint"),
"inputNormal": node.GetShaderInput("inputNormal"),
"inputStruct": node.GetShaderInput("inputStruct"),
"inputAssetIdentifier": node.GetShaderInput("inputAssetIdentifier"),
"resultF": node.GetShaderOutput("resultF"),
"resultF2": node.GetShaderOutput("resultF2"),
"resultF3": node.GetShaderOutput("resultF3"),
"resultI": node.GetShaderOutput("resultI"),
"vstruct1": node.GetShaderOutput("vstruct1"),
"vstruct1_bump": node.GetShaderOutput("vstruct1_bump"),
"outputPoint": node.GetShaderOutput("outputPoint"),
"outputNormal": node.GetShaderOutput("outputNormal"),
"outputColor": node.GetShaderOutput("outputColor"),
"outputVector": node.GetShaderOutput("outputVector"),
}
assert properties["inputA"].GetLabel() == "inputA label"
assert properties["inputA"].GetHelp() == "inputA help message"
assert properties["inputA"].GetPage() == "inputs1"
assert properties["inputA"].GetWidget() == "number"
assert properties["inputA"].GetHints() == {
"uncategorized": "1"
}
assert properties["inputA"].GetOptions() == []
assert properties["inputA"].GetVStructMemberOf() == ""
assert properties["inputA"].GetVStructMemberName() == ""
assert not properties["inputA"].IsVStructMember()
assert not properties["inputA"].IsVStruct()
assert properties["inputA"].IsConnectable()
assert properties["inputA"].GetValidConnectionTypes() == []
assert properties["inputA"].CanConnectTo(properties["resultF"])
assert not properties["inputA"].CanConnectTo(properties["resultI"])
# --------------------------------------------------------------------------
# Check correct options parsing
# --------------------------------------------------------------------------
assert set(properties["inputOptions"].GetOptions()) == {
("opt1", "opt1val"),
("opt2", "opt2val")
}
assert set(properties["inputInterp"].GetOptions()) == {
("linear", ""),
("catmull-rom", ""),
("bspline", ""),
("constant", ""),
}
# --------------------------------------------------------------------------
# Check cross-type connection allowances
# --------------------------------------------------------------------------
assert properties["inputPoint"].CanConnectTo(properties["outputNormal"])
assert properties["inputNormal"].CanConnectTo(properties["outputPoint"])
assert properties["inputNormal"].CanConnectTo(properties["outputColor"])
assert properties["inputNormal"].CanConnectTo(properties["outputVector"])
assert properties["inputNormal"].CanConnectTo(properties["resultF3"])
assert properties["inputF2"].CanConnectTo(properties["resultF2"])
assert properties["inputD"].CanConnectTo(properties["resultI"])
assert not properties["inputNormal"].CanConnectTo(properties["resultF2"])
assert not properties["inputF4"].CanConnectTo(properties["resultF2"])
assert not properties["inputF2"].CanConnectTo(properties["resultF3"])
# --------------------------------------------------------------------------
# Check clean and unclean mappings to Sdf types
# --------------------------------------------------------------------------
assert properties["inputB"].GetTypeAsSdfType() == (SdfTypes.Int, "")
assert properties["inputF2"].GetTypeAsSdfType() == (SdfTypes.Float2, "")
assert properties["inputF3"].GetTypeAsSdfType() == (SdfTypes.Float3, "")
assert properties["inputF4"].GetTypeAsSdfType() == (SdfTypes.Float4, "")
assert properties["inputF5"].GetTypeAsSdfType() == (SdfTypes.FloatArray, "")
assert properties["inputStruct"].GetTypeAsSdfType() == \
(SdfTypes.Token, Sdr.PropertyTypes.Struct)
# --------------------------------------------------------------------------
# Ensure asset identifiers are detected correctly
# --------------------------------------------------------------------------
assert properties["inputAssetIdentifier"].IsAssetIdentifier()
assert not properties["inputOptions"].IsAssetIdentifier()
assert properties["inputAssetIdentifier"].GetTypeAsSdfType() == \
(SdfTypes.Asset, "")
# Nested pages and VStructs are only possible in args files
if not isOSL:
# ----------------------------------------------------------------------
# Check nested page correctness
# ----------------------------------------------------------------------
assert properties["vstruct1"].GetPage() == "VStructs:Nested"
assert properties["vstruct1_bump"].GetPage() == "VStructs:Nested:More"
# ----------------------------------------------------------------------
# Check VStruct correctness
# ----------------------------------------------------------------------
assert properties["vstruct1"].IsVStruct()
assert properties["vstruct1"].GetVStructMemberOf() == ""
assert properties["vstruct1"].GetVStructMemberName() == ""
assert not properties["vstruct1"].IsVStructMember()
assert not properties["vstruct1_bump"].IsVStruct()
assert properties["vstruct1_bump"].GetVStructMemberOf() == "vstruct1"
assert properties["vstruct1_bump"].GetVStructMemberName() == "bump"
assert properties["vstruct1_bump"].IsVStructMember()
def TestBasicNode(node, nodeSourceType, nodeDefinitionURI, nodeImplementationURI):
"""
Test basic, non-shader-specific correctness on the specified node.
"""
# Implementation notes:
# ---
# The source type needs to be passed manually in order to ensure the utils
# do not have a dependency on the plugin (where the source type resides).
# The URIs are manually specified because the utils cannot know ahead of
# time where the node originated.
isOSL = IsNodeOSL(node)
nodeContext = "OSL" if isOSL else "pattern"
# Data that varies between OSL/Args
# --------------------------------------------------------------------------
nodeName = "TestNodeOSL" if isOSL else "TestNodeARGS"
numOutputs = 8 if isOSL else 10
outputNames = {
"resultF", "resultF2", "resultF3", "resultI", "outputPoint",
"outputNormal", "outputColor", "outputVector"
}
metadata = {
"category": "testing",
"departments": "testDept",
"help": "This is the test node",
"label": "TestNodeLabel",
"primvars": "primvar1|primvar2|primvar3|$primvarNamingProperty|"
"$invalidPrimvarNamingProperty",
"uncategorizedMetadata": "uncategorized"
}
if not isOSL:
metadata.pop("category")
metadata.pop("label")
metadata.pop("uncategorizedMetadata")
outputNames.add("vstruct1")
outputNames.add("vstruct1_bump")
# --------------------------------------------------------------------------
nodeInputs = {propertyName: node.GetShaderInput(propertyName)
for propertyName in node.GetInputNames()}
nodeOutputs = {propertyName: node.GetShaderOutput(propertyName)
for propertyName in node.GetOutputNames()}
assert node.GetName() == nodeName
assert node.GetContext() == nodeContext
assert node.GetSourceType() == nodeSourceType
assert node.GetFamily() == ""
assert node.GetResolvedDefinitionURI() == nodeDefinitionURI
assert node.GetResolvedImplementationURI() == nodeImplementationURI
assert node.IsValid()
assert len(nodeInputs) == 17
assert len(nodeOutputs) == numOutputs
assert nodeInputs["inputA"] is not None
assert nodeInputs["inputB"] is not None
assert nodeInputs["inputC"] is not None
assert nodeInputs["inputD"] is not None
assert nodeInputs["inputF2"] is not None
assert nodeInputs["inputF3"] is not None
assert nodeInputs["inputF4"] is not None
assert nodeInputs["inputF5"] is not None
assert nodeInputs["inputInterp"] is not None
assert nodeInputs["inputOptions"] is not None
assert nodeInputs["inputPoint"] is not None
assert nodeInputs["inputNormal"] is not None
assert nodeOutputs["resultF2"] is not None
assert nodeOutputs["resultI"] is not None
assert nodeOutputs["outputPoint"] is not None
assert nodeOutputs["outputNormal"] is not None
assert nodeOutputs["outputColor"] is not None
assert nodeOutputs["outputVector"] is not None
print(set(node.GetInputNames()))
assert set(node.GetInputNames()) == {
"inputA", "inputB", "inputC", "inputD", "inputF2", "inputF3", "inputF4",
"inputF5", "inputInterp", "inputOptions", "inputPoint", "inputNormal",
"inputStruct", "inputAssetIdentifier", "primvarNamingProperty",
"invalidPrimvarNamingProperty", "inputStrArray"
}
assert set(node.GetOutputNames()) == outputNames
# There may be additional metadata passed in via the NdrNodeDiscoveryResult.
# So, ensure that the bits we expect to see are there instead of doing
# an equality check.
nodeMetadata = node.GetMetadata()
for i,j in metadata.items():
assert i in nodeMetadata
assert nodeMetadata[i] == metadata[i]
# Test basic property correctness
TestBasicProperties(node)
def TestShaderSpecificNode(node):
"""
Test shader-specific correctness on the specified node.
"""
isOSL = IsNodeOSL(node)
# Data that varies between OSL/Args
# --------------------------------------------------------------------------
numOutputs = 8 if isOSL else 10
label = "TestNodeLabel" if isOSL else ""
category = "testing" if isOSL else ""
vstructNames = [] if isOSL else ["vstruct1"]
pages = {"", "inputs1", "inputs2", "results"} if isOSL else \
{"", "inputs1", "inputs2", "results", "VStructs:Nested",
"VStructs:Nested:More"}
# --------------------------------------------------------------------------
shaderInputs = {propertyName: node.GetShaderInput(propertyName)
for propertyName in node.GetInputNames()}
shaderOutputs = {propertyName: node.GetShaderOutput(propertyName)
for propertyName in node.GetOutputNames()}
assert len(shaderInputs) == 17
assert len(shaderOutputs) == numOutputs
assert shaderInputs["inputA"] is not None
assert shaderInputs["inputB"] is not None
assert shaderInputs["inputC"] is not None
assert shaderInputs["inputD"] is not None
assert shaderInputs["inputF2"] is not None
assert shaderInputs["inputF3"] is not None
assert shaderInputs["inputF4"] is not None
assert shaderInputs["inputF5"] is not None
assert shaderInputs["inputInterp"] is not None
assert shaderInputs["inputOptions"] is not None
assert shaderInputs["inputPoint"] is not None
assert shaderInputs["inputNormal"] is not None
assert shaderOutputs["resultF"] is not None
assert shaderOutputs["resultF2"] is not None
assert shaderOutputs["resultF3"] is not None
assert shaderOutputs["resultI"] is not None
assert shaderOutputs["outputPoint"] is not None
assert shaderOutputs["outputNormal"] is not None
assert shaderOutputs["outputColor"] is not None
assert shaderOutputs["outputVector"] is not None
assert node.GetLabel() == label
assert node.GetCategory() == category
assert node.GetHelp() == "This is the test node"
assert node.GetDepartments() == ["testDept"]
assert set(node.GetPages()) == pages
assert set(node.GetPrimvars()) == {"primvar1", "primvar2", "primvar3"}
assert set(node.GetAdditionalPrimvarProperties()) == {"primvarNamingProperty"}
assert set(node.GetPropertyNamesForPage("results")) == {
"resultF", "resultF2", "resultF3", "resultI"
}
assert set(node.GetPropertyNamesForPage("")) == {
"outputPoint", "outputNormal", "outputColor", "outputVector"
}
assert set(node.GetPropertyNamesForPage("inputs1")) == {"inputA"}
assert set(node.GetPropertyNamesForPage("inputs2")) == {
"inputB", "inputC", "inputD", "inputF2", "inputF3", "inputF4", "inputF5",
"inputInterp", "inputOptions", "inputPoint", "inputNormal",
"inputStruct", "inputAssetIdentifier", "primvarNamingProperty",
"invalidPrimvarNamingProperty", "inputStrArray"
}
assert node.GetAllVstructNames() == vstructNames
# Test shading-specific property correctness
TestShadingProperties(node)
def TestShaderPropertiesNode(node):
"""
Tests property correctness on the specified shader node, which must be
one of the following pre-defined nodes:
* 'TestShaderPropertiesNodeOSL'
* 'TestShaderPropertiesNodeARGS'
* 'TestShaderPropertiesNodeUSD'
These pre-defined nodes have a property of every type that Sdr supports.
Property correctness is defined as:
* The shader property has the expected SdrPropertyType
* The shader property has the expected SdfValueTypeName
* If the shader property has a default value, the default value's type
matches the shader property's type
"""
# This test should only be run on the following allowed node names
# --------------------------------------------------------------------------
allowedNodeNames = ["TestShaderPropertiesNodeOSL",
"TestShaderPropertiesNodeARGS",
"TestShaderPropertiesNodeUSD"]
# If this assertion on the name fails, then this test was called with the
# wrong node.
assert node.GetName() in allowedNodeNames
# If we have the correct node name, double check that the source type is
# also correct
if node.GetName() == "TestShaderPropertiesNodeOSL":
assert node.GetSourceType() == "OSL"
elif node.GetName() == "TestShaderPropertiesNodeARGS":
assert node.GetSourceType() == "RmanCpp"
elif node.GetName() == "TestShaderPropertiesNodeUSD":
assert node.GetSourceType() == "glslfx"
nodeInputs = {propertyName: node.GetShaderInput(propertyName)
for propertyName in node.GetInputNames()}
nodeOutputs = {propertyName: node.GetShaderOutput(propertyName)
for propertyName in node.GetOutputNames()}
# For each property, we test that:
# * The property has the expected SdrPropertyType
# * The property has the expected TfType (from SdfValueTypeName)
# * The property's type and default value's type match
property = nodeInputs["inputInt"]
assert property.GetType() == Sdr.PropertyTypes.Int
assert GetType(property) == Tf.Type.FindByName("int")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputString"]
assert property.GetType() == Sdr.PropertyTypes.String
assert GetType(property) == Tf.Type.FindByName("string")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputFloat"]
assert property.GetType() == Sdr.PropertyTypes.Float
assert GetType(property) == Tf.Type.FindByName("float")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputColor"]
assert property.GetType() == Sdr.PropertyTypes.Color
assert GetType(property) == Tf.Type.FindByName("GfVec3f")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputPoint"]
assert property.GetType() == Sdr.PropertyTypes.Point
assert GetType(property) == Tf.Type.FindByName("GfVec3f")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputNormal"]
assert property.GetType() == Sdr.PropertyTypes.Normal
assert GetType(property) == Tf.Type.FindByName("GfVec3f")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputVector"]
assert property.GetType() == Sdr.PropertyTypes.Vector
assert GetType(property) == Tf.Type.FindByName("GfVec3f")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputMatrix"]
assert property.GetType() == Sdr.PropertyTypes.Matrix
assert GetType(property) == Tf.Type.FindByName("GfMatrix4d")
assert Ndr._ValidateProperty(node, property)
if node.GetName() != "TestShaderPropertiesNodeUSD":
# XXX Note that 'struct' and 'vstruct' types are currently unsupported
# by the UsdShadeShaderDefParserPlugin, which parses shaders defined in
# usd files. Please see UsdShadeShaderDefParserPlugin implementation for
# details.
property = nodeInputs["inputStruct"]
assert property.GetType() == Sdr.PropertyTypes.Struct
assert GetType(property) == Tf.Type.FindByName("TfToken")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputVstruct"]
assert property.GetType() == Sdr.PropertyTypes.Vstruct
assert GetType(property) == Tf.Type.FindByName("TfToken")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputIntArray"]
assert property.GetType() == Sdr.PropertyTypes.Int
assert GetType(property) == Tf.Type.FindByName("VtArray<int>")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputStringArray"]
assert property.GetType() == Sdr.PropertyTypes.String
assert GetType(property) == Tf.Type.FindByName("VtArray<string>")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputFloatArray"]
assert property.GetType() == Sdr.PropertyTypes.Float
assert GetType(property) == Tf.Type.FindByName("VtArray<float>")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputColorArray"]
assert property.GetType() == Sdr.PropertyTypes.Color
assert GetType(property) == Tf.Type.FindByName("VtArray<GfVec3f>")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputPointArray"]
assert property.GetType() == Sdr.PropertyTypes.Point
assert GetType(property) == Tf.Type.FindByName("VtArray<GfVec3f>")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputNormalArray"]
assert property.GetType() == Sdr.PropertyTypes.Normal
assert GetType(property) == Tf.Type.FindByName("VtArray<GfVec3f>")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputVectorArray"]
assert property.GetType() == Sdr.PropertyTypes.Vector
assert GetType(property) == Tf.Type.FindByName("VtArray<GfVec3f>")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputMatrixArray"]
assert property.GetType() == Sdr.PropertyTypes.Matrix
assert GetType(property) == Tf.Type.FindByName("VtArray<GfMatrix4d>")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputFloat2"]
assert property.GetType() == Sdr.PropertyTypes.Float
assert GetType(property) == Tf.Type.FindByName("GfVec2f")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputFloat3"]
assert property.GetType() == Sdr.PropertyTypes.Float
assert GetType(property) == Tf.Type.FindByName("GfVec3f")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputFloat4"]
assert property.GetType() == Sdr.PropertyTypes.Float
assert GetType(property) == Tf.Type.FindByName("GfVec4f")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputAsset"]
assert property.GetType() == Sdr.PropertyTypes.String
assert GetType(property) == Tf.Type.FindByName("SdfAssetPath")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputAssetArray"]
assert property.GetType() == Sdr.PropertyTypes.String
assert GetType(property) == Tf.Type.FindByName("VtArray<SdfAssetPath>")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputColorRoleNone"]
assert property.GetType() == Sdr.PropertyTypes.Float
assert GetType(property) == Tf.Type.FindByName("GfVec3f")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputPointRoleNone"]
assert property.GetType() == Sdr.PropertyTypes.Float
assert GetType(property) == Tf.Type.FindByName("GfVec3f")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputNormalRoleNone"]
assert property.GetType() == Sdr.PropertyTypes.Float
assert GetType(property) == Tf.Type.FindByName("GfVec3f")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputVectorRoleNone"]
assert property.GetType() == Sdr.PropertyTypes.Float
assert GetType(property) == Tf.Type.FindByName("GfVec3f")
assert Ndr._ValidateProperty(node, property)
property = nodeOutputs["outputSurface"]
assert property.GetType() == Sdr.PropertyTypes.Terminal
assert GetType(property) == Tf.Type.FindByName("TfToken")
assert Ndr._ValidateProperty(node, property)
# Specific test of implementationName feature, we can skip type-tests
property = nodeInputs["normal"]
assert property.GetImplementationName() == "aliasedNormalInput"
assert Ndr._ValidateProperty(node, property)
if node.GetName() != "TestShaderPropertiesNodeOSL" and \
node.GetName() != "TestShaderPropertiesNodeARGS" :
# We will parse color4 in MaterialX and UsdShade. Not currently
# supported in OSL. rman Args also do not support / require color4 type.
property = nodeInputs["inputColor4"]
assert property.GetType() == Sdr.PropertyTypes.Color4
assert GetType(property) == Tf.Type.FindByName("GfVec4f")
assert Ndr._ValidateProperty(node, property)
# oslc v1.11.14 does not allow arrays of structs as parameter.
property = nodeInputs["inputColor4Array"]
assert property.GetType() == Sdr.PropertyTypes.Color4
assert GetType(property) == Tf.Type.FindByName("VtArray<GfVec4f>")
assert Ndr._ValidateProperty(node, property)
property = nodeInputs["inputColor4RoleNone"]
assert property.GetType() == Sdr.PropertyTypes.Float
assert GetType(property) == Tf.Type.FindByName("GfVec4f")
assert Ndr._ValidateProperty(node, property)
| 27,467 | Python | 42.393365 | 82 | 0.65089 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdHydra/__init__.py | #
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
from pxr import Tf
Tf.PreparePythonModule()
del Tf
| 1,111 | Python | 38.714284 | 74 | 0.765977 |
omniverse-code/kit/exts/omni.usd.libs/pxr/UsdHydra/__DOC.py | def Execute(result):
result["GenerativeProceduralAPI"].__doc__ = """
This API extends and configures the core UsdProcGenerativeProcedural
schema defined within usdProc for use with hydra generative
procedurals as defined within hdGp.
For any described attribute *Fallback* *Value* or *Allowed* *Values*
below that are text/tokens, the actual token is published and defined
in UsdHydraTokens. So to set an attribute to the value"rightHanded",
use UsdHydraTokens->rightHanded as the value.
"""
result["GenerativeProceduralAPI"].__init__.func_doc = """__init__(prim)
Construct a UsdHydraGenerativeProceduralAPI on UsdPrim ``prim`` .
Equivalent to UsdHydraGenerativeProceduralAPI::Get (prim.GetStage(),
prim.GetPath()) for a *valid* ``prim`` , but will not immediately
throw an error for an invalid ``prim``
Parameters
----------
prim : Prim
----------------------------------------------------------------------
__init__(schemaObj)
Construct a UsdHydraGenerativeProceduralAPI on the prim held by
``schemaObj`` .
Should be preferred over UsdHydraGenerativeProceduralAPI
(schemaObj.GetPrim()), as it preserves SchemaBase state.
Parameters
----------
schemaObj : SchemaBase
"""
result["GenerativeProceduralAPI"].GetProceduralTypeAttr.func_doc = """GetProceduralTypeAttr() -> Attribute
The registered name of a HdGpGenerativeProceduralPlugin to be
executed.
Declaration
``token primvars:hdGp:proceduralType``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
"""
result["GenerativeProceduralAPI"].CreateProceduralTypeAttr.func_doc = """CreateProceduralTypeAttr(defaultValue, writeSparsely) -> Attribute
See GetProceduralTypeAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["GenerativeProceduralAPI"].GetProceduralSystemAttr.func_doc = """GetProceduralSystemAttr() -> Attribute
This value should correspond to a configured instance of
HdGpGenerativeProceduralResolvingSceneIndex which will evaluate the
procedural.
The default value of"hydraGenerativeProcedural"matches the equivalent
default of HdGpGenerativeProceduralResolvingSceneIndex. Multiple
instances of the scene index can be used to determine where within a
scene index chain a given procedural will be evaluated.
Declaration
``token proceduralSystem ="hydraGenerativeProcedural"``
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
"""
result["GenerativeProceduralAPI"].CreateProceduralSystemAttr.func_doc = """CreateProceduralSystemAttr(defaultValue, writeSparsely) -> Attribute
See GetProceduralSystemAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author ``defaultValue`` as the attribute's default,
sparsely (when it makes sense to do so) if ``writeSparsely`` is
``true`` - the default for ``writeSparsely`` is ``false`` .
Parameters
----------
defaultValue : VtValue
writeSparsely : bool
"""
result["GenerativeProceduralAPI"].GetSchemaAttributeNames.func_doc = """**classmethod** GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
----------
includeInherited : bool
"""
result["GenerativeProceduralAPI"].Get.func_doc = """**classmethod** Get(stage, path) -> GenerativeProceduralAPI
Return a UsdHydraGenerativeProceduralAPI holding the prim adhering to
this schema at ``path`` on ``stage`` .
If no prim exists at ``path`` on ``stage`` , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
.. code-block:: text
UsdHydraGenerativeProceduralAPI(stage->GetPrimAtPath(path));
Parameters
----------
stage : Stage
path : Path
"""
result["GenerativeProceduralAPI"].CanApply.func_doc = """**classmethod** CanApply(prim, whyNot) -> bool
Returns true if this **single-apply** API schema can be applied to the
given ``prim`` .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates ``whyNot`` with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
whyNot : str
"""
result["GenerativeProceduralAPI"].Apply.func_doc = """**classmethod** Apply(prim) -> GenerativeProceduralAPI
Applies this **single-apply** API schema to the given ``prim`` .
This information is stored by adding"HydraGenerativeProceduralAPI"to
the token-valued, listOp metadata *apiSchemas* on the prim.
A valid UsdHydraGenerativeProceduralAPI object is returned upon
success. An invalid (or empty) UsdHydraGenerativeProceduralAPI object
is returned upon failure. See UsdPrim::ApplyAPI() for conditions
resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
----------
prim : Prim
"""
result["GenerativeProceduralAPI"]._GetStaticTfType.func_doc = """**classmethod** _GetStaticTfType() -> Type
""" | 5,684 | Python | 21.559524 | 149 | 0.746129 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.