file_path
stringlengths 5
44
| content
stringlengths 75
400k
|
---|---|
omni.ui.ShadowFlag.md | ShadowFlag — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
ShadowFlag
# ShadowFlag
class omni.ui.ShadowFlag
Bases: pybind11_object
Members:
NONE
CUT_OUT_SHAPE_BACKGROUND
Methods
__init__(self, value)
Attributes
CUT_OUT_SHAPE_BACKGROUND
NONE
name
value
__init__(self: omni.ui._ui.ShadowFlag, value: int) → None
property name
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.VectorImageProvider.md | VectorImageProvider — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
VectorImageProvider
# VectorImageProvider
class omni.ui.VectorImageProvider
Bases: ImageProvider
doc
Methods
__init__(self[, source_url])
doc
Attributes
max_mip_levels
Maximum number of mip map levels allowed
source_url
Sets the vector image URL.
__init__(self: omni.ui._ui.VectorImageProvider, source_url: str = None, **kwargs) → None
doc
property max_mip_levels
Maximum number of mip map levels allowed
property source_url
Sets the vector image URL. Asset loading doesn’t happen immediately, but rather is started the next time widget is visible, in prepareDraw call.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
Kind.md | Kind module — pxr-usd-api 105.1 documentation
pxr-usd-api
»
Modules »
Kind module
# Kind module
Summary: The Kind library provides a runtime-extensible taxonomy known as “kinds”. Useful for classifying scenegraph objects.
Python bindings for libKind
Classes:
Registry
A singleton that holds known kinds and information about them.
Tokens
class pxr.Kind.Registry
A singleton that holds known kinds and information about them. See
Kind Overview for a description of why kind exists, what the builtin
registered kinds are, and how to extend the core kinds.
## KindRegistry Threadsafty
KindRegistry serves performance-critical clients that operate under
the stl threading model, and therefore itself follows that model in
order to avoid locking during HasKind() and IsA() queries.
To make this robust, KindRegistry exposes no means to mutate the
registry. All extensions must be accomplished via plugInfo.json files,
which are consumed once during the registry initialization (See
Extending the KindRegistry)
Methods:
GetAllKinds
classmethod GetAllKinds() -> list[str]
GetBaseKind
classmethod GetBaseKind(kind) -> str
HasKind
classmethod HasKind(kind) -> bool
IsA
classmethod IsA(derivedKind, baseKind) -> bool
Attributes:
expired
True if this object has expired, False otherwise.
static GetAllKinds()
classmethod GetAllKinds() -> list[str]
Return an unordered vector of all kinds known to the registry.
static GetBaseKind()
classmethod GetBaseKind(kind) -> str
Return the base kind of the given kind.
If there is no base, the result will be an empty token. Issues a
coding error if kind is unknown to the registry.
Parameters
kind (str) –
static HasKind()
classmethod HasKind(kind) -> bool
Test whether kind is known to the registry.
Parameters
kind (str) –
static IsA()
classmethod IsA(derivedKind, baseKind) -> bool
Test whether derivedKind is the same as baseKind or has it as a
base kind (either directly or indirectly).
It is not required that derivedKind or baseKind be known to the
registry: if they are unknown but equal, IsA will return true ;
otherwise if either is unknown, we will simply return false.
Therefore this method will not raise any errors.
Parameters
derivedKind (str) –
baseKind (str) –
property expired
True if this object has expired, False otherwise.
class pxr.Kind.Tokens
Attributes:
assembly
component
group
model
subcomponent
assembly = 'assembly'
component = 'component'
group = 'group'
model = 'model'
subcomponent = 'subcomponent'
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023. |
omni.ui.FocusPolicy.md | FocusPolicy — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
FocusPolicy
# FocusPolicy
class omni.ui.FocusPolicy
Bases: pybind11_object
Members:
DEFAULT
FOCUS_ON_LEFT_MOUSE_DOWN
FOCUS_ON_ANY_MOUSE_DOWN
FOCUS_ON_HOVER
Methods
__init__(self, value)
Attributes
DEFAULT
FOCUS_ON_ANY_MOUSE_DOWN
FOCUS_ON_HOVER
FOCUS_ON_LEFT_MOUSE_DOWN
name
value
__init__(self: omni.ui._ui.FocusPolicy, value: int) → None
property name
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.UIntDrag.md | UIntDrag — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
UIntDrag
# UIntDrag
class omni.ui.UIntDrag
Bases: UIntSlider
Methods
__init__(self[, model])
Constructs UIntDrag.
Attributes
step
This property controls the steping speed on the drag, its float to enable slower speed, but of course the value on the Control are still integer.
__init__(self: omni.ui._ui.UIntDrag, model: omni.ui._ui.AbstractValueModel = None, **kwargs) → None
Constructs UIntDrag.
### Arguments:
`model :`The widget’s model. If the model is not assigned, the default model is created.
`kwargsdict`See below
### Keyword Arguments:
`step`This property controls the steping speed on the drag, its float to enable slower speed, but of course the value on the Control are still integer.
`min`This property holds the slider’s minimum value.
`max`This property holds the slider’s maximum value.
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
property step
This property controls the steping speed on the drag, its float to enable slower speed, but of course the value on the Control are still integer.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.Triangle.md | Triangle — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
Triangle
# Triangle
class omni.ui.Triangle
Bases: Shape
The Triangle widget provides a colored triangle to display.
Methods
__init__(self, **kwargs)
Constructs Triangle.
Attributes
alignment
This property holds the alignment of the triangle when the fill policy is ePreserveAspectFit or ePreserveAspectCrop.
__init__(self: omni.ui._ui.Triangle, **kwargs) → None
Constructs Triangle.
`kwargsdict`See below
### Keyword Arguments:
`alignment`This property holds the alignment of the triangle when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the triangle is centered.
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
property alignment
This property holds the alignment of the triangle when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the triangle is centered.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.color_utils.AbstractShade.md | AbstractShade — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Submodules »
omni.ui.color_utils »
omni.ui.color_utils Classes »
AbstractShade
# AbstractShade
class omni.ui.color_utils.AbstractShade
Bases: object
The implementation of shades for custom style parameter type.
The user has to reimplement methods _store and _find to set/get the value
in the specific store.
Methods
__init__()
set_shade([name])
Set the default shade.
shade([default])
Save the given shade, pick the color and apply it to ui.ColorStore.
__init__()
set_shade(name: Optional[str] = None)
Set the default shade.
shade(default: Optional[Any] = None, **kwargs) → str
Save the given shade, pick the color and apply it to ui.ColorStore.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.SimpleIntModel.md | SimpleIntModel — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
SimpleIntModel
# SimpleIntModel
class omni.ui.SimpleIntModel
Bases: AbstractValueModel
A very simple Int model.
Methods
__init__(self[, default_value])
get_max(self)
get_min(self)
set_max(self, arg0)
set_min(self, arg0)
Attributes
max
This property holds the model's minimum value.
min
This property holds the model's minimum value.
__init__(self: omni.ui._ui.SimpleIntModel, default_value: int = 0, **kwargs) → None
get_max(self: omni.ui._ui.SimpleIntModel) → int
get_min(self: omni.ui._ui.SimpleIntModel) → int
set_max(self: omni.ui._ui.SimpleIntModel, arg0: int) → None
set_min(self: omni.ui._ui.SimpleIntModel, arg0: int) → None
property max
This property holds the model’s minimum value.
property min
This property holds the model’s minimum value.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.FloatSlider.md | FloatSlider — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
FloatSlider
# FloatSlider
class omni.ui.FloatSlider
Bases: AbstractSlider
The slider is the classic widget for controlling a bounded value. It lets the user move a slider handle along a horizontal groove and translates the handle’s position into a float value within the legal range.
Methods
__init__(self[, model])
Construct FloatSlider.
Attributes
format
This property overrides automatic formatting if needed.
max
This property holds the slider's maximum value.
min
This property holds the slider's minimum value.
precision
This property holds the slider value's float precision.
step
This property controls the steping speed on the drag.
__init__(self: omni.ui._ui.FloatSlider, model: omni.ui._ui.AbstractValueModel = None, **kwargs) → None
Construct FloatSlider.
`kwargsdict`See below
### Keyword Arguments:
`minfloat`This property holds the slider’s minimum value.
`maxfloat`This property holds the slider’s maximum value.
`stepfloat`This property controls the steping speed on the drag.
`formatstr`This property overrides automatic formatting if needed.
`precisionuint32_t`This property holds the slider value’s float precision.
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
property format
This property overrides automatic formatting if needed.
property max
This property holds the slider’s maximum value.
property min
This property holds the slider’s minimum value.
property precision
This property holds the slider value’s float precision.
property step
This property controls the steping speed on the drag.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.StringField.md | StringField — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
StringField
# StringField
class omni.ui.StringField
Bases: AbstractField
The StringField widget is a one-line text editor with a string model.
Methods
__init__(self[, model])
Constructs StringField.
Attributes
allow_tab_input
This property holds if the field allows Tab input.
multiline
Multiline allows to press enter and create a new line.
password_mode
This property holds the password mode.
read_only
This property holds if the field is read-only.
__init__(self: omni.ui._ui.StringField, model: omni.ui._ui.AbstractValueModel = None, **kwargs) → None
Constructs StringField.
### Arguments:
`model :`The widget’s model. If the model is not assigned, the default model is created.
`kwargsdict`See below
### Keyword Arguments:
`password_mode`This property holds the password mode. If the field is in the password mode when the entered text is obscured.
`read_only`This property holds if the field is read-only.
`multiline`Multiline allows to press enter and create a new line.
`allow_tab_input`This property holds if the field allows Tab input.
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
property allow_tab_input
This property holds if the field allows Tab input.
property multiline
Multiline allows to press enter and create a new line.
property password_mode
This property holds the password mode. If the field is in the password mode when the entered text is obscured.
property read_only
This property holds if the field is read-only.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
1_4_0.md | 1.4.0 — Omniverse Launcher latest documentation
Omniverse Launcher
»
Omniverse Launcher »
Release Notes »
1.4.0
# 1.4.0
Release Date: Nov 2022
## Changed
Added retries for downloading EULA and GDPR agreements.
## Fixed
Fixed an issue with scrolling the left menu on the exchange tab.
Fixed an issue where Launcher dialogs were displayed behind the exchange view after navigation.
Fixed an issue where thin packages could not install correctly if the file system had dangling symlinks.
Remove all unused packages on the startup.
Fixed an issue where failed updates changed the latest registered app version in the library.
Fixed an issue where scheduling two installers could not finish the download if authentication needs to be refreshed.
Fixed an issue with collecting hardware info on Windows 11.
Fixed sending multiple simultaneous session events.
© Copyright 2023-2024, NVIDIA.
Last updated on Apr 15, 2024. |
omni.ui.DockSpace.md | DockSpace — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
DockSpace
# DockSpace
class omni.ui.DockSpace
Bases: pybind11_object
The DockSpace class represents Dock Space for the OS Window.
Methods
__init__(self, arg0, **kwargs)
Construct the main window, add it to the underlying windowing system, and makes it appear.
Attributes
dock_frame
This represents Styling opportunity for the Window background.
__init__(self: omni.ui._ui.DockSpace, arg0: object, **kwargs) → None
Construct the main window, add it to the underlying windowing system, and makes it appear.
`kwargsdict`See below
### Keyword Arguments:
property dock_frame
This represents Styling opportunity for the Window background.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.ComboBox.md | ComboBox — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
ComboBox
# ComboBox
class omni.ui.ComboBox
Bases: Widget, ItemModelHelper
The ComboBox widget is a combined button and a drop-down list.
A combo box is a selection widget that displays the current item and can pop up a list of selectable items.
The ComboBox is implemented using the model-view pattern. The model is the central component of this system. The root of the item model should contain the index of currently selected items, and the children of the root include all the items of the combo box.
Methods
__init__(self, *args, **kwargs)
Construct ComboBox.
Attributes
__init__(self: omni.ui._ui.ComboBox, *args, **kwargs) → None
Construct ComboBox.
### Arguments:
`model :`The model that determines if the button is checked.
`kwargsdict`See below
### Keyword Arguments:
`arrow_onlybool`Determines if it’s necessary to hide the text of the ComboBox.
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.Fraction.md | Fraction — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
Fraction
# Fraction
class omni.ui.Fraction
Bases: Length
Fraction length is made to take the space of the parent widget, divides it up into a row of boxes, and makes each child widget fill one box.
Methods
__init__(self, value)
Construct Fraction.
Attributes
__init__(self: omni.ui._ui.Fraction, value: float) → None
Construct Fraction.
`kwargsdict`See below
### Keyword Arguments:
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
UsdRi.md | UsdRi module — pxr-usd-api 105.1 documentation
pxr-usd-api
»
Modules »
UsdRi module
# UsdRi module
Summary: The UsdRi module provides schemas and utilities for authoring USD that encodes Renderman-specific information, and USD/RI data conversions.
Classes:
MaterialAPI
Deprecated
SplineAPI
Deprecated
StatementsAPI
Container namespace schema for all renderman statements.
TextureAPI
Deprecated
Tokens
class pxr.UsdRi.MaterialAPI
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.
Methods:
Apply
classmethod Apply(prim) -> MaterialAPI
CanApply
classmethod CanApply(prim, whyNot) -> bool
ComputeInterfaceInputConsumersMap(...)
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.
CreateDisplacementAttr(defaultValue, ...)
See GetDisplacementAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateSurfaceAttr(defaultValue, writeSparsely)
See GetSurfaceAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateVolumeAttr(defaultValue, writeSparsely)
See GetVolumeAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
Get
classmethod Get(stage, path) -> MaterialAPI
GetDisplacement(ignoreBaseMaterial)
Returns a valid shader object if the"displacement"output on the material is connected to one.
GetDisplacementAttr()
Declaration
GetDisplacementOutput()
Returns the"displacement"output associated with the material.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
GetSurface(ignoreBaseMaterial)
Returns a valid shader object if the"surface"output on the material is connected to one.
GetSurfaceAttr()
Declaration
GetSurfaceOutput()
Returns the"surface"output associated with the material.
GetVolume(ignoreBaseMaterial)
Returns a valid shader object if the"volume"output on the material is connected to one.
GetVolumeAttr()
Declaration
GetVolumeOutput()
Returns the"volume"output associated with the material.
SetDisplacementSource(displacementPath)
param displacementPath
SetSurfaceSource(surfacePath)
param surfacePath
SetVolumeSource(volumePath)
param volumePath
static Apply()
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) –
static CanApply()
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) –
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) –
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) –
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) –
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) –
static Get()
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:
UsdRiMaterialAPI(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
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) –
GetDisplacementAttr() → Attribute
Declaration
token outputs:ri:displacement
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
GetDisplacementOutput() → Output
Returns the”displacement”output associated with the material.
static GetSchemaAttributeNames()
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) –
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) –
GetSurfaceAttr() → Attribute
Declaration
token outputs:ri:surface
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
GetSurfaceOutput() → Output
Returns the”surface”output associated with the material.
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) –
GetVolumeAttr() → Attribute
Declaration
token outputs:ri:volume
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
GetVolumeOutput() → Output
Returns the”volume”output associated with the material.
SetDisplacementSource(displacementPath) → bool
Parameters
displacementPath (Path) –
SetSurfaceSource(surfacePath) → bool
Parameters
surfacePath (Path) –
SetVolumeSource(volumePath) → bool
Parameters
volumePath (Path) –
class pxr.UsdRi.SplineAPI
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)
Methods:
Apply
classmethod Apply(prim) -> SplineAPI
CanApply
classmethod CanApply(prim, whyNot) -> bool
CreateInterpolationAttr(defaultValue, ...)
See GetInterpolationAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreatePositionsAttr(defaultValue, writeSparsely)
See GetPositionsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateValuesAttr(defaultValue, writeSparsely)
See GetValuesAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
Get
classmethod Get(stage, path) -> SplineAPI
GetInterpolationAttr()
Interpolation method for the spline.
GetPositionsAttr()
Positions of the knots.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
GetValuesAttr()
Values of the knots.
GetValuesTypeName()
Returns the intended typename of the values attribute of the spline.
Validate(reason)
Validates the attribute values belonging to the spline.
static Apply()
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) –
static CanApply()
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) –
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) –
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) –
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) –
static Get()
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:
UsdRiSplineAPI(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
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]
GetPositionsAttr() → Attribute
Positions of the knots.
C++ Type: VtArray<float> Usd Type: SdfValueTypeNames->FloatArray
Variability: SdfVariabilityUniform Fallback Value: No Fallback
static GetSchemaAttributeNames()
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) –
GetValuesAttr() → Attribute
Values of the knots.
C++ Type: See GetValuesTypeName() Usd Type: See GetValuesTypeName()
Variability: SdfVariabilityUniform Fallback Value: No Fallback
GetValuesTypeName() → ValueTypeName
Returns the intended typename of the values attribute of the spline.
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) –
class pxr.UsdRi.StatementsAPI
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.
Methods:
Apply
classmethod Apply(prim) -> StatementsAPI
CanApply
classmethod CanApply(prim, whyNot) -> bool
CreateRiAttribute(name, riType, nameSpace)
Create a rib attribute on the prim to which this schema is attached.
Get
classmethod Get(stage, path) -> StatementsAPI
GetCoordinateSystem()
Returns the value in the"ri:coordinateSystem"attribute if it exists.
GetModelCoordinateSystems(targets)
Populates the output targets with the authored ri:modelCoordinateSystems, if any.
GetModelScopedCoordinateSystems(targets)
Populates the output targets with the authored ri:modelScopedCoordinateSystems, if any.
GetRiAttribute(name, nameSpace)
Return a UsdAttribute representing the Ri attribute with the name name, in the namespace nameSpace.
GetRiAttributeName
classmethod GetRiAttributeName(prop) -> str
GetRiAttributeNameSpace
classmethod GetRiAttributeNameSpace(prop) -> str
GetRiAttributes(nameSpace)
Return all rib attributes on this prim, or under a specific namespace (e.g."user").
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
GetScopedCoordinateSystem()
Returns the value in the"ri:scopedCoordinateSystem"attribute if it exists.
HasCoordinateSystem()
Returns true if the underlying prim has a ri:coordinateSystem opinion.
HasScopedCoordinateSystem()
Returns true if the underlying prim has a ri:scopedCoordinateSystem opinion.
IsRiAttribute
classmethod IsRiAttribute(prop) -> bool
MakeRiAttributePropertyName
classmethod MakeRiAttributePropertyName(attrName) -> str
SetCoordinateSystem(coordSysName)
Sets the"ri:coordinateSystem"attribute to the given string value, creating the attribute if needed.
SetScopedCoordinateSystem(coordSysName)
Sets the"ri:scopedCoordinateSystem"attribute to the given string value, creating the attribute if needed.
static Apply()
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) –
static CanApply()
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) –
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) –
static Get()
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:
UsdRiStatementsAPI(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetCoordinateSystem() → str
Returns the value in the”ri:coordinateSystem”attribute if it exists.
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]) –
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]) –
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) –
static GetRiAttributeName()
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) –
static GetRiAttributeNameSpace()
classmethod GetRiAttributeNameSpace(prop) -> str
Return the containing namespace of the rib attribute (e.g.”user”).
Parameters
prop (Property) –
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) –
static GetSchemaAttributeNames()
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) –
GetScopedCoordinateSystem() → str
Returns the value in the”ri:scopedCoordinateSystem”attribute if it
exists.
HasCoordinateSystem() → bool
Returns true if the underlying prim has a ri:coordinateSystem opinion.
HasScopedCoordinateSystem() → bool
Returns true if the underlying prim has a ri:scopedCoordinateSystem
opinion.
static IsRiAttribute()
classmethod IsRiAttribute(prop) -> bool
Return true if the property is in the”ri:attributes”namespace.
Parameters
prop (Property) –
static MakeRiAttributePropertyName()
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) –
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) –
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) –
class pxr.UsdRi.TextureAPI
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.
Methods:
Apply
classmethod Apply(prim) -> TextureAPI
CanApply
classmethod CanApply(prim, whyNot) -> bool
CreateRiTextureGammaAttr(defaultValue, ...)
See GetRiTextureGammaAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateRiTextureSaturationAttr(defaultValue, ...)
See GetRiTextureSaturationAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
Get
classmethod Get(stage, path) -> TextureAPI
GetRiTextureGammaAttr()
Gamma-correct the texture.
GetRiTextureSaturationAttr()
Adjust the texture's saturation.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
static Apply()
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) –
static CanApply()
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) –
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) –
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) –
static Get()
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:
UsdRiTextureAPI(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetRiTextureGammaAttr() → Attribute
Gamma-correct the texture.
Declaration
float ri:texture:gamma
C++ Type
float
Usd Type
SdfValueTypeNames->Float
GetRiTextureSaturationAttr() → Attribute
Adjust the texture’s saturation.
Declaration
float ri:texture:saturation
C++ Type
float
Usd Type
SdfValueTypeNames->Float
static GetSchemaAttributeNames()
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) –
class pxr.UsdRi.Tokens
Attributes:
bspline
catmullRom
constant
interpolation
linear
outputsRiDisplacement
outputsRiSurface
outputsRiVolume
positions
renderContext
riTextureGamma
riTextureSaturation
spline
values
bspline = 'bspline'
catmullRom = 'catmull-rom'
constant = 'constant'
interpolation = 'interpolation'
linear = 'linear'
outputsRiDisplacement = 'outputs:ri:displacement'
outputsRiSurface = 'outputs:ri:surface'
outputsRiVolume = 'outputs:ri:volume'
positions = 'positions'
renderContext = 'ri'
riTextureGamma = 'ri:texture:gamma'
riTextureSaturation = 'ri:texture:saturation'
spline = 'spline'
values = 'values'
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023. |
omni.ui.DockPreference.md | DockPreference — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
DockPreference
# DockPreference
class omni.ui.DockPreference
Bases: pybind11_object
Members:
DISABLED
MAIN
RIGHT
LEFT
RIGHT_TOP
RIGHT_BOTTOM
LEFT_BOTTOM
Methods
__init__(self, value)
Attributes
DISABLED
LEFT
LEFT_BOTTOM
MAIN
RIGHT
RIGHT_BOTTOM
RIGHT_TOP
name
value
__init__(self: omni.ui._ui.DockPreference, value: int) → None
property name
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
1_3_3.md | 1.3.3 — Omniverse Launcher latest documentation
Omniverse Launcher
»
Omniverse Launcher »
Release Notes »
1.3.3
# 1.3.3
Release Date: Oct 2021
## Added
Added the OS version to com.nvidia.omniverse.launcher.session telemetry event.
Added the locale to com.nvidia.omniverse.launcher.session telemetry event.
Added “Developer” and “Publisher” fields to component details.
Show “Welcome to Omniverse” page on the first launch.
Support installing the Enterprise Launcher to a shared location on Linux.
## Fixed
Fixed an issue where “Add Connector” button was pointing to the wrong location on the Exchange tab.
Fixed an issue where the default Omniverse app was not reset after its last version is uninstalled.
Fixed an issue where the startup component didn’t react on the background authentication.
Fixed an issue where installers that were initiated from the library tab ignored the current queue and started a download immediately.
Fixed Japanese translations.
Fixed an issue that caused a delay for queuing new installers.
Fixed an issue where components were added to the library before they were registered by scripts.
Fixed an issue where component platforms were determined incorrectly if thin packaging is used.
Fixed an issue where installers used incorrect path with the latest component version instead of the specified version.
© Copyright 2023-2024, NVIDIA.
Last updated on Apr 15, 2024. |
omni.ui.StringStore.md | StringStore — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
StringStore
# StringStore
class omni.ui.StringStore
Bases: pybind11_object
A singleton that stores all the UI Style string properties of omni.ui.
Methods
__init__(*args, **kwargs)
find(name)
Return the index of the color with specific name.
store(name, string)
Save the color by name.
__init__(*args, **kwargs)
static find(name: str) → str
Return the index of the color with specific name.
static store(name: str, string: str) → None
Save the color by name.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
UsdUtils.md | UsdUtils module — pxr-usd-api 105.1 documentation
pxr-usd-api
»
Modules »
UsdUtils module
# UsdUtils module
Summary: The UsdUtils module contains utility classes and functions for managing, inspecting, editing, and creating USD Assets.
Classes:
CoalescingDiagnosticDelegate
A class which collects warnings and statuses from the Tf diagnostic manager system in a thread safe manner.
CoalescingDiagnosticDelegateItem
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.
CoalescingDiagnosticDelegateSharedItem
The shared component in a coalesced result This type can be thought of as the key by which we coalesce our diagnostics.
CoalescingDiagnosticDelegateUnsharedItem
The unshared component in a coalesced result.
ConditionalAbortDiagnosticDelegate
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.
ConditionalAbortDiagnosticDelegateErrorFilters
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.
RegisteredVariantSet
Info for registered variant set
SparseAttrValueWriter
A utility class for authoring time-varying attribute values with simple run-length encoding, by skipping any redundant time-samples.
SparseValueWriter
Utility class that manages sparse authoring of a set of UsdAttributes.
StageCache
The UsdUtilsStageCache class provides a simple interface for handling a singleton usd stage cache for use by all USD clients.
TimeCodeRange
Represents a range of UsdTimeCode values as start and end time codes and a stride value.
UsdStageStatsKeys
class pxr.UsdUtils.CoalescingDiagnosticDelegate
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.
Methods:
DumpCoalescedDiagnosticsToStderr
DumpCoalescedDiagnosticsToStdout
DumpUncoalescedDiagnostics(ostr)
Print all pending diagnostics without any coalescing to ostr .
TakeCoalescedDiagnostics()
Get all pending diagnostics in a coalesced form.
TakeUncoalescedDiagnostics()
Get all pending diagnostics without any coalescing.
DumpCoalescedDiagnosticsToStderr()
DumpCoalescedDiagnosticsToStdout()
DumpUncoalescedDiagnostics(ostr) → None
Print all pending diagnostics without any coalescing to ostr .
This method clears the pending diagnostics.
Parameters
ostr (ostream) –
TakeCoalescedDiagnostics() → list[UsdUtilsCoalescingDiagnosticDelegate]
Get all pending diagnostics in a coalesced form.
This method clears the pending diagnostics.
TakeUncoalescedDiagnostics() → list[TfDiagnosticBase]
Get all pending diagnostics without any coalescing.
This method clears the pending diagnostics.
class pxr.UsdUtils.CoalescingDiagnosticDelegateItem
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.
Attributes:
sharedItem
unsharedItems
property sharedItem
property unsharedItems
class pxr.UsdUtils.CoalescingDiagnosticDelegateSharedItem
The shared component in a coalesced result This type can be thought of
as the key by which we coalesce our diagnostics.
Attributes:
sourceFileName
sourceFunction
sourceLineNumber
property sourceFileName
property sourceFunction
property sourceLineNumber
class pxr.UsdUtils.CoalescingDiagnosticDelegateUnsharedItem
The unshared component in a coalesced result.
Attributes:
commentary
context
property commentary
property context
class pxr.UsdUtils.ConditionalAbortDiagnosticDelegate
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:
UsdUtilsConditionalAbortDiagnosticDelegateErrorFilters includeFilters;
UsdUtilsConditionalAbortDiagnosticDelegateErrorFilters excludeFilters;
includeFilters.SetCodePathFilters({"\*pxr\*"});
excludeFilters.SetCodePathFilters({"\*ConditionalAbortDiagnosticDelegate\*"});
UsdUtilsConditionalAbortDiagnosticDelegate delegate =
UsdUtilsConditionalAbortDiagnosticDelegate(includeFilters,
excludeFilters);
class pxr.UsdUtils.ConditionalAbortDiagnosticDelegateErrorFilters
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.
Methods:
GetCodePathFilters()
GetStringFilters()
SetCodePathFilters(codePathFilters)
param codePathFilters
SetStringFilters(stringFilters)
param stringFilters
GetCodePathFilters() → list[str]
GetStringFilters() → list[str]
SetCodePathFilters(codePathFilters) → None
Parameters
codePathFilters (list[str]) –
SetStringFilters(stringFilters) → None
Parameters
stringFilters (list[str]) –
class pxr.UsdUtils.RegisteredVariantSet
Info for registered variant set
Classes:
SelectionExportPolicy
This specifies how the variantSet should be treated during export.
Attributes:
name
selectionExportPolicy
class SelectionExportPolicy
This specifies how the variantSet should be treated during export.
Note, in the plugInfo.json, the values for these enum’s are
lowerCamelCase.
Attributes:
Always
IfAuthored
Never
names
values
Always = pxr.UsdUtils.SelectionExportPolicy.Always
IfAuthored = pxr.UsdUtils.SelectionExportPolicy.IfAuthored
Never = pxr.UsdUtils.SelectionExportPolicy.Never
names = {'Always': pxr.UsdUtils.SelectionExportPolicy.Always, 'IfAuthored': pxr.UsdUtils.SelectionExportPolicy.IfAuthored, 'Never': pxr.UsdUtils.SelectionExportPolicy.Never}
values = {0: pxr.UsdUtils.SelectionExportPolicy.Never, 1: pxr.UsdUtils.SelectionExportPolicy.IfAuthored, 2: pxr.UsdUtils.SelectionExportPolicy.Always}
property name
property selectionExportPolicy
class pxr.UsdUtils.SparseAttrValueWriter
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:
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:
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.
Methods:
SetTimeSample(value, time)
Sets a new time-sample on the attribute with given value at the given time .
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) –
class pxr.UsdUtils.SparseValueWriter
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:
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:
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.
Methods:
GetSparseAttrValueWriters()
Returns a new vector of UsdUtilsSparseAttrValueWriter populated from the attrValueWriter map.
SetAttribute(attr, value, time)
Sets the value of attr to value at time time .
GetSparseAttrValueWriters() → list[SparseAttrValueWriter]
Returns a new vector of UsdUtilsSparseAttrValueWriter populated from
the attrValueWriter map.
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) –
class pxr.UsdUtils.StageCache
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.
Methods:
Get
classmethod Get() -> StageCache
GetSessionLayerForVariantSelections
classmethod GetSessionLayerForVariantSelections(modelName, variantSelections) -> Layer
static Get()
classmethod Get() -> StageCache
Returns the singleton stage cache.
static GetSessionLayerForVariantSelections()
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]]) –
class pxr.UsdUtils.TimeCodeRange
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.
Classes:
Tokens
Methods:
CreateFromFrameSpec
classmethod CreateFromFrameSpec(frameSpec) -> TimeCodeRange
IsValid()
Return true if this range contains one or more time codes, or false otherwise.
empty()
Return true if this range contains no time codes, or false otherwise.
Attributes:
endTimeCode
TimeCode
frameSpec
startTimeCode
TimeCode
stride
float
class Tokens
Attributes:
EmptyTimeCodeRange
RangeSeparator
StrideSeparator
EmptyTimeCodeRange = 'NONE'
RangeSeparator = ':'
StrideSeparator = 'x'
static CreateFromFrameSpec()
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) –
IsValid() → bool
Return true if this range contains one or more time codes, or false
otherwise.
empty() → bool
Return true if this range contains no time codes, or false otherwise.
property endTimeCode
TimeCode
Return the end time code of this range.
Type
type
property frameSpec
property startTimeCode
TimeCode
Return the start time code of this range.
Type
type
property stride
float
Return the stride value of this range.
Type
type
class pxr.UsdUtils.UsdStageStatsKeys
Attributes:
activePrimCount
approxMemoryInMb
assetCount
inactivePrimCount
instanceCount
instancedModelCount
modelCount
primCounts
primCountsByType
primary
prototypeCount
prototypes
pureOverCount
totalInstanceCount
totalPrimCount
untyped
usedLayerCount
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'
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023. |
omni.ui.FreeRectangle.md | FreeRectangle — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
FreeRectangle
# FreeRectangle
class omni.ui.FreeRectangle
Bases: Rectangle
The Rectangle widget provides a colored rectangle to display.
The free widget is the widget that is independent of the layout. It means it is stuck to other widgets. When initializing, it’s necessary to provide two widgets, and the shape is drawn from one widget position to the another.
Methods
__init__(self, arg0, arg1, **kwargs)
Initialize the shape with bounds limited to the positions of the given widgets.
Attributes
__init__(self: omni.ui._ui.FreeRectangle, arg0: omni.ui._ui.Widget, arg1: omni.ui._ui.Widget, **kwargs) → None
Initialize the shape with bounds limited to the positions of the given widgets.
### Arguments:
`start :`The bound corner is in the center of this given widget.
`end :`The bound corner is in the center of this given widget.
`kwargsdict`See below
### Keyword Arguments:
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
1_9_11.md | 1.9.11 — Omniverse Launcher latest documentation
Omniverse Launcher
»
Omniverse Launcher »
Release Notes »
1.9.11
# 1.9.11
Release Date: April 2024
# Fixed
Fixed an issue where Launcher was minimized to the system tray instead of exiting when users clicked on Exit option in user settings menu.
Fixed a race condition that could cause settings reset. [OM-118568]
Fixed gallery positioning for content packs. [OM-118695]
Fixed beta banner positioning on the Exchange tab. [OM-119105]
Fixed an issue on the Hub page settings that caused showing “infinity” in disk chart for Linux. [HUB-965]
Fixed cache size max validations on Hub page settings tab. [OM-119136]
Fixed cache size decimal points validations on Hub page settings tab. [OM-119335]
Fixed Hub Total Disk Space chart to not allow available disk space to become negative. [HUB-966]
Fixed an issue on the Hub page settings that caused showing “infinity” in disk chart for Linux. [HUB-965]
Fixed an issue on the Hub page settings that cause cache size not to be displayed. [HUB-960]
Fixed an issue on the Hub page settings preventing editing Cleanup Threshold. [OM-119137]
Fixed Hub page settings chart drive/mount detection size based on cache path. [HUB-970]
Replace Omniverse Beta license agreement text with NVIDIA License and add license agreement link in the About dialog. [OM-120991]
© Copyright 2023-2024, NVIDIA.
Last updated on Apr 15, 2024. |
using_pip_packages.md | Using Python pip Packages — kit-manual 105.1 documentation
kit-manual
»
Using Python pip Packages
# Using Python pip Packages
There are 2 ways to use python pip packages in extensions:
Install them at runtime and use them right away.
Install them at build-time and pre-package into another extension.
## Runtime installation using omni.kit.pipapi
Installing at runtime is probably the most convenient way to quickly prototype and play around with tools. The omni.kit.pipapi extension conveniently wraps pip (which is already included into python by default) and provides an API to install pip packages. You just have to declare a dependency on this extension, and call the omni.kit.pipapi.install("package_name")() function. Right after this line, you can import and start using the installed package.
# Package name and module can be different (although rarely is in practice):
import omni.kit.pipapi
omni.kit.pipapi.install("Pillow", module="PIL")
import PIL
However installing at runtime has a couple of downsides:
Can be slow. Usually it ends up blocking the process, waiting for the download and installation upon first startup.
Requires internet access and pip index availability.
Has security and licensing implications.
Even if the version is locked, which should always be the case, the package can still become unavailable at some point, or the content could change. It opens up the opportunity for certain types of attacks, and from a legal perspective we can’t ship any extensions/apps that perform a pip installation at runtime. The end-user can decide to write, test, and execute such code, but it shouldn’t come from NVIDIA.
## Build-time installation using repo_build
The recommended way to install pip packages is at build time, and to embed it into an extension. For most packages, it is as simple as installing it into a folder inside an extension. As long it is added to the sys.path, python can import it. Sometimes, packages require certain shared libraries or other system software, which goes out of the scope of this guide and had to be dealt on case by case basis.
We also provide tooling to simplify the process of build time package installation. The repo_build tool, when run, can process special config file(s). By default: deps/pip.toml. Here you can specify a list of packages to install and a target folder:
[[dependency]]
packages = [
"watchdog==0.10.4", # SWIPAT filed under: http://nvbugs/123456
]
target = "../_build/target-deps/pip_prebundle"
The version must be specified (locked).
The repo_build tool performs an installation only once. It then hashes the whole config file and uploads the installed packages into packman. On the next launch, it will download the uploaded package from packman, instead of using the pip index. This is much faster and removes the necessity of vendoring dependencies. The build also won’t depend on the availability of the pip index.
Then, this folder where packages were installed into is linked (or copied) into an extension. The only reason we don’t install it directly into the extension target folder is because debug and release configurations can share the same pip packages. It is convenient to install it once and link the folder into both build flavors. Linking the folder is done in the premake5.lua file of an extension.
-- Include pip packages installed at build time
repo_build.prebuild_link {
{ "%{root}/_build/target-deps/pip_prebundle", ext.target_dir.."/pip_prebundle" },
}
Also, after installation, repo_build gathers up pip package license information (including N-order dependencies) into the gather_licenses_path. They must be included into an extension too, for legal reasons.
After the build, you can make sure that everything looks correct by looking into the extension target folder, e.g.: _build/$platform/$config/exts/example.mixed_ext/pip_prebundle .
Finally, in the extension.toml, we need to make sure that this folder is added to sys.path.
# Demonstrate how to add another folder to sys.path. Here we add pip packages installed at build time.
[[python.module]]
path = "pip_prebundle"
When the extension starts, it adds all [[python.module]] entries with their path relative to extension root to the sys.path. The order of those entries can be important if you have other code in the extension that for instance performs an import watchdog.
All the extensions that are loaded as dependees can also make use of those packages as well. This way one extension can bring several pip packages for other extensions to use. They just need to add a dependency on the package providing them.
## pip packages included in Kit: omni.kit.pip_archive
Exactly as described above, Kit comes with the omni.kit.pip_archive extension that includes many commonly used packages, like numpy or PIL. To use them just add dependency:
[dependecies]
"omni.kit.pip_archive" = {}
The Kit repo serves as another great example of this setup.
## Code Examples
### Install pip package at runtime
# PIP/Install pip package
# omni.kit.pipapi extension is required
import omni.kit.pipapi
# It wraps `pip install` calls and reroutes package installation into user specified environment folder.
# That folder is added to sys.path.
# Note: This call is blocking and slow. It is meant to be used for debugging, development. For final product packages
# should be installed at build-time and packaged inside extensions.
omni.kit.pipapi.install(
package="semver",
version="2.13.0",
module="semver", # sometimes module is different from package name, module is used for import check
ignore_import_check=False,
ignore_cache=False,
use_online_index=True,
surpress_output=False,
extra_args=[]
)
# use
import semver
ver = semver.VersionInfo.parse('1.2.3-pre.2+build.4')
print(ver)
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023. |
omni.ui.Placer.md | Placer — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
Placer
# Placer
class omni.ui.Placer
Bases: Container
The Placer class place a single widget to a particular position based on the offet.
Methods
__init__(self, **kwargs)
Construct Placer.
invalidate_raster(self)
This method regenerates the raster image of the widget, even if the widget's content has not changed.
set_offset_x_changed_fn(self, arg0)
offsetX defines the offset placement for the child widget relative to the Placer
set_offset_y_changed_fn(self, arg0)
offsetY defines the offset placement for the child widget relative to the Placer
Attributes
drag_axis
Sets if dragging can be horizontally or vertically.
draggable
Provides a convenient way to make an item draggable.
frames_to_start_drag
The placer size depends on the position of the child when false.
offset_x
offsetX defines the offset placement for the child widget relative to the Placer
offset_y
offsetY defines the offset placement for the child widget relative to the Placer
raster_policy
Determine how the content of the frame should be rasterized.
stable_size
The placer size depends on the position of the child when false.
__init__(self: omni.ui._ui.Placer, **kwargs) → None
Construct Placer.
`kwargsdict`See below
### Keyword Arguments:
`offset_xtoLength`offsetX defines the offset placement for the child widget relative to the Placer
`offset_ytoLength`offsetY defines the offset placement for the child widget relative to the Placer
`draggablebool`Provides a convenient way to make an item draggable.
`drag_axisAxis`Sets if dragging can be horizontally or vertically.
`stable_sizebool`The placer size depends on the position of the child when false.
`raster_policy`Determine how the content of the frame should be rasterized.
`offset_x_changed_fnCallable[[ui.Length], None]`offsetX defines the offset placement for the child widget relative to the Placer
`offset_y_changed_fnCallable[[ui.Length], None]`offsetY defines the offset placement for the child widget relative to the Placer
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
invalidate_raster(self: omni.ui._ui.Placer) → None
This method regenerates the raster image of the widget, even if the widget’s content has not changed. This can be used with both the eOnDemand and eAuto raster policies, and is used to update the content displayed in the widget. Note that this operation may be resource-intensive, and should be used sparingly.
set_offset_x_changed_fn(self: omni.ui._ui.Placer, arg0: Callable[[omni.ui._ui.Length], None]) → None
offsetX defines the offset placement for the child widget relative to the Placer
set_offset_y_changed_fn(self: omni.ui._ui.Placer, arg0: Callable[[omni.ui._ui.Length], None]) → None
offsetY defines the offset placement for the child widget relative to the Placer
property drag_axis
Sets if dragging can be horizontally or vertically.
property draggable
Provides a convenient way to make an item draggable.
property frames_to_start_drag
The placer size depends on the position of the child when false.
property offset_x
offsetX defines the offset placement for the child widget relative to the Placer
property offset_y
offsetY defines the offset placement for the child widget relative to the Placer
property raster_policy
Determine how the content of the frame should be rasterized.
property stable_size
The placer size depends on the position of the child when false.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.MultiFloatField.md | MultiFloatField — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
MultiFloatField
# MultiFloatField
class omni.ui.MultiFloatField
Bases: AbstractMultiField
MultiFloatField is the widget that has a sub widget (FloatField) per model item.
It’s handy to use it for multi-component data, like for example, float3 or color.
Methods
__init__(*args, **kwargs)
Overloaded function.
Attributes
__init__(*args, **kwargs)
Overloaded function.
__init__(self: omni.ui._ui.MultiFloatField, **kwargs) -> None
__init__(self: omni.ui._ui.MultiFloatField, arg0: omni.ui._ui.AbstractItemModel, **kwargs) -> None
__init__(self: omni.ui._ui.MultiFloatField, *args, **kwargs) -> None
Constructor.
`kwargsdict`See below
### Keyword Arguments:
`column_count`The max number of fields in a line.
`h_spacing`Sets a non-stretchable horizontal space in pixels between child fields.
`v_spacing`Sets a non-stretchable vertical space in pixels between child fields.
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.constant_utils.AbstractShade.md | AbstractShade — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Submodules »
omni.ui.constant_utils »
omni.ui.constant_utils Classes »
AbstractShade
# AbstractShade
class omni.ui.constant_utils.AbstractShade
Bases: object
The implementation of shades for custom style parameter type.
The user has to reimplement methods _store and _find to set/get the value
in the specific store.
Methods
__init__()
set_shade([name])
Set the default shade.
shade([default])
Save the given shade, pick the color and apply it to ui.ColorStore.
__init__()
set_shade(name: Optional[str] = None)
Set the default shade.
shade(default: Optional[Any] = None, **kwargs) → str
Save the given shade, pick the color and apply it to ui.ColorStore.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.ValueModelHelper.md | ValueModelHelper — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
ValueModelHelper
# ValueModelHelper
class omni.ui.ValueModelHelper
Bases: pybind11_object
The ValueModelHelper class provides the basic functionality for value widget classes. ValueModelHelper class is the base class for every standard widget that uses a AbstractValueModel. ValueModelHelper is an abstract class and itself cannot be instantiated. It provides a standard interface for interoperating with models.
Methods
__init__(*args, **kwargs)
Attributes
model
__init__(*args, **kwargs)
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.AbstractValueModel.md | AbstractValueModel — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
AbstractValueModel
# AbstractValueModel
class omni.ui.AbstractValueModel
Bases: pybind11_object
Methods
__init__(self)
Constructs AbstractValueModel.
add_begin_edit_fn(self, arg0)
Adds the function that will be called every time the user starts the editing.
add_end_edit_fn(self, arg0)
Adds the function that will be called every time the user finishes the editing.
add_value_changed_fn(self, arg0)
Adds the function that will be called every time the value changes.
begin_edit(self)
Called when the user starts the editing.
end_edit(self)
Called when the user finishes the editing.
get_value_as_bool(self)
Return the bool representation of the value.
get_value_as_float(self)
Return the float representation of the value.
get_value_as_int(self)
Return the int representation of the value.
get_value_as_string(self)
Return the string representation of the value.
remove_begin_edit_fn(self, arg0)
Remove the callback by its id.
remove_end_edit_fn(self, arg0)
Remove the callback by its id.
remove_value_changed_fn(self, arg0)
Remove the callback by its id.
set_value(*args, **kwargs)
Overloaded function.
subscribe_begin_edit_fn(self, arg0)
Adds the function that will be called every time the user starts the editing.
subscribe_end_edit_fn(self, arg0)
Adds the function that will be called every time the user finishes the editing.
subscribe_item_changed_fn(self, arg0)
subscribe_value_changed_fn(self, arg0)
Adds the function that will be called every time the value changes.
Attributes
as_bool
Return the bool representation of the value.
as_float
Return the float representation of the value.
as_int
Return the int representation of the value.
as_string
Return the string representation of the value.
__init__(self: omni.ui._ui.AbstractValueModel) → None
Constructs AbstractValueModel.
`kwargsdict`See below
### Keyword Arguments:
add_begin_edit_fn(self: omni.ui._ui.AbstractValueModel, arg0: Callable[[omni.ui._ui.AbstractValueModel], None]) → int
Adds the function that will be called every time the user starts the editing.
The id of the callback that is used to remove the callback.
add_end_edit_fn(self: omni.ui._ui.AbstractValueModel, arg0: Callable[[omni.ui._ui.AbstractValueModel], None]) → int
Adds the function that will be called every time the user finishes the editing.
The id of the callback that is used to remove the callback.
add_value_changed_fn(self: omni.ui._ui.AbstractValueModel, arg0: Callable[[omni.ui._ui.AbstractValueModel], None]) → int
Adds the function that will be called every time the value changes.
The id of the callback that is used to remove the callback.
begin_edit(self: omni.ui._ui.AbstractValueModel) → None
Called when the user starts the editing. If it’s a field, this method is called when the user activates the field and places the cursor inside. This method should be reimplemented.
end_edit(self: omni.ui._ui.AbstractValueModel) → None
Called when the user finishes the editing. If it’s a field, this method is called when the user presses Enter or selects another field for editing. It’s useful for undo/redo. This method should be reimplemented.
get_value_as_bool(self: omni.ui._ui.AbstractValueModel) → bool
Return the bool representation of the value.
get_value_as_float(self: omni.ui._ui.AbstractValueModel) → float
Return the float representation of the value.
get_value_as_int(self: omni.ui._ui.AbstractValueModel) → int
Return the int representation of the value.
get_value_as_string(self: omni.ui._ui.AbstractValueModel) → str
Return the string representation of the value.
remove_begin_edit_fn(self: omni.ui._ui.AbstractValueModel, arg0: int) → None
Remove the callback by its id.
### Arguments:
`id :`The id that addBeginEditFn returns.
remove_end_edit_fn(self: omni.ui._ui.AbstractValueModel, arg0: int) → None
Remove the callback by its id.
### Arguments:
`id :`The id that addEndEditFn returns.
remove_value_changed_fn(self: omni.ui._ui.AbstractValueModel, arg0: int) → None
Remove the callback by its id.
### Arguments:
`id :`The id that addValueChangedFn returns.
set_value(*args, **kwargs)
Overloaded function.
set_value(self: omni.ui._ui.AbstractValueModel, value: bool) -> None
Set the value.
set_value(self: omni.ui._ui.AbstractValueModel, value: int) -> None
Set the value.
set_value(self: omni.ui._ui.AbstractValueModel, value: float) -> None
Set the value.
set_value(self: omni.ui._ui.AbstractValueModel, value: str) -> None
Set the value.
subscribe_begin_edit_fn(self: omni.ui._ui.AbstractValueModel, arg0: Callable[[omni.ui._ui.AbstractValueModel], None]) → carb._carb.Subscription
Adds the function that will be called every time the user starts the editing.
The id of the callback that is used to remove the callback.
subscribe_end_edit_fn(self: omni.ui._ui.AbstractValueModel, arg0: Callable[[omni.ui._ui.AbstractValueModel], None]) → carb._carb.Subscription
Adds the function that will be called every time the user finishes the editing.
The id of the callback that is used to remove the callback.
subscribe_item_changed_fn(self: omni.ui._ui.AbstractValueModel, arg0: Callable[[omni.ui._ui.AbstractValueModel], None]) → carb._carb.Subscription
subscribe_value_changed_fn(self: omni.ui._ui.AbstractValueModel, arg0: Callable[[omni.ui._ui.AbstractValueModel], None]) → carb._carb.Subscription
Adds the function that will be called every time the value changes.
The id of the callback that is used to remove the callback.
property as_bool
Return the bool representation of the value.
property as_float
Return the float representation of the value.
property as_int
Return the int representation of the value.
property as_string
Return the string representation of the value.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.MenuItem.md | MenuItem — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
MenuItem
# MenuItem
class omni.ui.MenuItem
Bases: Widget, MenuHelper
A MenuItem represents the items the Menu consists of.
MenuItem can be inserted only once in the menu.
Methods
__init__(self, arg0, **kwargs)
Construct MenuItem.
Attributes
__init__(self: omni.ui._ui.MenuItem, arg0: str, **kwargs) → None
Construct MenuItem.
`kwargsdict`See below
### Keyword Arguments:
`textstr`This property holds the menu’s text.
`hotkey_textstr`This property holds the menu’s hotkey text.
`checkablebool`This property holds whether this menu item is checkable. A checkable item is one which has an on/off state.
`hide_on_clickbool`Hide or keep the window when the user clicked this item.
`delegateMenuDelegate`The delegate that generates a widget per menu item.
`triggered_fnvoid`Sets the function that is called when an action is activated by the user; for example, when the user clicks a menu option, or presses an action’s shortcut key combination.
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.Line.md | Line — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
Line
# Line
class omni.ui.Line
Bases: Shape, ArrowHelper, ShapeAnchorHelper
The Line widget provides a colored line to display.
Methods
__init__(self, **kwargs)
Constructs Line.
Attributes
alignment
This property that holds the alignment of the Line can only be LEFT, RIGHT, V_CENTER, H_CENTER , BOTTOM, TOP.
__init__(self: omni.ui._ui.Line, **kwargs) → None
Constructs Line.
`kwargsdict`See below
### Keyword Arguments:
`alignment`This property that holds the alignment of the Line can only be LEFT, RIGHT, V_CENTER, H_CENTER , BOTTOM, TOP. By default, the Line is H_Center.
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
`anchor_position: `This property holds the parametric value of the curve anchor.
`anchor_alignment: `This property holds the Alignment of the curve anchor.
`set_anchor_fn: Callable`Sets the function that will be called for the curve anchor.
`invalidate_anchor: `Function that causes the anchor frame to be redrawn.
`get_closest_parametric_position: `Function that returns the closest parametric T value to a given x,y position.
property alignment
This property that holds the alignment of the Line can only be LEFT, RIGHT, V_CENTER, H_CENTER , BOTTOM, TOP. By default, the Line is H_Center.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.ScrollBarPolicy.md | ScrollBarPolicy — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
ScrollBarPolicy
# ScrollBarPolicy
class omni.ui.ScrollBarPolicy
Bases: pybind11_object
Members:
SCROLLBAR_AS_NEEDED
SCROLLBAR_ALWAYS_OFF
SCROLLBAR_ALWAYS_ON
Methods
__init__(self, value)
Attributes
SCROLLBAR_ALWAYS_OFF
SCROLLBAR_ALWAYS_ON
SCROLLBAR_AS_NEEDED
name
value
__init__(self: omni.ui._ui.ScrollBarPolicy, value: int) → None
property name
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
installing_launcher.md | Installing Launcher — Omniverse Launcher latest documentation
Omniverse Launcher
»
Omniverse Launcher »
Installing Launcher
# Installing Launcher
Please watch the following video for instructions on installing Omniverse Launcher.
## Administrator Rights
Local Admin Rights on the installed computer is recommended for full use and capability of the Omniverse Launcher. Though the launcher will install without admin rights, some tools, connectors, apps, etc. may require admin rights (UAC) to complete the installation.
## First Run
When first running the launcher after install, you will be presented with a series of options.
### Data Collection
Users must agree to allow NVIDIA to collect data regarding usage of the Omniverse Platform.
### Paths
Next you will be presented with a series of path selections.
Option
Description
Library Path
This location specifies where apps, connectors and tools are installed when installed from Launcher.
Data Path
Displays and allows selection of the Data Path. The data path is where all content on the local Nucleus is stored.
Cache Path
This is the location the Cache Database will use to store its cache files. (if installed)
### Install cache
Though Omniverse Cache is optional, it is highly recommended for users who plan to collaborate with other Omniverse users on your network. This option does require Administrator Privileges on the installed machine and can be installed at a later time if necessary.
Once the installation is complete, please refer to the User Guide for additional help and information on using Launcher.
© Copyright 2023-2024, NVIDIA.
Last updated on Apr 15, 2024. |
documenting_exts.md | Documenting Extensions — kit-manual 105.1 documentation
kit-manual
»
Documenting Extensions
# Documenting Extensions
This guide is for developers who write API documentation. To build the documentation, run:
repo.{sh|bat} docs
Add the -o flag to automatically open the resulting docs in the browser. If multiple projects of documentation are generated, each one will be opened.
Add the --project flag to specify a project to only generate those docs. Documentation generation can be long for some modules, so this may be important to reduce iteration time when testing your docs. e.g:
repo.bat docs --project kit-sdk / repo.bat docs --project omni.ui
Add the -v / -vv flags to repo docs invocations for additional debug information, particularly for low-level Sphinx events.
Note
You must have successfully completed a debug build of the repo before you can build the docs for Python.
This is due to the documentation being extracted from the .pyd and .py files in the _build folder.
Run build --debug-only from the root of the repo if you haven’t done this already.
As a result of running repo docs in the repo, and you will find the project-specific output under _build/docs/{project}/latest.
The generated index.html is what the -o flag will launch in the browser if specified.
Warning
sphinx warnings will result in a non-zero exit code for repo docs, therefore will fail a CI build.
This means that it is important to maintain docstrings with the correct syntax (as described below) over the lifetime of a project.
## Documenting Python API
The best way to document our Python API is to do so directly in the code. That way it’s always extracted from a location where it’s closest to the actual code and most likely to be correct. We have two scenarios to consider:
Python code
C++ code that is exposed to Python
For both of these cases we need to write our documentation in the Python Docstring format (see PEP 257 for background).
In a perfect world we would be able to use exactly the same approach, regardless of whether the Python API was written in Python or coming from C++ code that is exposing Python bindings via pybind11.
Our world is unfortunately not perfect here but it’s quite close; most of the approach is the same - we will highlight when a different approach is required for the two cases of Python code and C++ code exposed to Python.
Instead of using the older and more cumbersome restructuredText Docstring specification, we have adopted the more streamlined Google Python Style Docstring format. This is how you would document an API function in Python:
from typing import Optional
def answer_question(question: str) -> Optional[str]:
"""This function can answer some questions.
It currently only answers a limited set of questions so don't expect it to know everything.
Args:
question: The question passed to the function, trailing question mark is not necessary and
casing is not important.
Returns:
The answer to the question or ``None`` if it doesn't know the answer.
"""
if question.lower().startswith("what is the answer to life, universe, and everything"):
return str(42)
else:
return None
After running the documentation generation system we will get this as the output (assuming the above was in a module named carb):
There are a few things you will notice:
We use the Python type hints (introduced in Python 3.5) in the function signature so we don’t need to write any of that information in the docstring.
An additional benefit of this approach is that many Python IDEs can utilize this information and perform type checking when programming against the API.
Notice that we always do from typing import ... so that we never have to prefix with the typing namespace when referring to List, Union, Dict, and friends.
This is the common approach in the Python community.
The high-level structure is essentially in four parts:
A one-liner describing the function (without details or corner cases), referred to by Sphinx as the “brief summary”.
A paragraph that gives more detail on the function behavior (if necessary).
An Args: section (if the function takes arguments, note that self is not considered an argument).
A Returns: section (if the function does return something other than None).
Before we discuss the other bits to document (modules and module attributes), let’s examine how we would document the very same function if it was written in C++ and exposed to Python using pybind11.
m.def("answer_question", &answerQuestion, py::arg("question"), R"(
This function can answer some questions.
It currently only answers a limited set of questions so don't expect it to know everything.
Args:
question: The question passed to the function, trailing question mark is not necessary and
casing is not important.
Returns:
The answer to the question or empty string if it doesn't know the answer.)");
The outcome is identical to what we saw from the Python source code, except that we cannot return optionally a string in C++.
The same docstring syntax rules must be obeyed because they will be propagated through the bindings.
We want to draw your attention to the following:
pybind11 generates the type information for you, based on the C++ types.
The py::arg object must be used to get properly named arguments into the function signature (see pybind11 documentation) - otherwise you just get arg0 and so forth in the documentation.
Indentation and whitespace are key when writing docstrings.
The documentation system is clever enough to remove uniform indentation.
That is, as long as all the lines have the same amount of padding, that padding will be ignored and not passed onto the RestructuredText processor. Fortunately clang-format leaves this funky formatting alone - respecting the raw string qualifier.
Sphinx warnings caused by non-uniform whitespace can be opaque (such as referring to nested blocks being ended without newlines, etc)
Let’s now turn our attention to how we document modules and their attributes.
We should of course only document modules that are part of our API (not internal helper modules) and only public attributes.
Below is a detailed example:
"""Example of Google style docstrings for module.
This module demonstrates documentation as specified by the `Google Python
Style Guide`_. Docstrings may extend over multiple lines. Sections are created
with a section header and a colon followed by a block of indented text.
Example:
Examples can be given using either the ``Example`` or ``Examples``
sections. Sections support any reStructuredText formatting, including
literal blocks::
$ python example.py
Section breaks are created by resuming unindented text. Section breaks
are also implicitly created anytime a new section starts.
Attributes:
module_level_variable1 (int): Module level variables may be documented in
either the ``Attributes`` section of the module docstring, or in an
inline docstring immediately following the variable.
Either form is acceptable, but the two should not be mixed. Choose
one convention to document module level variables and be consistent
with it.
module_level_variable2 (Optional[str]): Use objects from typing,
such as Optional, to annotate the type properly.
module_level_variable4 (Optional[File]): We can resolve type references
to other objects that are built as part of the documentation. This will link
to `carb.filesystem.File`.
Todo:
* For module TODOs if you want them
* These can be useful if you want to communicate any shortcomings in the module we plan to address
.. _Google Python Style Guide:
http://google.github.io/styleguide/pyguide.html
"""
module_level_variable1 = 12345
module_level_variable3 = 98765
"""int: Module level variable documented inline. The type hint should be specified on the first line, separated by a
colon from the text. This approach may be preferable since it keeps the documentation closer to the code and the default
assignment is shown. A downside is that the variable will get alphabetically sorted among functions in the module
so won't have the same cohesion as the approach above."""
module_level_variable2 = None
module_level_variable4 = None
This is what the documentation would look like:
As we have mentioned we should not mix the Attributes: style of documentation with inline documentation of attributes.
Notice how module_level_variable3 appears in a separate block from all the other attributes that were documented.
It is even after the TODO section.
Choose one approach for your module and stick to it.
There are valid reasons to pick one style above the other, but don’t cross the streams!
As before, we use type hints from typing but we don’t use the typing syntax to attach them.
We write:
"""...
Attributes:
module_variable (Optional[str]): This is important ...
"""
or
module_variable = None
"""Optional[str]: This is important ..."""
But we don’t write:
from typing import Optional
module_variable: Optional[str] = 12345
"""This is important ..."""
This is because the last form (which was introduced in Python 3.6) is still poorly supported by tools - including our documentation system.
It also doesn’t work with Python bindings generated from C++ code using pybind11.
For instructions on how to document classes, exceptions, etc please consult the Sphinx Napoleon Extension Guide.
### Adding Extensions to the automatic-introspection documentation system
It used to be necessary to maintain a ./docs/index.rst to write out automodule/autoclass/etc directives, as well as to include hand-written documentation about your extensions.
In order to facilitate rapid deployment of high-quality documentation out-of-the-box, a new system has been implemented.
Warning
If your extension’s modules cannot be imported at documentation-generation time, they cannot be documented correctly by this system.
Check the logs for warnings/errors about any failures to import, and any errors propagated.
In the Kit repo.toml, the [repo_docs.projects."kit-sdk"] section is responsible for targeting the old system, and the [repo_docs.kit] section is responsible for targeting the new.
Opt your extension in to the new system by:
Adding the extension to the list of extensions.
In ./source/extensions/{ext_name}/docs/, Add or write an Overview.md if none exists. Users will land here first.
In ./source/extensions/{ext_name}/config/extension.toml, Add all markdown files - except README.md - to an entry per the example below.
In ./source/extensions/{ext_name}/config/extension.toml, Add any extension dependencies to which your documentation depends on links or Sphinx ref-targets existing. This syntax follows the repo_docs tools intersphinx syntax. The deps are a list of lists, where the inner list contains the name of the target intersphinx project, followed by the path to the folder containing that projects objects.inv file. http links to websites that host their objects.inv file online like python will work as well, if discoverable at docs build time. Apart from web paths, this will only work for projects inside of the kit repo for now.
[documentation]
deps = [
["kit-sdk", "_build/docs/kit-sdk/latest"]
]
pages = [
"docs/Overview.md",
"docs/CHANGELOG.md",
]
The first item in the list will be treated as the “main page” for the documentation, and a user will land there first.
Changelogs are automatically bumped to the last entry regardless of their position in the list.
### Dealing with Sphinx Warnings
The introspection system ends up introducing many more objects to Sphinx than previously, and in a much more structured way.
It is therefore extremely common to come across many as-yet-undiscovered Sphinx warnings when migrating to this new system.
Here are some strategies for dealing with them.
#### MyST-parser warnings
These are common as we migrate away from the RecommonMark/m2r2 markdown Sphinx extensions, and towards MyST-parser, which is more extensible and stringent.
Common issues include:
Header-level warnings. MyST does not tolerate jumping from h1 directly to h3, without first passing through h2, for example.
Links which fail to match a reference. MyST will flag these to be fixed (Consider it a QC check that your links are not broken).
Code block syntax - If the language of a code-block cannot be automatically determined, a highlighting-failure warning may be emitted. Specify the language directly after the first backticks.
General markdown syntax - Recommonmark/m2r2 were more forgiving of syntax failures. MyST can raise warnings where they would not previously.
#### Docstring syntax warnings
The biggest issue with the Sphinx autodoc extension’s module-introspection is that it is difficult to control which members to inspect, and doubly so when recursing or imported-members are being inspected.
Therefore, it is strongly advised that your python modules define __all__, which controls which objects are imported when from module import * syntax is used. It is also advised to do this step from the perspective of python modules acting as bindings for C++ modules.
__all__ is respected by multiple stages of the documentation generation process (introspection, autosummary stub generation, etc).
This has two notable effects:
Items that your module imports will not be considered when determining the items to be documented. This speeds up documentation generation.
Prevents unnecessary or unwanted autosummary stubs from being generated and included in your docs.
Optimizes the import-time of your module when star-imports are used in other modules.
Unclutters imported namespaces for easier debugging.
Reduces “duplicate object” Sphinx warnings, because the number of imported targets with the same name is reduced to one.
Other common sources of docstring syntax warnings:
Indentation / whitespace mismatches in docstrings.
Improper usage or lack-of newlines where required. e.g. for an indented block.
#### C++ docstring issues
As a boon to users of the new system, and because default bindings-generated initialization docstrings typically make heavy use of asterisks and backticks, these are automatically escaped at docstring-parse time.
Please note that the pybind11_builtins.pybind11_object object Base is automatically hidden from class pages.
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023. |
Vt.md | Vt module — pxr-usd-api 105.1 documentation
pxr-usd-api
»
Modules »
Vt module
# Vt module
Summary: The Vt (Value Types) module defines classes that provide for type abstraction, enhanced array types, and value type manipulation.
Vt Value Types library
This package defines classes for creating objects that behave like value
types. It contains facilities for creating simple copy-on-write
implicitly shared types.
Classes:
BoolArray
An array of type bool.
CharArray
An array of type char.
DoubleArray
An array of type double.
DualQuatdArray
An array of type GfDualQuatd.
DualQuatfArray
An array of type GfDualQuatf.
DualQuathArray
An array of type GfDualQuath.
FloatArray
An array of type float.
HalfArray
An array of type pxr_half::half.
Int64Array
An array of type __int64.
IntArray
An array of type int.
IntervalArray
An array of type GfInterval.
Matrix2dArray
An array of type GfMatrix2d.
Matrix2fArray
An array of type GfMatrix2f.
Matrix3dArray
An array of type GfMatrix3d.
Matrix3fArray
An array of type GfMatrix3f.
Matrix4dArray
An array of type GfMatrix4d.
Matrix4fArray
An array of type GfMatrix4f.
QuatdArray
An array of type GfQuatd.
QuaternionArray
An array of type GfQuaternion.
QuatfArray
An array of type GfQuatf.
QuathArray
An array of type GfQuath.
Range1dArray
An array of type GfRange1d.
Range1fArray
An array of type GfRange1f.
Range2dArray
An array of type GfRange2d.
Range2fArray
An array of type GfRange2f.
Range3dArray
An array of type GfRange3d.
Range3fArray
An array of type GfRange3f.
Rect2iArray
An array of type GfRect2i.
ShortArray
An array of type short.
StringArray
An array of type string.
TokenArray
An array of type TfToken.
UCharArray
An array of type unsigned char.
UInt64Array
An array of type unsigned __int64.
UIntArray
An array of type unsigned int.
UShortArray
An array of type unsigned short.
Vec2dArray
An array of type GfVec2d.
Vec2fArray
An array of type GfVec2f.
Vec2hArray
An array of type GfVec2h.
Vec2iArray
An array of type GfVec2i.
Vec3dArray
An array of type GfVec3d.
Vec3fArray
An array of type GfVec3f.
Vec3hArray
An array of type GfVec3h.
Vec3iArray
An array of type GfVec3i.
Vec4dArray
An array of type GfVec4d.
Vec4fArray
An array of type GfVec4f.
Vec4hArray
An array of type GfVec4h.
Vec4iArray
An array of type GfVec4i.
class pxr.Vt.BoolArray
An array of type bool.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.CharArray
An array of type char.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.DoubleArray
An array of type double.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.DualQuatdArray
An array of type GfDualQuatd.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.DualQuatfArray
An array of type GfDualQuatf.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.DualQuathArray
An array of type GfDualQuath.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.FloatArray
An array of type float.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.HalfArray
An array of type pxr_half::half.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Int64Array
An array of type __int64.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.IntArray
An array of type int.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.IntervalArray
An array of type GfInterval.
class pxr.Vt.Matrix2dArray
An array of type GfMatrix2d.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Matrix2fArray
An array of type GfMatrix2f.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Matrix3dArray
An array of type GfMatrix3d.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Matrix3fArray
An array of type GfMatrix3f.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Matrix4dArray
An array of type GfMatrix4d.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Matrix4fArray
An array of type GfMatrix4f.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.QuatdArray
An array of type GfQuatd.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.QuaternionArray
An array of type GfQuaternion.
class pxr.Vt.QuatfArray
An array of type GfQuatf.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.QuathArray
An array of type GfQuath.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Range1dArray
An array of type GfRange1d.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Range1fArray
An array of type GfRange1f.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Range2dArray
An array of type GfRange2d.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Range2fArray
An array of type GfRange2f.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Range3dArray
An array of type GfRange3d.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Range3fArray
An array of type GfRange3f.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Rect2iArray
An array of type GfRect2i.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.ShortArray
An array of type short.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.StringArray
An array of type string.
class pxr.Vt.TokenArray
An array of type TfToken.
class pxr.Vt.UCharArray
An array of type unsigned char.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.UInt64Array
An array of type unsigned __int64.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.UIntArray
An array of type unsigned int.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.UShortArray
An array of type unsigned short.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Vec2dArray
An array of type GfVec2d.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Vec2fArray
An array of type GfVec2f.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Vec2hArray
An array of type GfVec2h.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Vec2iArray
An array of type GfVec2i.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Vec3dArray
An array of type GfVec3d.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Vec3fArray
An array of type GfVec3f.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Vec3hArray
An array of type GfVec3h.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Vec3iArray
An array of type GfVec3i.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Vec4dArray
An array of type GfVec4d.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Vec4fArray
An array of type GfVec4f.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Vec4hArray
An array of type GfVec4h.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
class pxr.Vt.Vec4iArray
An array of type GfVec4i.
Methods:
FromBuffer
FromNumpy
static FromBuffer()
static FromNumpy()
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023. |
omni.ui.RadioButton.md | RadioButton — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
RadioButton
# RadioButton
class omni.ui.RadioButton
Bases: Button
RadioButton is the widget that allows the user to choose only one of a predefined set of mutually exclusive options.
RadioButtons are arranged in collections of two or more with the class RadioCollection, which is the central component of the system and controls the behavior of all the RadioButtons in the collection.
Methods
__init__(self, **kwargs)
Constructs RadioButton.
Attributes
radio_collection
This property holds the button's text.
__init__(self: omni.ui._ui.RadioButton, **kwargs) → None
Constructs RadioButton.
`kwargsdict`See below
### Keyword Arguments:
`radio_collection`This property holds the button’s text.
`textstr`This property holds the button’s text.
`image_urlstr`This property holds the button’s optional image URL.
`image_widthfloat`This property holds the width of the image widget. Do not use this function to find the width of the image.
`image_heightfloat`This property holds the height of the image widget. Do not use this function to find the height of the image.
`spacingfloat`Sets a non-stretchable space in points between image and text.
`clicked_fnCallable[[], None]`Sets the function that will be called when when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button).
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
property radio_collection
This property holds the button’s text.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
1_5_7.md | 1.5.7 — Omniverse Launcher latest documentation
Omniverse Launcher
»
Omniverse Launcher »
Release Notes »
1.5.7
# 1.5.7
Release Date: May 2023
## Added
Added new controls for changing the current language on the login screen.
Added the Extensions content type in the Exchange.
## Fixed
Fixed an issue where the close icon closed Launcher instead of hiding it to the system tray.
Removed the crash reporter logging when using custom protocol commands.
Fixed an issue that caused a crash when Launcher failed to collect hardware info.
Fixed an issue where connectors were sometimes duplicated after the installation.
Fixed an issue where “Add connector” button on the Library tab opened a blank page.
© Copyright 2023-2024, NVIDIA.
Last updated on Apr 15, 2024. |
UsdLux.md | UsdLux module — pxr-usd-api 105.1 documentation
pxr-usd-api
»
Modules »
UsdLux module
# UsdLux module
Summary: The UsdLux module provides a representation for lights and related components that are common to many graphics environments.
Classes:
BoundableLightBase
Base class for intrinsic lights that are boundable.
CylinderLight
Light emitted outward from a cylinder.
DiskLight
Light emitted from one side of a circular disk.
DistantLight
Light emitted from a distant source along the -Z axis.
DomeLight
Light emitted inward from a distant external environment, such as a sky or IBL light probe.
GeometryLight
Deprecated
LightAPI
API schema that imparts the quality of being a light onto a prim.
LightFilter
A light filter modifies the effect of a light.
LightListAPI
API schema to support discovery and publishing of lights in a scene.
ListAPI
Deprecated
MeshLightAPI
This is the preferred API schema to apply to Mesh type prims when adding light behaviors to a mesh.
NonboundableLightBase
Base class for intrinsic lights that are not boundable.
PluginLight
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.
PluginLightFilter
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.
PortalLight
A rectangular portal in the local XY plane that guides sampling of a dome light.
RectLight
Light emitted from one side of a rectangle.
ShadowAPI
Controls to refine a light's shadow behavior.
ShapingAPI
Controls for shaping a light's emission.
SphereLight
Light emitted outward from a sphere.
Tokens
VolumeLightAPI
This is the preferred API schema to apply to Volume type prims when adding light behaviors to a volume.
class pxr.UsdLux.BoundableLightBase
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.
Methods:
CreateColorAttr(defaultValue, writeSparsely)
See UsdLuxLightAPI::CreateColorAttr() .
CreateColorTemperatureAttr(defaultValue, ...)
See UsdLuxLightAPI::CreateColorTemperatureAttr() .
CreateDiffuseAttr(defaultValue, writeSparsely)
See UsdLuxLightAPI::CreateDiffuseAttr() .
CreateEnableColorTemperatureAttr(...)
See UsdLuxLightAPI::CreateEnableColorTemperatureAttr() .
CreateExposureAttr(defaultValue, writeSparsely)
See UsdLuxLightAPI::CreateExposureAttr() .
CreateFiltersRel()
See UsdLuxLightAPI::CreateFiltersRel() .
CreateIntensityAttr(defaultValue, writeSparsely)
See UsdLuxLightAPI::CreateIntensityAttr() .
CreateNormalizeAttr(defaultValue, writeSparsely)
See UsdLuxLightAPI::CreateNormalizeAttr() .
CreateSpecularAttr(defaultValue, writeSparsely)
See UsdLuxLightAPI::CreateSpecularAttr() .
Get
classmethod Get(stage, path) -> BoundableLightBase
GetColorAttr()
See UsdLuxLightAPI::GetColorAttr() .
GetColorTemperatureAttr()
See UsdLuxLightAPI::GetColorTemperatureAttr() .
GetDiffuseAttr()
See UsdLuxLightAPI::GetDiffuseAttr() .
GetEnableColorTemperatureAttr()
See UsdLuxLightAPI::GetEnableColorTemperatureAttr() .
GetExposureAttr()
See UsdLuxLightAPI::GetExposureAttr() .
GetFiltersRel()
See UsdLuxLightAPI::GetFiltersRel() .
GetIntensityAttr()
See UsdLuxLightAPI::GetIntensityAttr() .
GetNormalizeAttr()
See UsdLuxLightAPI::GetNormalizeAttr() .
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
GetSpecularAttr()
See UsdLuxLightAPI::GetSpecularAttr() .
LightAPI()
Contructs and returns a UsdLuxLightAPI object for this light.
CreateColorAttr(defaultValue, writeSparsely) → Attribute
See UsdLuxLightAPI::CreateColorAttr() .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateColorTemperatureAttr(defaultValue, writeSparsely) → Attribute
See UsdLuxLightAPI::CreateColorTemperatureAttr() .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateDiffuseAttr(defaultValue, writeSparsely) → Attribute
See UsdLuxLightAPI::CreateDiffuseAttr() .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateEnableColorTemperatureAttr(defaultValue, writeSparsely) → Attribute
See UsdLuxLightAPI::CreateEnableColorTemperatureAttr() .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateExposureAttr(defaultValue, writeSparsely) → Attribute
See UsdLuxLightAPI::CreateExposureAttr() .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateFiltersRel() → Relationship
See UsdLuxLightAPI::CreateFiltersRel() .
CreateIntensityAttr(defaultValue, writeSparsely) → Attribute
See UsdLuxLightAPI::CreateIntensityAttr() .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateNormalizeAttr(defaultValue, writeSparsely) → Attribute
See UsdLuxLightAPI::CreateNormalizeAttr() .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateSpecularAttr(defaultValue, writeSparsely) → Attribute
See UsdLuxLightAPI::CreateSpecularAttr() .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
static Get()
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:
UsdLuxBoundableLightBase(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetColorAttr() → Attribute
See UsdLuxLightAPI::GetColorAttr() .
GetColorTemperatureAttr() → Attribute
See UsdLuxLightAPI::GetColorTemperatureAttr() .
GetDiffuseAttr() → Attribute
See UsdLuxLightAPI::GetDiffuseAttr() .
GetEnableColorTemperatureAttr() → Attribute
See UsdLuxLightAPI::GetEnableColorTemperatureAttr() .
GetExposureAttr() → Attribute
See UsdLuxLightAPI::GetExposureAttr() .
GetFiltersRel() → Relationship
See UsdLuxLightAPI::GetFiltersRel() .
GetIntensityAttr() → Attribute
See UsdLuxLightAPI::GetIntensityAttr() .
GetNormalizeAttr() → Attribute
See UsdLuxLightAPI::GetNormalizeAttr() .
static GetSchemaAttributeNames()
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) –
GetSpecularAttr() → Attribute
See UsdLuxLightAPI::GetSpecularAttr() .
LightAPI() → LightAPI
Contructs and returns a UsdLuxLightAPI object for this light.
class pxr.UsdLux.CylinderLight
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.
Methods:
CreateLengthAttr(defaultValue, writeSparsely)
See GetLengthAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateRadiusAttr(defaultValue, writeSparsely)
See GetRadiusAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateTreatAsLineAttr(defaultValue, ...)
See GetTreatAsLineAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
Define
classmethod Define(stage, path) -> CylinderLight
Get
classmethod Get(stage, path) -> CylinderLight
GetLengthAttr()
Width of the rectangle, in the local X axis.
GetRadiusAttr()
Radius of the cylinder.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
GetTreatAsLineAttr()
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.
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) –
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) –
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) –
static Define()
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) –
static Get()
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:
UsdLuxCylinderLight(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetLengthAttr() → Attribute
Width of the rectangle, in the local X axis.
Declaration
float inputs:length = 1
C++ Type
float
Usd Type
SdfValueTypeNames->Float
GetRadiusAttr() → Attribute
Radius of the cylinder.
Declaration
float inputs:radius = 0.5
C++ Type
float
Usd Type
SdfValueTypeNames->Float
static GetSchemaAttributeNames()
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) –
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
class pxr.UsdLux.DiskLight
Light emitted from one side of a circular disk. The disk is centered
in the XY plane and emits light along the -Z axis.
Methods:
CreateRadiusAttr(defaultValue, writeSparsely)
See GetRadiusAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
Define
classmethod Define(stage, path) -> DiskLight
Get
classmethod Get(stage, path) -> DiskLight
GetRadiusAttr()
Radius of the disk.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
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) –
static Define()
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) –
static Get()
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:
UsdLuxDiskLight(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetRadiusAttr() → Attribute
Radius of the disk.
Declaration
float inputs:radius = 0.5
C++ Type
float
Usd Type
SdfValueTypeNames->Float
static GetSchemaAttributeNames()
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) –
class pxr.UsdLux.DistantLight
Light emitted from a distant source along the -Z axis. Also known as a
directional light.
Methods:
CreateAngleAttr(defaultValue, writeSparsely)
See GetAngleAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
Define
classmethod Define(stage, path) -> DistantLight
Get
classmethod Get(stage, path) -> DistantLight
GetAngleAttr()
Angular size of the light in degrees.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
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) –
static Define()
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) –
static Get()
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:
UsdLuxDistantLight(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
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
static GetSchemaAttributeNames()
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) –
class pxr.UsdLux.DomeLight
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.
Methods:
CreateGuideRadiusAttr(defaultValue, ...)
See GetGuideRadiusAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreatePortalsRel()
See GetPortalsRel() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateTextureFileAttr(defaultValue, ...)
See GetTextureFileAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateTextureFormatAttr(defaultValue, ...)
See GetTextureFormatAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
Define
classmethod Define(stage, path) -> DomeLight
Get
classmethod Get(stage, path) -> DomeLight
GetGuideRadiusAttr()
The radius of guide geometry to use to visualize the dome light.
GetPortalsRel()
Optional portals to guide light sampling.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
GetTextureFileAttr()
A color texture to use on the dome, such as an HDR (high dynamic range) texture intended for IBL (image based lighting).
GetTextureFormatAttr()
Specifies the parameterization of the color map file.
OrientToStageUpAxis()
Adds a transformation op, if neeeded, to orient the dome to align with the stage's up axis.
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) –
CreatePortalsRel() → Relationship
See GetPortalsRel() , and also Create vs Get Property Methods for when
to use Get vs Create.
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) –
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) –
static Define()
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) –
static Get()
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:
UsdLuxDomeLight(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
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
GetPortalsRel() → Relationship
Optional portals to guide light sampling.
static GetSchemaAttributeNames()
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) –
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
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
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
class pxr.UsdLux.GeometryLight
Deprecated
Light emitted outward from a geometric prim (UsdGeomGprim), which is
typically a mesh.
Methods:
CreateGeometryRel()
See GetGeometryRel() , and also Create vs Get Property Methods for when to use Get vs Create.
Define
classmethod Define(stage, path) -> GeometryLight
Get
classmethod Get(stage, path) -> GeometryLight
GetGeometryRel()
Relationship to the geometry to use as the light source.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
CreateGeometryRel() → Relationship
See GetGeometryRel() , and also Create vs Get Property Methods for
when to use Get vs Create.
static Define()
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) –
static Get()
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:
UsdLuxGeometryLight(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetGeometryRel() → Relationship
Relationship to the geometry to use as the light source.
static GetSchemaAttributeNames()
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) –
class pxr.UsdLux.LightAPI
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.
Methods:
Apply
classmethod Apply(prim) -> LightAPI
CanApply
classmethod CanApply(prim, whyNot) -> bool
ConnectableAPI()
Contructs and returns a UsdShadeConnectableAPI object with this light.
CreateColorAttr(defaultValue, writeSparsely)
See GetColorAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateColorTemperatureAttr(defaultValue, ...)
See GetColorTemperatureAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateDiffuseAttr(defaultValue, writeSparsely)
See GetDiffuseAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateEnableColorTemperatureAttr(...)
See GetEnableColorTemperatureAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateExposureAttr(defaultValue, writeSparsely)
See GetExposureAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateFiltersRel()
See GetFiltersRel() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateInput(name, typeName)
Create an input which can either have a value or can be connected.
CreateIntensityAttr(defaultValue, writeSparsely)
See GetIntensityAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateMaterialSyncModeAttr(defaultValue, ...)
See GetMaterialSyncModeAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateNormalizeAttr(defaultValue, writeSparsely)
See GetNormalizeAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateOutput(name, typeName)
Create an output which can either have a value or can be connected.
CreateShaderIdAttr(defaultValue, writeSparsely)
See GetShaderIdAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateShaderIdAttrForRenderContext(...)
Creates the shader ID attribute for the given renderContext .
CreateSpecularAttr(defaultValue, writeSparsely)
See GetSpecularAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
Get
classmethod Get(stage, path) -> LightAPI
GetColorAttr()
The color of emitted light, in energy-linear terms.
GetColorTemperatureAttr()
Color temperature, in degrees Kelvin, representing the white point.
GetDiffuseAttr()
A multiplier for the effect of this light on the diffuse response of materials.
GetEnableColorTemperatureAttr()
Enables using colorTemperature.
GetExposureAttr()
Scales the power of the light exponentially as a power of 2 (similar to an F-stop control over exposure).
GetFiltersRel()
Relationship to the light filters that apply to this light.
GetInput(name)
Return the requested input if it exists.
GetInputs(onlyAuthored)
Inputs are represented by attributes in the"inputs:"namespace.
GetIntensityAttr()
Scales the power of the light linearly.
GetLightLinkCollectionAPI()
Return the UsdCollectionAPI interface used for examining and modifying the light-linking of this light.
GetMaterialSyncModeAttr()
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.
GetNormalizeAttr()
Normalizes power by the surface area of the light.
GetOutput(name)
Return the requested output if it exists.
GetOutputs(onlyAuthored)
Outputs are represented by attributes in the"outputs:"namespace.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
GetShaderId(renderContexts)
Return the light's shader ID for the given list of available renderContexts .
GetShaderIdAttr()
Default ID for the light's shader.
GetShaderIdAttrForRenderContext(renderContext)
Returns the shader ID attribute for the given renderContext .
GetShadowLinkCollectionAPI()
Return the UsdCollectionAPI interface used for examining and modifying the shadow-linking of this light.
GetSpecularAttr()
A multiplier for the effect of this light on the specular response of materials.
static Apply()
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) –
static CanApply()
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) –
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.
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) –
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) –
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) –
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) –
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) –
CreateFiltersRel() → Relationship
See GetFiltersRel() , and also Create vs Get Property Methods for when
to use Get vs Create.
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) –
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) –
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) –
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) –
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) –
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) –
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) –
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) –
static Get()
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:
UsdLuxLightAPI(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
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
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
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
GetEnableColorTemperatureAttr() → Attribute
Enables using colorTemperature.
Declaration
bool inputs:enableColorTemperature = 0
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
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
GetFiltersRel() → Relationship
Relationship to the light filters that apply to this light.
GetInput(name) → Input
Return the requested input if it exists.
Parameters
name (str) –
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) –
GetIntensityAttr() → Attribute
Scales the power of the light linearly.
Declaration
float inputs:intensity = 1
C++ Type
float
Usd Type
SdfValueTypeNames->Float
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.
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
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
GetOutput(name) → Output
Return the requested output if it exists.
Parameters
name (str) –
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) –
static GetSchemaAttributeNames()
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) –
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]) –
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
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) –
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.
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
class pxr.UsdLux.LightFilter
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.
Methods:
ConnectableAPI()
Contructs and returns a UsdShadeConnectableAPI object with this light filter.
CreateInput(name, typeName)
Create an input which can either have a value or can be connected.
CreateOutput(name, typeName)
Create an output which can either have a value or can be connected.
CreateShaderIdAttr(defaultValue, writeSparsely)
See GetShaderIdAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateShaderIdAttrForRenderContext(...)
Creates the shader ID attribute for the given renderContext .
Define
classmethod Define(stage, path) -> LightFilter
Get
classmethod Get(stage, path) -> LightFilter
GetFilterLinkCollectionAPI()
Return the UsdCollectionAPI interface used for examining and modifying the filter-linking of this light filter.
GetInput(name)
Return the requested input if it exists.
GetInputs(onlyAuthored)
Inputs are represented by attributes in the"inputs:"namespace.
GetOutput(name)
Return the requested output if it exists.
GetOutputs(onlyAuthored)
Outputs are represented by attributes in the"outputs:"namespace.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
GetShaderId(renderContexts)
Return the light filter's shader ID for the given list of available renderContexts .
GetShaderIdAttr()
Default ID for the light filter's shader.
GetShaderIdAttrForRenderContext(renderContext)
Returns the shader ID attribute for the given renderContext .
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.
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) –
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) –
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) –
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) –
static Define()
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) –
static Get()
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:
UsdLuxLightFilter(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
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.
GetInput(name) → Input
Return the requested input if it exists.
Parameters
name (str) –
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) –
GetOutput(name) → Output
Return the requested output if it exists.
Parameters
name (str) –
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) –
static GetSchemaAttributeNames()
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) –
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]) –
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
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) –
class pxr.UsdLux.LightListAPI
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:
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:
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:
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):
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.
Classes:
ComputeMode
Runtime control over whether to consult stored lightList caches.
Methods:
Apply
classmethod Apply(prim) -> LightListAPI
CanApply
classmethod CanApply(prim, whyNot) -> bool
ComputeLightList(mode)
Computes and returns the list of lights and light filters in the stage, optionally consulting a cached result.
CreateLightListCacheBehaviorAttr(...)
See GetLightListCacheBehaviorAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateLightListRel()
See GetLightListRel() , and also Create vs Get Property Methods for when to use Get vs Create.
Get
classmethod Get(stage, path) -> LightListAPI
GetLightListCacheBehaviorAttr()
Controls how the lightList should be interpreted.
GetLightListRel()
Relationship to lights in the scene.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
InvalidateLightList()
Mark any stored lightlist as invalid, by setting the lightList:cacheBehavior attribute to ignore.
StoreLightList(arg1)
Store the given paths as the lightlist for this prim.
Attributes:
ComputeModeConsultModelHierarchyCache
ComputeModeIgnoreCache
class ComputeMode
Runtime control over whether to consult stored lightList caches.
Methods:
GetValueFromName
Attributes:
allValues
static GetValueFromName()
allValues = (UsdLux.LightListAPI.ComputeModeConsultModelHierarchyCache, UsdLux.LightListAPI.ComputeModeIgnoreCache)
static Apply()
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) –
static CanApply()
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) –
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) –
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) –
CreateLightListRel() → Relationship
See GetLightListRel() , and also Create vs Get Property Methods for
when to use Get vs Create.
static Get()
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:
UsdLuxLightListAPI(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
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
GetLightListRel() → Relationship
Relationship to lights in the scene.
static GetSchemaAttributeNames()
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) –
InvalidateLightList() → None
Mark any stored lightlist as invalid, by setting the
lightList:cacheBehavior attribute to ignore.
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) –
ComputeModeConsultModelHierarchyCache = UsdLux.LightListAPI.ComputeModeConsultModelHierarchyCache
ComputeModeIgnoreCache = UsdLux.LightListAPI.ComputeModeIgnoreCache
class pxr.UsdLux.ListAPI
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.
Classes:
ComputeMode
Runtime control over whether to consult stored lightList caches.
Methods:
Apply
classmethod Apply(prim) -> ListAPI
CanApply
classmethod CanApply(prim, whyNot) -> bool
ComputeLightList(mode)
Computes and returns the list of lights and light filters in the stage, optionally consulting a cached result.
CreateLightListCacheBehaviorAttr(...)
See GetLightListCacheBehaviorAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateLightListRel()
See GetLightListRel() , and also Create vs Get Property Methods for when to use Get vs Create.
Get
classmethod Get(stage, path) -> ListAPI
GetLightListCacheBehaviorAttr()
Controls how the lightList should be interpreted.
GetLightListRel()
Relationship to lights in the scene.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
InvalidateLightList()
Mark any stored lightlist as invalid, by setting the lightList:cacheBehavior attribute to ignore.
StoreLightList(arg1)
Store the given paths as the lightlist for this prim.
Attributes:
ComputeModeConsultModelHierarchyCache
ComputeModeIgnoreCache
class ComputeMode
Runtime control over whether to consult stored lightList caches.
Methods:
GetValueFromName
Attributes:
allValues
static GetValueFromName()
allValues = (UsdLux.ListAPI.ComputeModeConsultModelHierarchyCache, UsdLux.ListAPI.ComputeModeIgnoreCache)
static Apply()
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) –
static CanApply()
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) –
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) –
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) –
CreateLightListRel() → Relationship
See GetLightListRel() , and also Create vs Get Property Methods for
when to use Get vs Create.
static Get()
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:
UsdLuxListAPI(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
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
GetLightListRel() → Relationship
Relationship to lights in the scene.
static GetSchemaAttributeNames()
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) –
InvalidateLightList() → None
Mark any stored lightlist as invalid, by setting the
lightList:cacheBehavior attribute to ignore.
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) –
ComputeModeConsultModelHierarchyCache = UsdLux.ListAPI.ComputeModeConsultModelHierarchyCache
ComputeModeIgnoreCache = UsdLux.ListAPI.ComputeModeIgnoreCache
class pxr.UsdLux.MeshLightAPI
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
Methods:
Apply
classmethod Apply(prim) -> MeshLightAPI
CanApply
classmethod CanApply(prim, whyNot) -> bool
Get
classmethod Get(stage, path) -> MeshLightAPI
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
static Apply()
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) –
static CanApply()
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) –
static Get()
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:
UsdLuxMeshLightAPI(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
static GetSchemaAttributeNames()
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) –
class pxr.UsdLux.NonboundableLightBase
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.
Methods:
CreateColorAttr(defaultValue, writeSparsely)
See UsdLuxLightAPI::CreateColorAttr() .
CreateColorTemperatureAttr(defaultValue, ...)
See UsdLuxLightAPI::CreateColorTemperatureAttr() .
CreateDiffuseAttr(defaultValue, writeSparsely)
See UsdLuxLightAPI::CreateDiffuseAttr() .
CreateEnableColorTemperatureAttr(...)
See UsdLuxLightAPI::CreateEnableColorTemperatureAttr() .
CreateExposureAttr(defaultValue, writeSparsely)
See UsdLuxLightAPI::CreateExposureAttr() .
CreateFiltersRel()
See UsdLuxLightAPI::CreateFiltersRel() .
CreateIntensityAttr(defaultValue, writeSparsely)
See UsdLuxLightAPI::CreateIntensityAttr() .
CreateNormalizeAttr(defaultValue, writeSparsely)
See UsdLuxLightAPI::CreateNormalizeAttr() .
CreateSpecularAttr(defaultValue, writeSparsely)
See UsdLuxLightAPI::CreateSpecularAttr() .
Get
classmethod Get(stage, path) -> NonboundableLightBase
GetColorAttr()
See UsdLuxLightAPI::GetColorAttr() .
GetColorTemperatureAttr()
See UsdLuxLightAPI::GetColorTemperatureAttr() .
GetDiffuseAttr()
See UsdLuxLightAPI::GetDiffuseAttr() .
GetEnableColorTemperatureAttr()
See UsdLuxLightAPI::GetEnableColorTemperatureAttr() .
GetExposureAttr()
See UsdLuxLightAPI::GetExposureAttr() .
GetFiltersRel()
See UsdLuxLightAPI::GetFiltersRel() .
GetIntensityAttr()
See UsdLuxLightAPI::GetIntensityAttr() .
GetNormalizeAttr()
See UsdLuxLightAPI::GetNormalizeAttr() .
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
GetSpecularAttr()
See UsdLuxLightAPI::GetSpecularAttr() .
LightAPI()
Contructs and returns a UsdLuxLightAPI object for this light.
CreateColorAttr(defaultValue, writeSparsely) → Attribute
See UsdLuxLightAPI::CreateColorAttr() .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateColorTemperatureAttr(defaultValue, writeSparsely) → Attribute
See UsdLuxLightAPI::CreateColorTemperatureAttr() .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateDiffuseAttr(defaultValue, writeSparsely) → Attribute
See UsdLuxLightAPI::CreateDiffuseAttr() .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateEnableColorTemperatureAttr(defaultValue, writeSparsely) → Attribute
See UsdLuxLightAPI::CreateEnableColorTemperatureAttr() .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateExposureAttr(defaultValue, writeSparsely) → Attribute
See UsdLuxLightAPI::CreateExposureAttr() .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateFiltersRel() → Relationship
See UsdLuxLightAPI::CreateFiltersRel() .
CreateIntensityAttr(defaultValue, writeSparsely) → Attribute
See UsdLuxLightAPI::CreateIntensityAttr() .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateNormalizeAttr(defaultValue, writeSparsely) → Attribute
See UsdLuxLightAPI::CreateNormalizeAttr() .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateSpecularAttr(defaultValue, writeSparsely) → Attribute
See UsdLuxLightAPI::CreateSpecularAttr() .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
static Get()
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:
UsdLuxNonboundableLightBase(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetColorAttr() → Attribute
See UsdLuxLightAPI::GetColorAttr() .
GetColorTemperatureAttr() → Attribute
See UsdLuxLightAPI::GetColorTemperatureAttr() .
GetDiffuseAttr() → Attribute
See UsdLuxLightAPI::GetDiffuseAttr() .
GetEnableColorTemperatureAttr() → Attribute
See UsdLuxLightAPI::GetEnableColorTemperatureAttr() .
GetExposureAttr() → Attribute
See UsdLuxLightAPI::GetExposureAttr() .
GetFiltersRel() → Relationship
See UsdLuxLightAPI::GetFiltersRel() .
GetIntensityAttr() → Attribute
See UsdLuxLightAPI::GetIntensityAttr() .
GetNormalizeAttr() → Attribute
See UsdLuxLightAPI::GetNormalizeAttr() .
static GetSchemaAttributeNames()
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) –
GetSpecularAttr() → Attribute
See UsdLuxLightAPI::GetSpecularAttr() .
LightAPI() → LightAPI
Contructs and returns a UsdLuxLightAPI object for this light.
class pxr.UsdLux.PluginLight
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
Methods:
Define
classmethod Define(stage, path) -> PluginLight
Get
classmethod Get(stage, path) -> PluginLight
GetNodeDefAPI()
Convenience method for accessing the UsdShadeNodeDefAPI functionality for this prim.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
static Define()
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) –
static Get()
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:
UsdLuxPluginLight(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetNodeDefAPI() → NodeDefAPI
Convenience method for accessing the UsdShadeNodeDefAPI functionality
for this prim.
One can also construct a UsdShadeNodeDefAPI directly from a UsdPrim.
static GetSchemaAttributeNames()
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) –
class pxr.UsdLux.PluginLightFilter
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
Methods:
Define
classmethod Define(stage, path) -> PluginLightFilter
Get
classmethod Get(stage, path) -> PluginLightFilter
GetNodeDefAPI()
Convenience method for accessing the UsdShadeNodeDefAPI functionality for this prim.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
static Define()
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) –
static Get()
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:
UsdLuxPluginLightFilter(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetNodeDefAPI() → NodeDefAPI
Convenience method for accessing the UsdShadeNodeDefAPI functionality
for this prim.
One can also construct a UsdShadeNodeDefAPI directly from a UsdPrim.
static GetSchemaAttributeNames()
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) –
class pxr.UsdLux.PortalLight
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.
Methods:
Define
classmethod Define(stage, path) -> PortalLight
Get
classmethod Get(stage, path) -> PortalLight
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
static Define()
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) –
static Get()
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:
UsdLuxPortalLight(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
static GetSchemaAttributeNames()
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) –
class pxr.UsdLux.RectLight
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).
Methods:
CreateHeightAttr(defaultValue, writeSparsely)
See GetHeightAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateTextureFileAttr(defaultValue, ...)
See GetTextureFileAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateWidthAttr(defaultValue, writeSparsely)
See GetWidthAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
Define
classmethod Define(stage, path) -> RectLight
Get
classmethod Get(stage, path) -> RectLight
GetHeightAttr()
Height of the rectangle, in the local Y axis.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
GetTextureFileAttr()
A color texture to use on the rectangle.
GetWidthAttr()
Width of the rectangle, in the local X axis.
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) –
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) –
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) –
static Define()
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) –
static Get()
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:
UsdLuxRectLight(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetHeightAttr() → Attribute
Height of the rectangle, in the local Y axis.
Declaration
float inputs:height = 1
C++ Type
float
Usd Type
SdfValueTypeNames->Float
static GetSchemaAttributeNames()
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) –
GetTextureFileAttr() → Attribute
A color texture to use on the rectangle.
Declaration
asset inputs:texture:file
C++ Type
SdfAssetPath
Usd Type
SdfValueTypeNames->Asset
GetWidthAttr() → Attribute
Width of the rectangle, in the local X axis.
Declaration
float inputs:width = 1
C++ Type
float
Usd Type
SdfValueTypeNames->Float
class pxr.UsdLux.ShadowAPI
Controls to refine a light’s shadow behavior. These are non-physical
controls that are valuable for visual lighting work.
Methods:
Apply
classmethod Apply(prim) -> ShadowAPI
CanApply
classmethod CanApply(prim, whyNot) -> bool
ConnectableAPI()
Contructs and returns a UsdShadeConnectableAPI object with this shadow API prim.
CreateInput(name, typeName)
Create an input which can either have a value or can be connected.
CreateOutput(name, typeName)
Create an output which can either have a value or can be connected.
CreateShadowColorAttr(defaultValue, ...)
See GetShadowColorAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateShadowDistanceAttr(defaultValue, ...)
See GetShadowDistanceAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateShadowEnableAttr(defaultValue, ...)
See GetShadowEnableAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateShadowFalloffAttr(defaultValue, ...)
See GetShadowFalloffAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateShadowFalloffGammaAttr(defaultValue, ...)
See GetShadowFalloffGammaAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
Get
classmethod Get(stage, path) -> ShadowAPI
GetInput(name)
Return the requested input if it exists.
GetInputs(onlyAuthored)
Inputs are represented by attributes in the"inputs:"namespace.
GetOutput(name)
Return the requested output if it exists.
GetOutputs(onlyAuthored)
Outputs are represented by attributes in the"outputs:"namespace.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
GetShadowColorAttr()
The color of shadows cast by the light.
GetShadowDistanceAttr()
The maximum distance shadows are cast.
GetShadowEnableAttr()
Enables shadows to be cast by this light.
GetShadowFalloffAttr()
The near distance at which shadow falloff begins.
GetShadowFalloffGammaAttr()
A gamma (i.e., exponential) control over shadow strength with linear distance within the falloff zone.
static Apply()
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) –
static CanApply()
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) –
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.
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) –
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) –
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) –
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) –
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) –
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) –
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) –
static Get()
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:
UsdLuxShadowAPI(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetInput(name) → Input
Return the requested input if it exists.
Parameters
name (str) –
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) –
GetOutput(name) → Output
Return the requested output if it exists.
Parameters
name (str) –
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) –
static GetSchemaAttributeNames()
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) –
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
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
GetShadowEnableAttr() → Attribute
Enables shadows to be cast by this light.
Declaration
bool inputs:shadow:enable = 1
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
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
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
class pxr.UsdLux.ShapingAPI
Controls for shaping a light’s emission.
Methods:
Apply
classmethod Apply(prim) -> ShapingAPI
CanApply
classmethod CanApply(prim, whyNot) -> bool
ConnectableAPI()
Contructs and returns a UsdShadeConnectableAPI object with this shaping API prim.
CreateInput(name, typeName)
Create an input which can either have a value or can be connected.
CreateOutput(name, typeName)
Create an output which can either have a value or can be connected.
CreateShapingConeAngleAttr(defaultValue, ...)
See GetShapingConeAngleAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateShapingConeSoftnessAttr(defaultValue, ...)
See GetShapingConeSoftnessAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateShapingFocusAttr(defaultValue, ...)
See GetShapingFocusAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateShapingFocusTintAttr(defaultValue, ...)
See GetShapingFocusTintAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateShapingIesAngleScaleAttr(defaultValue, ...)
See GetShapingIesAngleScaleAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateShapingIesFileAttr(defaultValue, ...)
See GetShapingIesFileAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateShapingIesNormalizeAttr(defaultValue, ...)
See GetShapingIesNormalizeAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
Get
classmethod Get(stage, path) -> ShapingAPI
GetInput(name)
Return the requested input if it exists.
GetInputs(onlyAuthored)
Inputs are represented by attributes in the"inputs:"namespace.
GetOutput(name)
Return the requested output if it exists.
GetOutputs(onlyAuthored)
Outputs are represented by attributes in the"outputs:"namespace.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
GetShapingConeAngleAttr()
Angular limit off the primary axis to restrict the light spread.
GetShapingConeSoftnessAttr()
Controls the cutoff softness for cone angle.
GetShapingFocusAttr()
A control to shape the spread of light.
GetShapingFocusTintAttr()
Off-axis color tint.
GetShapingIesAngleScaleAttr()
Rescales the angular distribution of the IES profile.
GetShapingIesFileAttr()
An IES (Illumination Engineering Society) light profile describing the angular distribution of light.
GetShapingIesNormalizeAttr()
Normalizes the IES profile so that it affects the shaping of the light while preserving the overall energy output.
static Apply()
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) –
static CanApply()
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) –
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.
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) –
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) –
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) –
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) –
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) –
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) –
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) –
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) –
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) –
static Get()
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:
UsdLuxShapingAPI(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetInput(name) → Input
Return the requested input if it exists.
Parameters
name (str) –
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) –
GetOutput(name) → Output
Return the requested output if it exists.
Parameters
name (str) –
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) –
static GetSchemaAttributeNames()
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) –
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
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
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
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
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
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
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
class pxr.UsdLux.SphereLight
Light emitted outward from a sphere.
Methods:
CreateRadiusAttr(defaultValue, writeSparsely)
See GetRadiusAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateTreatAsPointAttr(defaultValue, ...)
See GetTreatAsPointAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
Define
classmethod Define(stage, path) -> SphereLight
Get
classmethod Get(stage, path) -> SphereLight
GetRadiusAttr()
Radius of the sphere.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
GetTreatAsPointAttr()
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.
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) –
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) –
static Define()
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) –
static Get()
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:
UsdLuxSphereLight(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetRadiusAttr() → Attribute
Radius of the sphere.
Declaration
float inputs:radius = 0.5
C++ Type
float
Usd Type
SdfValueTypeNames->Float
static GetSchemaAttributeNames()
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) –
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
class pxr.UsdLux.Tokens
Attributes:
angular
automatic
collectionFilterLinkIncludeRoot
collectionLightLinkIncludeRoot
collectionShadowLinkIncludeRoot
consumeAndContinue
consumeAndHalt
cubeMapVerticalCross
cylinderLight
diskLight
distantLight
domeLight
extent
filterLink
geometry
geometryLight
guideRadius
ignore
independent
inputsAngle
inputsColor
inputsColorTemperature
inputsDiffuse
inputsEnableColorTemperature
inputsExposure
inputsHeight
inputsIntensity
inputsLength
inputsNormalize
inputsRadius
inputsShadowColor
inputsShadowDistance
inputsShadowEnable
inputsShadowFalloff
inputsShadowFalloffGamma
inputsShapingConeAngle
inputsShapingConeSoftness
inputsShapingFocus
inputsShapingFocusTint
inputsShapingIesAngleScale
inputsShapingIesFile
inputsShapingIesNormalize
inputsSpecular
inputsTextureFile
inputsTextureFormat
inputsWidth
latlong
lightFilterShaderId
lightFilters
lightLink
lightList
lightListCacheBehavior
lightMaterialSyncMode
lightShaderId
materialGlowTintsLight
meshLight
mirroredBall
noMaterialResponse
orientToStageUpAxis
portalLight
portals
rectLight
shadowLink
sphereLight
treatAsLine
treatAsPoint
volumeLight
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'
class pxr.UsdLux.VolumeLightAPI
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
Methods:
Apply
classmethod Apply(prim) -> VolumeLightAPI
CanApply
classmethod CanApply(prim, whyNot) -> bool
Get
classmethod Get(stage, path) -> VolumeLightAPI
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
static Apply()
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) –
static CanApply()
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) –
static Get()
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:
UsdLuxVolumeLightAPI(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
static GetSchemaAttributeNames()
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) –
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023. |
omni.ui.ArrowType.md | ArrowType — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
ArrowType
# ArrowType
class omni.ui.ArrowType
Bases: pybind11_object
Members:
NONE
ARROW
Methods
__init__(self, value)
Attributes
ARROW
NONE
name
value
__init__(self: omni.ui._ui.ArrowType, value: int) → None
property name
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
Gf.md | Gf module — pxr-usd-api 105.1 documentation
pxr-usd-api
»
Modules »
Gf module
# Gf module
Summary: The Gf (Graphics Foundations) library contains classes and functions for working with basic mathematical aspects of graphics.
Graphics Foundation
This package defines classes for fundamental graphics types and operations.
Classes:
BBox3d
Arbitrarily oriented 3D bounding box
Camera
DualQuatd
DualQuatf
DualQuath
Frustum
Basic view frustum
Interval
Basic mathematical interval class
Line
Line class
LineSeg
Line segment class
Matrix2d
Matrix2f
Matrix3d
Matrix3f
Matrix4d
Matrix4f
MultiInterval
Plane
Quatd
Quaternion
Quaternion class
Quatf
Quath
Range1d
Range1f
Range2d
Range2f
Range3d
Range3f
Ray
Rect2i
Rotation
3-space rotation
Size2
A 2D size class
Size3
A 3D size class
Transform
Vec2d
Vec2f
Vec2h
Vec2i
Vec3d
Vec3f
Vec3h
Vec3i
Vec4d
Vec4f
Vec4h
Vec4i
class pxr.Gf.BBox3d
Arbitrarily oriented 3D bounding box
Methods:
Combine
classmethod Combine(b1, b2) -> BBox3d
ComputeAlignedBox()
Returns the axis-aligned range (as a GfRange3d ) that results from applying the transformation matrix to the axis-aligned box and aligning the result.
ComputeAlignedRange()
Returns the axis-aligned range (as a GfRange3d ) that results from applying the transformation matrix to the wxis-aligned box and aligning the result.
ComputeCentroid()
Returns the centroid of the bounding box.
GetBox()
Returns the range of the axis-aligned untransformed box.
GetInverseMatrix()
Returns the inverse of the transformation matrix.
GetMatrix()
Returns the transformation matrix.
GetRange()
Returns the range of the axis-aligned untransformed box.
GetVolume()
Returns the volume of the box (0 for an empty box).
HasZeroAreaPrimitives()
Returns the current state of the zero-area primitives flag".
Set(box, matrix)
Sets the axis-aligned box and transformation matrix.
SetHasZeroAreaPrimitives(hasThem)
Sets the zero-area primitives flag to the given value.
SetMatrix(matrix)
Sets the transformation matrix only.
SetRange(box)
Sets the range of the axis-aligned box only.
Transform(matrix)
Transforms the bounding box by the given matrix, which is assumed to be a global transformation to apply to the box.
Attributes:
box
hasZeroAreaPrimitives
matrix
static Combine()
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) –
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.
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.
ComputeCentroid() → Vec3d
Returns the centroid of the bounding box.
The centroid is computed as the transformed centroid of the range.
GetBox() → Range3d
Returns the range of the axis-aligned untransformed box.
This synonym of GetRange exists for compatibility purposes.
GetInverseMatrix() → Matrix4d
Returns the inverse of the transformation matrix.
This will be the identity matrix if the transformation matrix is not
invertible.
GetMatrix() → Matrix4d
Returns the transformation matrix.
GetRange() → Range3d
Returns the range of the axis-aligned untransformed box.
GetVolume() → float
Returns the volume of the box (0 for an empty box).
HasZeroAreaPrimitives() → bool
Returns the current state of the zero-area primitives flag”.
Set(box, matrix) → None
Sets the axis-aligned box and transformation matrix.
Parameters
box (Range3d) –
matrix (Matrix4d) –
SetHasZeroAreaPrimitives(hasThem) → None
Sets the zero-area primitives flag to the given value.
Parameters
hasThem (bool) –
SetMatrix(matrix) → None
Sets the transformation matrix only.
The axis-aligned box is not modified.
Parameters
matrix (Matrix4d) –
SetRange(box) → None
Sets the range of the axis-aligned box only.
The transformation matrix is not modified.
Parameters
box (Range3d) –
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 box
property hasZeroAreaPrimitives
property matrix
class pxr.Gf.Camera
Classes:
FOVDirection
Direction used for Field of View or orthographic size.
Projection
Projection type.
Methods:
GetFieldOfView(direction)
Returns the horizontal or vertical field of view in degrees.
SetFromViewAndProjectionMatrix(viewMatrix, ...)
Sets the camera from a view and projection matrix.
SetOrthographicFromAspectRatioAndSize(...)
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).
SetPerspectiveFromAspectRatioAndFieldOfView(...)
Sets the frustum to be projective with the given aspectRatio and horizontal, respectively, vertical field of view fieldOfView (similar to gluPerspective when direction = FOVVertical).
Attributes:
APERTURE_UNIT
DEFAULT_HORIZONTAL_APERTURE
DEFAULT_VERTICAL_APERTURE
FOCAL_LENGTH_UNIT
FOVHorizontal
FOVVertical
Orthographic
Perspective
aspectRatio
float
clippingPlanes
list[Vec4f]
clippingRange
Range1f
fStop
float
focalLength
float
focusDistance
float
frustum
Frustum
horizontalAperture
float
horizontalApertureOffset
float
horizontalFieldOfView
projection
Projection
transform
Matrix4d
verticalAperture
float
verticalApertureOffset
float
verticalFieldOfView
class FOVDirection
Direction used for Field of View or orthographic size.
Methods:
GetValueFromName
Attributes:
allValues
static GetValueFromName()
allValues = (Gf.Camera.FOVHorizontal, Gf.Camera.FOVVertical)
class Projection
Projection type.
Methods:
GetValueFromName
Attributes:
allValues
static GetValueFromName()
allValues = (Gf.Camera.Perspective, Gf.Camera.Orthographic)
GetFieldOfView(direction) → float
Returns the horizontal or vertical field of view in degrees.
Parameters
direction (FOVDirection) –
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) –
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) –
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) –
APERTURE_UNIT = 0.1
DEFAULT_HORIZONTAL_APERTURE = 20.955
DEFAULT_VERTICAL_APERTURE = 15.290799999999999
FOCAL_LENGTH_UNIT = 0.1
FOVHorizontal = Gf.Camera.FOVHorizontal
FOVVertical = Gf.Camera.FOVVertical
Orthographic = Gf.Camera.Orthographic
Perspective = Gf.Camera.Perspective
property aspectRatio
float
Returns the projector aperture aspect ratio.
Type
type
property clippingPlanes
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.
Type
type
property clippingRange
Range1f
Returns the clipping range in world units.
type : None
Sets the clipping range in world units.
Type
type
property fStop
float
Returns the lens aperture.
type : None
Sets the lens aperture, unitless.
Type
type
property focalLength
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
type
property focusDistance
float
Returns the focus distance in world units.
type : None
Sets the focus distance in world units.
Type
type
property frustum
Frustum
Returns the computed, world-space camera frustum.
The frustum will always be that of a Y-up, -Z-looking camera.
Type
type
property horizontalAperture
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
type
property horizontalApertureOffset
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
type
property horizontalFieldOfView
property projection
Projection
Returns the projection type.
type : None
Sets the projection type.
Type
type
property transform
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
type
property verticalAperture
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
type
property verticalApertureOffset
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
type
property verticalFieldOfView
class pxr.Gf.DualQuatd
Methods:
GetConjugate()
Returns the conjugate of this dual quaternion.
GetDual()
Returns the dual part of the dual quaternion.
GetIdentity
classmethod GetIdentity() -> DualQuatd
GetInverse()
Returns the inverse of this dual quaternion.
GetLength()
Returns geometric length of this dual quaternion.
GetNormalized(eps)
Returns a normalized (unit-length) version of this dual quaternion.
GetReal()
Returns the real part of the dual quaternion.
GetTranslation()
Get the translation component of this dual quaternion.
GetZero
classmethod GetZero() -> DualQuatd
Normalize(eps)
Normalizes this dual quaternion in place.
SetDual(dual)
Sets the dual part of the dual quaternion.
SetReal(real)
Sets the real part of the dual quaternion.
SetTranslation(translation)
Set the translation component of this dual quaternion.
Transform(vec)
Transforms the row vector vec by the dual quaternion.
Attributes:
dual
real
GetConjugate() → DualQuatd
Returns the conjugate of this dual quaternion.
GetDual() → Quatd
Returns the dual part of the dual quaternion.
static GetIdentity()
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).
GetInverse() → DualQuatd
Returns the inverse of this dual quaternion.
GetLength() → tuple[float, float]
Returns geometric length of this dual quaternion.
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) –
GetReal() → Quatd
Returns the real part of the dual quaternion.
GetTranslation() → Vec3d
Get the translation component of this dual quaternion.
static GetZero()
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).
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) –
SetDual(dual) → None
Sets the dual part of the dual quaternion.
Parameters
dual (Quatd) –
SetReal(real) → None
Sets the real part of the dual quaternion.
Parameters
real (Quatd) –
SetTranslation(translation) → None
Set the translation component of this dual quaternion.
Parameters
translation (Vec3d) –
Transform(vec) → Vec3d
Transforms the row vector vec by the dual quaternion.
Parameters
vec (Vec3d) –
property dual
property real
class pxr.Gf.DualQuatf
Methods:
GetConjugate()
Returns the conjugate of this dual quaternion.
GetDual()
Returns the dual part of the dual quaternion.
GetIdentity
classmethod GetIdentity() -> DualQuatf
GetInverse()
Returns the inverse of this dual quaternion.
GetLength()
Returns geometric length of this dual quaternion.
GetNormalized(eps)
Returns a normalized (unit-length) version of this dual quaternion.
GetReal()
Returns the real part of the dual quaternion.
GetTranslation()
Get the translation component of this dual quaternion.
GetZero
classmethod GetZero() -> DualQuatf
Normalize(eps)
Normalizes this dual quaternion in place.
SetDual(dual)
Sets the dual part of the dual quaternion.
SetReal(real)
Sets the real part of the dual quaternion.
SetTranslation(translation)
Set the translation component of this dual quaternion.
Transform(vec)
Transforms the row vector vec by the dual quaternion.
Attributes:
dual
real
GetConjugate() → DualQuatf
Returns the conjugate of this dual quaternion.
GetDual() → Quatf
Returns the dual part of the dual quaternion.
static GetIdentity()
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).
GetInverse() → DualQuatf
Returns the inverse of this dual quaternion.
GetLength() → tuple[float, float]
Returns geometric length of this dual quaternion.
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) –
GetReal() → Quatf
Returns the real part of the dual quaternion.
GetTranslation() → Vec3f
Get the translation component of this dual quaternion.
static GetZero()
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).
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) –
SetDual(dual) → None
Sets the dual part of the dual quaternion.
Parameters
dual (Quatf) –
SetReal(real) → None
Sets the real part of the dual quaternion.
Parameters
real (Quatf) –
SetTranslation(translation) → None
Set the translation component of this dual quaternion.
Parameters
translation (Vec3f) –
Transform(vec) → Vec3f
Transforms the row vector vec by the dual quaternion.
Parameters
vec (Vec3f) –
property dual
property real
class pxr.Gf.DualQuath
Methods:
GetConjugate()
Returns the conjugate of this dual quaternion.
GetDual()
Returns the dual part of the dual quaternion.
GetIdentity
classmethod GetIdentity() -> DualQuath
GetInverse()
Returns the inverse of this dual quaternion.
GetLength()
Returns geometric length of this dual quaternion.
GetNormalized(eps)
Returns a normalized (unit-length) version of this dual quaternion.
GetReal()
Returns the real part of the dual quaternion.
GetTranslation()
Get the translation component of this dual quaternion.
GetZero
classmethod GetZero() -> DualQuath
Normalize(eps)
Normalizes this dual quaternion in place.
SetDual(dual)
Sets the dual part of the dual quaternion.
SetReal(real)
Sets the real part of the dual quaternion.
SetTranslation(translation)
Set the translation component of this dual quaternion.
Transform(vec)
Transforms the row vector vec by the dual quaternion.
Attributes:
dual
real
GetConjugate() → DualQuath
Returns the conjugate of this dual quaternion.
GetDual() → Quath
Returns the dual part of the dual quaternion.
static GetIdentity()
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).
GetInverse() → DualQuath
Returns the inverse of this dual quaternion.
GetLength() → tuple[GfHalf, GfHalf]
Returns geometric length of this dual quaternion.
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) –
GetReal() → Quath
Returns the real part of the dual quaternion.
GetTranslation() → Vec3h
Get the translation component of this dual quaternion.
static GetZero()
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).
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) –
SetDual(dual) → None
Sets the dual part of the dual quaternion.
Parameters
dual (Quath) –
SetReal(real) → None
Sets the real part of the dual quaternion.
Parameters
real (Quath) –
SetTranslation(translation) → None
Set the translation component of this dual quaternion.
Parameters
translation (Vec3h) –
Transform(vec) → Vec3h
Transforms the row vector vec by the dual quaternion.
Parameters
vec (Vec3h) –
property dual
property real
class pxr.Gf.Frustum
Basic view frustum
Classes:
ProjectionType
This enum is used to determine the type of projection represented by a frustum.
Methods:
ComputeAspectRatio()
Returns the aspect ratio of the frustum, defined as the width of the window divided by the height.
ComputeCorners()
Returns the world-space corners of the frustum as a vector of 8 points, ordered as:
ComputeCornersAtDistance(d)
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:
ComputeLookAtPoint()
Computes and returns the world-space look-at point from the eye point (position), view direction (rotation), and view distance.
ComputeNarrowedFrustum(windowPos, size)
Returns a frustum that is a narrowed-down version of this frustum.
ComputePickRay(windowPos)
Builds and returns a GfRay that can be used for picking at the given normalized (-1 to +1 in both dimensions) window position.
ComputeProjectionMatrix()
Returns a GL-style projection matrix corresponding to the frustum's projection.
ComputeUpVector()
Returns the normalized world-space up vector, which is computed by rotating the y axis by the frustum's rotation.
ComputeViewDirection()
Returns the normalized world-space view direction vector, which is computed by rotating the -z axis by the frustum's rotation.
ComputeViewFrame(side, up, view)
Computes the view frame defined by this frustum.
ComputeViewInverse()
Returns a matrix that represents the inverse viewing transformation for this frustum.
ComputeViewMatrix()
Returns a matrix that represents the viewing transformation for this frustum.
FitToSphere(center, radius, slack)
Modifies the frustum to tightly enclose a sphere with the given center and radius, using the current view direction.
GetFOV
Returns the horizontal fov of the frustum.
GetNearFar()
Returns the near/far interval.
GetOrthographic(left, right, bottom, top, ...)
Returns the current frustum in the format used by SetOrthographic() .
GetPerspective
Returns the current perspective frustum values suitable for use by SetPerspective.
GetPosition()
Returns the position of the frustum in world space.
GetProjectionType()
Returns the projection type.
GetReferencePlaneDepth
classmethod GetReferencePlaneDepth() -> float
GetRotation()
Returns the orientation of the frustum in world space as a rotation to apply to the -z axis.
GetViewDistance()
Returns the view distance.
GetWindow()
Returns the window rectangle in the reference plane.
Intersects(bbox)
Returns true if the given axis-aligned bbox is inside or intersecting the frustum.
IntersectsViewVolume
classmethod IntersectsViewVolume(bbox, vpMat) -> bool
SetNearFar(nearFar)
Sets the near/far interval.
SetOrthographic(left, right, bottom, top, ...)
Sets up the frustum in a manner similar to glOrtho() .
SetPerspective(fieldOfViewHeight, ...)
Sets up the frustum in a manner similar to gluPerspective() .
SetPosition(position)
Sets the position of the frustum in world space.
SetPositionAndRotationFromMatrix(camToWorldXf)
Sets the position and rotation of the frustum from a camera matrix (always from a y-Up camera).
SetProjectionType(projectionType)
Sets the projection type.
SetRotation(rotation)
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".
SetViewDistance(viewDistance)
Sets the view distance.
SetWindow(window)
Sets the window rectangle in the reference plane that defines the left, right, top, and bottom planes of the frustum.
Transform(matrix)
Transforms the frustum by the given matrix.
Attributes:
Orthographic
Perspective
nearFar
position
projectionType
rotation
viewDistance
window
class ProjectionType
This enum is used to determine the type of projection represented by a
frustum.
Methods:
GetValueFromName
Attributes:
allValues
static GetValueFromName()
allValues = (Gf.Frustum.Orthographic, Gf.Frustum.Perspective)
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.
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
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) –
ComputeLookAtPoint() → Vec3d
Computes and returns the world-space look-at point from the eye point
(position), view direction (rotation), and view distance.
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) –
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) –
ComputeProjectionMatrix() → Matrix4d
Returns a GL-style projection matrix corresponding to the frustum’s
projection.
ComputeUpVector() → Vec3d
Returns the normalized world-space up vector, which is computed by
rotating the y axis by the frustum’s rotation.
ComputeViewDirection() → Vec3d
Returns the normalized world-space view direction vector, which is
computed by rotating the -z axis by the frustum’s rotation.
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.
up
^ ^
| /
| / view
|/
+- - - - > side
Parameters
side (Vec3d) –
up (Vec3d) –
view (Vec3d) –
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.
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.
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) –
GetFOV()
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.
GetNearFar() → Range1d
Returns the near/far interval.
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) –
GetPerspective()
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.
GetPosition() → Vec3d
Returns the position of the frustum in world space.
GetProjectionType() → Frustum.ProjectionType
Returns the projection type.
static GetReferencePlaneDepth()
classmethod GetReferencePlaneDepth() -> float
Returns the depth of the reference plane.
GetRotation() → Rotation
Returns the orientation of the frustum in world space as a rotation to
apply to the -z axis.
GetViewDistance() → float
Returns the view distance.
GetWindow() → Range2d
Returns the window rectangle in the reference plane.
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) –
static IntersectsViewVolume()
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) –
SetNearFar(nearFar) → None
Sets the near/far interval.
Parameters
nearFar (Range1d) –
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) –
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:
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) –
SetPosition(position) → None
Sets the position of the frustum in world space.
Parameters
position (Vec3d) –
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) –
SetProjectionType(projectionType) → None
Sets the projection type.
Parameters
projectionType (Frustum.ProjectionType) –
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) –
SetViewDistance(viewDistance) → None
Sets the view distance.
Parameters
viewDistance (float) –
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) –
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) –
Orthographic = Gf.Frustum.Orthographic
Perspective = Gf.Frustum.Perspective
property nearFar
property position
property projectionType
property rotation
property viewDistance
property window
class pxr.Gf.Interval
Basic mathematical interval class
Methods:
Contains
Returns true if x is inside the interval.
GetFullInterval
classmethod GetFullInterval() -> Interval
GetMax
Get the maximum value.
GetMin
Get the minimum value.
GetSize
The width of the interval
In
Returns true if x is inside the interval.
Intersects(i)
Return true iff the given interval i intersects this interval.
IsEmpty
True if the interval is empty.
IsFinite()
Returns true if both the maximum and minimum value are finite.
IsMaxClosed()
Maximum boundary condition.
IsMaxFinite()
Returns true if the maximum value is finite.
IsMaxOpen()
Maximum boundary condition.
IsMinClosed()
Minimum boundary condition.
IsMinFinite()
Returns true if the minimum value is finite.
IsMinOpen()
Minimum boundary condition.
SetMax
Set the maximum value.
SetMin
Set the minimum value.
Attributes:
finite
isEmpty
True if the interval is empty.
max
The maximum value.
maxClosed
maxFinite
maxOpen
min
The minimum value.
minClosed
minFinite
minOpen
size
The width of the interval.
Contains()
Returns true if x is inside the interval.
Returns true if x is inside the interval.
static GetFullInterval()
classmethod GetFullInterval() -> Interval
Returns the full interval (-inf, inf).
GetMax()
Get the maximum value.
GetMin()
Get the minimum value.
GetSize()
The width of the interval
In()
Returns true if x is inside the interval.
Intersects(i) → bool
Return true iff the given interval i intersects this interval.
Parameters
i (Interval) –
IsEmpty()
True if the interval is empty.
IsFinite() → bool
Returns true if both the maximum and minimum value are finite.
IsMaxClosed() → bool
Maximum boundary condition.
IsMaxFinite() → bool
Returns true if the maximum value is finite.
IsMaxOpen() → bool
Maximum boundary condition.
IsMinClosed() → bool
Minimum boundary condition.
IsMinFinite() → bool
Returns true if the minimum value is finite.
IsMinOpen() → bool
Minimum boundary condition.
SetMax()
Set the maximum value.
Set the maximum value and boundary condition.
SetMin()
Set the minimum value.
Set the minimum value and boundary condition.
property finite
property isEmpty
True if the interval is empty.
property max
The maximum value.
property maxClosed
property maxFinite
property maxOpen
property min
The minimum value.
property minClosed
property minFinite
property minOpen
property size
The width of the interval.
class pxr.Gf.Line
Line class
Methods:
FindClosestPoint(point, t)
Returns the point on the line that is closest to point .
GetDirection()
Return the normalized direction of the line.
GetPoint(t)
Return the point on the line at ```` ( p0 + t * dir).
Set(p0, dir)
param p0
Attributes:
direction
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) –
GetDirection() → Vec3d
Return the normalized direction of the line.
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) –
Set(p0, dir) → float
Parameters
p0 (Vec3d) –
dir (Vec3d) –
property direction
class pxr.Gf.LineSeg
Line segment class
Methods:
FindClosestPoint(point, t)
Returns the point on the line that is closest to point .
GetDirection()
Return the normalized direction of the line.
GetLength()
Return the length of the line.
GetPoint(t)
Return the point on the segment specified by the parameter t.
Attributes:
direction
length
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) –
GetDirection() → Vec3d
Return the normalized direction of the line.
GetLength() → float
Return the length of the line.
GetPoint(t) → Vec3d
Return the point on the segment specified by the parameter t.
p = p0 + t * (p1 - p0)
Parameters
t (float) –
property direction
property length
class pxr.Gf.Matrix2d
Methods:
GetColumn(i)
Gets a column of the matrix as a Vec2.
GetDeterminant()
Returns the determinant of the matrix.
GetInverse(det, eps)
Returns the inverse of the matrix, or FLT_MAX * SetIdentity() if the matrix is singular.
GetRow(i)
Gets a row of the matrix as a Vec2.
GetTranspose()
Returns the transpose of the matrix.
Set(m00, m01, m10, m11)
Sets the matrix from 4 independent double values, specified in row-major order.
SetColumn(i, v)
Sets a column of the matrix from a Vec2.
SetDiagonal(s)
Sets the matrix to s times the identity matrix.
SetIdentity()
Sets the matrix to the identity matrix.
SetRow(i, v)
Sets a row of the matrix from a Vec2.
SetZero()
Sets the matrix to zero.
Attributes:
dimension
GetColumn(i) → Vec2d
Gets a column of the matrix as a Vec2.
Parameters
i (int) –
GetDeterminant() → float
Returns the determinant of the matrix.
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) –
GetRow(i) → Vec2d
Gets a row of the matrix as a Vec2.
Parameters
i (int) –
GetTranspose() → Matrix2d
Returns the transpose of the matrix.
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) –
SetColumn(i, v) → None
Sets a column of the matrix from a Vec2.
Parameters
i (int) –
v (Vec2d) –
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) –
SetIdentity() → Matrix2d
Sets the matrix to the identity matrix.
SetRow(i, v) → None
Sets a row of the matrix from a Vec2.
Parameters
i (int) –
v (Vec2d) –
SetZero() → Matrix2d
Sets the matrix to zero.
dimension = (2, 2)
class pxr.Gf.Matrix2f
Methods:
GetColumn(i)
Gets a column of the matrix as a Vec2.
GetDeterminant()
Returns the determinant of the matrix.
GetInverse(det, eps)
Returns the inverse of the matrix, or FLT_MAX * SetIdentity() if the matrix is singular.
GetRow(i)
Gets a row of the matrix as a Vec2.
GetTranspose()
Returns the transpose of the matrix.
Set(m00, m01, m10, m11)
Sets the matrix from 4 independent float values, specified in row- major order.
SetColumn(i, v)
Sets a column of the matrix from a Vec2.
SetDiagonal(s)
Sets the matrix to s times the identity matrix.
SetIdentity()
Sets the matrix to the identity matrix.
SetRow(i, v)
Sets a row of the matrix from a Vec2.
SetZero()
Sets the matrix to zero.
Attributes:
dimension
GetColumn(i) → Vec2f
Gets a column of the matrix as a Vec2.
Parameters
i (int) –
GetDeterminant() → float
Returns the determinant of the matrix.
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) –
GetRow(i) → Vec2f
Gets a row of the matrix as a Vec2.
Parameters
i (int) –
GetTranspose() → Matrix2f
Returns the transpose of the matrix.
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) –
SetColumn(i, v) → None
Sets a column of the matrix from a Vec2.
Parameters
i (int) –
v (Vec2f) –
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) –
SetIdentity() → Matrix2f
Sets the matrix to the identity matrix.
SetRow(i, v) → None
Sets a row of the matrix from a Vec2.
Parameters
i (int) –
v (Vec2f) –
SetZero() → Matrix2f
Sets the matrix to zero.
dimension = (2, 2)
class pxr.Gf.Matrix3d
Methods:
ExtractRotation()
Returns the rotation corresponding to this matrix.
GetColumn(i)
Gets a column of the matrix as a Vec3.
GetDeterminant()
Returns the determinant of the matrix.
GetHandedness()
Returns the sign of the determinant of the matrix, i.e.
GetInverse(det, eps)
Returns the inverse of the matrix, or FLT_MAX * SetIdentity() if the matrix is singular.
GetOrthonormalized(issueWarning)
Returns an orthonormalized copy of the matrix.
GetRow(i)
Gets a row of the matrix as a Vec3.
GetTranspose()
Returns the transpose of the matrix.
IsLeftHanded()
Returns true if the vectors in matrix form a left-handed coordinate system.
IsRightHanded()
Returns true if the vectors in the matrix form a right-handed coordinate system.
Orthonormalize(issueWarning)
Makes the matrix orthonormal in place.
Set(m00, m01, m02, m10, m11, m12, m20, m21, m22)
Sets the matrix from 9 independent double values, specified in row-major order.
SetColumn(i, v)
Sets a column of the matrix from a Vec3.
SetDiagonal(s)
Sets the matrix to s times the identity matrix.
SetIdentity()
Sets the matrix to the identity matrix.
SetRotate(rot)
Sets the matrix to specify a rotation equivalent to rot.
SetRow(i, v)
Sets a row of the matrix from a Vec3.
SetScale(scaleFactors)
Sets the matrix to specify a nonuniform scaling in x, y, and z by the factors in vector scaleFactors.
SetZero()
Sets the matrix to zero.
Attributes:
dimension
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.
GetColumn(i) → Vec3d
Gets a column of the matrix as a Vec3.
Parameters
i (int) –
GetDeterminant() → float
Returns the determinant of the matrix.
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.
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) –
GetOrthonormalized(issueWarning) → Matrix3d
Returns an orthonormalized copy of the matrix.
Parameters
issueWarning (bool) –
GetRow(i) → Vec3d
Gets a row of the matrix as a Vec3.
Parameters
i (int) –
GetTranspose() → Matrix3d
Returns the transpose of the matrix.
IsLeftHanded() → bool
Returns true if the vectors in matrix form a left-handed coordinate
system.
IsRightHanded() → bool
Returns true if the vectors in the matrix form a right-handed
coordinate system.
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) –
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) –
SetColumn(i, v) → None
Sets a column of the matrix from a Vec3.
Parameters
i (int) –
v (Vec3d) –
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) –
SetIdentity() → Matrix3d
Sets the matrix to the identity matrix.
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) –
SetRow(i, v) → None
Sets a row of the matrix from a Vec3.
Parameters
i (int) –
v (Vec3d) –
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) –
SetZero() → Matrix3d
Sets the matrix to zero.
dimension = (3, 3)
class pxr.Gf.Matrix3f
Methods:
ExtractRotation()
Returns the rotation corresponding to this matrix.
GetColumn(i)
Gets a column of the matrix as a Vec3.
GetDeterminant()
Returns the determinant of the matrix.
GetHandedness()
Returns the sign of the determinant of the matrix, i.e.
GetInverse(det, eps)
Returns the inverse of the matrix, or FLT_MAX * SetIdentity() if the matrix is singular.
GetOrthonormalized(issueWarning)
Returns an orthonormalized copy of the matrix.
GetRow(i)
Gets a row of the matrix as a Vec3.
GetTranspose()
Returns the transpose of the matrix.
IsLeftHanded()
Returns true if the vectors in matrix form a left-handed coordinate system.
IsRightHanded()
Returns true if the vectors in the matrix form a right-handed coordinate system.
Orthonormalize(issueWarning)
Makes the matrix orthonormal in place.
Set(m00, m01, m02, m10, m11, m12, m20, m21, m22)
Sets the matrix from 9 independent float values, specified in row- major order.
SetColumn(i, v)
Sets a column of the matrix from a Vec3.
SetDiagonal(s)
Sets the matrix to s times the identity matrix.
SetIdentity()
Sets the matrix to the identity matrix.
SetRotate(rot)
Sets the matrix to specify a rotation equivalent to rot.
SetRow(i, v)
Sets a row of the matrix from a Vec3.
SetScale(scaleFactors)
Sets the matrix to specify a nonuniform scaling in x, y, and z by the factors in vector scaleFactors.
SetZero()
Sets the matrix to zero.
Attributes:
dimension
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.
GetColumn(i) → Vec3f
Gets a column of the matrix as a Vec3.
Parameters
i (int) –
GetDeterminant() → float
Returns the determinant of the matrix.
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.
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) –
GetOrthonormalized(issueWarning) → Matrix3f
Returns an orthonormalized copy of the matrix.
Parameters
issueWarning (bool) –
GetRow(i) → Vec3f
Gets a row of the matrix as a Vec3.
Parameters
i (int) –
GetTranspose() → Matrix3f
Returns the transpose of the matrix.
IsLeftHanded() → bool
Returns true if the vectors in matrix form a left-handed coordinate
system.
IsRightHanded() → bool
Returns true if the vectors in the matrix form a right-handed
coordinate system.
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) –
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) –
SetColumn(i, v) → None
Sets a column of the matrix from a Vec3.
Parameters
i (int) –
v (Vec3f) –
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) –
SetIdentity() → Matrix3f
Sets the matrix to the identity matrix.
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) –
SetRow(i, v) → None
Sets a row of the matrix from a Vec3.
Parameters
i (int) –
v (Vec3f) –
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) –
SetZero() → Matrix3f
Sets the matrix to zero.
dimension = (3, 3)
class pxr.Gf.Matrix4d
Methods:
ExtractRotation()
Returns the rotation corresponding to this matrix.
ExtractRotationMatrix()
Returns the rotation corresponding to this matrix.
ExtractRotationQuat()
Return the rotation corresponding to this matrix as a quaternion.
ExtractTranslation()
Returns the translation part of the matrix, defined as the first three elements of the last row.
Factor(r, s, u, t, p, eps)
Factors the matrix into 5 components:
GetColumn(i)
Gets a column of the matrix as a Vec4.
GetDeterminant()
Returns the determinant of the matrix.
GetDeterminant3()
Returns the determinant of the upper 3x3 matrix.
GetHandedness()
Returns the sign of the determinant of the upper 3x3 matrix, i.e.
GetInverse(det, eps)
Returns the inverse of the matrix, or FLT_MAX * SetIdentity() if the matrix is singular.
GetOrthonormalized(issueWarning)
Returns an orthonormalized copy of the matrix.
GetRow(i)
Gets a row of the matrix as a Vec4.
GetRow3(i)
Gets a row of the matrix as a Vec3.
GetTranspose()
Returns the transpose of the matrix.
HasOrthogonalRows3()
Returns true, if the row vectors of the upper 3x3 matrix form an orthogonal basis.
IsLeftHanded()
Returns true if the vectors in the upper 3x3 matrix form a left-handed coordinate system.
IsRightHanded()
Returns true if the vectors in the upper 3x3 matrix form a right- handed coordinate system.
Orthonormalize(issueWarning)
Makes the matrix orthonormal in place.
RemoveScaleShear()
Returns the matrix with any scaling or shearing removed, leaving only the rotation and translation.
Set(m00, m01, m02, m03, m10, m11, m12, m13, ...)
Sets the matrix from 16 independent double values, specified in row-major order.
SetColumn(i, v)
Sets a column of the matrix from a Vec4.
SetDiagonal(s)
Sets the matrix to s times the identity matrix.
SetIdentity()
Sets the matrix to the identity matrix.
SetLookAt(eyePoint, centerPoint, upDirection)
Sets the matrix to specify a viewing matrix from parameters similar to those used by gluLookAt(3G) .
SetRotate(rot)
Sets the matrix to specify a rotation equivalent to rot, and clears the translation.
SetRotateOnly(rot)
Sets the matrix to specify a rotation equivalent to rot, without clearing the translation.
SetRow(i, v)
Sets a row of the matrix from a Vec4.
SetRow3(i, v)
Sets a row of the matrix from a Vec3.
SetScale(scaleFactors)
Sets the matrix to specify a nonuniform scaling in x, y, and z by the factors in vector scaleFactors.
SetTransform(rotate, translate)
Sets matrix to specify a rotation by rotate and a translation by translate.
SetTranslate(trans)
Sets matrix to specify a translation by the vector trans, and clears the rotation.
SetTranslateOnly(t)
Sets matrix to specify a translation by the vector trans, without clearing the rotation.
SetZero()
Sets the matrix to zero.
Transform(vec)
Transforms the row vector vec by the matrix, returning the result.
TransformAffine(vec)
Transforms the row vector vec by the matrix, returning the result.
TransformDir(vec)
Transforms row vector vec by the matrix, returning the result.
Attributes:
dimension
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.
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.
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.
ExtractTranslation() → Vec3d
Returns the translation part of the matrix, defined as the first three
elements of the last row.
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) –
GetColumn(i) → Vec4d
Gets a column of the matrix as a Vec4.
Parameters
i (int) –
GetDeterminant() → float
Returns the determinant of the matrix.
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.
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.
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) –
GetOrthonormalized(issueWarning) → Matrix4d
Returns an orthonormalized copy of the matrix.
Parameters
issueWarning (bool) –
GetRow(i) → Vec4d
Gets a row of the matrix as a Vec4.
Parameters
i (int) –
GetRow3(i) → Vec3d
Gets a row of the matrix as a Vec3.
Parameters
i (int) –
GetTranspose() → Matrix4d
Returns the transpose of the matrix.
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.
IsLeftHanded() → bool
Returns true if the vectors in the upper 3x3 matrix form a left-handed
coordinate system.
IsRightHanded() → bool
Returns true if the vectors in the upper 3x3 matrix form a right-
handed coordinate system.
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) –
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.
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) –
SetColumn(i, v) → None
Sets a column of the matrix from a Vec4.
Parameters
i (int) –
v (Vec4d) –
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) –
SetIdentity() → Matrix4d
Sets the matrix to the identity matrix.
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) –
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) –
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) –
SetRow(i, v) → None
Sets a row of the matrix from a Vec4.
Parameters
i (int) –
v (Vec4d) –
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) –
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) –
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) –
SetTranslate(trans) → Matrix4d
Sets matrix to specify a translation by the vector trans, and clears
the rotation.
Parameters
trans (Vec3d) –
SetTranslateOnly(t) → Matrix4d
Sets matrix to specify a translation by the vector trans, without
clearing the rotation.
Parameters
t (Vec3d) –
SetZero() → Matrix4d
Sets the matrix to zero.
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) –
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) –
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) –
dimension = (4, 4)
class pxr.Gf.Matrix4f
Methods:
ExtractRotation()
Returns the rotation corresponding to this matrix.
ExtractRotationMatrix()
Returns the rotation corresponding to this matrix.
ExtractRotationQuat()
Return the rotation corresponding to this matrix as a quaternion.
ExtractTranslation()
Returns the translation part of the matrix, defined as the first three elements of the last row.
Factor(r, s, u, t, p, eps)
Factors the matrix into 5 components:
GetColumn(i)
Gets a column of the matrix as a Vec4.
GetDeterminant()
Returns the determinant of the matrix.
GetDeterminant3()
Returns the determinant of the upper 3x3 matrix.
GetHandedness()
Returns the sign of the determinant of the upper 3x3 matrix, i.e.
GetInverse(det, eps)
Returns the inverse of the matrix, or FLT_MAX * SetIdentity() if the matrix is singular.
GetOrthonormalized(issueWarning)
Returns an orthonormalized copy of the matrix.
GetRow(i)
Gets a row of the matrix as a Vec4.
GetRow3(i)
Gets a row of the matrix as a Vec3.
GetTranspose()
Returns the transpose of the matrix.
HasOrthogonalRows3()
Returns true, if the row vectors of the upper 3x3 matrix form an orthogonal basis.
IsLeftHanded()
Returns true if the vectors in the upper 3x3 matrix form a left-handed coordinate system.
IsRightHanded()
Returns true if the vectors in the upper 3x3 matrix form a right- handed coordinate system.
Orthonormalize(issueWarning)
Makes the matrix orthonormal in place.
RemoveScaleShear()
Returns the matrix with any scaling or shearing removed, leaving only the rotation and translation.
Set(m00, m01, m02, m03, m10, m11, m12, m13, ...)
Sets the matrix from 16 independent float values, specified in row-major order.
SetColumn(i, v)
Sets a column of the matrix from a Vec4.
SetDiagonal(s)
Sets the matrix to s times the identity matrix.
SetIdentity()
Sets the matrix to the identity matrix.
SetLookAt(eyePoint, centerPoint, upDirection)
Sets the matrix to specify a viewing matrix from parameters similar to those used by gluLookAt(3G) .
SetRotate(rot)
Sets the matrix to specify a rotation equivalent to rot, and clears the translation.
SetRotateOnly(rot)
Sets the matrix to specify a rotation equivalent to rot, without clearing the translation.
SetRow(i, v)
Sets a row of the matrix from a Vec4.
SetRow3(i, v)
Sets a row of the matrix from a Vec3.
SetScale(scaleFactors)
Sets the matrix to specify a nonuniform scaling in x, y, and z by the factors in vector scaleFactors.
SetTransform(rotate, translate)
Sets matrix to specify a rotation by rotate and a translation by translate.
SetTranslate(trans)
Sets matrix to specify a translation by the vector trans, and clears the rotation.
SetTranslateOnly(t)
Sets matrix to specify a translation by the vector trans, without clearing the rotation.
SetZero()
Sets the matrix to zero.
Transform(vec)
Transforms the row vector vec by the matrix, returning the result.
TransformAffine(vec)
Transforms the row vector vec by the matrix, returning the result.
TransformDir(vec)
Transforms row vector vec by the matrix, returning the result.
Attributes:
dimension
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.
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.
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.
ExtractTranslation() → Vec3f
Returns the translation part of the matrix, defined as the first three
elements of the last row.
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) –
GetColumn(i) → Vec4f
Gets a column of the matrix as a Vec4.
Parameters
i (int) –
GetDeterminant() → float
Returns the determinant of the matrix.
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.
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.
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) –
GetOrthonormalized(issueWarning) → Matrix4f
Returns an orthonormalized copy of the matrix.
Parameters
issueWarning (bool) –
GetRow(i) → Vec4f
Gets a row of the matrix as a Vec4.
Parameters
i (int) –
GetRow3(i) → Vec3f
Gets a row of the matrix as a Vec3.
Parameters
i (int) –
GetTranspose() → Matrix4f
Returns the transpose of the matrix.
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.
IsLeftHanded() → bool
Returns true if the vectors in the upper 3x3 matrix form a left-handed
coordinate system.
IsRightHanded() → bool
Returns true if the vectors in the upper 3x3 matrix form a right-
handed coordinate system.
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) –
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.
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) –
SetColumn(i, v) → None
Sets a column of the matrix from a Vec4.
Parameters
i (int) –
v (Vec4f) –
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) –
SetIdentity() → Matrix4f
Sets the matrix to the identity matrix.
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) –
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) –
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) –
SetRow(i, v) → None
Sets a row of the matrix from a Vec4.
Parameters
i (int) –
v (Vec4f) –
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) –
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) –
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) –
SetTranslate(trans) → Matrix4f
Sets matrix to specify a translation by the vector trans, and clears
the rotation.
Parameters
trans (Vec3f) –
SetTranslateOnly(t) → Matrix4f
Sets matrix to specify a translation by the vector trans, without
clearing the rotation.
Parameters
t (Vec3f) –
SetZero() → Matrix4f
Sets the matrix to zero.
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) –
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) –
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) –
dimension = (4, 4)
class pxr.Gf.MultiInterval
Methods:
Add(i)
Add the given interval to the multi-interval.
ArithmeticAdd(i)
Uses the given interval to extend the multi-interval in the interval arithmetic sense.
Clear()
Clear the multi-interval.
Contains
Returns true if x is inside the multi-interval.
GetBounds()
Returns an interval bounding the entire multi-interval.
GetComplement()
Return the complement of this set.
GetFullInterval
classmethod GetFullInterval() -> MultiInterval
GetSize()
Returns the number of intervals in the set.
Intersect(i)
param i
IsEmpty()
Returns true if the multi-interval is empty.
Remove(i)
Remove the given interval from this multi-interval.
Attributes:
bounds
isEmpty
size
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) –
ArithmeticAdd(i) → None
Uses the given interval to extend the multi-interval in the interval
arithmetic sense.
Parameters
i (Interval) –
Clear() → None
Clear the multi-interval.
Contains()
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.
GetBounds() → Interval
Returns an interval bounding the entire multi-interval.
Returns an empty interval if the multi-interval is empty.
GetComplement() → MultiInterval
Return the complement of this set.
static GetFullInterval()
classmethod GetFullInterval() -> MultiInterval
Returns the full interval (-inf, inf).
GetSize() → int
Returns the number of intervals in the set.
Intersect(i) → None
Parameters
i (Interval) –
Intersect(s) -> None
Parameters
s (MultiInterval) –
IsEmpty() → bool
Returns true if the multi-interval is empty.
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) –
property bounds
property isEmpty
property size
class pxr.Gf.Plane
Methods:
GetDistance(p)
Returns the distance of point from the plane.
GetDistanceFromOrigin()
Returns the distance of the plane from the origin.
GetEquation()
Give the coefficients of the equation of the plane.
GetNormal()
Returns the unit-length normal vector of the plane.
IntersectsPositiveHalfSpace(box)
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.
Project(p)
Return the projection of p onto the plane.
Reorient(p)
Flip the plane normal (if necessary) so that p is in the positive halfspace.
Set(normal, distanceToOrigin)
Sets this to the plane perpendicular to normal and at distance units from the origin.
Transform(matrix)
Transforms the plane by the given matrix.
Attributes:
distanceFromOrigin
normal
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) –
GetDistanceFromOrigin() → float
Returns the distance of the plane from the origin.
GetEquation() → Vec4d
Give the coefficients of the equation of the plane.
Suitable to OpenGL calls to set the clipping plane.
GetNormal() → Vec3d
Returns the unit-length normal vector of the plane.
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) –
Project(p) → Vec3d
Return the projection of p onto the plane.
Parameters
p (Vec3d) –
Reorient(p) → None
Flip the plane normal (if necessary) so that p is in the positive
halfspace.
Parameters
p (Vec3d) –
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) –
Transform(matrix) → Plane
Transforms the plane by the given matrix.
Parameters
matrix (Matrix4d) –
property distanceFromOrigin
property normal
class pxr.Gf.Quatd
Methods:
GetConjugate()
Return this quaternion's conjugate, which is the quaternion with the same real coefficient and negated imaginary coefficients.
GetIdentity
classmethod GetIdentity() -> Quatd
GetImaginary()
Return the imaginary coefficient.
GetInverse()
Return this quaternion's inverse, or reciprocal.
GetLength()
Return geometric length of this quaternion.
GetNormalized(eps)
length of this quaternion is smaller than eps , return the identity quaternion.
GetReal()
Return the real coefficient.
GetZero
classmethod GetZero() -> Quatd
Normalize(eps)
Normalizes this quaternion in place to unit length, returning the length before normalization.
SetImaginary(imaginary)
Set the imaginary coefficients.
SetReal(real)
Set the real coefficient.
Transform(point)
Transform the GfVec3d point.
Attributes:
imaginary
real
GetConjugate() → Quatd
Return this quaternion’s conjugate, which is the quaternion with the
same real coefficient and negated imaginary coefficients.
static GetIdentity()
classmethod GetIdentity() -> Quatd
Return the identity quaternion, with real coefficient 1 and an
imaginary coefficients all zero.
GetImaginary() → Vec3d
Return the imaginary coefficient.
GetInverse() → Quatd
Return this quaternion’s inverse, or reciprocal.
This is the quaternion’s conjugate divided by it’s squared length.
GetLength() → float
Return geometric length of this quaternion.
GetNormalized(eps) → Quatd
length of this quaternion is smaller than eps , return the
identity quaternion.
Parameters
eps (float) –
GetReal() → float
Return the real coefficient.
static GetZero()
classmethod GetZero() -> Quatd
Return the zero quaternion, with real coefficient 0 and an imaginary
coefficients all zero.
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) –
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) –
SetReal(real) → None
Set the real coefficient.
Parameters
real (float) –
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 imaginary
property real
class pxr.Gf.Quaternion
Quaternion class
Methods:
GetIdentity
classmethod GetIdentity() -> Quaternion
GetImaginary()
Returns the imaginary part of the quaternion.
GetInverse()
Returns the inverse of this quaternion.
GetLength()
Returns geometric length of this quaternion.
GetNormalized(eps)
Returns a normalized (unit-length) version of this quaternion.
GetReal()
Returns the real part of the quaternion.
GetZero
classmethod GetZero() -> Quaternion
Normalize(eps)
Normalizes this quaternion in place to unit length, returning the length before normalization.
Attributes:
imaginary
None
real
None
static GetIdentity()
classmethod GetIdentity() -> Quaternion
Returns the identity quaternion, which has a real part of 1 and an
imaginary part of (0,0,0).
GetImaginary() → Vec3d
Returns the imaginary part of the quaternion.
GetInverse() → Quaternion
Returns the inverse of this quaternion.
GetLength() → float
Returns geometric length of this 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) –
GetReal() → float
Returns the real part of the quaternion.
static GetZero()
classmethod GetZero() -> Quaternion
Returns the zero quaternion, which has a real part of 0 and an
imaginary part of (0,0,0).
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 imaginary
None
Sets the imaginary part of the quaternion.
Type
type
property real
None
Sets the real part of the quaternion.
Type
type
class pxr.Gf.Quatf
Methods:
GetConjugate()
Return this quaternion's conjugate, which is the quaternion with the same real coefficient and negated imaginary coefficients.
GetIdentity
classmethod GetIdentity() -> Quatf
GetImaginary()
Return the imaginary coefficient.
GetInverse()
Return this quaternion's inverse, or reciprocal.
GetLength()
Return geometric length of this quaternion.
GetNormalized(eps)
length of this quaternion is smaller than eps , return the identity quaternion.
GetReal()
Return the real coefficient.
GetZero
classmethod GetZero() -> Quatf
Normalize(eps)
Normalizes this quaternion in place to unit length, returning the length before normalization.
SetImaginary(imaginary)
Set the imaginary coefficients.
SetReal(real)
Set the real coefficient.
Transform(point)
Transform the GfVec3f point.
Attributes:
imaginary
real
GetConjugate() → Quatf
Return this quaternion’s conjugate, which is the quaternion with the
same real coefficient and negated imaginary coefficients.
static GetIdentity()
classmethod GetIdentity() -> Quatf
Return the identity quaternion, with real coefficient 1 and an
imaginary coefficients all zero.
GetImaginary() → Vec3f
Return the imaginary coefficient.
GetInverse() → Quatf
Return this quaternion’s inverse, or reciprocal.
This is the quaternion’s conjugate divided by it’s squared length.
GetLength() → float
Return geometric length of this quaternion.
GetNormalized(eps) → Quatf
length of this quaternion is smaller than eps , return the
identity quaternion.
Parameters
eps (float) –
GetReal() → float
Return the real coefficient.
static GetZero()
classmethod GetZero() -> Quatf
Return the zero quaternion, with real coefficient 0 and an imaginary
coefficients all zero.
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) –
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) –
SetReal(real) → None
Set the real coefficient.
Parameters
real (float) –
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 imaginary
property real
class pxr.Gf.Quath
Methods:
GetConjugate()
Return this quaternion's conjugate, which is the quaternion with the same real coefficient and negated imaginary coefficients.
GetIdentity
classmethod GetIdentity() -> Quath
GetImaginary()
Return the imaginary coefficient.
GetInverse()
Return this quaternion's inverse, or reciprocal.
GetLength()
Return geometric length of this quaternion.
GetNormalized(eps)
length of this quaternion is smaller than eps , return the identity quaternion.
GetReal()
Return the real coefficient.
GetZero
classmethod GetZero() -> Quath
Normalize(eps)
Normalizes this quaternion in place to unit length, returning the length before normalization.
SetImaginary(imaginary)
Set the imaginary coefficients.
SetReal(real)
Set the real coefficient.
Transform(point)
Transform the GfVec3h point.
Attributes:
imaginary
real
GetConjugate() → Quath
Return this quaternion’s conjugate, which is the quaternion with the
same real coefficient and negated imaginary coefficients.
static GetIdentity()
classmethod GetIdentity() -> Quath
Return the identity quaternion, with real coefficient 1 and an
imaginary coefficients all zero.
GetImaginary() → Vec3h
Return the imaginary coefficient.
GetInverse() → Quath
Return this quaternion’s inverse, or reciprocal.
This is the quaternion’s conjugate divided by it’s squared length.
GetLength() → GfHalf
Return geometric length of this quaternion.
GetNormalized(eps) → Quath
length of this quaternion is smaller than eps , return the
identity quaternion.
Parameters
eps (GfHalf) –
GetReal() → GfHalf
Return the real coefficient.
static GetZero()
classmethod GetZero() -> Quath
Return the zero quaternion, with real coefficient 0 and an imaginary
coefficients all zero.
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) –
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) –
SetReal(real) → None
Set the real coefficient.
Parameters
real (GfHalf) –
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 imaginary
property real
class pxr.Gf.Range1d
Methods:
Contains(point)
Returns true if the point is located inside the range.
GetDistanceSquared(p)
Compute the squared distance from a point to the range.
GetIntersection
classmethod GetIntersection(a, b) -> Range1d
GetMax()
Returns the maximum value of the range.
GetMidpoint()
Returns the midpoint of the range, that is, 0.5*(min+max).
GetMin()
Returns the minimum value of the range.
GetSize()
Returns the size of the range.
GetUnion
classmethod GetUnion(a, b) -> Range1d
IntersectWith(b)
Modifies this range to hold its intersection with b and returns the result.
IsEmpty()
Returns whether the range is empty (max<min).
SetEmpty()
Sets the range to an empty interval.
SetMax(max)
Sets the maximum value of the range.
SetMin(min)
Sets the minimum value of the range.
UnionWith(b)
Extend this to include b .
Attributes:
dimension
max
min
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) –
GetDistanceSquared(p) → float
Compute the squared distance from a point to the range.
Parameters
p (float) –
static GetIntersection()
classmethod GetIntersection(a, b) -> Range1d
Returns a GfRange1d that describes the intersection of a and
b .
Parameters
a (Range1d) –
b (Range1d) –
GetMax() → float
Returns the maximum value of the range.
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() .
GetMin() → float
Returns the minimum value of the range.
GetSize() → float
Returns the size of the range.
static GetUnion()
classmethod GetUnion(a, b) -> Range1d
Returns the smallest GfRange1d which contains both a and b
.
Parameters
a (Range1d) –
b (Range1d) –
IntersectWith(b) → Range1d
Modifies this range to hold its intersection with b and returns
the result.
Parameters
b (Range1d) –
IsEmpty() → bool
Returns whether the range is empty (max<min).
SetEmpty() → None
Sets the range to an empty interval.
SetMax(max) → None
Sets the maximum value of the range.
Parameters
max (float) –
SetMin(min) → None
Sets the minimum value of the range.
Parameters
min (float) –
UnionWith(b) → Range1d
Extend this to include b .
Parameters
b (Range1d) –
UnionWith(b) -> Range1d
Extend this to include b .
Parameters
b (float) –
dimension = 1
property max
property min
class pxr.Gf.Range1f
Methods:
Contains(point)
Returns true if the point is located inside the range.
GetDistanceSquared(p)
Compute the squared distance from a point to the range.
GetIntersection
classmethod GetIntersection(a, b) -> Range1f
GetMax()
Returns the maximum value of the range.
GetMidpoint()
Returns the midpoint of the range, that is, 0.5*(min+max).
GetMin()
Returns the minimum value of the range.
GetSize()
Returns the size of the range.
GetUnion
classmethod GetUnion(a, b) -> Range1f
IntersectWith(b)
Modifies this range to hold its intersection with b and returns the result.
IsEmpty()
Returns whether the range is empty (max<min).
SetEmpty()
Sets the range to an empty interval.
SetMax(max)
Sets the maximum value of the range.
SetMin(min)
Sets the minimum value of the range.
UnionWith(b)
Extend this to include b .
Attributes:
dimension
max
min
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) –
GetDistanceSquared(p) → float
Compute the squared distance from a point to the range.
Parameters
p (float) –
static GetIntersection()
classmethod GetIntersection(a, b) -> Range1f
Returns a GfRange1f that describes the intersection of a and
b .
Parameters
a (Range1f) –
b (Range1f) –
GetMax() → float
Returns the maximum value of the range.
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() .
GetMin() → float
Returns the minimum value of the range.
GetSize() → float
Returns the size of the range.
static GetUnion()
classmethod GetUnion(a, b) -> Range1f
Returns the smallest GfRange1f which contains both a and b
.
Parameters
a (Range1f) –
b (Range1f) –
IntersectWith(b) → Range1f
Modifies this range to hold its intersection with b and returns
the result.
Parameters
b (Range1f) –
IsEmpty() → bool
Returns whether the range is empty (max<min).
SetEmpty() → None
Sets the range to an empty interval.
SetMax(max) → None
Sets the maximum value of the range.
Parameters
max (float) –
SetMin(min) → None
Sets the minimum value of the range.
Parameters
min (float) –
UnionWith(b) → Range1f
Extend this to include b .
Parameters
b (Range1f) –
UnionWith(b) -> Range1f
Extend this to include b .
Parameters
b (float) –
dimension = 1
property max
property min
class pxr.Gf.Range2d
Methods:
Contains(point)
Returns true if the point is located inside the range.
GetCorner(i)
Returns the ith corner of the range, in the following order: SW, SE, NW, NE.
GetDistanceSquared(p)
Compute the squared distance from a point to the range.
GetIntersection
classmethod GetIntersection(a, b) -> Range2d
GetMax()
Returns the maximum value of the range.
GetMidpoint()
Returns the midpoint of the range, that is, 0.5*(min+max).
GetMin()
Returns the minimum value of the range.
GetQuadrant(i)
Returns the ith quadrant of the range, in the following order: SW, SE, NW, NE.
GetSize()
Returns the size of the range.
GetUnion
classmethod GetUnion(a, b) -> Range2d
IntersectWith(b)
Modifies this range to hold its intersection with b and returns the result.
IsEmpty()
Returns whether the range is empty (max<min).
SetEmpty()
Sets the range to an empty interval.
SetMax(max)
Sets the maximum value of the range.
SetMin(min)
Sets the minimum value of the range.
UnionWith(b)
Extend this to include b .
Attributes:
dimension
max
min
unitSquare
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) –
GetCorner(i) → Vec2d
Returns the ith corner of the range, in the following order: SW, SE,
NW, NE.
Parameters
i (int) –
GetDistanceSquared(p) → float
Compute the squared distance from a point to the range.
Parameters
p (Vec2d) –
static GetIntersection()
classmethod GetIntersection(a, b) -> Range2d
Returns a GfRange2d that describes the intersection of a and
b .
Parameters
a (Range2d) –
b (Range2d) –
GetMax() → Vec2d
Returns the maximum value of the range.
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() .
GetMin() → Vec2d
Returns the minimum value of the range.
GetQuadrant(i) → Range2d
Returns the ith quadrant of the range, in the following order: SW, SE,
NW, NE.
Parameters
i (int) –
GetSize() → Vec2d
Returns the size of the range.
static GetUnion()
classmethod GetUnion(a, b) -> Range2d
Returns the smallest GfRange2d which contains both a and b
.
Parameters
a (Range2d) –
b (Range2d) –
IntersectWith(b) → Range2d
Modifies this range to hold its intersection with b and returns
the result.
Parameters
b (Range2d) –
IsEmpty() → bool
Returns whether the range is empty (max<min).
SetEmpty() → None
Sets the range to an empty interval.
SetMax(max) → None
Sets the maximum value of the range.
Parameters
max (Vec2d) –
SetMin(min) → None
Sets the minimum value of the range.
Parameters
min (Vec2d) –
UnionWith(b) → Range2d
Extend this to include b .
Parameters
b (Range2d) –
UnionWith(b) -> Range2d
Extend this to include b .
Parameters
b (Vec2d) –
dimension = 2
property max
property min
unitSquare = Gf.Range2d(Gf.Vec2d(0.0, 0.0), Gf.Vec2d(1.0, 1.0))
class pxr.Gf.Range2f
Methods:
Contains(point)
Returns true if the point is located inside the range.
GetCorner(i)
Returns the ith corner of the range, in the following order: SW, SE, NW, NE.
GetDistanceSquared(p)
Compute the squared distance from a point to the range.
GetIntersection
classmethod GetIntersection(a, b) -> Range2f
GetMax()
Returns the maximum value of the range.
GetMidpoint()
Returns the midpoint of the range, that is, 0.5*(min+max).
GetMin()
Returns the minimum value of the range.
GetQuadrant(i)
Returns the ith quadrant of the range, in the following order: SW, SE, NW, NE.
GetSize()
Returns the size of the range.
GetUnion
classmethod GetUnion(a, b) -> Range2f
IntersectWith(b)
Modifies this range to hold its intersection with b and returns the result.
IsEmpty()
Returns whether the range is empty (max<min).
SetEmpty()
Sets the range to an empty interval.
SetMax(max)
Sets the maximum value of the range.
SetMin(min)
Sets the minimum value of the range.
UnionWith(b)
Extend this to include b .
Attributes:
dimension
max
min
unitSquare
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) –
GetCorner(i) → Vec2f
Returns the ith corner of the range, in the following order: SW, SE,
NW, NE.
Parameters
i (int) –
GetDistanceSquared(p) → float
Compute the squared distance from a point to the range.
Parameters
p (Vec2f) –
static GetIntersection()
classmethod GetIntersection(a, b) -> Range2f
Returns a GfRange2f that describes the intersection of a and
b .
Parameters
a (Range2f) –
b (Range2f) –
GetMax() → Vec2f
Returns the maximum value of the range.
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() .
GetMin() → Vec2f
Returns the minimum value of the range.
GetQuadrant(i) → Range2f
Returns the ith quadrant of the range, in the following order: SW, SE,
NW, NE.
Parameters
i (int) –
GetSize() → Vec2f
Returns the size of the range.
static GetUnion()
classmethod GetUnion(a, b) -> Range2f
Returns the smallest GfRange2f which contains both a and b
.
Parameters
a (Range2f) –
b (Range2f) –
IntersectWith(b) → Range2f
Modifies this range to hold its intersection with b and returns
the result.
Parameters
b (Range2f) –
IsEmpty() → bool
Returns whether the range is empty (max<min).
SetEmpty() → None
Sets the range to an empty interval.
SetMax(max) → None
Sets the maximum value of the range.
Parameters
max (Vec2f) –
SetMin(min) → None
Sets the minimum value of the range.
Parameters
min (Vec2f) –
UnionWith(b) → Range2f
Extend this to include b .
Parameters
b (Range2f) –
UnionWith(b) -> Range2f
Extend this to include b .
Parameters
b (Vec2f) –
dimension = 2
property max
property min
unitSquare = Gf.Range2f(Gf.Vec2f(0.0, 0.0), Gf.Vec2f(1.0, 1.0))
class pxr.Gf.Range3d
Methods:
Contains(point)
Returns true if the point is located inside the range.
GetCorner(i)
Returns the ith corner of the range, in the following order: LDB, RDB, LUB, RUB, LDF, RDF, LUF, RUF.
GetDistanceSquared(p)
Compute the squared distance from a point to the range.
GetIntersection
classmethod GetIntersection(a, b) -> Range3d
GetMax()
Returns the maximum value of the range.
GetMidpoint()
Returns the midpoint of the range, that is, 0.5*(min+max).
GetMin()
Returns the minimum value of the range.
GetOctant(i)
Returns the ith octant of the range, in the following order: LDB, RDB, LUB, RUB, LDF, RDF, LUF, RUF.
GetSize()
Returns the size of the range.
GetUnion
classmethod GetUnion(a, b) -> Range3d
IntersectWith(b)
Modifies this range to hold its intersection with b and returns the result.
IsEmpty()
Returns whether the range is empty (max<min).
SetEmpty()
Sets the range to an empty interval.
SetMax(max)
Sets the maximum value of the range.
SetMin(min)
Sets the minimum value of the range.
UnionWith(b)
Extend this to include b .
Attributes:
dimension
max
min
unitCube
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) –
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) –
GetDistanceSquared(p) → float
Compute the squared distance from a point to the range.
Parameters
p (Vec3d) –
static GetIntersection()
classmethod GetIntersection(a, b) -> Range3d
Returns a GfRange3d that describes the intersection of a and
b .
Parameters
a (Range3d) –
b (Range3d) –
GetMax() → Vec3d
Returns the maximum value of the range.
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() .
GetMin() → Vec3d
Returns the minimum value of the range.
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) –
GetSize() → Vec3d
Returns the size of the range.
static GetUnion()
classmethod GetUnion(a, b) -> Range3d
Returns the smallest GfRange3d which contains both a and b
.
Parameters
a (Range3d) –
b (Range3d) –
IntersectWith(b) → Range3d
Modifies this range to hold its intersection with b and returns
the result.
Parameters
b (Range3d) –
IsEmpty() → bool
Returns whether the range is empty (max<min).
SetEmpty() → None
Sets the range to an empty interval.
SetMax(max) → None
Sets the maximum value of the range.
Parameters
max (Vec3d) –
SetMin(min) → None
Sets the minimum value of the range.
Parameters
min (Vec3d) –
UnionWith(b) → Range3d
Extend this to include b .
Parameters
b (Range3d) –
UnionWith(b) -> Range3d
Extend this to include b .
Parameters
b (Vec3d) –
dimension = 3
property max
property min
unitCube = Gf.Range3d(Gf.Vec3d(0.0, 0.0, 0.0), Gf.Vec3d(1.0, 1.0, 1.0))
class pxr.Gf.Range3f
Methods:
Contains(point)
Returns true if the point is located inside the range.
GetCorner(i)
Returns the ith corner of the range, in the following order: LDB, RDB, LUB, RUB, LDF, RDF, LUF, RUF.
GetDistanceSquared(p)
Compute the squared distance from a point to the range.
GetIntersection
classmethod GetIntersection(a, b) -> Range3f
GetMax()
Returns the maximum value of the range.
GetMidpoint()
Returns the midpoint of the range, that is, 0.5*(min+max).
GetMin()
Returns the minimum value of the range.
GetOctant(i)
Returns the ith octant of the range, in the following order: LDB, RDB, LUB, RUB, LDF, RDF, LUF, RUF.
GetSize()
Returns the size of the range.
GetUnion
classmethod GetUnion(a, b) -> Range3f
IntersectWith(b)
Modifies this range to hold its intersection with b and returns the result.
IsEmpty()
Returns whether the range is empty (max<min).
SetEmpty()
Sets the range to an empty interval.
SetMax(max)
Sets the maximum value of the range.
SetMin(min)
Sets the minimum value of the range.
UnionWith(b)
Extend this to include b .
Attributes:
dimension
max
min
unitCube
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) –
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) –
GetDistanceSquared(p) → float
Compute the squared distance from a point to the range.
Parameters
p (Vec3f) –
static GetIntersection()
classmethod GetIntersection(a, b) -> Range3f
Returns a GfRange3f that describes the intersection of a and
b .
Parameters
a (Range3f) –
b (Range3f) –
GetMax() → Vec3f
Returns the maximum value of the range.
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() .
GetMin() → Vec3f
Returns the minimum value of the range.
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) –
GetSize() → Vec3f
Returns the size of the range.
static GetUnion()
classmethod GetUnion(a, b) -> Range3f
Returns the smallest GfRange3f which contains both a and b
.
Parameters
a (Range3f) –
b (Range3f) –
IntersectWith(b) → Range3f
Modifies this range to hold its intersection with b and returns
the result.
Parameters
b (Range3f) –
IsEmpty() → bool
Returns whether the range is empty (max<min).
SetEmpty() → None
Sets the range to an empty interval.
SetMax(max) → None
Sets the maximum value of the range.
Parameters
max (Vec3f) –
SetMin(min) → None
Sets the minimum value of the range.
Parameters
min (Vec3f) –
UnionWith(b) → Range3f
Extend this to include b .
Parameters
b (Range3f) –
UnionWith(b) -> Range3f
Extend this to include b .
Parameters
b (Vec3f) –
dimension = 3
property max
property min
unitCube = Gf.Range3f(Gf.Vec3f(0.0, 0.0, 0.0), Gf.Vec3f(1.0, 1.0, 1.0))
class pxr.Gf.Ray
Methods:
FindClosestPoint(point, rayDistance)
Returns the point on the ray that is closest to point .
GetPoint(distance)
Returns the point that is distance units from the starting point along the direction vector, expressed in parametic distance.
Intersect(p0, p1, p2)
float, barycentric = GfVec3d, frontFacing = bool>
SetEnds(startPoint, endPoint)
Sets the ray by specifying a starting point and an ending point.
SetPointAndDirection(startPoint, direction)
Sets the ray by specifying a starting point and a direction.
Transform(matrix)
Transforms the ray by the given matrix.
Attributes:
direction
Vec3d
startPoint
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) –
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) –
Intersect(p0, p1, p2) → tuple<intersects = bool, dist =
float, barycentric = GfVec3d, frontFacing = bool>
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);
Intersect( plane ) -> tuple<intersects = bool, dist = float,
frontFacing = bool>
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.
———————————————————————-
Intersect( range3d ) -> tuple<intersects = bool, enterDist
= float, exitDist = float>
Intersects the plane with an axis-aligned box in a
Gf.Range3d. intersects is true if the ray intersects it at
all within bounds. If there is an intersection then enterDist
and exitDist will be the parametric distances to the two
intersection points.
———————————————————————-
Intersect( bbox3d ) -> tuple<intersects = bool, enterDist
= float, exitDist = float>
Intersects the plane with an oriented box in a Gf.BBox3d.
intersects is true if the ray intersects it at all within
bounds. If there is an intersection then enterDist and
exitDist will be the parametric distances to the two
intersection points.
———————————————————————-
Intersect( center, radius ) -> tuple<intersects = bool,
enterDist = float, exitDist = float>
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.
———————————————————————-
Intersect( origin, axis, radius ) -> tuple<intersects = bool,
enterDist = float, exitDist = float>
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.
———————————————————————-
Intersect( origin, axis, radius, height ) ->
tuple<intersects = bool, enterDist = float, exitDist = float>
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.
———————————————————————-
SetEnds(startPoint, endPoint) → None
Sets the ray by specifying a starting point and an ending point.
Parameters
startPoint (Vec3d) –
endPoint (Vec3d) –
SetPointAndDirection(startPoint, direction) → None
Sets the ray by specifying a starting point and a direction.
Parameters
startPoint (Vec3d) –
direction (Vec3d) –
Transform(matrix) → Ray
Transforms the ray by the given matrix.
Parameters
matrix (Matrix4d) –
property direction
Vec3d
Returns the direction vector of the segment.
This is not guaranteed to be unit length.
Type
type
property startPoint
Vec3d
Returns the starting point of the segment.
Type
type
class pxr.Gf.Rect2i
Methods:
Contains(p)
Returns true if the specified point in the rectangle.
GetArea()
Return the area of the rectangle.
GetCenter()
Returns the center point of the rectangle.
GetHeight()
Returns the height of the rectangle.
GetIntersection(that)
Computes the intersection of two rectangles.
GetMax()
Returns the max corner of the rectangle.
GetMaxX()
Return the X value of the max corner.
GetMaxY()
Return the Y value of the max corner.
GetMin()
Returns the min corner of the rectangle.
GetMinX()
Return the X value of min corner.
GetMinY()
Return the Y value of the min corner.
GetNormalized()
Returns a normalized rectangle, i.e.
GetSize()
Returns the size of the rectangle as a vector (width,height).
GetUnion(that)
Computes the union of two rectangles.
GetWidth()
Returns the width of the rectangle.
IsEmpty()
Returns true if the rectangle is empty.
IsNull()
Returns true if the rectangle is a null rectangle.
IsValid()
Return true if the rectangle is valid (equivalently, not empty).
SetMax(max)
Sets the max corner of the rectangle.
SetMaxX(x)
Set the X value of the max corner.
SetMaxY(y)
Set the Y value of the max corner.
SetMin(min)
Sets the min corner of the rectangle.
SetMinX(x)
Set the X value of the min corner.
SetMinY(y)
Set the Y value of the min corner.
Translate(displacement)
Move the rectangle by displ .
Attributes:
max
maxX
maxY
min
minX
minY
Contains(p) → bool
Returns true if the specified point in the rectangle.
Parameters
p (Vec2i) –
GetArea() → int
Return the area of the rectangle.
GetCenter() → Vec2i
Returns the center point of the rectangle.
GetHeight() → int
Returns the height of the rectangle.
If the min and max y-coordinates are coincident, the height is one.
GetIntersection(that) → Rect2i
Computes the intersection of two rectangles.
Parameters
that (Rect2i) –
GetMax() → Vec2i
Returns the max corner of the rectangle.
GetMaxX() → int
Return the X value of the max corner.
GetMaxY() → int
Return the Y value of the max corner.
GetMin() → Vec2i
Returns the min corner of the rectangle.
GetMinX() → int
Return the X value of min corner.
GetMinY() → int
Return the Y value of the min corner.
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.
GetSize() → Vec2i
Returns the size of the rectangle as a vector (width,height).
GetUnion(that) → Rect2i
Computes the union of two rectangles.
Parameters
that (Rect2i) –
GetWidth() → int
Returns the width of the rectangle.
If the min and max x-coordinates are coincident, the width is one.
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.
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
GetMaxX() == GetMinX() - 1
and
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.
IsValid() → bool
Return true if the rectangle is valid (equivalently, not empty).
SetMax(max) → None
Sets the max corner of the rectangle.
Parameters
max (Vec2i) –
SetMaxX(x) → None
Set the X value of the max corner.
Parameters
x (int) –
SetMaxY(y) → None
Set the Y value of the max corner.
Parameters
y (int) –
SetMin(min) → None
Sets the min corner of the rectangle.
Parameters
min (Vec2i) –
SetMinX(x) → None
Set the X value of the min corner.
Parameters
x (int) –
SetMinY(y) → None
Set the Y value of the min corner.
Parameters
y (int) –
Translate(displacement) → None
Move the rectangle by displ .
Parameters
displacement (Vec2i) –
property max
property maxX
property maxY
property min
property minX
property minY
class pxr.Gf.Rotation
3-space rotation
Methods:
Decompose(axis0, axis1, axis2)
Decompose rotation about 3 orthogonal axes.
DecomposeRotation
classmethod DecomposeRotation(rot, TwAxis, FBAxis, LRAxis, handedness, thetaTw, thetaFB, thetaLR, thetaSw, useHint, swShift) -> None
DecomposeRotation3
GetAngle()
Returns the rotation angle in degrees.
GetAxis()
Returns the axis of rotation.
GetInverse()
Returns the inverse of this rotation.
GetQuat()
Returns the rotation expressed as a quaternion.
GetQuaternion()
Returns the rotation expressed as a quaternion.
MatchClosestEulerRotation
classmethod MatchClosestEulerRotation(targetTw, targetFB, targetLR, targetSw, thetaTw, thetaFB, thetaLR, thetaSw) -> None
RotateOntoProjected
classmethod RotateOntoProjected(v1, v2, axis) -> Rotation
SetAxisAngle(axis, angle)
Sets the rotation to be angle degrees about axis .
SetIdentity()
Sets the rotation to an identity rotation.
SetQuat(quat)
Sets the rotation from a quaternion.
SetQuaternion(quat)
Sets the rotation from a quaternion.
SetRotateInto(rotateFrom, rotateTo)
Sets the rotation to one that brings the rotateFrom vector to align with rotateTo .
TransformDir(vec)
Transforms row vector vec by the rotation, returning the result.
Attributes:
angle
axis
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) –
static DecomposeRotation()
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) –
static DecomposeRotation3()
GetAngle() → float
Returns the rotation angle in degrees.
GetAxis() → Vec3d
Returns the axis of rotation.
GetInverse() → Rotation
Returns the inverse of this rotation.
GetQuat() → Quatd
Returns the rotation expressed as a quaternion.
GetQuaternion() → Quaternion
Returns the rotation expressed as a quaternion.
static MatchClosestEulerRotation()
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) –
static RotateOntoProjected()
classmethod RotateOntoProjected(v1, v2, axis) -> Rotation
Parameters
v1 (Vec3d) –
v2 (Vec3d) –
axis (Vec3d) –
SetAxisAngle(axis, angle) → Rotation
Sets the rotation to be angle degrees about axis .
Parameters
axis (Vec3d) –
angle (float) –
SetIdentity() → Rotation
Sets the rotation to an identity rotation.
(This is chosen to be 0 degrees around the positive X axis.)
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) –
SetQuaternion(quat) → Rotation
Sets the rotation from a quaternion.
Parameters
quat (Quaternion) –
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) –
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) –
property angle
property axis
class pxr.Gf.Size2
A 2D size class
Methods:
Set(v)
Set to the values in a given array.
Attributes:
dimension
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) –
dimension = 2
class pxr.Gf.Size3
A 3D size class
Methods:
Set(v)
Set to the values in v .
Attributes:
dimension
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) –
dimension = 3
class pxr.Gf.Transform
Methods:
GetMatrix()
Returns a GfMatrix4d that implements the cumulative transformation.
GetPivotOrientation()
Returns the pivot orientation component.
GetPivotPosition()
Returns the pivot position component.
GetRotation()
Returns the rotation component.
GetScale()
Returns the scale component.
GetTranslation()
Returns the translation component.
Set
Set method used by old 2x code.
SetIdentity()
Sets the transformation to the identity transformation.
SetMatrix(m)
Sets the transform components to implement the transformation represented by matrix m , ignoring any projection.
SetPivotOrientation(pivotOrient)
Sets the pivot orientation component, leaving all others untouched.
SetPivotPosition(pivPos)
Sets the pivot position component, leaving all others untouched.
SetRotation(rotation)
Sets the rotation component, leaving all others untouched.
SetScale(scale)
Sets the scale component, leaving all others untouched.
SetTranslation(translation)
Sets the translation component, leaving all others untouched.
Attributes:
pivotOrientation
pivotPosition
rotation
scale
translation
GetMatrix() → Matrix4d
Returns a GfMatrix4d that implements the cumulative
transformation.
GetPivotOrientation() → Rotation
Returns the pivot orientation component.
GetPivotPosition() → Vec3d
Returns the pivot position component.
GetRotation() → Rotation
Returns the rotation component.
GetScale() → Vec3d
Returns the scale component.
GetTranslation() → Vec3d
Returns the translation component.
Set()
Set method used by old 2x code. (Deprecated)
SetIdentity() → Transform
Sets the transformation to the identity transformation.
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) –
SetPivotOrientation(pivotOrient) → None
Sets the pivot orientation component, leaving all others untouched.
Parameters
pivotOrient (Rotation) –
SetPivotPosition(pivPos) → None
Sets the pivot position component, leaving all others untouched.
Parameters
pivPos (Vec3d) –
SetRotation(rotation) → None
Sets the rotation component, leaving all others untouched.
Parameters
rotation (Rotation) –
SetScale(scale) → None
Sets the scale component, leaving all others untouched.
Parameters
scale (Vec3d) –
SetTranslation(translation) → None
Sets the translation component, leaving all others untouched.
Parameters
translation (Vec3d) –
property pivotOrientation
property pivotPosition
property rotation
property scale
property translation
class pxr.Gf.Vec2d
Methods:
Axis
classmethod Axis(i) -> Vec2d
GetComplement(b)
Returns the orthogonal complement of this->GetProjection(b) .
GetDot
GetLength()
Length.
GetNormalized(eps)
param eps
GetProjection(v)
Returns the projection of this onto v .
Normalize(eps)
Normalizes the vector in place to unit length, returning the length before normalization.
XAxis
classmethod XAxis() -> Vec2d
YAxis
classmethod YAxis() -> Vec2d
Attributes:
dimension
static Axis()
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) –
GetComplement(b) → Vec2d
Returns the orthogonal complement of this->GetProjection(b) .
That is:
\*this - this->GetProjection(b)
Parameters
b (Vec2d) –
GetDot()
GetLength() → float
Length.
GetNormalized(eps) → Vec2d
Parameters
eps (float) –
GetProjection(v) → Vec2d
Returns the projection of this onto v .
That is:
v \* (\*this \* v)
Parameters
v (Vec2d) –
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) –
static XAxis()
classmethod XAxis() -> Vec2d
Create a unit vector along the X-axis.
static YAxis()
classmethod YAxis() -> Vec2d
Create a unit vector along the Y-axis.
dimension = 2
class pxr.Gf.Vec2f
Methods:
Axis
classmethod Axis(i) -> Vec2f
GetComplement(b)
Returns the orthogonal complement of this->GetProjection(b) .
GetDot
GetLength()
Length.
GetNormalized(eps)
param eps
GetProjection(v)
Returns the projection of this onto v .
Normalize(eps)
Normalizes the vector in place to unit length, returning the length before normalization.
XAxis
classmethod XAxis() -> Vec2f
YAxis
classmethod YAxis() -> Vec2f
Attributes:
dimension
static Axis()
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) –
GetComplement(b) → Vec2f
Returns the orthogonal complement of this->GetProjection(b) .
That is:
\*this - this->GetProjection(b)
Parameters
b (Vec2f) –
GetDot()
GetLength() → float
Length.
GetNormalized(eps) → Vec2f
Parameters
eps (float) –
GetProjection(v) → Vec2f
Returns the projection of this onto v .
That is:
v \* (\*this \* v)
Parameters
v (Vec2f) –
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) –
static XAxis()
classmethod XAxis() -> Vec2f
Create a unit vector along the X-axis.
static YAxis()
classmethod YAxis() -> Vec2f
Create a unit vector along the Y-axis.
dimension = 2
class pxr.Gf.Vec2h
Methods:
Axis
classmethod Axis(i) -> Vec2h
GetComplement(b)
Returns the orthogonal complement of this->GetProjection(b) .
GetDot
GetLength()
Length.
GetNormalized(eps)
param eps
GetProjection(v)
Returns the projection of this onto v .
Normalize(eps)
Normalizes the vector in place to unit length, returning the length before normalization.
XAxis
classmethod XAxis() -> Vec2h
YAxis
classmethod YAxis() -> Vec2h
Attributes:
dimension
static Axis()
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) –
GetComplement(b) → Vec2h
Returns the orthogonal complement of this->GetProjection(b) .
That is:
\*this - this->GetProjection(b)
Parameters
b (Vec2h) –
GetDot()
GetLength() → GfHalf
Length.
GetNormalized(eps) → Vec2h
Parameters
eps (GfHalf) –
GetProjection(v) → Vec2h
Returns the projection of this onto v .
That is:
v \* (\*this \* v)
Parameters
v (Vec2h) –
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) –
static XAxis()
classmethod XAxis() -> Vec2h
Create a unit vector along the X-axis.
static YAxis()
classmethod YAxis() -> Vec2h
Create a unit vector along the Y-axis.
dimension = 2
class pxr.Gf.Vec2i
Methods:
Axis
classmethod Axis(i) -> Vec2i
GetDot
XAxis
classmethod XAxis() -> Vec2i
YAxis
classmethod YAxis() -> Vec2i
Attributes:
dimension
static Axis()
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) –
GetDot()
static XAxis()
classmethod XAxis() -> Vec2i
Create a unit vector along the X-axis.
static YAxis()
classmethod YAxis() -> Vec2i
Create a unit vector along the Y-axis.
dimension = 2
class pxr.Gf.Vec3d
Methods:
Axis
classmethod Axis(i) -> Vec3d
BuildOrthonormalFrame(v1, v2, eps)
Sets v1 and v2 to unit vectors such that v1, v2 and *this are mutually orthogonal.
GetComplement(b)
Returns the orthogonal complement of this->GetProjection(b) .
GetCross
GetDot
GetLength()
Length.
GetNormalized(eps)
param eps
GetProjection(v)
Returns the projection of this onto v .
Normalize(eps)
Normalizes the vector in place to unit length, returning the length before normalization.
OrthogonalizeBasis
classmethod OrthogonalizeBasis(tx, ty, tz, normalize, eps) -> bool
XAxis
classmethod XAxis() -> Vec3d
YAxis
classmethod YAxis() -> Vec3d
ZAxis
classmethod ZAxis() -> Vec3d
Attributes:
dimension
static Axis()
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) –
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) –
GetComplement(b) → Vec3d
Returns the orthogonal complement of this->GetProjection(b) .
That is:
\*this - this->GetProjection(b)
Parameters
b (Vec3d) –
GetCross()
GetDot()
GetLength() → float
Length.
GetNormalized(eps) → Vec3d
Parameters
eps (float) –
GetProjection(v) → Vec3d
Returns the projection of this onto v .
That is:
v \* (\*this \* v)
Parameters
v (Vec3d) –
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) –
static OrthogonalizeBasis()
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) –
static XAxis()
classmethod XAxis() -> Vec3d
Create a unit vector along the X-axis.
static YAxis()
classmethod YAxis() -> Vec3d
Create a unit vector along the Y-axis.
static ZAxis()
classmethod ZAxis() -> Vec3d
Create a unit vector along the Z-axis.
dimension = 3
class pxr.Gf.Vec3f
Methods:
Axis
classmethod Axis(i) -> Vec3f
BuildOrthonormalFrame(v1, v2, eps)
Sets v1 and v2 to unit vectors such that v1, v2 and *this are mutually orthogonal.
GetComplement(b)
Returns the orthogonal complement of this->GetProjection(b) .
GetCross
GetDot
GetLength()
Length.
GetNormalized(eps)
param eps
GetProjection(v)
Returns the projection of this onto v .
Normalize(eps)
Normalizes the vector in place to unit length, returning the length before normalization.
OrthogonalizeBasis
classmethod OrthogonalizeBasis(tx, ty, tz, normalize, eps) -> bool
XAxis
classmethod XAxis() -> Vec3f
YAxis
classmethod YAxis() -> Vec3f
ZAxis
classmethod ZAxis() -> Vec3f
Attributes:
dimension
static Axis()
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) –
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) –
GetComplement(b) → Vec3f
Returns the orthogonal complement of this->GetProjection(b) .
That is:
\*this - this->GetProjection(b)
Parameters
b (Vec3f) –
GetCross()
GetDot()
GetLength() → float
Length.
GetNormalized(eps) → Vec3f
Parameters
eps (float) –
GetProjection(v) → Vec3f
Returns the projection of this onto v .
That is:
v \* (\*this \* v)
Parameters
v (Vec3f) –
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) –
static OrthogonalizeBasis()
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) –
static XAxis()
classmethod XAxis() -> Vec3f
Create a unit vector along the X-axis.
static YAxis()
classmethod YAxis() -> Vec3f
Create a unit vector along the Y-axis.
static ZAxis()
classmethod ZAxis() -> Vec3f
Create a unit vector along the Z-axis.
dimension = 3
class pxr.Gf.Vec3h
Methods:
Axis
classmethod Axis(i) -> Vec3h
BuildOrthonormalFrame(v1, v2, eps)
Sets v1 and v2 to unit vectors such that v1, v2 and *this are mutually orthogonal.
GetComplement(b)
Returns the orthogonal complement of this->GetProjection(b) .
GetCross
GetDot
GetLength()
Length.
GetNormalized(eps)
param eps
GetProjection(v)
Returns the projection of this onto v .
Normalize(eps)
Normalizes the vector in place to unit length, returning the length before normalization.
OrthogonalizeBasis
classmethod OrthogonalizeBasis(tx, ty, tz, normalize, eps) -> bool
XAxis
classmethod XAxis() -> Vec3h
YAxis
classmethod YAxis() -> Vec3h
ZAxis
classmethod ZAxis() -> Vec3h
Attributes:
dimension
static Axis()
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) –
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) –
GetComplement(b) → Vec3h
Returns the orthogonal complement of this->GetProjection(b) .
That is:
\*this - this->GetProjection(b)
Parameters
b (Vec3h) –
GetCross()
GetDot()
GetLength() → GfHalf
Length.
GetNormalized(eps) → Vec3h
Parameters
eps (GfHalf) –
GetProjection(v) → Vec3h
Returns the projection of this onto v .
That is:
v \* (\*this \* v)
Parameters
v (Vec3h) –
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) –
static OrthogonalizeBasis()
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) –
static XAxis()
classmethod XAxis() -> Vec3h
Create a unit vector along the X-axis.
static YAxis()
classmethod YAxis() -> Vec3h
Create a unit vector along the Y-axis.
static ZAxis()
classmethod ZAxis() -> Vec3h
Create a unit vector along the Z-axis.
dimension = 3
class pxr.Gf.Vec3i
Methods:
Axis
classmethod Axis(i) -> Vec3i
GetDot
XAxis
classmethod XAxis() -> Vec3i
YAxis
classmethod YAxis() -> Vec3i
ZAxis
classmethod ZAxis() -> Vec3i
Attributes:
dimension
static Axis()
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) –
GetDot()
static XAxis()
classmethod XAxis() -> Vec3i
Create a unit vector along the X-axis.
static YAxis()
classmethod YAxis() -> Vec3i
Create a unit vector along the Y-axis.
static ZAxis()
classmethod ZAxis() -> Vec3i
Create a unit vector along the Z-axis.
dimension = 3
class pxr.Gf.Vec4d
Methods:
Axis
classmethod Axis(i) -> Vec4d
GetComplement(b)
Returns the orthogonal complement of this->GetProjection(b) .
GetDot
GetLength()
Length.
GetNormalized(eps)
param eps
GetProjection(v)
Returns the projection of this onto v .
Normalize(eps)
Normalizes the vector in place to unit length, returning the length before normalization.
WAxis
classmethod WAxis() -> Vec4d
XAxis
classmethod XAxis() -> Vec4d
YAxis
classmethod YAxis() -> Vec4d
ZAxis
classmethod ZAxis() -> Vec4d
Attributes:
dimension
static Axis()
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) –
GetComplement(b) → Vec4d
Returns the orthogonal complement of this->GetProjection(b) .
That is:
\*this - this->GetProjection(b)
Parameters
b (Vec4d) –
GetDot()
GetLength() → float
Length.
GetNormalized(eps) → Vec4d
Parameters
eps (float) –
GetProjection(v) → Vec4d
Returns the projection of this onto v .
That is:
v \* (\*this \* v)
Parameters
v (Vec4d) –
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) –
static WAxis()
classmethod WAxis() -> Vec4d
Create a unit vector along the W-axis.
static XAxis()
classmethod XAxis() -> Vec4d
Create a unit vector along the X-axis.
static YAxis()
classmethod YAxis() -> Vec4d
Create a unit vector along the Y-axis.
static ZAxis()
classmethod ZAxis() -> Vec4d
Create a unit vector along the Z-axis.
dimension = 4
class pxr.Gf.Vec4f
Methods:
Axis
classmethod Axis(i) -> Vec4f
GetComplement(b)
Returns the orthogonal complement of this->GetProjection(b) .
GetDot
GetLength()
Length.
GetNormalized(eps)
param eps
GetProjection(v)
Returns the projection of this onto v .
Normalize(eps)
Normalizes the vector in place to unit length, returning the length before normalization.
WAxis
classmethod WAxis() -> Vec4f
XAxis
classmethod XAxis() -> Vec4f
YAxis
classmethod YAxis() -> Vec4f
ZAxis
classmethod ZAxis() -> Vec4f
Attributes:
dimension
static Axis()
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) –
GetComplement(b) → Vec4f
Returns the orthogonal complement of this->GetProjection(b) .
That is:
\*this - this->GetProjection(b)
Parameters
b (Vec4f) –
GetDot()
GetLength() → float
Length.
GetNormalized(eps) → Vec4f
Parameters
eps (float) –
GetProjection(v) → Vec4f
Returns the projection of this onto v .
That is:
v \* (\*this \* v)
Parameters
v (Vec4f) –
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) –
static WAxis()
classmethod WAxis() -> Vec4f
Create a unit vector along the W-axis.
static XAxis()
classmethod XAxis() -> Vec4f
Create a unit vector along the X-axis.
static YAxis()
classmethod YAxis() -> Vec4f
Create a unit vector along the Y-axis.
static ZAxis()
classmethod ZAxis() -> Vec4f
Create a unit vector along the Z-axis.
dimension = 4
class pxr.Gf.Vec4h
Methods:
Axis
classmethod Axis(i) -> Vec4h
GetComplement(b)
Returns the orthogonal complement of this->GetProjection(b) .
GetDot
GetLength()
Length.
GetNormalized(eps)
param eps
GetProjection(v)
Returns the projection of this onto v .
Normalize(eps)
Normalizes the vector in place to unit length, returning the length before normalization.
WAxis
classmethod WAxis() -> Vec4h
XAxis
classmethod XAxis() -> Vec4h
YAxis
classmethod YAxis() -> Vec4h
ZAxis
classmethod ZAxis() -> Vec4h
Attributes:
dimension
static Axis()
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) –
GetComplement(b) → Vec4h
Returns the orthogonal complement of this->GetProjection(b) .
That is:
\*this - this->GetProjection(b)
Parameters
b (Vec4h) –
GetDot()
GetLength() → GfHalf
Length.
GetNormalized(eps) → Vec4h
Parameters
eps (GfHalf) –
GetProjection(v) → Vec4h
Returns the projection of this onto v .
That is:
v \* (\*this \* v)
Parameters
v (Vec4h) –
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) –
static WAxis()
classmethod WAxis() -> Vec4h
Create a unit vector along the W-axis.
static XAxis()
classmethod XAxis() -> Vec4h
Create a unit vector along the X-axis.
static YAxis()
classmethod YAxis() -> Vec4h
Create a unit vector along the Y-axis.
static ZAxis()
classmethod ZAxis() -> Vec4h
Create a unit vector along the Z-axis.
dimension = 4
class pxr.Gf.Vec4i
Methods:
Axis
classmethod Axis(i) -> Vec4i
GetDot
WAxis
classmethod WAxis() -> Vec4i
XAxis
classmethod XAxis() -> Vec4i
YAxis
classmethod YAxis() -> Vec4i
ZAxis
classmethod ZAxis() -> Vec4i
Attributes:
dimension
static Axis()
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) –
GetDot()
static WAxis()
classmethod WAxis() -> Vec4i
Create a unit vector along the W-axis.
static XAxis()
classmethod XAxis() -> Vec4i
Create a unit vector along the X-axis.
static YAxis()
classmethod YAxis() -> Vec4i
Create a unit vector along the Y-axis.
static ZAxis()
classmethod ZAxis() -> Vec4i
Create a unit vector along the Z-axis.
dimension = 4
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023. |
omni.ui.MultiIntField.md | MultiIntField — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
MultiIntField
# MultiIntField
class omni.ui.MultiIntField
Bases: AbstractMultiField
MultiIntField is the widget that has a sub widget (IntField) per model item.
It’s handy to use it for multi-component data, like for example, int3.
Methods
__init__(*args, **kwargs)
Overloaded function.
Attributes
__init__(*args, **kwargs)
Overloaded function.
__init__(self: omni.ui._ui.MultiIntField, **kwargs) -> None
__init__(self: omni.ui._ui.MultiIntField, arg0: omni.ui._ui.AbstractItemModel, **kwargs) -> None
__init__(self: omni.ui._ui.MultiIntField, *args, **kwargs) -> None
Constructor.
`kwargsdict`See below
### Keyword Arguments:
`column_count`The max number of fields in a line.
`h_spacing`Sets a non-stretchable horizontal space in pixels between child fields.
`v_spacing`Sets a non-stretchable vertical space in pixels between child fields.
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.AbstractSlider.md | AbstractSlider — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
AbstractSlider
# AbstractSlider
class omni.ui.AbstractSlider
Bases: Widget, ValueModelHelper
The abstract widget that is base for drags and sliders.
Methods
__init__(*args, **kwargs)
Attributes
__init__(*args, **kwargs)
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
dictionary_settings.md | Dictionaries and Settings — kit-manual 105.1 documentation
kit-manual
»
Dictionaries and Settings
# Dictionaries and Settings
Settings is a generalized subsystem designed to provide a simple to use interface to Kit’s various subsystems, which can be automated, enumerated, serialized and so on. It is accessible from both C++ and scripting bindings such as Python bindings. carb.settings is a Python namespace (and, coincidentally, a C++ plugin name) for the Settings subsystem.
Settings uses carb.dictionary under the hood, and is effectively a singleton dictionary with a specialized API to streamline access.
carb.dictionary is a Dictionary subsystem, which provides functionality to work with the data structure type known as dictionary, associative array, map, and so on.
## Dictionaries
For the low-level description of the design and general principles, please refer to the Carbonite documentation for the carb.dictionary interfaces.
## Settings
As mentioned above, the settings subsystem is using carb.dictionary under the hood, and to learn more about the low-level description of the design and general principles, please refer to the Carbonite documentation.
On a higher level, there are several important principles and guidelines for using settings infrastructure, and best practices for using settings within Omniverse Kit.
### Default values
Default values need to be set for settings at the initialization stage of the plugin, and in the extension configuration file.
A rule of thumb is that no setting should be read when there is no value for it. As always, there are exceptions to this rule, but in the vast majority of cases, settings should be read after the setting owner sets a default value for this particular setting.
### Notifications
To ensure optimal performance, it is recommended to use notifications instead of directly polling for settings, to avoid the costs of accessing the settings backend when the value didn’t change.
DON’T: This is an example of polling in a tight loop, and it is not recommended to do things this way:
while (m_settings->get<bool>("/snippet/app/isRunning"))
{
doStuff();
// Stop the loop via settings change
m_settings->set("/snippet/app/isRunning", false);
}
DO: Instead, use the notification APIs, and available helpers that simplify the notification subscription code, to reduce the overhead significantly:
carb::settings::ThreadSafeLocalCache<bool> valueTracker;
valueTracker.startTracking("/snippet/app/isRunning");
while (valueTracker.get())
{
doStuff();
// Stop the loop via settings change
m_settings->set("/snippet/app/isRunning", false);
}
valueTracker.stopTracking();
With the bool value, getting and setting the value is cheap, but in cases of more complicated types, e.g. string, marking and clearing dirty marks could be used in the helper.
In case a helper is not sufficient for the task at hand - it is always possible to use the settings API in such a way as subscribeToNodeChangeEvents/subscribeToTreeChangeEvents and unsubscribeToChangeEvents to achieve what’s needed with greater flexibility.
### Settings structure
Settings are intended to be easily tweakable, serializable and human readable. One of the use-cases is automatic UI creation from the settings snapshot to help users view and tweak settings at run time.
DO: Simple and readable settings like /app/rendering/enabled
DON’T: Internal settings that don’t make sense to anyone outside the core developer group, things like:
/component/modelArray/0=23463214
/component/modelArray/1=54636715
/component/modelArray/2=23543205
...
/component/modelArray/100=66587434
### Reacting to and consuming settings
Ideally settings should be monitored for changes and plugin/extensions should be reacting to the changes accordingly. But exceptions are possible, and in these cases, the settings changes should still be monitored and user should be given a warning that the change in setting is not going to affect the behavior of a particular system.
### Combining API and settings
Often, there are at least two ways to modify behavior: via the designated API function call, or via changing the corresponding setting. The question is how to reconcile these two approaches.
One way to address this problem - API functions should only change settings, and the core logic tracks settings changes and react to them. Never change the core logic value directly when the corresponding setting value is present. By adding a small detour into the settings subsystem from API calls, you can make sure that the value stored in the core logic and corresponding setting value are never out of sync.
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023. |
Work.md | Work module — pxr-usd-api 105.1 documentation
pxr-usd-api
»
Modules »
Work module
# Work module
Summary: The Work library is intended to simplify the use of multithreading in the context of our software ecosystem.
Work
Allows for configuration of the system’s multithreading subsystem.
Functions:
GetConcurrencyLimit
GetPhysicalConcurrencyLimit
HasConcurrency
SetConcurrencyLimit
SetConcurrencyLimitArgument
SetMaximumConcurrencyLimit
pxr.Work.GetConcurrencyLimit()
pxr.Work.GetPhysicalConcurrencyLimit()
pxr.Work.HasConcurrency()
pxr.Work.SetConcurrencyLimit()
pxr.Work.SetConcurrencyLimitArgument()
pxr.Work.SetMaximumConcurrencyLimit()
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023. |
develop.md | Develop a Project — Omniverse Developer Guide latest documentation
Omniverse Developer Guide
»
Omniverse Developer Guide »
Develop a Project
# Develop a Project
After creating a new Project, the development phase begins. In this phase, you configure and use an assortment of tools and extensions, along with automated documentation features to fit the needs of your project.
As a reminder, you can find additional documentation in the left-hand menu, such as:
Kit Manual for extensive information about programming using the Kit SDK.
Extensions for an extensive list of extensions you can include as dependencies in your project.
Having followed the methods outlined in the Create section, you’ve produced configuration files and established a folder setup. Now you will transform this set of default files to enable new functionality. This stage of Omniverse Project Development is undeniably the most in-depth, offering numerous paths to achieve desired outcomes as a developer.
In this section, we’ll discuss tools and resources for project development, be it crafting an Extension (or multiple extensions), Application, Service, or Connector.
## Configure TOML Files
Introduction
Both Omniverse Applications and Extensions fundamentally rely on a configuration file in TOML format. This file dictates dependencies and settings that the Kit SDK loads and executes. Through this mechanism, Applications can include Extensions, which may further depend on other Extensions, forming a dependency tree.
For details on constructing this tree and the corresponding settings for each Extension, it’s essential to understand the specific configuration files. Applications utilize the .kit file, while Extensions are defined using .toml files. For more on each type of configuration file, please refer to the tabs above.
Extension (extension.toml)
Requirements:
Understanding TOML file format.
Text Editor (VS Code recommended)
Extensions can contain many types of assets, such as images, python files, data files, C++ code/header files, documentation, and more. However, one thing all Extensions have in common is the extension.toml file.
Extension.toml should be located in the ./config folder of your project so that it can be found by various script tools.
Here is an example extension.toml file that can be found in the Advanced Template Repository:
[package]
version = "1.0.0"
title = "Simple UI Extension Template"
description = "The simplest python extension example. Use it as a starting point for your extensions."
# One of categories for UI.
category = "Example"
# Keywords for the extension
keywords = ["kit", "example"]
# Path (relative to the root) or content of readme markdown file for UI.
readme = "docs/README.md"
# Path (relative to the root) of changelog
changelog = "docs/CHANGELOG.md"
# URL of the extension source repository.
repository = "https://github.com/NVIDIA-Omniverse/kit-project-template"
# Icon to show in the extension manager
icon = "data/icon.png"
# Preview to show in the extension manager
preview_image = "data/preview.png"
# Use omni.ui to build simple UI
[dependencies]
"omni.kit.uiapp" = {}
# Main python module this extension provides, it will be publicly available as "import my.hello.world".
[[python.module]]
name = "my.hello.world"
Here we will break this down…
[package]
version = "1.0.0"
This sets the version of your extension. It is critical that this version is set any time you produce a new release of your extension, as this version is most often used to differentiate releases of extensions in registries and databases. As a best practice, it is useful to maintain semantic versioning.
It is also best practice to ensure that you document changes you have made to your code. See the Documentation section for more information.
title = "Simple UI Extension Template"
description = "The simplest python extension example. Use it as a starting point for your extensions."
category = "Example"
keywords = ["kit", "example"]
The title and description can be used in registries and publishing destinations to allow users more information on what your extension is used for.
The category sets an overall filter for where this extension should appear in various UIs.
The keywords property lists an array of searchable, filterable attributes for this extension.
[dependencies]
"omni.kit.uiapp" = {}
This section is critical to the development of all aspects of your project. The dependencies section in your toml files specifies which extensions are required. As a best practice, you should ensure that you use the smallest list of dependencies that still accomplishes your goals. When setting dependencies for extensions, ensure you only add extensions that are dependencies of that extension.
The brackets {} in the dependency line allow for parameters such as the following:
order=[ordernum] allows you to define by signed integer which order the dependencies are loaded. Lower integers are loaded first. (e.g. order=5000)
version=["version ID"] lets you specify which version of an extension is loaded. (e.g. version="1.0.1")
exact=true (default is false) - If set to true, parser will use only an exact match for the version, not just a partial match.
[[python.module]]
name = "my.hello.world"
This section should contain one or more named python modules that are used by the extension. The name is expected to also match a folder structure within the extension path. In this example, the extension named my.hello.world would have the following path.
my/hello/world.
These are the minimum required settings for extensions and apps. We will discuss more settings later in the Dev Guide, and you can find plenty of examples of these configuration files in the Developer Reference sections of the menu.
Application ([appname].kit)
Requirements:
Understanding TOML file format.
Text Editor (VS Code recommended)
Applications are not much different than extensions. It is assumed that an application is the “root” of a dependency tree. It also often has settings in it related to the behavior of a particular workflow. Regardless, an App has the same TOML file configuration as extensions, but an App’s TOML file is called a .kit file.
.kit files should be located in the ./source/apps folder of your project so that it can be found by various script tools.
Here is an example kit file that provides some of the minimum settings you’ll need. Additional settings and options can be found later:
[package]
version = "1.0.0"
title = "My Minimum App"
description = "A very simple app."
# One of categories for UI.
category = "Example"
# Keywords for the extension
keywords = ["kit", "example"]
# Path (relative to the root) or content of readme markdown file for UI.
readme = "docs/README.md"
# Path (relative to the root) of changelog
changelog = "docs/CHANGELOG.md"
# URL of the extension source repository.
repository = "https://github.com/NVIDIA-Omniverse/kit-project-template"
# Icon to show in the extension manager
icon = "data/icon.png"
# Preview to show in the extension manager
preview_image = "data/preview.png"
# Use omni.ui to build simple UI
[dependencies]
"omni.kit.uiapp" = {}
Here we will break this down…
[package]
version = "1.0.0"
This sets the version of your extension or app. It is critical that this version is set any time you produce a new release of your extension, as this version is most often used to differentiate releases of extensions/apps in registries and databases. As a best practice, it is useful to maintain semantic versioning https://semver.org/.
It is also best practice to ensure that you document changes you have made in your docs show each version you’ve released.
title = "Simple UI Extension Template"
description = "A very simple app."
category = "Example"
keywords = ["kit", "example"]
The title and description can be used in registries and publishing destinations to allow users more information on what your app or extension is used for.
The category sets an overall filter for where this project should appear in various UIs.
The keywords property lists an array of searchable, filterable attributes for this extension.
[dependencies]
"omni.kit.uiapp" = {}
This section is critical to the development of all aspects of your project. The dependencies section in your toml files specifies which extensions are to be used by the app. As a best practice, you should ensure that you use the smallest list of dependencies that still accomplishes your goals. And, in extensions especially, you only add dependencies which THAT extension requires.
The brackets {} in the dependency line allow for parameters such as the following:
order=[ordernum] allows you to define by signed integer which order the dependencies are loaded. Lower integers are loaded first. (e.g. order=5000)
version=["version ID"] lets you specify which version of an extension is loaded. (e.g. version="1.0.1")
exact=true (default is false) - If set and true, parser will use only an exact match for the version, not just a partial match.
These are the minimum required settings for Apps. We will discuss more settings later in the Dev Guide, and you can find plenty of examples of these configuration files in the Developer Reference sections of the menu.
## Available Extensions
Virtually all user-facing elements in an Omniverse Application, such as Omniverse USD Composer or Omniverse USD Presenter, are created using Extensions. The very same extensions used in Omniverse Applications are also available to you for your own development.
The number of extensions provided by both the Community and NVIDIA is continually growing to support new features and use cases. However, a core set of extensions is provided alongside the Omniverse Kit SDK. These ensure basic functionality for your Extensions and Applications including:
Omniverse UI Framework : A UI toolkit for creating beautiful and flexible graphical user interfaces within extensions.
Omni Kit Actions Core : A framework for creating, registering, and discovering programmable Actions in Omniverse.
Omni Scene UI : Provides tooling to create great-looking 3d manipulators and 3d helpers with as little code as possible.
And more.
A list of available Extensions can be found via API Search.
## Documentation
If you are developing your project using Repo Tools, you also have the ability to create documentation from source files to be included in your build. This powerful feature helps automate html-based documentation from human-readable .md files.
You can refer to the repo docs -h command to see more information on the docs tool and its parameters.
By running
repo docs
you will generate in the _build/docs/[project_name]/latest/ folder a set of files which represents the html version of your source documentation. The “home page” for your documentation will be the index.html file in that folder.
You can find latest information by reading the Omniverse Documentation System.
Note
You may find that when running repo docs you receive an error message instead of the build proceeding. If this is the case it is likely that you are either using a project that does not contain the “docs” tool OR that your repo.toml file is not setup correctly. Please refer to the repo tools documentation linked to above for more information.
## Additional Documentation
Script Editor
Code Samples
Repo Tools
© Copyright 2023-2024, NVIDIA.
Last updated on Apr 15, 2024. |
omni.ui.FillPolicy.md | FillPolicy — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
FillPolicy
# FillPolicy
class omni.ui.FillPolicy
Bases: pybind11_object
Members:
STRETCH
PRESERVE_ASPECT_FIT
PRESERVE_ASPECT_CROP
Methods
__init__(self, value)
Attributes
PRESERVE_ASPECT_CROP
PRESERVE_ASPECT_FIT
STRETCH
name
value
__init__(self: omni.ui._ui.FillPolicy, value: int) → None
property name
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
1_1_2.md | 1.1.2 — Omniverse Launcher latest documentation
Omniverse Launcher
»
Omniverse Launcher »
Release Notes »
1.1.2
# 1.1.2
Release Date: March 2021
## Spotlight Features
New “Learn Tab” available in launcher lets you get quick and immediate “in-launcher” access to our video learning portal. From Introductory content for the beginner to highly focused deep dives for the experienced, Omniverse Learning Videos are now just a click away.
## New Capabilities
Show available updates for components on the exchange tab.
Show component versions in the list view on the exchange tab.
Added omniverse-launcher://exit command to close the launcher.
Register a custom protocol handler on Linux automatically.
HTTP API to get the current authentication info.
HTTP API to get a list of installed components and their settings.
Added Learn tab.
Added new options to group and sort content on the exchange tab.
Added the list view for components on the exchange tab.
Use omniverse-launcher:// custom protocol to accept commands from other apps.
Added the telemetry service for events from external applications.
## Fixed/Altered
Changed the aspect ratio of images used in component cards to be 16:9.
Fixed focusing the search bar automatically when nothing was typed in the input.
Fixed reinstalling components that were marked as installed after a restart.
Changed the gap between cards on the Exchange tab using the grid view.
Fixed refreshing News and Learn pages when users click on the header tabs.
Fixed News and Learn links to load webpages without headers and footers.
Fixed the scrollbar on the Exchange tab not working correctly when dragged with a mouse.
Fixed clicking area for the notification bell.
Fixed Nucleus showing up in the library.
Fixed “Uninstall” button position in component settings dialog.
Fixed the search input losing focus after typing.
Fixed losing the search filters after selecting a card on the exchange tab.
Changed how content is structured and searched on the exchange tab – moved Apps and Connectors categories to the left menu.
Improved the load speed and performance on the exchange tab.
Show placeholder in the installation queue if no downloads are queued.
Load messages displayed in the footer from the server.
Match the font size used for links in the settings dialog.
Updated links on Collaboration tab.
Fixed extracting files from zip archives with a read-only flag on Windows.
Fixed error that crashed browser page and didn’t let users log in.
Fixed showing invalid error messages in the exchange tab when Starfleet returns unexpected response body.
Fixed expiration of the authentication token.
© Copyright 2023-2024, NVIDIA.
Last updated on Apr 15, 2024. |
publish.md | Publish a Package — Omniverse Developer Guide latest documentation
Omniverse Developer Guide
»
Omniverse Developer Guide »
Publish a Package
# Publish a Package
The ultimate goal is to transform your hard work into a product that others can realize value from. The publishing process helps you to achieve this by relocating the Packaged Build to a location suitable for installation or deployment. Omniverse offers a wide array of endpoints including integrated ZIP files, Cloud systems, Streaming systems, our Launcher system, Git repositories, customized CMS, and more. Although the functional content of a package can be consistent across platforms, the delivery and installation methods may vary. This section guides you through the process of publishing your project to reach your intended audience.
For end users of your custom App or Extension, users must accept the NVIDIA Omniverse License Agreement.
It’s important to keep in mind that you can publish your project to multiple destinations as long as you can meet the requirements for each of them. Some might require particular Package steps, others may require that you create a Package for a particular platform. In any case, it is important to note that you can create your development workflow around generating multiple Packages intended for multiple publishing destinations.
## Direct Deployment
Package Types: Thin Package, Fat Package
Project Types: Apps, Services, Connectors, Extensions
Platforms: Windows, Linux
Instructions to Install Packages Directly to End User
## Launcher
Package Types: Thin Package, Fat Package
Project Types: Apps, Services, Connectors, Extensions
Platforms: Windows, Linux
NVIDIA Omniverse™ Launcher is the method that most Omniverse Projects are distributed to end-users. Launcher not only allows for distribution of NVIDIA generated applications and extensions, but also third-party apps and extensions. Launcher also can be used for on-prem distribution, enterprise solutions, and more. You can even test your packages on a local version of Launcher to see how they will be presented to your customers.
Learn more about publishing to Omniverse Launcher
## Omniverse Cloud
Package Types: Fat Package
Project Types: Apps
Platforms: Linux
After building a Launcher Package using the Fat Package, you can then also distribute via Omniverse Cloud (OVC). With OVC, users can stream their apps to devices with nothing more than an internet connection.
Learn about publishing to OVC via the Omniverse Cloud Guide
© Copyright 2023-2024, NVIDIA.
Last updated on Apr 15, 2024. |
omni.ui.Widget.md | Widget — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
Widget
# Widget
class omni.ui.Widget
Bases: pybind11_object
The Widget class is the base class of all user interface objects.
The widget is the atom of the user interface: it receives mouse, keyboard and other events, and paints a representation of itself on the screen. Every widget is rectangular. A widget is clipped by its parent and by the widgets in front of it.
Methods
__init__(self, **kwargs)
call_accept_drop_fn(self, arg0)
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
call_computed_content_size_changed_fn(self)
Called when the size of the widget is changed.
call_drag_fn(self)
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
call_drop_fn(self, arg0)
Specify that this Widget accepts drops and set the callback to the drop operation.
call_key_pressed_fn(self, arg0, arg1, arg2)
Sets the function that will be called when the user presses the keyboard key when the mouse clicks the widget.
call_mouse_double_clicked_fn(self, arg0, ...)
Sets the function that will be called when the user presses the mouse button twice inside the widget.
call_mouse_hovered_fn(self, arg0)
Sets the function that will be called when the user use mouse enter/leave on the focused window.
call_mouse_moved_fn(self, arg0, arg1, arg2, arg3)
Sets the function that will be called when the user moves the mouse inside the widget.
call_mouse_pressed_fn(self, arg0, arg1, ...)
Sets the function that will be called when the user presses the mouse button inside the widget.
call_mouse_released_fn(self, arg0, arg1, ...)
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget.
call_mouse_wheel_fn(self, arg0, arg1, arg2)
Sets the function that will be called when the user uses mouse wheel on the focused window.
call_tooltip_fn(self)
Set dynamic tooltip that will be created dynamiclly the first time it is needed.
destroy(self)
Removes all the callbacks and circular references.
has_accept_drop_fn(self)
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
has_computed_content_size_changed_fn(self)
Called when the size of the widget is changed.
has_drag_fn(self)
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
has_drop_fn(self)
Specify that this Widget accepts drops and set the callback to the drop operation.
has_key_pressed_fn(self)
Sets the function that will be called when the user presses the keyboard key when the mouse clicks the widget.
has_mouse_double_clicked_fn(self)
Sets the function that will be called when the user presses the mouse button twice inside the widget.
has_mouse_hovered_fn(self)
Sets the function that will be called when the user use mouse enter/leave on the focused window.
has_mouse_moved_fn(self)
Sets the function that will be called when the user moves the mouse inside the widget.
has_mouse_pressed_fn(self)
Sets the function that will be called when the user presses the mouse button inside the widget.
has_mouse_released_fn(self)
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget.
has_mouse_wheel_fn(self)
Sets the function that will be called when the user uses mouse wheel on the focused window.
has_tooltip_fn(self)
Set dynamic tooltip that will be created dynamiclly the first time it is needed.
scroll_here(self[, center_ratio_x, ...])
Adjust scrolling amount in two axes to make current item visible.
scroll_here_x(self[, center_ratio])
Adjust scrolling amount to make current item visible.
scroll_here_y(self[, center_ratio])
Adjust scrolling amount to make current item visible.
set_accept_drop_fn(self, fn)
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
set_checked_changed_fn(self, fn)
This property holds a flag that specifies the widget has to use eChecked state of the style.
set_computed_content_size_changed_fn(self, fn)
Called when the size of the widget is changed.
set_drag_fn(self, fn)
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
set_drop_fn(self, fn)
Specify that this Widget accepts drops and set the callback to the drop operation.
set_key_pressed_fn(self, fn)
Sets the function that will be called when the user presses the keyboard key when the mouse clicks the widget.
set_mouse_double_clicked_fn(self, fn)
Sets the function that will be called when the user presses the mouse button twice inside the widget.
set_mouse_hovered_fn(self, fn)
Sets the function that will be called when the user use mouse enter/leave on the focused window.
set_mouse_moved_fn(self, fn)
Sets the function that will be called when the user moves the mouse inside the widget.
set_mouse_pressed_fn(self, fn)
Sets the function that will be called when the user presses the mouse button inside the widget.
set_mouse_released_fn(self, fn)
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget.
set_mouse_wheel_fn(self, fn)
Sets the function that will be called when the user uses mouse wheel on the focused window.
set_style(self, arg0)
Set the current style.
set_tooltip(self, tooltip_label)
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
set_tooltip_fn(self, fn)
Set dynamic tooltip that will be created dynamiclly the first time it is needed.
Attributes
FLAG_WANT_CAPTURE_KEYBOARD
checked
This property holds a flag that specifies the widget has to use eChecked state of the style.
computed_content_height
Returns the final computed height of the content of the widget.
computed_content_width
Returns the final computed width of the content of the widget.
computed_height
Returns the final computed height of the widget.
computed_width
Returns the final computed width of the widget.
dragging
This property holds if the widget is being dragged.
enabled
This property holds whether the widget is enabled.
height
This property holds the height of the widget relative to its parent.
identifier
An optional identifier of the widget we can use to refer to it in queries.
name
The name of the widget that user can set.
opaque_for_mouse_events
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don't get routed to the child widgets either
screen_position_x
Returns the X Screen coordinate the widget was last draw.
screen_position_y
Returns the Y Screen coordinate the widget was last draw.
scroll_only_window_hovered
When it's false, the scroll callback is called even if other window is hovered.
selected
This property holds a flag that specifies the widget has to use eSelected state of the style.
skip_draw_when_clipped
The flag that specifies if it's necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame.
style
The local style.
style_type_name_override
By default, we use typeName to look up the style.
tooltip
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
tooltip_offset_x
Set the X tooltip offset in points.
tooltip_offset_y
Set the Y tooltip offset in points.
visible
This property holds whether the widget is visible.
visible_max
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
visible_min
If the current zoom factor and DPI is less than this value, the widget is not visible.
width
This property holds the width of the widget relative to its parent.
__init__(self: omni.ui._ui.Widget, **kwargs) → None
call_accept_drop_fn(self: omni.ui._ui.Widget, arg0: str) → bool
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
call_computed_content_size_changed_fn(self: omni.ui._ui.Widget) → None
Called when the size of the widget is changed.
call_drag_fn(self: omni.ui._ui.Widget) → str
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
call_drop_fn(self: omni.ui._ui.Widget, arg0: omni.ui._ui.WidgetMouseDropEvent) → None
Specify that this Widget accepts drops and set the callback to the drop operation.
call_key_pressed_fn(self: omni.ui._ui.Widget, arg0: int, arg1: int, arg2: bool) → None
Sets the function that will be called when the user presses the keyboard key when the mouse clicks the widget.
call_mouse_double_clicked_fn(self: omni.ui._ui.Widget, arg0: float, arg1: float, arg2: int, arg3: int) → None
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
call_mouse_hovered_fn(self: omni.ui._ui.Widget, arg0: bool) → None
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
call_mouse_moved_fn(self: omni.ui._ui.Widget, arg0: float, arg1: float, arg2: int, arg3: bool) → None
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
call_mouse_pressed_fn(self: omni.ui._ui.Widget, arg0: float, arg1: float, arg2: int, arg3: int) → None
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
call_mouse_released_fn(self: omni.ui._ui.Widget, arg0: float, arg1: float, arg2: int, arg3: int) → None
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
call_mouse_wheel_fn(self: omni.ui._ui.Widget, arg0: float, arg1: float, arg2: int) → None
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
call_tooltip_fn(self: omni.ui._ui.Widget) → None
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
destroy(self: omni.ui._ui.Widget) → None
Removes all the callbacks and circular references.
has_accept_drop_fn(self: omni.ui._ui.Widget) → bool
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
has_computed_content_size_changed_fn(self: omni.ui._ui.Widget) → bool
Called when the size of the widget is changed.
has_drag_fn(self: omni.ui._ui.Widget) → bool
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
has_drop_fn(self: omni.ui._ui.Widget) → bool
Specify that this Widget accepts drops and set the callback to the drop operation.
has_key_pressed_fn(self: omni.ui._ui.Widget) → bool
Sets the function that will be called when the user presses the keyboard key when the mouse clicks the widget.
has_mouse_double_clicked_fn(self: omni.ui._ui.Widget) → bool
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
has_mouse_hovered_fn(self: omni.ui._ui.Widget) → bool
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
has_mouse_moved_fn(self: omni.ui._ui.Widget) → bool
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
has_mouse_pressed_fn(self: omni.ui._ui.Widget) → bool
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
has_mouse_released_fn(self: omni.ui._ui.Widget) → bool
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
has_mouse_wheel_fn(self: omni.ui._ui.Widget) → bool
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
has_tooltip_fn(self: omni.ui._ui.Widget) → bool
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
scroll_here(self: omni.ui._ui.Widget, center_ratio_x: float = 0.0, center_ratio_y: float = 0.0) → None
Adjust scrolling amount in two axes to make current item visible.
### Arguments:
`centerRatioX :`0.0: left, 0.5: center, 1.0: right
`centerRatioY :`0.0: top, 0.5: center, 1.0: bottom
scroll_here_x(self: omni.ui._ui.Widget, center_ratio: float = 0.0) → None
Adjust scrolling amount to make current item visible.
### Arguments:
`centerRatio :`0.0: left, 0.5: center, 1.0: right
scroll_here_y(self: omni.ui._ui.Widget, center_ratio: float = 0.0) → None
Adjust scrolling amount to make current item visible.
### Arguments:
`centerRatio :`0.0: top, 0.5: center, 1.0: bottom
set_accept_drop_fn(self: omni.ui._ui.Widget, fn: Callable[[str], bool]) → None
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
set_checked_changed_fn(self: omni.ui._ui.Widget, fn: Callable[[bool], None]) → None
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
set_computed_content_size_changed_fn(self: omni.ui._ui.Widget, fn: Callable[[], None]) → None
Called when the size of the widget is changed.
set_drag_fn(self: omni.ui._ui.Widget, fn: Callable[[], str]) → None
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
set_drop_fn(self: omni.ui._ui.Widget, fn: Callable[[omni.ui._ui.WidgetMouseDropEvent], None]) → None
Specify that this Widget accepts drops and set the callback to the drop operation.
set_key_pressed_fn(self: omni.ui._ui.Widget, fn: Callable[[int, int, bool], None]) → None
Sets the function that will be called when the user presses the keyboard key when the mouse clicks the widget.
set_mouse_double_clicked_fn(self: omni.ui._ui.Widget, fn: Callable[[float, float, int, int], None]) → None
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
set_mouse_hovered_fn(self: omni.ui._ui.Widget, fn: Callable[[bool], None]) → None
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
set_mouse_moved_fn(self: omni.ui._ui.Widget, fn: Callable[[float, float, int, bool], None]) → None
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
set_mouse_pressed_fn(self: omni.ui._ui.Widget, fn: Callable[[float, float, int, int], None]) → None
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
set_mouse_released_fn(self: omni.ui._ui.Widget, fn: Callable[[float, float, int, int], None]) → None
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
set_mouse_wheel_fn(self: omni.ui._ui.Widget, fn: Callable[[float, float, int], None]) → None
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
set_style(self: omni.ui._ui.Widget, arg0: handle) → None
Set the current style. The style contains a description of customizations to the widget’s style.
set_tooltip(self: omni.ui._ui.Widget, tooltip_label: str) → None
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
set_tooltip_fn(self: omni.ui._ui.Widget, fn: Callable[[], None]) → None
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
property checked
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
property computed_content_height
Returns the final computed height of the content of the widget.
It’s in puplic section. For the explanation why please see the draw() method.
property computed_content_width
Returns the final computed width of the content of the widget.
It’s in puplic section. For the explanation why please see the draw() method.
property computed_height
Returns the final computed height of the widget. It includes margins.
It’s in puplic section. For the explanation why please see the draw() method.
property computed_width
Returns the final computed width of the widget. It includes margins.
It’s in puplic section. For the explanation why please see the draw() method.
property dragging
This property holds if the widget is being dragged.
property enabled
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
property height
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
property identifier
An optional identifier of the widget we can use to refer to it in queries.
property name
The name of the widget that user can set.
property opaque_for_mouse_events
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
property screen_position_x
Returns the X Screen coordinate the widget was last draw. This is in Screen Pixel size.
It’s a float because we need negative numbers and precise position considering DPI scale factor.
property screen_position_y
Returns the Y Screen coordinate the widget was last draw. This is in Screen Pixel size.
It’s a float because we need negative numbers and precise position considering DPI scale factor.
property scroll_only_window_hovered
When it’s false, the scroll callback is called even if other window is hovered.
property selected
This property holds a flag that specifies the widget has to use eSelected state of the style.
property skip_draw_when_clipped
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
property style
The local style. When the user calls
setStyle()
property style_type_name_override
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
property tooltip
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
property tooltip_offset_x
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
property tooltip_offset_y
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
property visible
This property holds whether the widget is visible.
property visible_max
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
property visible_min
If the current zoom factor and DPI is less than this value, the widget is not visible.
property width
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.add_to_namespace.md | add_to_namespace — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Functions »
add_to_namespace
# add_to_namespace
omni.ui.add_to_namespace(module=None, module_locals={'AbstractField': <class 'omni.ui._ui.AbstractField'>, 'AbstractItem': <class 'omni.ui._ui.AbstractItem'>, 'AbstractItemDelegate': <class 'omni.ui._ui.AbstractItemDelegate'>, 'AbstractItemModel': <class 'omni.ui._ui.AbstractItemModel'>, 'AbstractMultiField': <class 'omni.ui._ui.AbstractMultiField'>, 'AbstractSlider': <class 'omni.ui._ui.AbstractSlider'>, 'AbstractValueModel': <class 'omni.ui._ui.AbstractValueModel'>, 'Alignment': <class 'omni.ui._ui.Alignment'>, 'ArrowHelper': <class 'omni.ui._ui.ArrowHelper'>, 'ArrowType': <class 'omni.ui._ui.ArrowType'>, 'Axis': <class 'omni.ui._ui.Axis'>, 'BezierCurve': <class 'omni.ui._ui.BezierCurve'>, 'Button': <class 'omni.ui._ui.Button'>, 'ByteImageProvider': <class 'omni.ui._ui.ByteImageProvider'>, 'CanvasFrame': <class 'omni.ui._ui.CanvasFrame'>, 'CheckBox': <class 'omni.ui._ui.CheckBox'>, 'Circle': <class 'omni.ui._ui.Circle'>, 'CircleSizePolicy': <class 'omni.ui._ui.CircleSizePolicy'>, 'CollapsableFrame': <class 'omni.ui._ui.CollapsableFrame'>, 'ColorStore': <class 'omni.ui._ui.ColorStore'>, 'ColorWidget': <class 'omni.ui._ui.ColorWidget'>, 'ComboBox': <class 'omni.ui._ui.ComboBox'>, 'Container': <class 'omni.ui._ui.Container'>, 'CornerFlag': <class 'omni.ui._ui.CornerFlag'>, 'Direction': <class 'omni.ui._ui.Direction'>, 'DockPolicy': <class 'omni.ui._ui.DockPolicy'>, 'DockPosition': <class 'omni.ui._ui.DockPosition'>, 'DockPreference': <class 'omni.ui._ui.DockPreference'>, 'DockSpace': <class 'omni.ui._ui.DockSpace'>, 'DynamicTextureProvider': <class 'omni.ui._ui.DynamicTextureProvider'>, 'Ellipse': <class 'omni.ui._ui.Ellipse'>, 'FillPolicy': <class 'omni.ui._ui.FillPolicy'>, 'FloatDrag': <class 'omni.ui._ui.FloatDrag'>, 'FloatField': <class 'omni.ui._ui.FloatField'>, 'FloatSlider': <class 'omni.ui._ui.FloatSlider'>, 'FloatStore': <class 'omni.ui._ui.FloatStore'>, 'FocusPolicy': <class 'omni.ui._ui.FocusPolicy'>, 'FontStyle': <class 'omni.ui._ui.FontStyle'>, 'Fraction': <class 'omni.ui._ui.Fraction'>, 'Frame': <class 'omni.ui._ui.Frame'>, 'FreeBezierCurve': <class 'omni.ui._ui.FreeBezierCurve'>, 'FreeCircle': <class 'omni.ui._ui.FreeCircle'>, 'FreeEllipse': <class 'omni.ui._ui.FreeEllipse'>, 'FreeLine': <class 'omni.ui._ui.FreeLine'>, 'FreeRectangle': <class 'omni.ui._ui.FreeRectangle'>, 'FreeTriangle': <class 'omni.ui._ui.FreeTriangle'>, 'Grid': <class 'omni.ui._ui.Grid'>, 'HGrid': <class 'omni.ui._ui.HGrid'>, 'HStack': <class 'omni.ui._ui.HStack'>, 'Image': <class 'omni.ui._ui.Image'>, 'ImageProvider': <class 'omni.ui._ui.ImageProvider'>, 'ImageWithProvider': <class 'omni.ui._ui.ImageWithProvider'>, 'Inspector': <class 'omni.ui._ui.Inspector'>, 'IntDrag': <class 'omni.ui._ui.IntDrag'>, 'IntField': <class 'omni.ui._ui.IntField'>, 'IntSlider': <class 'omni.ui._ui.IntSlider'>, 'InvisibleButton': <class 'omni.ui._ui.InvisibleButton'>, 'ItemModelHelper': <class 'omni.ui._ui.ItemModelHelper'>, 'IwpFillPolicy': <class 'omni.ui._ui.IwpFillPolicy'>, 'Label': <class 'omni.ui._ui.Label'>, 'Length': <class 'omni.ui._ui.Length'>, 'Line': <class 'omni.ui._ui.Line'>, 'MainWindow': <class 'omni.ui._ui.MainWindow'>, 'Menu': <class 'omni.ui._ui.Menu'>, 'MenuBar': <class 'omni.ui._ui.MenuBar'>, 'MenuDelegate': <class 'omni.ui._ui.MenuDelegate'>, 'MenuHelper': <class 'omni.ui._ui.MenuHelper'>, 'MenuItem': <class 'omni.ui._ui.MenuItem'>, 'MenuItemCollection': <class 'omni.ui._ui.MenuItemCollection'>, 'MultiFloatDragField': <class 'omni.ui._ui.MultiFloatDragField'>, 'MultiFloatField': <class 'omni.ui._ui.MultiFloatField'>, 'MultiIntDragField': <class 'omni.ui._ui.MultiIntDragField'>, 'MultiIntField': <class 'omni.ui._ui.MultiIntField'>, 'MultiStringField': <class 'omni.ui._ui.MultiStringField'>, 'OffsetLine': <class 'omni.ui._ui.OffsetLine'>, 'Optional': typing.Optional, 'Percent': <class 'omni.ui._ui.Percent'>, 'Pixel': <class 'omni.ui._ui.Pixel'>, 'Placer': <class 'omni.ui._ui.Placer'>, 'Plot': <class 'omni.ui._ui.Plot'>, 'ProgressBar': <class 'omni.ui._ui.ProgressBar'>, 'RadioButton': <class 'omni.ui._ui.RadioButton'>, 'RadioCollection': <class 'omni.ui._ui.RadioCollection'>, 'RasterImageProvider': <class 'omni.ui._ui.RasterImageProvider'>, 'RasterPolicy': <class 'omni.ui._ui.RasterPolicy'>, 'Rectangle': <class 'omni.ui._ui.Rectangle'>, 'ScrollBarPolicy': <class 'omni.ui._ui.ScrollBarPolicy'>, 'ScrollingFrame': <class 'omni.ui._ui.ScrollingFrame'>, 'Separator': <class 'omni.ui._ui.Separator'>, 'ShadowFlag': <class 'omni.ui._ui.ShadowFlag'>, 'Shape': <class 'omni.ui._ui.Shape'>, 'ShapeAnchorHelper': <class 'omni.ui._ui.ShapeAnchorHelper'>, 'SimpleBoolModel': <class 'omni.ui._ui.SimpleBoolModel'>, 'SimpleFloatModel': <class 'omni.ui._ui.SimpleFloatModel'>, 'SimpleIntModel': <class 'omni.ui._ui.SimpleIntModel'>, 'SimpleStringModel': <class 'omni.ui._ui.SimpleStringModel'>, 'SliderDrawMode': <class 'omni.ui._ui.SliderDrawMode'>, 'Spacer': <class 'omni.ui._ui.Spacer'>, 'Stack': <class 'omni.ui._ui.Stack'>, 'StringField': <class 'omni.ui._ui.StringField'>, 'StringStore': <class 'omni.ui._ui.StringStore'>, 'Style': <class 'omni.ui._ui.Style'>, 'TextureFormat': <class 'omni.gpu_foundation_factory._gpu_foundation_factory.TextureFormat'>, 'ToolBar': <class 'omni.ui._ui.ToolBar'>, 'ToolBarAxis': <class 'omni.ui._ui.ToolBarAxis'>, 'ToolButton': <class 'omni.ui._ui.ToolButton'>, 'TreeView': <class 'omni.ui._ui.TreeView'>, 'Triangle': <class 'omni.ui._ui.Triangle'>, 'Type': <class 'omni.ui._ui.Type'>, 'UIPreferencesExtension': <class 'omni.ui.extension.UIPreferencesExtension'>, 'UIntDrag': <class 'omni.ui._ui.UIntDrag'>, 'UIntSlider': <class 'omni.ui._ui.UIntSlider'>, 'UnitType': <class 'omni.ui._ui.UnitType'>, 'VGrid': <class 'omni.ui._ui.VGrid'>, 'VStack': <class 'omni.ui._ui.VStack'>, 'ValueModelHelper': <class 'omni.ui._ui.ValueModelHelper'>, 'VectorImageProvider': <class 'omni.ui._ui.VectorImageProvider'>, 'WINDOW_FLAGS_FORCE_HORIZONTAL_SCROLLBAR': 32768, 'WINDOW_FLAGS_FORCE_VERTICAL_SCROLLBAR': 16384, 'WINDOW_FLAGS_MENU_BAR': 1024, 'WINDOW_FLAGS_MODAL': 134217728, 'WINDOW_FLAGS_NONE': 0, 'WINDOW_FLAGS_NO_BACKGROUND': 128, 'WINDOW_FLAGS_NO_CLOSE': 2147483648, 'WINDOW_FLAGS_NO_COLLAPSE': 32, 'WINDOW_FLAGS_NO_DOCKING': 2097152, 'WINDOW_FLAGS_NO_FOCUS_ON_APPEARING': 4096, 'WINDOW_FLAGS_NO_MOUSE_INPUTS': 512, 'WINDOW_FLAGS_NO_MOVE': 4, 'WINDOW_FLAGS_NO_RESIZE': 2, 'WINDOW_FLAGS_NO_SAVED_SETTINGS': 256, 'WINDOW_FLAGS_NO_SCROLLBAR': 8, 'WINDOW_FLAGS_NO_SCROLL_WITH_MOUSE': 16, 'WINDOW_FLAGS_NO_TITLE_BAR': 1, 'WINDOW_FLAGS_POPUP': 67108864, 'WINDOW_FLAGS_SHOW_HORIZONTAL_SCROLLBAR': 2048, 'Widget': <class 'omni.ui._ui.Widget'>, 'WidgetMouseDropEvent': <class 'omni.ui._ui.WidgetMouseDropEvent'>, 'Window': <class 'omni.ui._ui.Window'>, 'WindowHandle': <class 'omni.ui._ui.WindowHandle'>, 'Workspace': <class 'omni.ui._ui.Workspace'>, 'ZStack': <class 'omni.ui._ui.ZStack'>, '__builtins__': {'ArithmeticError': <class 'ArithmeticError'>, 'AssertionError': <class 'AssertionError'>, 'AttributeError': <class 'AttributeError'>, 'BaseException': <class 'BaseException'>, 'BlockingIOError': <class 'BlockingIOError'>, 'BrokenPipeError': <class 'BrokenPipeError'>, 'BufferError': <class 'BufferError'>, 'BytesWarning': <class 'BytesWarning'>, 'ChildProcessError': <class 'ChildProcessError'>, 'ConnectionAbortedError': <class 'ConnectionAbortedError'>, 'ConnectionError': <class 'ConnectionError'>, 'ConnectionRefusedError': <class 'ConnectionRefusedError'>, 'ConnectionResetError': <class 'ConnectionResetError'>, 'DeprecationWarning': <class 'DeprecationWarning'>, 'EOFError': <class 'EOFError'>, 'Ellipsis': Ellipsis, 'EncodingWarning': <class 'EncodingWarning'>, 'EnvironmentError': <class 'OSError'>, 'Exception': <class 'Exception'>, 'False': False, 'FileExistsError': <class 'FileExistsError'>, 'FileNotFoundError': <class 'FileNotFoundError'>, 'FloatingPointError': <class 'FloatingPointError'>, 'FutureWarning': <class 'FutureWarning'>, 'GeneratorExit': <class 'GeneratorExit'>, 'IOError': <class 'OSError'>, 'ImportError': <class 'ImportError'>, 'ImportWarning': <class 'ImportWarning'>, 'IndentationError': <class 'IndentationError'>, 'IndexError': <class 'IndexError'>, 'InterruptedError': <class 'InterruptedError'>, 'IsADirectoryError': <class 'IsADirectoryError'>, 'KeyError': <class 'KeyError'>, 'KeyboardInterrupt': <class 'KeyboardInterrupt'>, 'LookupError': <class 'LookupError'>, 'MemoryError': <class 'MemoryError'>, 'ModuleNotFoundError': <class 'ModuleNotFoundError'>, 'NameError': <class 'NameError'>, 'None': None, 'NotADirectoryError': <class 'NotADirectoryError'>, 'NotImplemented': NotImplemented, 'NotImplementedError': <class 'NotImplementedError'>, 'OSError': <class 'OSError'>, 'OverflowError': <class 'OverflowError'>, 'PendingDeprecationWarning': <class 'PendingDeprecationWarning'>, 'PermissionError': <class 'PermissionError'>, 'ProcessLookupError': <class 'ProcessLookupError'>, 'RecursionError': <class 'RecursionError'>, 'ReferenceError': <class 'ReferenceError'>, 'ResourceWarning': <class 'ResourceWarning'>, 'RuntimeError': <class 'RuntimeError'>, 'RuntimeWarning': <class 'RuntimeWarning'>, 'StopAsyncIteration': <class 'StopAsyncIteration'>, 'StopIteration': <class 'StopIteration'>, 'SyntaxError': <class 'SyntaxError'>, 'SyntaxWarning': <class 'SyntaxWarning'>, 'SystemError': <class 'SystemError'>, 'SystemExit': <class 'SystemExit'>, 'TabError': <class 'TabError'>, 'TimeoutError': <class 'TimeoutError'>, 'True': True, 'TypeError': <class 'TypeError'>, 'UnboundLocalError': <class 'UnboundLocalError'>, 'UnicodeDecodeError': <class 'UnicodeDecodeError'>, 'UnicodeEncodeError': <class 'UnicodeEncodeError'>, 'UnicodeError': <class 'UnicodeError'>, 'UnicodeTranslateError': <class 'UnicodeTranslateError'>, 'UnicodeWarning': <class 'UnicodeWarning'>, 'UserWarning': <class 'UserWarning'>, 'ValueError': <class 'ValueError'>, 'Warning': <class 'Warning'>, 'ZeroDivisionError': <class 'ZeroDivisionError'>, '__build_class__': <built-in function __build_class__>, '__debug__': True, '__doc__': "Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in slices.", '__import__': <built-in function __import__>, '__loader__': <class '_frozen_importlib.BuiltinImporter'>, '__name__': 'builtins', '__package__': '', '__pybind11_internals_v4_gcc_libstdcpp_cxxabi1011__': <capsule object NULL>, '__spec__': ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>, origin='built-in'), 'abs': <built-in function abs>, 'aiter': <built-in function aiter>, 'all': <built-in function all>, 'anext': <built-in function anext>, 'any': <built-in function any>, 'ascii': <built-in function ascii>, 'bin': <built-in function bin>, 'bool': <class 'bool'>, 'breakpoint': <built-in function breakpoint>, 'bytearray': <class 'bytearray'>, 'bytes': <class 'bytes'>, 'callable': <built-in function callable>, 'chr': <built-in function chr>, 'classmethod': <class 'classmethod'>, 'compile': <built-in function compile>, 'complex': <class 'complex'>, 'copyright': Copyright (c) 2001-2022 Python Software Foundation. All Rights Reserved. Copyright (c) 2000 BeOpen.com. All Rights Reserved. Copyright (c) 1995-2001 Corporation for National Research Initiatives. All Rights Reserved. Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam. All Rights Reserved., 'credits': Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands for supporting Python development. See www.python.org for more information., 'delattr': <built-in function delattr>, 'dict': <class 'dict'>, 'dir': <built-in function dir>, 'divmod': <built-in function divmod>, 'enumerate': <class 'enumerate'>, 'eval': <built-in function eval>, 'exec': <built-in function exec>, 'exit': Use exit() or Ctrl-D (i.e. EOF) to exit, 'filter': <class 'filter'>, 'float': <class 'float'>, 'format': <built-in function format>, 'frozenset': <class 'frozenset'>, 'getattr': <built-in function getattr>, 'globals': <built-in function globals>, 'hasattr': <built-in function hasattr>, 'hash': <built-in function hash>, 'help': Type help() for interactive help, or help(object) for help about object., 'hex': <built-in function hex>, 'id': <built-in function id>, 'input': <built-in function input>, 'int': <class 'int'>, 'isinstance': <built-in function isinstance>, 'issubclass': <built-in function issubclass>, 'iter': <built-in function iter>, 'len': <built-in function len>, 'license': Type license() to see the full license text, 'list': <class 'list'>, 'locals': <built-in function locals>, 'map': <class 'map'>, 'max': <built-in function max>, 'memoryview': <class 'memoryview'>, 'min': <built-in function min>, 'next': <built-in function next>, 'object': <class 'object'>, 'oct': <built-in function oct>, 'open': <built-in function open>, 'ord': <built-in function ord>, 'pow': <built-in function pow>, 'print': <built-in function print>, 'property': <class 'property'>, 'quit': Use quit() or Ctrl-D (i.e. EOF) to exit, 'range': <class 'range'>, 'repr': <built-in function repr>, 'reversed': <class 'reversed'>, 'round': <built-in function round>, 'set': <class 'set'>, 'setattr': <built-in function setattr>, 'slice': <class 'slice'>, 'sorted': <built-in function sorted>, 'staticmethod': <class 'staticmethod'>, 'str': <class 'str'>, 'sum': <built-in function sum>, 'super': <class 'super'>, 'tuple': <class 'tuple'>, 'type': <class 'type'>, 'vars': <built-in function vars>, 'zip': <class 'zip'>}, '__cached__': '/buildAgent/work/922c23240cdaae69/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui/__pycache__/__init__.cpython-310.pyc', '__doc__': '\nOmni::UI\n--------\n\nOmni::UI is Omniverse\'s UI toolkit for creating beautiful and flexible graphical user interfaces\nin the Kit extensions. Omni::UI provides the basic types necessary to create rich extensions with\na fluid and dynamic user interface in Omniverse Kit. It gives a layout system and includes\nwidgets for creating visual components, receiving user input, and creating data models. It allows\nuser interface components to be built around their behavior and enables a declarative flavor of\ndescribing the layout of the application. Omni::UI gives a very flexible styling system that\nallows deep customizing the final look of the application.\n\nTypical Example\n---------------\n\nTypical example to create a window with two buttons:\n\n.. code-block::\n\n import omni.ui as ui\n\n _window_example = ui.Window("Example Window", width=300, height=300)\n\n with _window_example.frame:\n with ui.VStack():\n ui.Button("click me")\n\n def move_me(window):\n window.setPosition(200, 200)\n\n def size_me(window):\n window.width = 300\n window.height = 300\n\n ui.Button("Move to (200,200)", clicked_fn=lambda w=self._window_example: move_me(w))\n ui.Button("Set size (300,300)", clicked_fn=lambda w=self._window_example: size_me(w))\n\nDetailed Documentation\n----------------------\n\nOmni::UI is shipped with the developer documentation that is written with Omni::UI. For detailed documentation, please\nsee `omni.example.ui` extension. It has detailed descriptions of all the classes, best practices, and real-world usage\nexamples.\n\nLayout\n------\n\n* Arrangement of elements\n * :class:`omni.ui.CollapsableFrame`\n * :class:`omni.ui.Frame`\n * :class:`omni.ui.HStack`\n * :class:`omni.ui.Placer`\n * :class:`omni.ui.ScrollingFrame`\n * :class:`omni.ui.Spacer`\n * :class:`omni.ui.VStack`\n * :class:`omni.ui.ZStack`\n\n* Lengths\n * :class:`omni.ui.Fraction`\n * :class:`omni.ui.Percent`\n * :class:`omni.ui.Pixel`\n\nWidgets\n-------\n\n* Base Widgets\n * :class:`omni.ui.Button`\n * :class:`omni.ui.Image`\n * :class:`omni.ui.Label`\n\n* Shapes\n * :class:`omni.ui.Circle`\n * :class:`omni.ui.Line`\n * :class:`omni.ui.Rectangle`\n * :class:`omni.ui.Triangle`\n\n* Menu\n * :class:`omni.ui.Menu`\n * :class:`omni.ui.MenuItem`\n\n* Model-View Widgets\n * :class:`omni.ui.AbstractItemModel`\n * :class:`omni.ui.AbstractValueModel`\n * :class:`omni.ui.CheckBox`\n * :class:`omni.ui.ColorWidget`\n * :class:`omni.ui.ComboBox`\n * :class:`omni.ui.RadioButton`\n * :class:`omni.ui.RadioCollection`\n * :class:`omni.ui.TreeView`\n\n* Model-View Fields\n * :class:`omni.ui.FloatField`\n * :class:`omni.ui.IntField`\n * :class:`omni.ui.MultiField`\n * :class:`omni.ui.StringField`\n\n* Model-View Drags and Sliders\n * :class:`omni.ui.FloatDrag`\n * :class:`omni.ui.FloatSlider`\n * :class:`omni.ui.IntDrag`\n * :class:`omni.ui.IntSlider`\n\n* Model-View ProgressBar\n * :class:`omni.ui.ProgressBar`\n\n* Windows\n * :class:`omni.ui.ToolBar`\n * :class:`omni.ui.Window`\n * :class:`omni.ui.Workspace`\n\n* Web\n * :class:`omni.ui.WebViewWidget`\n\n', '__file__': '/buildAgent/work/922c23240cdaae69/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui/__init__.py', '__loader__': <_frozen_importlib_external.SourceFileLoader object>, '__name__': 'omni.ui', '__package__': 'omni.ui', '__path__': ['/buildAgent/work/922c23240cdaae69/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui'], '__spec__': ModuleSpec(name='omni.ui', loader=<_frozen_importlib_external.SourceFileLoader object>, origin='/buildAgent/work/922c23240cdaae69/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui/__init__.py', submodule_search_locations=['/buildAgent/work/922c23240cdaae69/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui']), '_ui': <module 'omni.ui._ui' from '/buildAgent/work/922c23240cdaae69/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui/_ui.cpython-310-x86_64-linux-gnu.so'>, 'abstract_shade': <module 'omni.ui.abstract_shade' from '/buildAgent/work/922c23240cdaae69/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui/abstract_shade.py'>, 'add_to_namespace': <function add_to_namespace>, 'color': <omni.ui.color_utils.ColorShade object>, 'color_utils': <module 'omni.ui.color_utils' from '/buildAgent/work/922c23240cdaae69/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui/color_utils.py'>, 'constant': <omni.ui.constant_utils.FloatShade object>, 'constant_utils': <module 'omni.ui.constant_utils' from '/buildAgent/work/922c23240cdaae69/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui/constant_utils.py'>, 'dock_window_in_window': <built-in method dock_window_in_window of PyCapsule object>, 'extension': <module 'omni.ui.extension' from '/buildAgent/work/922c23240cdaae69/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui/extension.py'>, 'get_custom_glyph_code': <built-in method get_custom_glyph_code of PyCapsule object>, 'get_main_window_height': <built-in method get_main_window_height of PyCapsule object>, 'get_main_window_width': <built-in method get_main_window_width of PyCapsule object>, 'omni': <module 'omni' (<_frozen_importlib_external._NamespaceLoader object>)>, 'set_menu_delegate': <function set_menu_delegate>, 'set_shade': <function set_shade>, 'singleton': <module 'omni.ui.singleton' from '/buildAgent/work/922c23240cdaae69/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui/singleton.py'>, 'style': <omni.ui._ui.Style object>, 'style_utils': <module 'omni.ui.style_utils' from '/buildAgent/work/922c23240cdaae69/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui/style_utils.py'>, 'url': <omni.ui.url_utils.StringShade object>, 'url_utils': <module 'omni.ui.url_utils' from '/buildAgent/work/922c23240cdaae69/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui/url_utils.py'>, 'workspace_utils': <module 'omni.ui.workspace_utils' from '/buildAgent/work/922c23240cdaae69/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui/workspace_utils.py'>})
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
profiling.md | Profiling — kit-manual 105.1 documentation
kit-manual
»
Profiling
# Profiling
Kit-based applications come bundled with a profiler interface to instrument your code, for both C++ and Python. Multiple profiler backend implementations are supported:
NVTX
ChromeTrace
Tracy
## Easy Start
Enable the omni.kit.profiler.window extension.
Press F5 to start profiling, then press F5 again to stop profiling and get a trace opened in Tracy.
Press F8 to open the profiler window, where you can perform additional operations such as enabling the Python profiler, browsing traces, etc.
All traces are saved into one folder (can be found in the Browse section of the profiler window). They can be viewed with either Tracy or Chrome (by navigating to chrome://tracing).
Note
Both F5 and F8 have an entry in the top menu.
## Profiling Backends
### Chrome Trace
Run the Kit-based application using the following settings to produce a trace file named mytrace.gz in the directory where the executable is located:
kit.exe [your_configuration] \
--/app/profilerBackend="cpu" \
--/app/profileFromStart=1 \
--/plugins/carb.profiler-cpu.plugin/saveProfile=1 \
--/plugins/carb.profiler-cpu.plugin/compressProfile=1 \
--/plugins/carb.profiler-cpu.plugin/filePath="mytrace.gz"
Then, using the Google Chrome browser, navigate to chrome://tracing to open a trace file and explore areas of interest.
### Tracy
#### On Demand
Enable the omni.kit.profiler.tracy extension.
Select Profiling->Tracy->Launch and Connect from the menu.
Note: The omni.kit.profiler.tracy extension contains the currently supported version of Tracy (v0.9.1), which can also be downloaded from GitHub.
#### From Startup
Run the Kit-based application using the following settings:
kit.exe [your_configuration] \
--/app/profilerBackend="tracy" \
--/app/profileFromStart=true
Run Tracy and click the “Connect” button to start capturing profiling events.
You can also convert a chrome trace profile to Tracy format using import-chrome.exe tool it provides. There is a helper tool to do that in repo_kit_tools, it downloads Tracy from packman and opens any of those 3 formats:
repo tracetools tracy mytrace.gz
repo tracetools tracy mytrace.json
repo tracetools tracy mytrace.tracy
### Multiplexer
You can enable multiple profiler backends at the same time.
Run the Kit-based application using the following settings:
kit.exe [your_configuration] \
--/app/profilerBackend=[cpu,tracy] \
{other_settings_specific_to_either}
The multiplexer profiler will automatically detect any IProfiler implementations that are loaded afterwards, for example as part of an extension.
If the --/app/profilerBackend setting is empty, the multiplexer profiler will be used as the default, along with the cpu profiler behind it.
## Instrumenting Code
To instrument C++ code, use the macros from the Carbonite Profiler, e.g.:
#include <carb/profiler/Profile.h>
constexpr const uint64_t kProfilerMask = 1;
void myfunc()
{
CARB_PROFILE_ZONE(kProfilerMask, "My C++ function");
// Do hard work here.
// [...]
}
For Python code, use the Carbonite Profiler bindings:
import carb.profiler
# Using the decorator version:
@carb.profiler.profile
def foo():
pass
# Using explicit begin/end statements:
def my_func():
carb.profiler.begin(1, "My Python function")
# Do hard work here.
# [...]
carb.profiler.end(1)
## Automatic Python Profiler: omni.kit.profile_python
Python offers a sys.setprofile() method to profile all function calls. Kit-based applications come with an extension that hooks into it automatically and reports all events to carb.profiler. Since this profiling method has an impact on the runtime performance of the application, it is disabled by default.
kit.exe [your_configuration] \
[profiler_backend_configuration] \
--enable omni.kit.profile_python
## Profiling Startup Time
Kit includes a handy shell script to profile app startup time: profile_startup.bat.
It runs an app with profiling enabled, quits, and opens the trace in Tracy. Pass the path to the app kit file and other arguments to it. E.g.:
profile_startup.bat path/to/omni.app.full.kit --/foo/bar=123
To enable python profiling pass --enable omni.kit.profile_python:
profile_startup.bat path/to/omni.app.full.kit --enable omni.kit.profile_python
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023. |
omni.ui.VStack.md | VStack — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
VStack
# VStack
class omni.ui.VStack
Bases: Stack
Shortcut for Stack{eTopToBottom}. The widgets are placed in a column, with suitable sizes.
Methods
__init__(self, **kwargs)
Construct a stack with the widgets placed in a column from top to bottom.
Attributes
__init__(self: omni.ui._ui.VStack, **kwargs) → None
Construct a stack with the widgets placed in a column from top to bottom.
`kwargsdict`See below
### Keyword Arguments:
`direction`This type is used to determine the direction of the layout. If the Stack’s orientation is eLeftToRight the widgets are placed in a horizontal row, from left to right. If the Stack’s orientation is eRightToLeft the widgets are placed in a horizontal row, from right to left. If the Stack’s orientation is eTopToBottom, the widgets are placed in a vertical column, from top to bottom. If the Stack’s orientation is eBottomToTop, the widgets are placed in a vertical column, from bottom to top. If the Stack’s orientation is eBackToFront, the widgets are placed sorted in a Z-order in top right corner. If the Stack’s orientation is eFrontToBack, the widgets are placed sorted in a Z-order in top right corner, the first widget goes to front.
`content_clipping`Determines if the child widgets should be clipped by the rectangle of this Stack.
`spacing`Sets a non-stretchable space in pixels between child items of this layout.
`send_mouse_events_to_back`When children of a Z-based stack overlap mouse events are normally sent to the topmost one. Setting this property true will invert that behavior, sending mouse events to the bottom-most child.
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
Tf.md | Tf module — pxr-usd-api 105.1 documentation
pxr-usd-api
»
Modules »
Tf module
# Tf module
Summary: The Tf (Tools Foundations) module.
Tf – Tools Foundation
Exceptions:
CppException
ErrorException(*args)
Classes:
CallContext
Debug
DiagnosticType
Enum
Error
MallocTag
NamedTemporaryFile([suffix, prefix, dir, text])
A named temporary file which keeps the internal file handle closed.
Notice
PyModuleWasLoaded
A TfNotice that is sent when a script module is loaded.
RefPtrTracker
Provides tracking of TfRefPtr objects to particular objects.
ScopeDescription
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.
ScriptModuleLoader
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.
Singleton
StatusObject
Stopwatch
TemplateString
Tf_PyEnumWrapper
Tf_TestAnnotatedBoolResult
Tf_TestPyContainerConversions
Tf_TestPyOptional
Type
TfType represents a dynamic runtime type.
Warning
Functions:
Fatal(msg)
Raise a fatal error to the Tf Diagnostic system.
GetCodeLocation(framesUp)
Returns a tuple (moduleName, functionName, fileName, lineNo).
PrepareModule(module, result)
PrepareModule(module, result) -- Prepare an extension module at import time.
PreparePythonModule([moduleName])
Prepare an extension module at import time.
RaiseCodingError(msg)
Raise a coding error to the Tf Diagnostic system.
RaiseRuntimeError(msg)
Raise a runtime error to the Tf Diagnostic system.
Status(msg[, verbose])
Issues a status update to the Tf diagnostic system.
Warn(msg[, template])
Issue a warning via the TfDiagnostic system.
WindowsImportWrapper()
exception pxr.Tf.CppException
exception pxr.Tf.ErrorException(*args)
class pxr.Tf.CallContext
Attributes:
file
char
function
char
line
int
prettyFunction
char
property file
char
Type
type
property function
char
Type
type
property line
int
Type
type
property prettyFunction
char
Type
type
class pxr.Tf.Debug
Methods:
GetDebugSymbolDescription
classmethod GetDebugSymbolDescription(name) -> str
GetDebugSymbolDescriptions
classmethod GetDebugSymbolDescriptions() -> str
GetDebugSymbolNames
classmethod GetDebugSymbolNames() -> list[str]
IsDebugSymbolNameEnabled
classmethod IsDebugSymbolNameEnabled(name) -> bool
SetDebugSymbolsByName
classmethod SetDebugSymbolsByName(pattern, value) -> list[str]
SetOutputFile
classmethod SetOutputFile(file) -> None
static GetDebugSymbolDescription()
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) –
static GetDebugSymbolDescriptions()
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.
static GetDebugSymbolNames()
classmethod GetDebugSymbolNames() -> list[str]
Get a listing of all debug symbols.
static IsDebugSymbolNameEnabled()
classmethod IsDebugSymbolNameEnabled(name) -> bool
True if the specified debug symbol is set.
Parameters
name (str) –
static SetDebugSymbolsByName()
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) –
static SetOutputFile()
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) –
class pxr.Tf.DiagnosticType
Methods:
GetValueFromName
Attributes:
allValues
static GetValueFromName()
allValues = (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)
class pxr.Tf.Enum
Methods:
GetValueFromFullName
classmethod GetValueFromFullName(fullname, foundIt) -> Enum
static GetValueFromFullName()
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) –
class pxr.Tf.Error
Classes:
Mark
Attributes:
errorCode
The error code posted for this error.
errorCodeString
The error code posted for this error, as a string.
class Mark
Methods:
Clear
GetErrors
A list of the errors held by this mark.
IsClean
SetMark
Clear()
GetErrors()
A list of the errors held by this mark.
IsClean()
SetMark()
property errorCode
The error code posted for this error.
property errorCodeString
The error code posted for this error, as a string.
class pxr.Tf.MallocTag
Classes:
CallTree
Methods:
GetCallStacks
GetCallTree
classmethod GetCallTree(tree, skipRepeated) -> bool
GetMaxTotalBytes
classmethod GetMaxTotalBytes() -> int
GetTotalBytes
classmethod GetTotalBytes() -> int
Initialize
classmethod Initialize(errMsg) -> bool
IsInitialized
classmethod IsInitialized() -> bool
SetCapturedMallocStacksMatchList
classmethod SetCapturedMallocStacksMatchList(matchList) -> None
SetDebugMatchList
classmethod SetDebugMatchList(matchList) -> None
class CallTree
Classes:
CallSite
PathNode
Methods:
GetCallSites
GetPrettyPrintString
GetRoot
LogReport
Report
class CallSite
Attributes:
nBytes
name
property nBytes
property name
class PathNode
Methods:
GetChildren
Attributes:
nAllocations
nBytes
nBytesDirect
siteName
GetChildren()
property nAllocations
property nBytes
property nBytesDirect
property siteName
GetCallSites()
GetPrettyPrintString()
GetRoot()
LogReport()
Report()
static GetCallStacks()
static GetCallTree()
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) –
static GetMaxTotalBytes()
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.
static GetTotalBytes()
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.
static Initialize()
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) –
static IsInitialized()
classmethod IsInitialized() -> bool
Return true if the tagging system is active.
If Initialize() has been successfully called, this function
returns true .
static SetCapturedMallocStacksMatchList()
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) –
static SetDebugMatchList()
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) –
class pxr.Tf.NamedTemporaryFile(suffix='', prefix='', dir=None, text=False)
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.
Attributes:
name
The path for the temporary file created.
property name
The path for the temporary file created.
class pxr.Tf.Notice
Classes:
Listener
Represents the Notice connection between senders and receivers of notices.
Methods:
Register(noticeType, callback, sender)
noticeType : Tf.Notice callback : function sender : object
RegisterGlobally(noticeType, callback)
noticeType : Tf.Notice callback : function
Send
Send(sender)
SendGlobally
SendGlobally()
class Listener
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.
Methods:
Revoke
Revoke()
Revoke()
Revoke()
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.
static 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.
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.
static 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.
Send()
Send(sender)
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.
Send(sender)
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.
SendGlobally()
SendGlobally()
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.
class pxr.Tf.PyModuleWasLoaded
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.
Methods:
name()
Return the name of the module that was loaded.
name() → str
Return the name of the module that was loaded.
class pxr.Tf.RefPtrTracker
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:
#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 .
Methods:
GetAllTracesReport
GetAllWatchedCountsReport
GetTracesReportForWatched
Attributes:
expired
True if this object has expired, False otherwise.
GetAllTracesReport()
GetAllWatchedCountsReport()
GetTracesReportForWatched()
property expired
True if this object has expired, False otherwise.
class pxr.Tf.ScopeDescription
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.
Methods:
SetDescription(description)
Replace the description stack entry for this scope description.
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) –
class pxr.Tf.ScriptModuleLoader
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.
Methods:
GetModuleNames()
Return a list of all currently known modules in a valid dependency order.
GetModulesDict()
Return a python dict containing all currently known modules under their canonical names.
WriteDotFile(file)
Write a graphviz dot-file for the dependency graph of all.
Attributes:
expired
True if this object has expired, False otherwise.
GetModuleNames() → list[str]
Return a list of all currently known modules in a valid dependency
order.
GetModulesDict() → python.dict
Return a python dict containing all currently known modules under
their canonical names.
WriteDotFile(file) → None
Write a graphviz dot-file for the dependency graph of all.
currently known modules/modules to file.
Parameters
file (str) –
property expired
True if this object has expired, False otherwise.
class pxr.Tf.Singleton
class pxr.Tf.StatusObject
class pxr.Tf.Stopwatch
Methods:
AddFrom(t)
Adds the accumulated time and sample count from t into the TfStopwatch .
Reset()
Resets the accumulated time and the sample count to zero.
Start()
Record the current time for use by the next Stop() call.
Stop()
Increases the accumulated time stored in the TfStopwatch .
Attributes:
microseconds
int
milliseconds
int
nanoseconds
int
sampleCount
int
seconds
float
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) –
Reset() → None
Resets the accumulated time and the sample count to zero.
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 .
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 microseconds
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
type
property milliseconds
int
Return the accumulated time in milliseconds.
Type
type
property nanoseconds
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
type
property sampleCount
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
type
property seconds
float
Return the accumulated time in seconds as a double .
Type
type
class pxr.Tf.TemplateString
Methods:
GetEmptyMapping()
Returns an empty mapping for the current template.
GetParseErrors()
Returns any error messages generated during template parsing.
SafeSubstitute(arg1)
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.
Substitute(arg1)
Performs the template substitution, returning a new string.
Attributes:
template
str
valid
bool
GetEmptyMapping() → Mapping
Returns an empty mapping for the current template.
This method first calls IsValid to ensure that the template is valid.
GetParseErrors() → list[str]
Returns any error messages generated during template parsing.
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) –
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 template
str
Returns the template source string supplied to the constructor.
Type
type
property valid
bool
Returns true if the current template is well formed.
Empty templates are valid.
Type
type
class pxr.Tf.Tf_PyEnumWrapper
Attributes:
displayName
fullName
name
value
property displayName
property fullName
property name
property value
class pxr.Tf.Tf_TestAnnotatedBoolResult
Attributes:
annotation
property annotation
class pxr.Tf.Tf_TestPyContainerConversions
Methods:
GetPairTimesTwo
GetTokens
GetVectorTimesTwo
static GetPairTimesTwo()
static GetTokens()
static GetVectorTimesTwo()
class pxr.Tf.Tf_TestPyOptional
Methods:
TakesOptional
TestOptionalChar
TestOptionalDouble
TestOptionalFloat
TestOptionalInt
TestOptionalLong
TestOptionalShort
TestOptionalString
TestOptionalStringVector
TestOptionalUChar
TestOptionalUInt
TestOptionalULong
TestOptionalUShort
static TakesOptional()
static TestOptionalChar()
static TestOptionalDouble()
static TestOptionalFloat()
static TestOptionalInt()
static TestOptionalLong()
static TestOptionalShort()
static TestOptionalString()
static TestOptionalStringVector()
static TestOptionalUChar()
static TestOptionalUInt()
static TestOptionalULong()
static TestOptionalUShort()
class pxr.Tf.Type
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
Methods:
AddAlias
classmethod AddAlias(base, name) -> None
Define
classmethod Define() -> Type
Find
classmethod Find() -> Type
FindByName
classmethod FindByName(name) -> Type
FindDerivedByName
classmethod FindDerivedByName(name) -> Type
GetAliases(derivedType)
Returns a vector of the aliases registered for the derivedType under this, the base type.
GetAllAncestorTypes(result)
Build a vector of all ancestor types inherited by this type.
GetAllDerivedTypes(result)
Return the set of all types derived (directly or indirectly) from this type.
GetRoot
classmethod GetRoot() -> Type
IsA(queryType)
Return true if this type is the same as or derived from queryType
Attributes:
Unknown
baseTypes
list[Type]
derivedTypes
isEnumType
bool
isPlainOldDataType
bool
isUnknown
bool
pythonClass
TfPyObjWrapper
sizeof
int
typeName
str
AddAlias()
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) –
static Define()
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.
static Find()
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) –
static FindByName()
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:
TfType::GetRoot().FindDerivedByName(name)
For any object obj ,
Find(obj) == FindByName( Find(obj).GetTypeName() )
Parameters
name (str) –
FindDerivedByName()
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:
TfType::Find<BASE>().FindDerivedByName(name)
Parameters
name (str) –
GetAliases(derivedType) → list[str]
Returns a vector of the aliases registered for the derivedType under
this, the base type.
AddAlias()
Parameters
derivedType (Type) –
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]) –
GetAllDerivedTypes(result) → None
Return the set of all types derived (directly or indirectly) from this
type.
Parameters
result (set[Type]) –
static GetRoot()
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.
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:
IsA(Find<T>())
Unknown = Tf.Type.Unknown
property baseTypes
list[Type]
Return a vector of types from which this type was derived.
Type
type
property derivedTypes
property isEnumType
bool
Return true if this is an enum type.
Type
type
property isPlainOldDataType
bool
Return true if this is a plain old data type, as defined by C++.
Type
type
property isUnknown
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
type
property pythonClass
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()
Type
type
property sizeof
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
type
property typeName
str
Return the machine-independent name for this type.
This name is specified when the TfType is declared.
Declare()
Type
type
class pxr.Tf.Warning
pxr.Tf.Fatal(msg)
Raise a fatal error to the Tf Diagnostic system.
pxr.Tf.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().
pxr.Tf.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’).
pxr.Tf.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’).
pxr.Tf.RaiseCodingError(msg)
Raise a coding error to the Tf Diagnostic system.
pxr.Tf.RaiseRuntimeError(msg)
Raise a runtime error to the Tf Diagnostic system.
pxr.Tf.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.
pxr.Tf.Warn(msg, template='')
Issue a warning via the TfDiagnostic system.
At this time, template is ignored.
pxr.Tf.WindowsImportWrapper()
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023. |
debug.md | Debug a Build — Omniverse Developer Guide latest documentation
Omniverse Developer Guide
»
Omniverse Developer Guide »
Debug a Build
# Debug a Build
Recognizing the critical role of debugging in development, Omniverse offers tools and automation to streamline and simplify debugging workflows. In combination with third-party tools, Omniverse accelerates bug and anomaly detection, aiming for steady increases in project stability throughout the development process.
Omniverse provides utilities for debugging via extensions both for use within a given Application or in conjunction with third-party tools such as VSCode.
Console Extension : Allows the user to see log output and input commands directly from the Application interface.
Visual Studio Code Link Extension : Enables the connection of an Omniverse Application to VS Code’s python debugger.
Additional Learning:
Video Tutorial - How to Debug Your Kit Extension with Omniverse Code App.
Advanced Project Template Tutorial - Step-by-step instructions for debugging within the context of an Application development tutorial.
© Copyright 2023-2024, NVIDIA.
Last updated on Apr 15, 2024. |
omni.ui.workspace_utils.handle_exception.md | handle_exception — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Submodules »
omni.ui.workspace_utils »
omni.ui.workspace_utils Functions »
handle_exception
# handle_exception
omni.ui.workspace_utils.handle_exception(func)
Decorator to print exception in async functions
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
cli.md | Omni Asset Validator (CLI) — asset-validator 0.6.2 documentation
asset-validator
»
Omni Asset Validator (CLI)
# Omni Asset Validator (CLI)
## Command Line Interface
Utility for USD validation to ensure layers run smoothly across all Omniverse
products. Validation is based on the USD ComplianceChecker (i.e. the same
backend as the usdchecker commandline tool), and has been extended with
additional rules as follows:
Additional “Basic” rules applicable in the broader USD ecosystem.
Omniverse centric rules that ensure layer files work well with all
Omniverse applications & connectors.
Configurable end-user rules that can be specific to individual company
and/or team workflows.
Note this level of configuration requires manipulating PYTHONPATH prior to launching this tool.
### Syntax
Use the following syntax to run asset validator:
usage: omni_asset_validator [-h] [-d 0|1] [-c CATEGORY] [-r RULE] [-e] [-f] [-p PREDICATE] [URI]
### Positional arguments
#### URI
A single Omniverse Asset.
> Note: This can be a file URI or folder/container URI. (default: None)
### Options
#### -h, –help
show this help message and exit
#### -d 0| 1, –defaultRules 0|1
Flag to use the default-enabled validation rules. Opt-out of this behavior to gain finer control over
the rules using the –categories and –rules flags. The default configuration includes:
ByteAlignmentChecker
CompressionChecker
MissingReferenceChecker
StageMetadataChecker
TextureChecker
PrimEncapsulationChecker
NormalMapTextureChecker
KindChecker
ExtentsChecker
TypeChecker
OmniInvalidCharacterChecker
OmniDefaultPrimChecker
OmniOrphanedPrimChecker
OmniMaterialPathChecker
UsdAsciiPerformanceChecker
UsdLuxSchemaChecker
UsdGeomSubsetChecker
UsdMaterialBindingApi
UsdDanglingMaterialBinding
(default: 1)
#### -c CATEGORY, –category CATEGORY
Categories to enable, regardless of the –defaultRules flag.
Valid categories are:
Basic
ARKit
Omni:NamingConventions
Omni:Layout
Omni:Material
Usd:Performance
Usd:Schema
(default: [])
#### -r RULE, –rule RULE
Rules to enable, regardless of the –defaultRules flag. Valid rules include:
ByteAlignmentChecker
CompressionChecker
MissingReferenceChecker
StageMetadataChecker
TextureChecker
PrimEncapsulationChecker
NormalMapTextureChecker
KindChecker
ExtentsChecker
TypeChecker
ARKitLayerChecker
ARKitPrimTypeChecker
ARKitShaderChecker
ARKitMaterialBindingChecker
ARKitFileExtensionChecker
ARKitPackageEncapsulationChecker
ARKitRootLayerChecker
OmniInvalidCharacterChecker
OmniDefaultPrimChecker
OmniOrphanedPrimChecker
OmniMaterialPathChecker
UsdAsciiPerformanceChecker
UsdLuxSchemaChecker
UsdGeomSubsetChecker
UsdMaterialBindingApi
UsdDanglingMaterialBinding
(default: [])
#### -e, –explain
Rather than running the validator, provide descriptions for each configured rule.
(default: False)
#### -f, –fix
If this is selected, apply fixes.
#### -p PREDICATE, –predicate PREDICATE
Report issues and fix issues that match this predicate. Currently:
IsFailure
IsWarning
IsError
HasRootLayer
See Asset Validator for more details.
## Command Line Interface using USD Composer
### Getting USD Composer installation path
Open Omniverse Launcher. On Library / USD Composer, beside the Launch button click the burger menu to view the settings.
On Settings we can see the path of USD Composer installation.
Add it as environment variable.
In Windows:
set INSTALL_DIR=#See above
set KIT_PATH=%INSTALL_DIR%\kit
In Linux:
export INSTALL_DIR=#See above
export KIT_PATH=${INSTALL_DIR}\kit
### Getting Asset Validation Core path
Open the Extension manager in USD Composer. In Windows / Extensions, select omni.asset_validator.core extension.
On the extension information click on the path icon.
Add it as environment variable.
In Windows:
set VALIDATION_PATH=#See above
In Linux:
export VALIDATION_PATH=#See above
### Examples
#### Calling the help command
Windows:
%KIT_PATH% --enable omni.asset_validator.core --exec "%VALIDATION_PATH%\scripts\omni_asset_validator.py --help"
Linux:
${KIT_PATH} --enable omni.asset_validator.core --exec "${VALIDATION_PATH}\scripts\omni_asset_validator.py --help"
#### Validating a file
Windows:
%KIT_PATH% --enable omni.asset_validator.core --exec "%VALIDATION_PATH%\scripts\omni_asset_validator.py %VALIDATION_PATH%\scripts\test\asset.usda"
Linux:
${KIT_PATH} --enable omni.asset_validator.core --exec "${VALIDATION_PATH}\scripts\omni_asset_validator.py ${VALIDATION_PATH}\scripts\test\asset.usda"
#### Validating a folder, recursively
Windows:
%KIT_PATH% --enable omni.asset_validator.core --exec "%VALIDATION_PATH%\scripts\omni_asset_validator.py %VALIDATION_PATH%\scripts\test\"
Linux:
${KIT_PATH} --enable omni.asset_validator.core --exec "${VALIDATION_PATH}\scripts\omni_asset_validator.py ${VALIDATION_PATH}\scripts\test\"
#### Apply fixes on file
Windows:
%KIT_PATH% --enable omni.asset_validator.core --exec "%VALIDATION_PATH%\scripts\omni_asset_validator.py --fix %VALIDATION_PATH%\scripts\test\asset.usda"
Linux:
${KIT_PATH} --enable omni.asset_validator.core --exec "${VALIDATION_PATH}\scripts\omni_asset_validator.py --fix ${VALIDATION_PATH}\scripts\test\asset.usda"
#### Apply fixes on a folder, specific category
Windows:
%KIT_PATH% --enable omni.asset_validator.core --exec "%VALIDATION_PATH%\scripts\omni_asset_validator.py --fix --category Usd:Schema %VALIDATION_PATH%\scripts\test\"
Linux:
${KIT_PATH} --enable omni.asset_validator.core --exec "${VALIDATION_PATH}\scripts\omni_asset_validator.py --fix --category Usd:Schema ${VALIDATION_PATH}\scripts\test\"
#### Apply fixes on a folder, multiple categories
Windows:
%KIT_PATH% --enable omni.asset_validator.core --exec "%VALIDATION_PATH%\scripts\omni_asset_validator.py --fix --category Usd:Schema --category Basic %VALIDATION_PATH%\scripts\test\"
Linux:
${KIT_PATH} --enable omni.asset_validator.core --exec "${VALIDATION_PATH}\scripts\omni_asset_validator.py --fix --category Usd:Schema --category Basic ${VALIDATION_PATH}\scripts\test\"
#### Apply predicates, single file
Windows:
%KIT_PATH% --enable omni.asset_validator.core --exec "%VALIDATION_PATH%\scripts\omni_asset_validator.py --predicate HasRootLayer %VALIDATION_PATH%\scripts\test\asset.usda"
Linux:
${KIT_PATH} --enable omni.asset_validator.core --exec "${VALIDATION_PATH}\scripts\omni_asset_validator.py --predicate HasRootLayer ${VALIDATION_PATH}\scripts\test\asset.usda"
© Copyright 2021-2023, NVIDIA.
Last updated on Jun 20, 2023. |
PhysicsSchemaTools.md | PhysicsSchemaTools module — pxr-usd-api 105.1 documentation
pxr-usd-api
»
Modules »
PhysicsSchemaTools module
# PhysicsSchemaTools module
Summary: Omniverse-specific: The Physics Schema Tools provides tools for the representation of physics properties and behaviors in a 3D scene, such as gravity, collisions, and rigid body dynamics.
Classes:
Path(*args, **kwargs)
PurePath subclass that can make system calls.
Functions:
addActor
addBoxCollisionShape
addCollisionShape
addDensity
addDisplayColor
addGroundPlane
addGroundTriMesh
addOrientation
addPhysicsScene
addPosition
addRigidBody
addRigidBox
addRigidBoxForInstancing
addRigidCapsule
addRigidCone
addRigidCylinder
addRigidSphere
addVelocity
createMesh
createMeshBox
createMeshCapsule
createMeshCylinder
createMeshSphere
createMeshSquare
decodeSdfPath
encodeSdfPath
getMassSpaceInertia
intToSdfPath
sdfPathToInt
class pxr.PhysicsSchemaTools.Path(*args, **kwargs)
PurePath subclass that can make system calls.
Path represents a filesystem path but unlike PurePath, also offers
methods to do system calls on path objects. Depending on your system,
instantiating a Path will return either a PosixPath or a WindowsPath
object. You can also instantiate a PosixPath or WindowsPath directly,
but cannot instantiate a WindowsPath on a POSIX system or vice versa.
Methods:
absolute()
Return an absolute version of this path.
chmod(mode, *[, follow_symlinks])
Change the permissions of the path, like os.chmod().
cwd()
Return a new path pointing to the current working directory (as returned by os.getcwd()).
exists()
Whether this path exists.
expanduser()
Return a new path with expanded ~ and ~user constructs (as returned by os.path.expanduser)
glob(pattern)
Iterate over this subtree and yield all existing files (of any kind, including directories) matching the given relative pattern.
group()
Return the group name of the file gid.
hardlink_to(target)
Make this path a hard link pointing to the same file as target.
home()
Return a new path pointing to the user's home directory (as returned by os.path.expanduser('~')).
is_block_device()
Whether this path is a block device.
is_char_device()
Whether this path is a character device.
is_dir()
Whether this path is a directory.
is_fifo()
Whether this path is a FIFO.
is_file()
Whether this path is a regular file (also True for symlinks pointing to regular files).
is_mount()
Check if this path is a POSIX mount point
is_socket()
Whether this path is a socket.
is_symlink()
Whether this path is a symbolic link.
iterdir()
Iterate over the files in this directory.
lchmod(mode)
Like chmod(), except if the path points to a symlink, the symlink's permissions are changed, rather than its target's.
link_to(target)
Make the target path a hard link pointing to this path.
lstat()
Like stat(), except if the path points to a symlink, the symlink's status information is returned, rather than its target's.
mkdir([mode, parents, exist_ok])
Create a new directory at this given path.
open([mode, buffering, encoding, errors, ...])
Open the file pointed by this path and return a file object, as the built-in open() function does.
owner()
Return the login name of the file owner.
read_bytes()
Open the file in bytes mode, read it, and close the file.
read_text([encoding, errors])
Open the file in text mode, read it, and close the file.
readlink()
Return the path to which the symbolic link points.
rename(target)
Rename this path to the target path.
replace(target)
Rename this path to the target path, overwriting if that path exists.
resolve([strict])
Make the path absolute, resolving all symlinks on the way and also normalizing it (for example turning slashes into backslashes under Windows).
rglob(pattern)
Recursively yield all existing files (of any kind, including directories) matching the given relative pattern, anywhere in this subtree.
rmdir()
Remove this directory.
samefile(other_path)
Return whether other_path is the same or not as this file (as returned by os.path.samefile()).
stat(*[, follow_symlinks])
Return the result of the stat() system call on this path, like os.stat() does.
symlink_to(target[, target_is_directory])
Make this path a symlink pointing to the target path.
touch([mode, exist_ok])
Create this file with the given access mode, if it doesn't exist.
unlink([missing_ok])
Remove this file or link.
write_bytes(data)
Open the file in bytes mode, write to it, and close the file.
write_text(data[, encoding, errors, newline])
Open the file in text mode, write to it, and close the file.
absolute()
Return an absolute version of this path. This function works
even if the path doesn’t point to anything.
No normalization is done, i.e. all ‘.’ and ‘..’ will be kept along.
Use resolve() to get the canonical path to a file.
chmod(mode, *, follow_symlinks=True)
Change the permissions of the path, like os.chmod().
classmethod cwd()
Return a new path pointing to the current working directory
(as returned by os.getcwd()).
exists()
Whether this path exists.
expanduser()
Return a new path with expanded ~ and ~user constructs
(as returned by os.path.expanduser)
glob(pattern)
Iterate over this subtree and yield all existing files (of any
kind, including directories) matching the given relative pattern.
group()
Return the group name of the file gid.
hardlink_to(target)
Make this path a hard link pointing to the same file as target.
Note the order of arguments (self, target) is the reverse of os.link’s.
classmethod home()
Return a new path pointing to the user’s home directory (as
returned by os.path.expanduser(‘~’)).
is_block_device()
Whether this path is a block device.
is_char_device()
Whether this path is a character device.
is_dir()
Whether this path is a directory.
is_fifo()
Whether this path is a FIFO.
is_file()
Whether this path is a regular file (also True for symlinks pointing
to regular files).
is_mount()
Check if this path is a POSIX mount point
is_socket()
Whether this path is a socket.
is_symlink()
Whether this path is a symbolic link.
iterdir()
Iterate over the files in this directory. Does not yield any
result for the special paths ‘.’ and ‘..’.
lchmod(mode)
Like chmod(), except if the path points to a symlink, the symlink’s
permissions are changed, rather than its target’s.
link_to(target)
Make the target path a hard link pointing to this path.
Note this function does not make this path a hard link to target,
despite the implication of the function and argument names. The order
of arguments (target, link) is the reverse of Path.symlink_to, but
matches that of os.link.
Deprecated since Python 3.10 and scheduled for removal in Python 3.12.
Use hardlink_to() instead.
lstat()
Like stat(), except if the path points to a symlink, the symlink’s
status information is returned, rather than its target’s.
mkdir(mode=511, parents=False, exist_ok=False)
Create a new directory at this given path.
open(mode='r', buffering=-1, encoding=None, errors=None, newline=None)
Open the file pointed by this path and return a file object, as
the built-in open() function does.
owner()
Return the login name of the file owner.
read_bytes()
Open the file in bytes mode, read it, and close the file.
read_text(encoding=None, errors=None)
Open the file in text mode, read it, and close the file.
readlink()
Return the path to which the symbolic link points.
rename(target)
Rename this path to the target path.
The target path may be absolute or relative. Relative paths are
interpreted relative to the current working directory, not the
directory of the Path object.
Returns the new Path instance pointing to the target path.
replace(target)
Rename this path to the target path, overwriting if that path exists.
The target path may be absolute or relative. Relative paths are
interpreted relative to the current working directory, not the
directory of the Path object.
Returns the new Path instance pointing to the target path.
resolve(strict=False)
Make the path absolute, resolving all symlinks on the way and also
normalizing it (for example turning slashes into backslashes under
Windows).
rglob(pattern)
Recursively yield all existing files (of any kind, including
directories) matching the given relative pattern, anywhere in
this subtree.
rmdir()
Remove this directory. The directory must be empty.
samefile(other_path)
Return whether other_path is the same or not as this file
(as returned by os.path.samefile()).
stat(*, follow_symlinks=True)
Return the result of the stat() system call on this path, like
os.stat() does.
symlink_to(target, target_is_directory=False)
Make this path a symlink pointing to the target path.
Note the order of arguments (link, target) is the reverse of os.symlink.
touch(mode=438, exist_ok=True)
Create this file with the given access mode, if it doesn’t exist.
unlink(missing_ok=False)
Remove this file or link.
If the path is a directory, use rmdir() instead.
write_bytes(data)
Open the file in bytes mode, write to it, and close the file.
write_text(data, encoding=None, errors=None, newline=None)
Open the file in text mode, write to it, and close the file.
pxr.PhysicsSchemaTools.addActor()
pxr.PhysicsSchemaTools.addBoxCollisionShape()
pxr.PhysicsSchemaTools.addCollisionShape()
pxr.PhysicsSchemaTools.addDensity()
pxr.PhysicsSchemaTools.addDisplayColor()
pxr.PhysicsSchemaTools.addGroundPlane()
pxr.PhysicsSchemaTools.addGroundTriMesh()
pxr.PhysicsSchemaTools.addOrientation()
pxr.PhysicsSchemaTools.addPhysicsScene()
pxr.PhysicsSchemaTools.addPosition()
pxr.PhysicsSchemaTools.addRigidBody()
pxr.PhysicsSchemaTools.addRigidBox()
pxr.PhysicsSchemaTools.addRigidBoxForInstancing()
pxr.PhysicsSchemaTools.addRigidCapsule()
pxr.PhysicsSchemaTools.addRigidCone()
pxr.PhysicsSchemaTools.addRigidCylinder()
pxr.PhysicsSchemaTools.addRigidSphere()
pxr.PhysicsSchemaTools.addVelocity()
pxr.PhysicsSchemaTools.createMesh()
pxr.PhysicsSchemaTools.createMeshBox()
pxr.PhysicsSchemaTools.createMeshCapsule()
pxr.PhysicsSchemaTools.createMeshCylinder()
pxr.PhysicsSchemaTools.createMeshSphere()
pxr.PhysicsSchemaTools.createMeshSquare()
pxr.PhysicsSchemaTools.decodeSdfPath()
pxr.PhysicsSchemaTools.encodeSdfPath()
pxr.PhysicsSchemaTools.getMassSpaceInertia()
pxr.PhysicsSchemaTools.intToSdfPath()
pxr.PhysicsSchemaTools.sdfPathToInt()
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023. |
omni.ui.SimpleFloatModel.md | SimpleFloatModel — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
SimpleFloatModel
# SimpleFloatModel
class omni.ui.SimpleFloatModel
Bases: AbstractValueModel
A very simple double model.
Methods
__init__(self[, default_value])
get_max(self)
get_min(self)
set_max(self, arg0)
set_min(self, arg0)
Attributes
max
This property holds the model's minimum value.
min
This property holds the model's minimum value.
__init__(self: omni.ui._ui.SimpleFloatModel, default_value: float = 0.0, **kwargs) → None
get_max(self: omni.ui._ui.SimpleFloatModel) → float
get_min(self: omni.ui._ui.SimpleFloatModel) → float
set_max(self: omni.ui._ui.SimpleFloatModel, arg0: float) → None
set_min(self: omni.ui._ui.SimpleFloatModel, arg0: float) → None
property max
This property holds the model’s minimum value.
property min
This property holds the model’s minimum value.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
1_0_50.md | 1.0.50 — Omniverse Launcher latest documentation
Omniverse Launcher
»
Omniverse Launcher »
Release Notes »
1.0.50
# 1.0.50
Release Date: March 2021
## Fixed
Catch unexpected Starfleet responses and return the error that tells users to log in.
Fixed licenses link not working on Linux.
## Removed
Remove debug noise in logs from the auto-updater.
© Copyright 2023-2024, NVIDIA.
Last updated on Apr 15, 2024. |
UsdAppUtils.md | UsdAppUtils module — pxr-usd-api 105.1 documentation
pxr-usd-api
»
Modules »
UsdAppUtils module
# UsdAppUtils module
Summary: The UsdAppUtils module contains a number of utilities and common functionality for applications that view and/or record images of USD stages.
Classes:
FrameRecorder
A utility class for recording images of USD stages.
class pxr.UsdAppUtils.FrameRecorder
A utility class for recording images of USD stages.
UsdAppUtilsFrameRecorder uses Hydra to produce recorded images of a
USD stage looking through a particular UsdGeomCamera on that stage at
a particular UsdTimeCode. The images generated will be effectively the
same as what you would see in the viewer in usdview.
Note that it is assumed that an OpenGL context has already been setup.
Methods:
GetCurrentRendererId()
Gets the ID of the Hydra renderer plugin that will be used for recording.
Record(stage, usdCamera, timeCode, ...)
Records an image and writes the result to outputImagePath .
SetColorCorrectionMode(colorCorrectionMode)
Sets the color correction mode to be used for recording.
SetComplexity(complexity)
Sets the level of refinement complexity.
SetImageWidth(imageWidth)
Sets the width of the recorded image.
SetIncludedPurposes(purposes)
Sets the UsdGeomImageable purposes to be used for rendering.
SetRendererPlugin(id)
Sets the Hydra renderer plugin to be used for recording.
GetCurrentRendererId() → str
Gets the ID of the Hydra renderer plugin that will be used for
recording.
Record(stage, usdCamera, timeCode, outputImagePath) → bool
Records an image and writes the result to outputImagePath .
The recorded image will represent the view from usdCamera looking
at the imageable prims on USD stage stage at time timeCode .
If usdCamera is not a valid camera, a camera will be computed to
automatically frame the stage geometry.
Returns true if the image was generated and written successfully, or
false otherwise.
Parameters
stage (Stage) –
usdCamera (Camera) –
timeCode (TimeCode) –
outputImagePath (str) –
SetColorCorrectionMode(colorCorrectionMode) → None
Sets the color correction mode to be used for recording.
By default, color correction is disabled.
Parameters
colorCorrectionMode (str) –
SetComplexity(complexity) → None
Sets the level of refinement complexity.
The default complexity is”low”(1.0).
Parameters
complexity (float) –
SetImageWidth(imageWidth) → None
Sets the width of the recorded image.
The height of the recorded image will be computed using this value and
the aspect ratio of the camera used for recording.
The default image width is 960 pixels.
Parameters
imageWidth (int) –
SetIncludedPurposes(purposes) → None
Sets the UsdGeomImageable purposes to be used for rendering.
We will always include”default”purpose, and by default, we will
also include UsdGeomTokens->proxy. Use this method to explicitly
enumerate an alternate set of purposes to be included along
with”default”.
Parameters
purposes (list[TfToken]) –
SetRendererPlugin(id) → bool
Sets the Hydra renderer plugin to be used for recording.
Parameters
id (str) –
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023. |
omni.ui.WindowHandle.md | WindowHandle — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
WindowHandle
# WindowHandle
class omni.ui.WindowHandle
Bases: pybind11_object
WindowHandle is a handle object to control any of the windows in Kit. It can be created any time, and if it’s destroyed, the source window doesn’t disappear.
Methods
__init__(*args, **kwargs)
dock_in(self, window, dock_position[, ratio])
Dock the window to the existing window.
focus(self)
Brings the window to the top.
is_selected_in_dock(self)
Return true is the window is the current window in the docking area.
notify_app_window_change(self, arg0)
Notifies the UI window that the AppWindow it attached to has changed.
undock(self)
Undock the window and make it floating.
Attributes
dock_id
Returns ID of the dock node this window is docked to.
dock_order
The position of the window in the dock.
dock_tab_bar_enabled
Checks if the current docking space is disabled.
dock_tab_bar_visible
Checks if the current docking space has the tab bar.
docked
True if this window is docked.
height
The height of the window in points.
position_x
The position of the window in points.
position_y
The position of the window in points.
title
The title of the window.
visible
Returns whether the window is visible.
width
The width of the window in points.
__init__(*args, **kwargs)
dock_in(self: omni.ui._ui.WindowHandle, window: omni.ui._ui.WindowHandle, dock_position: omni.ui._ui.DockPosition, ratio: float = 0.5) → None
Dock the window to the existing window. It can split the window to two parts or it can convert the window to a docking tab.
focus(self: omni.ui._ui.WindowHandle) → None
Brings the window to the top. If it’s a docked window, it makes the window currently visible in the dock.
is_selected_in_dock(self: omni.ui._ui.WindowHandle) → bool
Return true is the window is the current window in the docking area.
notify_app_window_change(self: omni.ui._ui.WindowHandle, arg0: omni::kit::IAppWindow) → None
Notifies the UI window that the AppWindow it attached to has changed.
undock(self: omni.ui._ui.WindowHandle) → None
Undock the window and make it floating.
property dock_id
Returns ID of the dock node this window is docked to.
property dock_order
The position of the window in the dock.
property dock_tab_bar_enabled
Checks if the current docking space is disabled. The disabled docking tab bar can’t be shown by the user.
property dock_tab_bar_visible
Checks if the current docking space has the tab bar.
property docked
True if this window is docked. False otherwise.
property height
The height of the window in points.
property position_x
The position of the window in points.
property position_y
The position of the window in points.
property title
The title of the window.
property visible
Returns whether the window is visible.
property width
The width of the window in points.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
workstation-install.md | Workstation Install Guide — Omniverse Install Guide latest documentation
Omniverse Install Guide
»
Omniverse Install Guide »
Workstation Install Guide
# Workstation Install Guide
## Workstation Setup
Workstation is ideal for individuals and small teams. It’s deployment and configuration is simple thanks to the Omniverse Launcher application.
Warning
Workstation runs on a network interface and it’s IP Address or hostname must be accessible by all intended Clients (e.g., USD Composer), including Nucleus itself.
Running Workstation behind a firewall or using a Cloud Service Provider (CSP) and port forwarding traffic inbound is not supported.
### Setup Instructions
Download Omniverse Launcher.
Install the Omniverse Launcher and refer to the Installing Launcher instructions for additional help.
Install Nucleus Workstation. See Nucleus Tab for additional configuration details.
Install Omniverse Applications & Connectors as needed. See Install Apps for information and help.
Note
To ensure Workstation has access to and is accessible by all required services in a non-airgapped environment, refer to the Networking and TCP/IP Ports documentation
for a comprehensive list of connectivity ports and endpoints.
© Copyright 2023-2024, NVIDIA.
Last updated on Apr 15, 2024. |
omni.ui.InvisibleButton.md | InvisibleButton — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
InvisibleButton
# InvisibleButton
class omni.ui.InvisibleButton
Bases: Widget
The InvisibleButton widget provides a transparent command button.
Methods
__init__(self, **kwargs)
Constructor.
call_clicked_fn(self)
Sets the function that will be called when when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button).
has_clicked_fn(self)
Sets the function that will be called when when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button).
set_clicked_fn(self, fn)
Sets the function that will be called when when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button).
Attributes
__init__(self: omni.ui._ui.InvisibleButton, **kwargs) → None
Constructor.
`kwargsdict`See below
### Keyword Arguments:
`clicked_fnCallable[[], None]`Sets the function that will be called when when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button).
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
call_clicked_fn(self: omni.ui._ui.InvisibleButton) → None
Sets the function that will be called when when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button).
has_clicked_fn(self: omni.ui._ui.InvisibleButton) → bool
Sets the function that will be called when when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button).
set_clicked_fn(self: omni.ui._ui.InvisibleButton, fn: Callable[[], None]) → None
Sets the function that will be called when when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button).
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
1_7_1.md | 1.7.1 — Omniverse Launcher latest documentation
Omniverse Launcher
»
Omniverse Launcher »
Release Notes »
1.7.1
# 1.7.1
Release Date: Dec 2022
## Added
Renamed Enterprise Launcher to IT Managed Launcher.
Added new UI elements on Exchange cards to filter releases by release channel. A release is classified as Alpha, Beta, Release, or Enterprise, depending on its maturity and stability. If an Alpha or Beta release is selected, a banner appears on the main image to emphasize the relative risk of that release. Alpha or Beta releases may not be feature complete or fully stable. Versions classified as Release (also known as GA or General Availability) are feature complete and stable. Release versions that are supported for Enterprise customers appear in the Enterprise list.
Added /settings HTTP API for GET requests for the Launcher settings.
© Copyright 2023-2024, NVIDIA.
Last updated on Apr 15, 2024. |
omni.ui.Length.md | Length — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
Length
# Length
class omni.ui.Length
Bases: pybind11_object
OMNI.UI has several different units for expressing a length.
Many widget properties take “Length” values, such as width, height, minWidth, minHeight, etc. Pixel is the absolute length unit. Percent and Fraction are relative length units, and they specify a length relative to the parent length. Relative length units are scaled with the parent.
Methods
__init__(*args, **kwargs)
Overloaded function.
Attributes
unit
(UnitType.) Unit.
value
(float) Value
__init__(*args, **kwargs)
Overloaded function.
__init__(self: omni.ui._ui.Length, arg0: float, arg1: omni::ui::UnitType) -> None
__init__(self: omni.ui._ui.Length, arg0: float) -> None
__init__(self: omni.ui._ui.Length, arg0: int) -> None
Construct Length.
`kwargsdict`See below
### Keyword Arguments:
property unit
(UnitType.) Unit.
property value
(float) Value
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.Separator.md | Separator — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
Separator
# Separator
class omni.ui.Separator
Bases: Widget, MenuHelper
The Separator class provides blank space.
Normally, it’s used to create separator line in the UI elements
Methods
__init__(self[, text])
Construct Separator.
Attributes
__init__(self: omni.ui._ui.Separator, text: str = '', **kwargs) → None
Construct Separator.
`kwargsdict`See below
### Keyword Arguments:
`textstr`This property holds the menu’s text.
`hotkey_textstr`This property holds the menu’s hotkey text.
`checkablebool`This property holds whether this menu item is checkable. A checkable item is one which has an on/off state.
`hide_on_clickbool`Hide or keep the window when the user clicked this item.
`delegateMenuDelegate`The delegate that generates a widget per menu item.
`triggered_fnvoid`Sets the function that is called when an action is activated by the user; for example, when the user clicks a menu option, or presses an action’s shortcut key combination.
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
faq.md | Frequently Asked Questions — kit-manual 105.1 documentation
kit-manual
»
Frequently Asked Questions
# Frequently Asked Questions
## Where can I find the core Kit config file?
It is kit-core.json located close to the Kit executable.
## Can I debug python extensions and scripts?
Yes! Use VS Code for that.
Run Kit, open Window/Extensions Manager, find and enable the omni.kit.debug.vscode extension. You can now see the window called VS Code Link which shows you the status of the debugger connection.
Run VS Code with the Python extension installed. Open the Kit project folder with it.
Kit already has a proper .vscode/launch.json in the project. So select the Debugger tab in VS Code, select Python: Attach and press the Start Debugging button.
The status should now change to Connected in the Kit VS Code Link window.
Hit the Break button in this window, it shows an example of using the omni.kit.commands.execute("DebugBreak") command to break. You can debug your python code and add breakpoints.
Note
Unfortunately folder linked scripts are not properly recognized in this setup, so you must add your breakpoints in the real source files, which can be found under the _build folder.
Note
For non-UI configurations just use the omni.kit.debug.python extension instead. Look into its extension.toml for settings.
## Random failures when loading omni.usd ?
You can debug how USD loads its plugins with the environment variable TF_DEBUG. If you set TF_DEBUG=PLUG_INFO_SEARCH, it will print out all of the plugInfo.json files it finds. If you set TF_DEBUG=PLUG_REGISTRATION, it will print out all of the plugins it tries to register. Setting TF_DEBUG=PLUG_LOAD can also be useful, as it prints the plugins loaded. Kit mutes USD output by default. To unmute it, you need to set "/omni.kit.plugin/usdMuteDiagnosticMessage" to false.
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023. |
omni.ui.constant_utils.Singleton.md | Singleton — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Submodules »
omni.ui.constant_utils »
omni.ui.constant_utils Functions »
Singleton
# Singleton
omni.ui.constant_utils.Singleton(class_)
A singleton decorator
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.CheckBox.md | CheckBox — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
CheckBox
# CheckBox
class omni.ui.CheckBox
Bases: Widget, ValueModelHelper
A CheckBox is an option button that can be switched on (checked) or off (unchecked). Checkboxes are typically used to represent features in an application that can be enabled or disabled without affecting others.
The checkbox is implemented using the model-view pattern. The model is the central component of this system. It is the application’s dynamic data structure independent of the widget. It directly manages the data, logic, and rules of the checkbox. If the model is not specified, the simple one is created automatically when the object is constructed.
Methods
__init__(self[, model])
CheckBox with specified model.
Attributes
__init__(self: omni.ui._ui.CheckBox, model: omni.ui._ui.AbstractValueModel = None, **kwargs) → None
CheckBox with specified model. If model is not specified, it’s using the default one.
`kwargsdict`See below
### Keyword Arguments:
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.constant_utils.FloatShade.md | FloatShade — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Submodules »
omni.ui.constant_utils »
omni.ui.constant_utils Functions »
FloatShade
# FloatShade
omni.ui.constant_utils.FloatShade(*args, **kwargs)
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.SimpleBoolModel.md | SimpleBoolModel — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
SimpleBoolModel
# SimpleBoolModel
class omni.ui.SimpleBoolModel
Bases: AbstractValueModel
A very simple bool model.
Methods
__init__(self[, default_value])
get_max(self)
get_min(self)
set_max(self, arg0)
set_min(self, arg0)
Attributes
max
This property holds the model's maximum value.
min
This property holds the model's minimum value.
__init__(self: omni.ui._ui.SimpleBoolModel, default_value: bool = False, **kwargs) → None
get_max(self: omni.ui._ui.SimpleBoolModel) → bool
get_min(self: omni.ui._ui.SimpleBoolModel) → bool
set_max(self: omni.ui._ui.SimpleBoolModel, arg0: bool) → None
set_min(self: omni.ui._ui.SimpleBoolModel, arg0: bool) → None
property max
This property holds the model’s maximum value.
property min
This property holds the model’s minimum value.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.Image.md | Image — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
Image
# Image
class omni.ui.Image
Bases: Widget
The Image widget displays an image.
The source of the image is specified as a URL using the source property. By default, specifying the width and height of the item causes the image to be scaled to that size. This behavior can be changed by setting the fill_mode property, allowing the image to be stretched or scaled instead. The property alignment controls where to align the scaled image.
Methods
__init__(*args, **kwargs)
Overloaded function.
set_progress_changed_fn(self, fn)
The progress of the image loading.
Attributes
alignment
This property holds the alignment of the image when the fill policy is ePreserveAspectFit or ePreserveAspectCrop.
fill_policy
Define what happens when the source image has a different size than the item.
pixel_aligned
Prevents image blurring when it's placed to fractional position (like x=0.5, y=0.5)
source_url
This property holds the image URL.
__init__(*args, **kwargs)
Overloaded function.
__init__(self: omni.ui._ui.Image, arg0: str, **kwargs) -> None
Construct image with given url. If the url is empty, it gets the image URL from styling.
`kwargsdict`See below
### Keyword Arguments:
`alignment`This property holds the alignment of the image when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the image is centered.
`fill_policy`Define what happens when the source image has a different size than the item.
`pixel_aligned`Prevents image blurring when it’s placed to fractional position (like x=0.5, y=0.5)
`progress_changed_fn`The progress of the image loading.
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
__init__(self: omni.ui._ui.Image, **kwargs) -> None
Construct image with given url. If the url is empty, it gets the image URL from styling.
`kwargsdict`See below
### Keyword Arguments:
`alignment`This property holds the alignment of the image when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the image is centered.
`fill_policy`Define what happens when the source image has a different size than the item.
`pixel_aligned`Prevents image blurring when it’s placed to fractional position (like x=0.5, y=0.5)
`progress_changed_fn`The progress of the image loading.
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
set_progress_changed_fn(self: omni.ui._ui.Image, fn: Callable[[float], None]) → None
The progress of the image loading.
property alignment
This property holds the alignment of the image when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the image is centered.
property fill_policy
Define what happens when the source image has a different size than the item.
property pixel_aligned
Prevents image blurring when it’s placed to fractional position (like x=0.5, y=0.5)
property source_url
This property holds the image URL. It can be an
omni:
file:
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.ColorWidget.md | ColorWidget — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
ColorWidget
# ColorWidget
class omni.ui.ColorWidget
Bases: Widget, ItemModelHelper
The ColorWidget widget is a button that displays the color from the item model and can open a picker window to change the color.
Methods
__init__(*args, **kwargs)
Overloaded function.
Attributes
__init__(*args, **kwargs)
Overloaded function.
__init__(self: omni.ui._ui.ColorWidget, **kwargs) -> None
__init__(self: omni.ui._ui.ColorWidget, arg0: omni.ui._ui.AbstractItemModel, **kwargs) -> None
__init__(self: omni.ui._ui.ColorWidget, arg0: float, arg1: float, arg2: float, **kwargs) -> None
__init__(self: omni.ui._ui.ColorWidget, arg0: float, arg1: float, arg2: float, arg3: float, **kwargs) -> None
Construct ColorWidget.
`kwargsdict`See below
### Keyword Arguments:
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.DockPosition.md | DockPosition — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
DockPosition
# DockPosition
class omni.ui.DockPosition
Bases: pybind11_object
Members:
RIGHT
LEFT
TOP
BOTTOM
SAME
Methods
__init__(self, value)
Attributes
BOTTOM
LEFT
RIGHT
SAME
TOP
name
value
__init__(self: omni.ui._ui.DockPosition, value: int) → None
property name
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.url_utils.StringShade.md | StringShade — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Submodules »
omni.ui.url_utils »
omni.ui.url_utils Functions »
StringShade
# StringShade
omni.ui.url_utils.StringShade(*args, **kwargs)
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.FloatStore.md | FloatStore — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
FloatStore
# FloatStore
class omni.ui.FloatStore
Bases: pybind11_object
A singleton that stores all the UI Style float properties of omni.ui.
Methods
__init__(*args, **kwargs)
find(name)
Return the index of the color with specific name.
store(name, value)
Save the color by name.
__init__(*args, **kwargs)
static find(name: str) → float
Return the index of the color with specific name.
static store(name: str, value: float) → None
Save the color by name.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.DynamicTextureProvider.md | DynamicTextureProvider — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
DynamicTextureProvider
# DynamicTextureProvider
class omni.ui.DynamicTextureProvider
Bases: ByteImageProvider
doc
Methods
__init__(self, arg0)
doc
Attributes
__init__(self: omni.ui._ui.DynamicTextureProvider, arg0: str) → None
doc
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.RadioCollection.md | RadioCollection — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
RadioCollection
# RadioCollection
class omni.ui.RadioCollection
Bases: ValueModelHelper
Radio Collection is a class that groups RadioButtons and coordinates their state.
It makes sure that the choice is mutually exclusive, it means when the user selects a radio button, any previously selected radio button in the same collection becomes deselected.
Methods
__init__(self[, model])
Constructs RadioCollection.
Attributes
__init__(self: omni.ui._ui.RadioCollection, model: omni.ui._ui.AbstractValueModel = None, **kwargs) → None
Constructs RadioCollection.
`kwargsdict`See below
### Keyword Arguments:
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
UsdVol.md | UsdVol module — pxr-usd-api 105.1 documentation
pxr-usd-api
»
Modules »
UsdVol module
# UsdVol module
Summary: The UsdVol module provides schemas for representing volumes (smoke, fire, etc).
Classes:
Field3DAsset
Field3D field primitive.
FieldAsset
Base class for field primitives defined by an external file.
FieldBase
Base class for field primitives.
OpenVDBAsset
OpenVDB field primitive.
Tokens
Volume
A renderable volume primitive.
class pxr.UsdVol.Field3DAsset
Field3D field primitive. The FieldAsset filePath attribute must
specify a file in the Field3D format on disk.
For any described attribute Fallback Value or Allowed Values
below that are text/tokens, the actual token is published and defined
in UsdVolTokens. So to set an attribute to the value”rightHanded”, use
UsdVolTokens->rightHanded as the value.
Methods:
CreateFieldDataTypeAttr(defaultValue, ...)
See GetFieldDataTypeAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateFieldPurposeAttr(defaultValue, ...)
See GetFieldPurposeAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
Define
classmethod Define(stage, path) -> Field3DAsset
Get
classmethod Get(stage, path) -> Field3DAsset
GetFieldDataTypeAttr()
Token which is used to indicate the data type of an individual field.
GetFieldPurposeAttr()
Optional token which can be used to indicate the purpose or grouping of an individual field.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
CreateFieldDataTypeAttr(defaultValue, writeSparsely) → Attribute
See GetFieldDataTypeAttr() , 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) –
CreateFieldPurposeAttr(defaultValue, writeSparsely) → Attribute
See GetFieldPurposeAttr() , 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) –
static Define()
classmethod Define(stage, path) -> Field3DAsset
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) –
static Get()
classmethod Get(stage, path) -> Field3DAsset
Return a UsdVolField3DAsset 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:
UsdVolField3DAsset(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetFieldDataTypeAttr() → Attribute
Token which is used to indicate the data type of an individual field.
Authors use this to tell consumers more about the field without
opening the file on disk. The list of allowed tokens reflects the
available choices for Field3d volumes.
Declaration
token fieldDataType
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Allowed Values
half, float, double, half3, float3, double3
GetFieldPurposeAttr() → Attribute
Optional token which can be used to indicate the purpose or grouping
of an individual field.
Clients which consume Field3D files should treat this as the Field3D
field name.
Declaration
token fieldPurpose
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
static GetSchemaAttributeNames()
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) –
class pxr.UsdVol.FieldAsset
Base class for field primitives defined by an external file.
For any described attribute Fallback Value or Allowed Values
below that are text/tokens, the actual token is published and defined
in UsdVolTokens. So to set an attribute to the value”rightHanded”, use
UsdVolTokens->rightHanded as the value.
Methods:
CreateFieldDataTypeAttr(defaultValue, ...)
See GetFieldDataTypeAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateFieldIndexAttr(defaultValue, writeSparsely)
See GetFieldIndexAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateFieldNameAttr(defaultValue, writeSparsely)
See GetFieldNameAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateFilePathAttr(defaultValue, writeSparsely)
See GetFilePathAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateVectorDataRoleHintAttr(defaultValue, ...)
See GetVectorDataRoleHintAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
Get
classmethod Get(stage, path) -> FieldAsset
GetFieldDataTypeAttr()
Token which is used to indicate the data type of an individual field.
GetFieldIndexAttr()
A file can contain multiple fields with the same name.
GetFieldNameAttr()
Name of an individual field within the file specified by the filePath attribute.
GetFilePathAttr()
An asset path attribute that points to a file on disk.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
GetVectorDataRoleHintAttr()
Optional token which is used to indicate the role of a vector valued field.
CreateFieldDataTypeAttr(defaultValue, writeSparsely) → Attribute
See GetFieldDataTypeAttr() , 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) –
CreateFieldIndexAttr(defaultValue, writeSparsely) → Attribute
See GetFieldIndexAttr() , 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) –
CreateFieldNameAttr(defaultValue, writeSparsely) → Attribute
See GetFieldNameAttr() , 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) –
CreateFilePathAttr(defaultValue, writeSparsely) → Attribute
See GetFilePathAttr() , 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) –
CreateVectorDataRoleHintAttr(defaultValue, writeSparsely) → Attribute
See GetVectorDataRoleHintAttr() , 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) –
static Get()
classmethod Get(stage, path) -> FieldAsset
Return a UsdVolFieldAsset 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:
UsdVolFieldAsset(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetFieldDataTypeAttr() → Attribute
Token which is used to indicate the data type of an individual field.
Authors use this to tell consumers more about the field without
opening the file on disk. The list of allowed tokens is specified with
the specific asset type. A missing value is considered an error.
Declaration
token fieldDataType
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
GetFieldIndexAttr() → Attribute
A file can contain multiple fields with the same name.
This optional attribute is an index used to disambiguate between these
multiple fields with the same name.
Declaration
int fieldIndex
C++ Type
int
Usd Type
SdfValueTypeNames->Int
GetFieldNameAttr() → Attribute
Name of an individual field within the file specified by the filePath
attribute.
Declaration
token fieldName
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
GetFilePathAttr() → Attribute
An asset path attribute that points to a file on disk.
For each supported file format, a separate FieldAsset subclass is
required.
This attribute’s value can be animated over time, as most volume asset
formats represent just a single timeSample of a volume. However, it
does not, at this time, support any pattern substitutions like”$F”.
Declaration
asset filePath
C++ Type
SdfAssetPath
Usd Type
SdfValueTypeNames->Asset
static GetSchemaAttributeNames()
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) –
GetVectorDataRoleHintAttr() → Attribute
Optional token which is used to indicate the role of a vector valued
field.
This can drive the data type in which fields are made available in a
renderer or whether the vector values are to be transformed.
Declaration
token vectorDataRoleHint ="None"
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Allowed Values
None, Point, Normal, Vector, Color
class pxr.UsdVol.FieldBase
Base class for field primitives.
Methods:
Get
classmethod Get(stage, path) -> FieldBase
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
static Get()
classmethod Get(stage, path) -> FieldBase
Return a UsdVolFieldBase 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:
UsdVolFieldBase(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
static GetSchemaAttributeNames()
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) –
class pxr.UsdVol.OpenVDBAsset
OpenVDB field primitive. The FieldAsset filePath attribute must
specify a file in the OpenVDB format on disk.
For any described attribute Fallback Value or Allowed Values
below that are text/tokens, the actual token is published and defined
in UsdVolTokens. So to set an attribute to the value”rightHanded”, use
UsdVolTokens->rightHanded as the value.
Methods:
CreateFieldClassAttr(defaultValue, writeSparsely)
See GetFieldClassAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateFieldDataTypeAttr(defaultValue, ...)
See GetFieldDataTypeAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
Define
classmethod Define(stage, path) -> OpenVDBAsset
Get
classmethod Get(stage, path) -> OpenVDBAsset
GetFieldClassAttr()
Optional token which can be used to indicate the class of an individual grid.
GetFieldDataTypeAttr()
Token which is used to indicate the data type of an individual field.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
CreateFieldClassAttr(defaultValue, writeSparsely) → Attribute
See GetFieldClassAttr() , 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) –
CreateFieldDataTypeAttr(defaultValue, writeSparsely) → Attribute
See GetFieldDataTypeAttr() , 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) –
static Define()
classmethod Define(stage, path) -> OpenVDBAsset
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) –
static Get()
classmethod Get(stage, path) -> OpenVDBAsset
Return a UsdVolOpenVDBAsset 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:
UsdVolOpenVDBAsset(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetFieldClassAttr() → Attribute
Optional token which can be used to indicate the class of an
individual grid.
This is a mapping to openvdb::GridClass where the values are
GRID_LEVEL_SET, GRID_FOG_VOLUME, GRID_STAGGERED, and GRID_UNKNOWN.
Declaration
token fieldClass
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Allowed Values
levelSet, fogVolume, staggered, unknown
GetFieldDataTypeAttr() → Attribute
Token which is used to indicate the data type of an individual field.
Authors use this to tell consumers more about the field without
opening the file on disk. The list of allowed tokens reflects the
available choices for OpenVDB volumes.
Declaration
token fieldDataType
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Allowed Values
half, float, double, int, uint, int64, half2, float2, double2, int2,
half3, float3, double3, int3, matrix3d, matrix4d, quatd, bool, mask,
string
static GetSchemaAttributeNames()
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) –
class pxr.UsdVol.Tokens
Attributes:
bool_
color
double2
double3
double_
field
fieldClass
fieldDataType
fieldIndex
fieldName
fieldPurpose
filePath
float2
float3
float_
fogVolume
half
half2
half3
int2
int3
int64
int_
levelSet
mask
matrix3d
matrix4d
none_
normal
point
quatd
staggered
string
uint
unknown
vector
vectorDataRoleHint
bool_ = 'bool'
color = 'Color'
double2 = 'double2'
double3 = 'double3'
double_ = 'double'
field = 'field'
fieldClass = 'fieldClass'
fieldDataType = 'fieldDataType'
fieldIndex = 'fieldIndex'
fieldName = 'fieldName'
fieldPurpose = 'fieldPurpose'
filePath = 'filePath'
float2 = 'float2'
float3 = 'float3'
float_ = 'float'
fogVolume = 'fogVolume'
half = 'half'
half2 = 'half2'
half3 = 'half3'
int2 = 'int2'
int3 = 'int3'
int64 = 'int64'
int_ = 'int'
levelSet = 'levelSet'
mask = 'mask'
matrix3d = 'matrix3d'
matrix4d = 'matrix4d'
none_ = 'None'
normal = 'Normal'
point = 'Point'
quatd = 'quatd'
staggered = 'staggered'
string = 'string'
uint = 'uint'
unknown = 'unknown'
vector = 'Vector'
vectorDataRoleHint = 'vectorDataRoleHint'
class pxr.UsdVol.Volume
A renderable volume primitive. A volume is made up of any number of
FieldBase primitives bound together in this volume. Each FieldBase
primitive is specified as a relationship with a namespace prefix
of”field”.
The relationship name is used by the renderer to associate individual
fields with the named input parameters on the volume shader. Using
this indirect approach to connecting fields to shader parameters
(rather than using the field prim’s name) allows a single field to be
reused for different shader inputs, or to be used as different shader
parameters when rendering different Volumes. This means that the name
of the field prim is not relevant to its contribution to the volume
prims which refer to it. Nor does the field prim’s location in the
scene graph have any relevance, and Volumes may refer to fields
anywhere in the scene graph. However, unless Field prims need to
be shared by multiple Volumes, a Volume’s Field prims should be
located under the Volume in namespace, for enhanced organization.
Methods:
BlockFieldRelationship(name)
Blocks an existing field relationship on this volume, ensuring it will not be enumerated by GetFieldPaths() .
CreateFieldRelationship(name, fieldPath)
Creates a relationship on this volume that targets the specified field.
Define
classmethod Define(stage, path) -> Volume
Get
classmethod Get(stage, path) -> Volume
GetFieldPath(name)
Checks if there is an existing field relationship with a given name, and if so, returns the path to the Field prim it targets, or else the empty path.
GetFieldPaths()
Return a map of field relationship names to the fields themselves, represented as prim paths.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
HasFieldRelationship(name)
Checks if there is an existing field relationship with a given name.
BlockFieldRelationship(name) → bool
Blocks an existing field relationship on this volume, ensuring it will
not be enumerated by GetFieldPaths() .
Returns true if the relationship existed, false if it did not. In
other words the return value indicates whether the volume prim was
changed.
The name lookup automatically applies the field relationship
namespacing, if it isn’t specified in the name token.
Parameters
name (str) –
CreateFieldRelationship(name, fieldPath) → bool
Creates a relationship on this volume that targets the specified
field.
If an existing relationship exists with the same name, it is replaced
(since only one target is allowed for each named relationship).
Returns true if the relationship was successfully created and set
- it is legal to call this method for a field relationship that
already”exists”, i.e. already posesses scene description, as this is
the only method we provide for setting a field relatioonship’s value,
to help enforce that field relationships can have only a single (or
no) target.
fieldPath
- can be a prim path, or the path of another relationship, to effect
Relationship Forwarding The name lookup automatically applies the
field relationship namespacing, if it isn’t specified in the name
token.
Parameters
name (str) –
fieldPath (Path) –
static Define()
classmethod Define(stage, path) -> Volume
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) –
static Get()
classmethod Get(stage, path) -> Volume
Return a UsdVolVolume 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:
UsdVolVolume(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetFieldPath(name) → Path
Checks if there is an existing field relationship with a given name,
and if so, returns the path to the Field prim it targets, or else the
empty path.
The name lookup automatically applies the field relationship
namespacing, if it isn’t specified in the name token.
Parameters
name (str) –
GetFieldPaths() → FieldMap
Return a map of field relationship names to the fields themselves,
represented as prim paths.
This map provides all the information that should be needed to tie
fields to shader parameters and render this volume.
The field relationship names that server as the map keys will have the
field namespace stripped from them.
static GetSchemaAttributeNames()
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) –
HasFieldRelationship(name) → bool
Checks if there is an existing field relationship with a given name.
This query will return true even for a field relationship that has
been blocked and therefore will not contribute to the map returned by
GetFieldRelationships()
The name lookup automatically applies the field relationship
namespacing, if it isn’t specified in the name token.
Parameters
name (str) –
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023. |
test.md | Test a Build — Omniverse Developer Guide latest documentation
Omniverse Developer Guide
»
Omniverse Developer Guide »
Test a Build
# Test a Build
Omniverse provides tooling and automation making testing easier and more efficient. Use the system’s built-in methods to generate UNIT TESTS for extensions, run automated INTEGRATION TESTS for your applications, and perform PERFORMANCE TESTS to ensure your project runs as efficiently as possible.
Testing Extensions with Python - Kit Manual : Python Testing.
Testing Extensions with C++ - Kit Manual : C++ Testing
Service Testing Tutorial - Unit testing for a viewport capture Service
## Logging
Logging, an essential tool for tracking Project activities, offers a detailed, sequential record of events occurring within your Project. This process assists in specifying the performance of your Project.
Kit Manual : Logging - Provides a brief overview of utility functions in Kit so you can create log entries during runtime.
## Profiling
Profiling is an analysis technique used to evaluate the runtime behavior of a software program. It entails gathering data on aspects such as time distribution across code segments, frequency of function usage, number of rendered “frames,” memory allocation, etc. This data serves to identify potential performance bottlenecks, memory leaks, and other factors potentially affecting the efficiency or stability of the program.
The Omniverse Platform provides comprehensive profiling support, enabling the thorough examination of your project’s frame rate, resource usage, stability, among other aspects.
For more information on profiling, refer to the following resources:
Kit Manual : Profiling Guide
© Copyright 2023-2024, NVIDIA.
Last updated on Apr 15, 2024. |
omni.ui.Grid.md | Grid — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
Grid
# Grid
class omni.ui.Grid
Bases: Stack
Grid is a container that arranges its child views in a grid. The grid vertical/horizontal direction is the direction the grid size growing with creating more children.
Methods
__init__(self, arg0, **kwargs)
Constructor.
Attributes
column_count
The number of columns.
column_width
The width of the column.
row_count
The number of rows.
row_height
The height of the row.
__init__(self: omni.ui._ui.Grid, arg0: omni.ui._ui.Direction, **kwargs) → None
Constructor.
### Arguments:
`direction :`Determines the direction the widget grows when adding more children.
`kwargsdict`See below
### Keyword Arguments:
`column_width`The width of the column. It’s only possible to set it if the grid is vertical. Once it’s set, the column count depends on the size of the widget.
`row_height`The height of the row. It’s only possible to set it if the grid is horizontal. Once it’s set, the row count depends on the size of the widget.
`column_count`The number of columns. It’s only possible to set it if the grid is vertical. Once it’s set, the column width depends on the widget size.
`row_count`The number of rows. It’s only possible to set it if the grid is horizontal. Once it’s set, the row height depends on the widget size.
`direction`This type is used to determine the direction of the layout. If the Stack’s orientation is eLeftToRight the widgets are placed in a horizontal row, from left to right. If the Stack’s orientation is eRightToLeft the widgets are placed in a horizontal row, from right to left. If the Stack’s orientation is eTopToBottom, the widgets are placed in a vertical column, from top to bottom. If the Stack’s orientation is eBottomToTop, the widgets are placed in a vertical column, from bottom to top. If the Stack’s orientation is eBackToFront, the widgets are placed sorted in a Z-order in top right corner. If the Stack’s orientation is eFrontToBack, the widgets are placed sorted in a Z-order in top right corner, the first widget goes to front.
`content_clipping`Determines if the child widgets should be clipped by the rectangle of this Stack.
`spacing`Sets a non-stretchable space in pixels between child items of this layout.
`send_mouse_events_to_back`When children of a Z-based stack overlap mouse events are normally sent to the topmost one. Setting this property true will invert that behavior, sending mouse events to the bottom-most child.
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
property column_count
The number of columns. It’s only possible to set it if the grid is vertical. Once it’s set, the column width depends on the widget size.
property column_width
The width of the column. It’s only possible to set it if the grid is vertical. Once it’s set, the column count depends on the size of the widget.
property row_count
The number of rows. It’s only possible to set it if the grid is horizontal. Once it’s set, the row height depends on the widget size.
property row_height
The height of the row. It’s only possible to set it if the grid is horizontal. Once it’s set, the row count depends on the size of the widget.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.color_utils.Singleton.md | Singleton — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Submodules »
omni.ui.color_utils »
omni.ui.color_utils Functions »
Singleton
# Singleton
omni.ui.color_utils.Singleton(class_)
A singleton decorator
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
Usd.md | Usd module — pxr-usd-api 105.1 documentation
pxr-usd-api
»
Modules »
Usd module
# Usd module
Summary: The core client-facing module for authoring, compositing, and reading Universal Scene Description.
Classes:
APISchemaBase
The base class for all API schemas.
AssetInfoKeys
Attribute
Scenegraph object for authoring and retrieving numeric, string, and array valued data, sampled over time.
AttributeQuery
Object for efficiently making repeated queries for attribute values.
ClipsAPI
UsdClipsAPI is an API schema that provides an interface to a prim's clip metadata.
CollectionAPI
This is a general purpose API schema, used to describe a collection of heterogeneous objects within the scene."Objects"here may be prims or properties belonging to prims or other collections.
CompositionArc
CrateInfo
A class for introspecting the underlying qualities of .usdc'crate'files, for diagnostic purposes.
EditContext
A utility class to temporarily modify a stage's current EditTarget during an execution scope.
EditTarget
Defines a mapping from scene graph paths to Sdf spec paths in a SdfLayer where edits should be directed, or up to where to perform partial composition.
Inherits
A proxy class for applying listOp edits to the inherit paths list for a prim.
InterpolationType
ListPosition
LoadPolicy
ModelAPI
UsdModelAPI is an API schema that provides an interface to a prim's model qualities, if it does, in fact, represent the root prim of a model.
Notice
Container class for Usd notices
Object
Base class for Usd scenegraph objects, providing common API.
Payloads
UsdPayloads provides an interface to authoring and introspecting payloads.
Prim
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a"Prim"as described in the Universal Scene Description Composition Compendium
PrimCompositionQuery
Object for making optionally filtered composition queries about a prim.
PrimDefinition
Class representing the builtin definition of a prim given the schemas registered in the schema registry.
PrimRange
An forward-iterable range that traverses a subtree of prims rooted at a given prim in depth-first order.
PrimTypeInfo
Class that holds the full type information for a prim.
Property
Base class for UsdAttribute and UsdRelationship scenegraph objects.
References
UsdReferences provides an interface to authoring and introspecting references in Usd.
Relationship
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other prims, attributes, or relationships.
ResolveInfo
Container for information about the source of an attribute's value, i.e. the'resolved'location of the attribute.
ResolveInfoSource
ResolveTarget
Defines a subrange of nodes and layers within a prim's prim index to consider when performing value resolution for the prim's attributes.
SchemaBase
The base class for all schema types in Usd.
SchemaKind
SchemaRegistry
Singleton registry that provides access to schema type information and the prim definitions for registered Usd"IsA"and applied API schema types.
Specializes
A proxy class for applying listOp edits to the specializes list for a prim.
Stage
The outermost container for scene description, which owns and presents composed prims as a scenegraph, following the composition recipe recursively described in its associated"root layer".
StageCache
A strongly concurrency safe collection of UsdStageRefPtr s, enabling sharing across multiple clients and threads.
StageCacheContext
A context object that lets the UsdStage::Open() API read from or read from and write to a UsdStageCache instance during a scope of execution.
StageCacheContextBlockType
StageLoadRules
This class represents rules that govern payload inclusion on UsdStages.
StagePopulationMask
This class represents a mask that may be applied to a UsdStage to limit the set of UsdPrim s it populates.
TimeCode
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdTimeCode::Default() .
Tokens
Typed
The base class for all typed schemas (those that can impart a typeName to a UsdPrim), and therefore the base class for all instantiable and"IsA"schemas.
UsdCollectionMembershipQuery
Represents a flattened view of a collection.
UsdFileFormat
File format for USD files.
VariantSet
A UsdVariantSet represents a single VariantSet in USD (e.g.
VariantSets
UsdVariantSets represents the collection of VariantSets that are present on a UsdPrim.
ZipFile
Class for reading a zip file.
ZipFileWriter
Class for writing a zip file.
class pxr.Usd.APISchemaBase
The base class for all API schemas.
An API schema provides an interface to a prim’s qualities, but does
not specify a typeName for the underlying prim. The prim’s qualities
include its inheritance structure, attributes, relationships etc.
Since it cannot provide a typeName, an API schema is considered to be
non-concrete.
To auto-generate an API schema using usdGenSchema, simply leave the
typeName empty and make it inherit from”/APISchemaBase”or from another
API schema. See UsdModelAPI, UsdClipsAPI and UsdCollectionAPI for
examples.
API schemas are classified into applied and non-applied API schemas.
The author of an API schema has to decide on the type of API schema at
the time of its creation by setting customData[‘apiSchemaType’] in the
schema definition (i.e. in the associated primSpec inside the
schema.usda file). UsdAPISchemaBase implements methods that are used
to record the application of an API schema on a USD prim.
If an API schema only provides an interface to set certain core bits
of metadata (like UsdModelAPI, which sets model kind and UsdClipsAPI,
which sets clips-related metadata) OR if the API schema can apply to
any type of prim or only to a known fixed set of prim types OR if
there is no use of recording the application of the API schema, in
such cases, it would be better to make it a non-applied API schema.
Examples of non-applied API schemas include UsdModelAPI, UsdClipsAPI,
UsdShadeConnectableAPI and UsdGeomPrimvarsAPI.
If there is a need to discover (or record) whether a prim contains or
subscribes to a given API schema, it would be advantageous to make the
API schema be”applied”. In general, API schemas that add one or more
properties to a prim should be tagged as applied API schemas. A public
Apply() method is generated for applied API schemas by usdGenSchema.
An applied API schema must be applied to a prim via a call to the
generated Apply() method, for the schema object to evaluate to true
when converted to a bool using the explicit bool conversion operator.
Examples of applied API schemas include UsdCollectionAPI,
UsdGeomModelAPI and UsdGeomMotionAPI
Methods:
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
static GetSchemaAttributeNames()
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) –
class pxr.Usd.AssetInfoKeys
Attributes:
identifier
name
payloadAssetDependencies
version
identifier = 'identifier'
name = 'name'
payloadAssetDependencies = 'payloadAssetDependencies'
version = 'version'
class pxr.Usd.Attribute
Scenegraph object for authoring and retrieving numeric, string, and
array valued data, sampled over time.
The allowed value types for UsdAttribute are dictated by the Sdf
(“Scene Description Foundations”) core’s data model, which we
summarize in Basic Datatypes for Scene Description Provided by Sdf.
## Attribute Defining Qualities
In addition to its value type, an Attribute has two other defining
qualities:
Variability Expresses whether an attribute is intended to
have time samples ( GetVariability() == SdfVariabilityVarying ),
or only a default ( GetVariability() == SdfVariabilityUniform ).
For more on reasoning about time samples, see Value & Time-Sample
Accessors.
Custom Determines whether an attribute belongs to a schema (
IsCustom() == false ), or is a user-defined, custom attribute.
schema attributes will always be defined on a prim of the schema type,
ans may possess fallback values from the schema, whereas custom
attributes must always first be authored in order to be defined. Note
that custom is actually an aspect of UsdProperty, as UsdRelationship
can also be custom or provided by a schema.
## Attribute Creation and Existence
One can always create an attribute generically via
UsdPrim::CreateAttribute() , which ensures that an attribute”is
defined”in the current UsdEditTarget. In order to author any metadata
or a default or timesample for an attribute, it must first be
defined. It is sufficient that the attribute be defined in any one of
the layers participating in the stage’s current composition; for
builtin attributes (those belonging to the owning prim’s defining
schema, i.e. the most specific subclass of UsdTypedSchema for which
prim.IsA<schema>() will evaluate to true) there need be no authored
scene description, because a definition is provided by the prim’s
schema definition.
Creating an attribute does not imply that the attribute has a
value. More broadly, in the following code:
if (UsdAttribute attr = prim.GetAttribute(TfToken("myAttr"))){
\.\.\.
}
The UsdAttribute passes the bool test, because it is defined; however,
inside the clause, we have no guarantee that attr has a value.
## Attribute Value Interpolation
UsdAttribute supports two interpolation behaviors when retrieving
attribute values at times where no value is explicitly authored. The
desired behavior may be specified via UsdStage::SetInterpolationType.
That behavior will be used for all calls to UsdAttribute::Get.
The supported interpolation types are:
Held Attribute values are held constant between authored
values. An attribute’s value will be equal to the nearest preceding
authored value. If there is no preceding authored value, the value
will be equal to the nearest subsequent value.
Linear Attribute values are linearly interpolated between
authored values.
Linear interpolation is only supported for certain data types. See
USD_LINEAR_INTERPOLATION_TYPES for the list of these types. Types that
do not support linear interpolation will use held interpolation
instead.
Linear interpolation is done element-by-element for array, vector, and
matrix data types. If linear interpolation is requested for two array
values with different sizes, held interpolation will be used instead.
## Attribute Value Blocking
While prims can effectively be removed from a scene by deactivating
them, properties cannot. However, it is possible to block an
attribute’s value, thus making the attribute behave as if it has a
definition (and possibly metadata), but no authored value.
One blocks an attribute using UsdAttribute::Block() , which will block
the attribute in the stage’s current UsdEditTarget, by authoring an
SdfValueBlock in the attribute’s default, and only values authored
in weaker layers than the editTarget will be blocked. If the value
block is the strongest authored opinion for the attribute, the
HasAuthoredValue() method will return false, and the HasValue() and
Get() methods will only return true if the attribute possesses a
fallback value from the prim’s schema.”Unblocking”a blocked attribute
is as simple as setting a default or timeSample value for the
attribute in the same or stronger layer.
The semantics of Value Clips necessitate the ability to selectively
block an attribute’s value for only some intervals in its authored
range of samples. One can block an attribute’s value at time t by
calling attr.Set(SdfValueBlock, t) When an attribute is
thusly”partially blocked”, UsdAttribute::Get() will succeed only for
those time intervals whose left/earlier bracketing timeSample is
not SdfValueBlock.
Due to this time-varying potential of value blocking, it may be the
case that an attribute’s HasAuthoredValue() and HasValue() methods
both return true (because they do not and cannot consider time-
varying blocks), but Get() may yet return false over some intervals.
## Attributes of type SdfAssetPath and UsdAttribute::Get()
If an attribute’s value type is SdfAssetPath or SdfAssetPathArray,
Get() performs extra work to compute the resolved asset paths, using
the layer that has the strongest value opinion as the anchor
for”relative”asset paths. Both the unresolved and resolved results are
available through SdfAssetPath::GetAssetPath() and
SdfAssetPath::GetResolvedPath() , respectively.
Clients that call Get() on many asset-path-valued attributes may wish
to employ an ArResolverScopedCache to improve asset path resolution
performance.
Methods:
AddConnection(source, position)
Adds source to the list of connections, in the position specified by position .
Block()
Remove all time samples on an attribute and author a block default value.
Clear()
Clears the authored default value and all time samples for this attribute at the current EditTarget and returns true on success.
ClearAtTime(time)
Clear the authored value for this attribute at the given time, at the current EditTarget and return true on success.
ClearColorSpace()
Clears authored color-space value on the attribute.
ClearConnections()
Remove all opinions about the connections list from the current edit target.
ClearDefault()
Shorthand for ClearAtTime(UsdTimeCode::Default()).
Get(value, time)
Perform value resolution to fetch the value of this attribute at the requested UsdTimeCode time , which defaults to default.
GetBracketingTimeSamples(desiredTime, lower, ...)
Populate lower and upper with the next greater and lesser value relative to the desiredTime.
GetColorSpace()
Gets the color space in which the attribute is authored.
GetConnections(sources)
Compose this attribute's connections and fill sources with the result.
GetNumTimeSamples()
Returns the number of time samples that have been authored.
GetResolveInfo(time)
Perform value resolution to determine the source of the resolved value of this attribute at the requested UsdTimeCode time .
GetRoleName()
Return the roleName for this attribute's typeName.
GetTimeSamples(times)
Populates a vector with authored sample times.
GetTimeSamplesInInterval(interval, times)
Populates a vector with authored sample times in interval .
GetTypeName()
Return the"scene description"value type name for this attribute.
GetUnionedTimeSamples
classmethod GetUnionedTimeSamples(attrs, times) -> bool
GetUnionedTimeSamplesInInterval
classmethod GetUnionedTimeSamplesInInterval(attrs, interval, times) -> bool
GetVariability()
An attribute's variability expresses whether it is intended to have time-samples ( SdfVariabilityVarying ), or only a single default value ( SdfVariabilityUniform ).
HasAuthoredConnections()
Return true if this attribute has any authored opinions regarding connections.
HasAuthoredValue()
Return true if this attribute has either an authored default value or authored time samples.
HasAuthoredValueOpinion()
Deprecated
HasColorSpace()
Returns whether color-space is authored on the attribute.
HasFallbackValue()
Return true if this attribute has a fallback value provided by a registered schema.
HasValue()
Return true if this attribute has an authored default value, authored time samples or a fallback value provided by a registered schema.
RemoveConnection(source)
Removes target from the list of targets.
Set(value, time)
Set the value of this attribute in the current UsdEditTarget to value at UsdTimeCode time , which defaults to default.
SetColorSpace(colorSpace)
Sets the color space of the attribute to colorSpace .
SetConnections(sources)
Make the authoring layer's opinion of the connection list explicit, and set exactly to sources .
SetTypeName(typeName)
Set the value for typeName at the current EditTarget, return true on success, false if the value can not be written.
SetVariability(variability)
Set the value for variability at the current EditTarget, return true on success, false if the value can not be written.
ValueMightBeTimeVarying()
Return true if it is possible, but not certain, that this attribute's value changes over time, false otherwise.
AddConnection(source, position) → bool
Adds source to the list of connections, in the position specified
by position .
Issue an error if source identifies a prototype prim or an object
descendant to a prototype prim. It is not valid to author connections
to these objects.
What data this actually authors depends on what data is currently
authored in the authoring layer, with respect to list-editing
semantics, which we will document soon
Parameters
source (Path) –
position (ListPosition) –
Block() → None
Remove all time samples on an attribute and author a block
default value.
This causes the attribute to resolve as if there were no authored
value opinions in weaker layers.
See Attribute Value Blocking for more information, including
information on time-varying blocking.
Clear() → bool
Clears the authored default value and all time samples for this
attribute at the current EditTarget and returns true on success.
Calling clear when either no value is authored or no spec is present,
is a silent no-op returning true.
This method does not affect any other data authored on this attribute.
ClearAtTime(time) → bool
Clear the authored value for this attribute at the given time, at
the current EditTarget and return true on success.
UsdTimeCode::Default() can be used to clear the default value.
Calling clear when either no value is authored or no spec is present,
is a silent no-op returning true.
Parameters
time (TimeCode) –
ClearColorSpace() → bool
Clears authored color-space value on the attribute.
SetColorSpace()
ClearConnections() → bool
Remove all opinions about the connections list from the current edit
target.
ClearDefault() → bool
Shorthand for ClearAtTime(UsdTimeCode::Default()).
Get(value, time) → bool
Perform value resolution to fetch the value of this attribute at the
requested UsdTimeCode time , which defaults to default.
If no value is authored at time but values are authored at other
times, this function will return an interpolated value based on the
stage’s interpolation type. See Attribute Value Interpolation.
This templated accessor is designed for high performance data-
streaming applications, allowing one to fetch data into the same
container repeatedly, avoiding memory allocations when possible
(VtArray containers will be resized as necessary to conform to the
size of data being read).
This template is only instantiated for the valid scene description
value types and their corresponding VtArray containers. See Basic
Datatypes for Scene Description Provided by Sdf for the complete list
of types.
Values are retrieved without regard to this attribute’s variability.
For example, a uniform attribute may retrieve time sample values if
any are authored. However, the USD_VALIDATE_VARIABILITY TF_DEBUG code
will cause debug information to be output if values that are
inconsistent with this attribute’s variability are retrieved. See
UsdAttribute::GetVariability for more details.
true if there was a value to be read, it was of the type T requested,
and we read it successfully - false otherwise. For more details, see
TimeSamples, Defaults, and Value Resolution, and also Attributes of
type SdfAssetPath and UsdAttribute::Get() for information on how to
retrieve resolved asset paths from SdfAssetPath-valued attributes.
Parameters
value (T) –
time (TimeCode) –
Get(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.
Type-erased access, often not as efficient as typed access.
Parameters
value (VtValue) –
time (TimeCode) –
GetBracketingTimeSamples(desiredTime, lower, upper, hasTimeSamples) → bool
Populate lower and upper with the next greater and lesser value
relative to the desiredTime.
Return false if no value exists or an error occurs, true if either a
default value or timeSamples exist.
Use standard resolution semantics: if a stronger default value is
authored over weaker time samples, the default value hides the
underlying timeSamples.
1) If a sample exists at the desiredTime, set both upper and lower
to desiredTime.
2) If samples exist surrounding, but not equal to the desiredTime,
set lower and upper to the bracketing samples nearest to the
desiredTime.
3) If the desiredTime is outside of the range of authored samples,
clamp upper and lower to the nearest time sample.
4) If no samples exist, do not modify upper and lower and set
hasTimeSamples to false.
In cases (1), (2) and (3), set hasTimeSamples to true.
All four cases above are considered to be successful, thus the return
value will be true and no error message will be emitted.
Parameters
desiredTime (float) –
lower (float) –
upper (float) –
hasTimeSamples (bool) –
GetColorSpace() → str
Gets the color space in which the attribute is authored.
SetColorSpace() UsdStage Color Configuration API
GetConnections(sources) → bool
Compose this attribute’s connections and fill sources with the
result.
All preexisting elements in sources are lost.
Returns true if any connection path opinions have been authored and no
composition errors were encountered, returns false otherwise. Note
that authored opinions may include opinions that clear the connections
and a return value of true does not necessarily indicate that
sources will contain any connection paths.
See Relationship Targets and Attribute Connections for details on
behavior when targets point to objects beneath instance prims.
The result is not cached, and thus recomputed on each query.
Parameters
sources (list[SdfPath]) –
GetNumTimeSamples() → int
Returns the number of time samples that have been authored.
This method uses the standard resolution semantics, so if a stronger
default value is authored over weaker time samples, the default value
will hide the underlying timesamples.
This function will query all value clips that may contribute time
samples for this attribute, opening them if needed. This may be
expensive, especially if many clips are involved.
GetResolveInfo(time) → ResolveInfo
Perform value resolution to determine the source of the resolved value
of this attribute at the requested UsdTimeCode time .
Parameters
time (TimeCode) –
GetResolveInfo() -> ResolveInfo
Perform value resolution to determine the source of the resolved value
of this attribute at any non-default time.
Often (i.e. unless the attribute is affected by Value Clips) the
source of the resolved value does not vary over time. See
UsdAttributeQuery as an example that takes advantage of this quality
of value resolution.
GetRoleName() → str
Return the roleName for this attribute’s typeName.
GetTimeSamples(times) → bool
Populates a vector with authored sample times.
Returns false only on error.
This method uses the standard resolution semantics, so if a stronger
default value is authored over weaker time samples, the default value
will hide the underlying timesamples.
This function will query all value clips that may contribute time
samples for this attribute, opening them if needed. This may be
expensive, especially if many clips are involved. times
- on return, will contain the sorted, ascending timeSample
ordinates. Any data in times will be lost, as this method clears
times .
UsdAttribute::GetTimeSamplesInInterval
Parameters
times (list[float]) –
GetTimeSamplesInInterval(interval, times) → bool
Populates a vector with authored sample times in interval .
Returns false only on an error.
This function will only query the value clips that may contribute time
samples for this attribute in the given interval, opening them if
necessary. interval
- the GfInterval on which to gather time samples. times
- on return, will contain the sorted, ascending timeSample
ordinates. Any data in times will be lost, as this method clears
times .
UsdAttribute::GetTimeSamples
Parameters
interval (Interval) –
times (list[float]) –
GetTypeName() → ValueTypeName
Return the”scene description”value type name for this attribute.
static GetUnionedTimeSamples()
classmethod GetUnionedTimeSamples(attrs, times) -> bool
Populates the given vector, times with the union of all the
authored sample times on all of the given attributes, attrs .
This function will query all value clips that may contribute time
samples for the attributes in attrs , opening them if needed. This
may be expensive, especially if many clips are involved. The
accumulated sample times will be in sorted (increasing) order and will
not contain any duplicates.
This clears any existing values in the times vector before
accumulating sample times of the given attributes.
false if any of the attributes in attr are invalid or if there’s
an error when fetching time-samples for any of the attributes.
UsdAttribute::GetTimeSamples
UsdAttribute::GetUnionedTimeSamplesInInterval
Parameters
attrs (list[Attribute]) –
times (list[float]) –
static GetUnionedTimeSamplesInInterval()
classmethod GetUnionedTimeSamplesInInterval(attrs, interval, times) -> bool
Populates the given vector, times with the union of all the
authored sample times in the GfInterval, interval on all of the
given attributes, attrs .
This function will only query the value clips that may contribute time
samples for the attributes in attrs , in the given interval ,
opening them if necessary. The accumulated sample times will be in
sorted (increasing) order and will not contain any duplicates.
This clears any existing values in the times vector before
accumulating sample times of the given attributes.
false if any of the attributes in attr are invalid or if there’s
an error fetching time-samples for any of the attributes.
UsdAttribute::GetTimeSamplesInInterval
UsdAttribute::GetUnionedTimeSamples
Parameters
attrs (list[Attribute]) –
interval (Interval) –
times (list[float]) –
GetVariability() → Variability
An attribute’s variability expresses whether it is intended to have
time-samples ( SdfVariabilityVarying ), or only a single default
value ( SdfVariabilityUniform ).
Variability is required meta-data of all attributes, and its fallback
value is SdfVariabilityVarying.
HasAuthoredConnections() → bool
Return true if this attribute has any authored opinions regarding
connections.
Note that this includes opinions that remove connections, so a true
return does not necessarily indicate that this attribute has
connections.
HasAuthoredValue() → bool
Return true if this attribute has either an authored default value or
authored time samples.
If the attribute has been blocked, then return false
HasAuthoredValueOpinion() → bool
Deprecated
This method is deprecated because it returns true even when an
attribute is blocked. Please use HasAuthoredValue() instead. If you
truly need to know whether the attribute has any authored value
opinions, including blocks, you can make the following query:
attr.GetResolveInfo(). HasAuthoredValueOpinion()
Return true if this attribute has either an authored default value or
authored time samples.
HasColorSpace() → bool
Returns whether color-space is authored on the attribute.
GetColorSpace()
HasFallbackValue() → bool
Return true if this attribute has a fallback value provided by a
registered schema.
HasValue() → bool
Return true if this attribute has an authored default value, authored
time samples or a fallback value provided by a registered schema.
If the attribute has been blocked, then return true if and only if
it has a fallback value.
RemoveConnection(source) → bool
Removes target from the list of targets.
Issue an error if source identifies a prototype prim or an object
descendant to a prototype prim. It is not valid to author connections
to these objects.
Parameters
source (Path) –
Set(value, time) → bool
Set the value of this attribute in the current UsdEditTarget to
value at UsdTimeCode time , which defaults to default.
Values are authored without regard to this attribute’s variability.
For example, time sample values may be authored on a uniform
attribute. However, the USD_VALIDATE_VARIABILITY TF_DEBUG code will
cause debug information to be output if values that are inconsistent
with this attribute’s variability are authored. See
UsdAttribute::GetVariability for more details.
false and generate an error if type T does not match this
attribute’s defined scene description type exactly, or if there is
no existing definition for the attribute.
Parameters
value (T) –
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.
As a convenience, we allow the setting of string value typed
attributes via a C string value.
Parameters
value (str) –
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.
Parameters
value (VtValue) –
time (TimeCode) –
SetColorSpace(colorSpace) → None
Sets the color space of the attribute to colorSpace .
GetColorSpace() UsdStage Color Configuration API
Parameters
colorSpace (str) –
SetConnections(sources) → bool
Make the authoring layer’s opinion of the connection list explicit,
and set exactly to sources .
Issue an error if source identifies a prototype prim or an object
descendant to a prototype prim. It is not valid to author connections
to these objects.
If any path in sources is invalid, issue an error and return
false.
Parameters
sources (list[SdfPath]) –
SetTypeName(typeName) → bool
Set the value for typeName at the current EditTarget, return true on
success, false if the value can not be written.
Note that this value should not be changed as it is typically
either automatically authored or provided by a property definition.
This method is provided primarily for fixing invalid scene
description.
Parameters
typeName (ValueTypeName) –
SetVariability(variability) → bool
Set the value for variability at the current EditTarget, return true
on success, false if the value can not be written.
Note that this value should not be changed as it is typically
either automatically authored or provided by a property definition.
This method is provided primarily for fixing invalid scene
description.
Parameters
variability (Variability) –
ValueMightBeTimeVarying() → bool
Return true if it is possible, but not certain, that this attribute’s
value changes over time, false otherwise.
If this function returns false, it is certain that this attribute’s
value remains constant over time.
This function is equivalent to checking if GetNumTimeSamples() >1, but
may be more efficient since it does not actually need to get a full
count of all time samples.
class pxr.Usd.AttributeQuery
Object for efficiently making repeated queries for attribute values.
Retrieving an attribute’s value at a particular time requires
determining the source of strongest opinion for that value. Often
(i.e. unless the attribute is affected by Value Clips) this source
does not vary over time. UsdAttributeQuery uses this fact to speed up
repeated value queries by caching the source information for an
attribute. It is safe to use a UsdAttributeQuery for any attribute -
if the attribute is affected by Value Clips, the performance gain
will just be less.
## Resolve targets
An attribute query can also be constructed for an attribute along with
a UsdResolveTarget. A resolve target allows value resolution to
consider only a subrange of the prim stack instead of the entirety of
it. All of the methods of an attribute query created with a resolve
target will perform value resolution within that resolve target. This
can be useful for finding the value of an attribute resolved up to a
particular layer or for determining if a value authored on layer would
be overridden by a stronger opinion.
## Thread safety
This object provides the basic thread-safety guarantee. Multiple
threads may call the value accessor functions simultaneously.
## Invalidation
This object does not listen for change notification. If a consumer is
holding on to a UsdAttributeQuery, it is their responsibility to
dispose of it in response to a resync change to the associated
attribute. Failing to do so may result in incorrect values or crashes
due to dereferencing invalid objects.
Methods:
CreateQueries
classmethod CreateQueries(prim, attrNames) -> list[AttributeQuery]
Get(value, time)
Perform value resolution to fetch the value of the attribute associated with this query at the requested UsdTimeCode time .
GetAttribute()
Return the attribute associated with this query.
GetBracketingTimeSamples(desiredTime, lower, ...)
Populate lower and upper with the next greater and lesser value relative to the desiredTime.
GetNumTimeSamples()
Returns the number of time samples that have been authored.
GetTimeSamples(times)
Populates a vector with authored sample times.
GetTimeSamplesInInterval(interval, times)
Populates a vector with authored sample times in interval .
GetUnionedTimeSamples
classmethod GetUnionedTimeSamples(attrQueries, times) -> bool
GetUnionedTimeSamplesInInterval
classmethod GetUnionedTimeSamplesInInterval(attrQueries, interval, times) -> bool
HasAuthoredValue()
Return true if this attribute has either an authored default value or authored time samples.
HasAuthoredValueOpinion()
Deprecated
HasFallbackValue()
Return true if the attribute associated with this query has a fallback value provided by a registered schema.
HasValue()
Return true if the attribute associated with this query has an authored default value, authored time samples or a fallback value provided by a registered schema.
IsValid()
Return true if this query is valid (i.e.
ValueMightBeTimeVarying()
Return true if it is possible, but not certain, that this attribute's value changes over time, false otherwise.
static CreateQueries()
classmethod CreateQueries(prim, attrNames) -> list[AttributeQuery]
Construct new queries for the attributes named in attrNames under
the prim prim .
The objects in the returned vector will line up 1-to-1 with
attrNames .
Parameters
prim (Prim) –
attrNames (list[TfToken]) –
Get(value, time) → bool
Perform value resolution to fetch the value of the attribute
associated with this query at the requested UsdTimeCode time .
UsdAttribute::Get
Parameters
value (T) –
time (TimeCode) –
Get(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.
Type-erased access, often not as efficient as typed access.
Parameters
value (VtValue) –
time (TimeCode) –
GetAttribute() → Attribute
Return the attribute associated with this query.
GetBracketingTimeSamples(desiredTime, lower, upper, hasTimeSamples) → bool
Populate lower and upper with the next greater and lesser value
relative to the desiredTime.
UsdAttribute::GetBracketingTimeSamples
Parameters
desiredTime (float) –
lower (float) –
upper (float) –
hasTimeSamples (bool) –
GetNumTimeSamples() → int
Returns the number of time samples that have been authored.
UsdAttribute::GetNumTimeSamples
GetTimeSamples(times) → bool
Populates a vector with authored sample times.
Returns false only on error. Behaves identically to
UsdAttribute::GetTimeSamples()
UsdAttributeQuery::GetTimeSamplesInInterval
Parameters
times (list[float]) –
GetTimeSamplesInInterval(interval, times) → bool
Populates a vector with authored sample times in interval .
Returns false only on an error.
Behaves identically to UsdAttribute::GetTimeSamplesInInterval()
Parameters
interval (Interval) –
times (list[float]) –
static GetUnionedTimeSamples()
classmethod GetUnionedTimeSamples(attrQueries, times) -> bool
Populates the given vector, times with the union of all the
authored sample times on all of the given attribute-query objects,
attrQueries .
Behaves identically to UsdAttribute::GetUnionedTimeSamples()
false if one or more attribute-queries in attrQueries are invalid
or if there’s an error fetching time-samples for any of the attribute-
query objects.
UsdAttribute::GetUnionedTimeSamples
UsdAttributeQuery::GetUnionedTimeSamplesInInterval
Parameters
attrQueries (list[AttributeQuery]) –
times (list[float]) –
static GetUnionedTimeSamplesInInterval()
classmethod GetUnionedTimeSamplesInInterval(attrQueries, interval, times) -> bool
Populates the given vector, times with the union of all the
authored sample times in the GfInterval, interval on all of the
given attribute-query objects, attrQueries .
Behaves identically to UsdAttribute::GetUnionedTimeSamplesInInterval()
false if one or more attribute-queries in attrQueries are invalid
or if there’s an error fetching time-samples for any of the attribute-
query objects.
UsdAttribute::GetUnionedTimeSamplesInInterval
Parameters
attrQueries (list[AttributeQuery]) –
interval (Interval) –
times (list[float]) –
HasAuthoredValue() → bool
Return true if this attribute has either an authored default value or
authored time samples.
If the attribute has been blocked, then return false
UsdAttribute::HasAuthoredValue()
HasAuthoredValueOpinion() → bool
Deprecated
This method is deprecated because it returns true even when an
attribute is blocked. Please use HasAuthoredValue() instead. If you
truly need to know whether the attribute has any authored value
opinions, including blocks, you can make the following query:
query.GetAttribute().GetResolveInfo(). HasAuthoredValueOpinion()
Return true if this attribute has either an authored default value or
authored time samples.
HasFallbackValue() → bool
Return true if the attribute associated with this query has a fallback
value provided by a registered schema.
UsdAttribute::HasFallbackValue
HasValue() → bool
Return true if the attribute associated with this query has an
authored default value, authored time samples or a fallback value
provided by a registered schema.
UsdAttribute::HasValue
IsValid() → bool
Return true if this query is valid (i.e.
it is associated with a valid attribute), false otherwise.
ValueMightBeTimeVarying() → bool
Return true if it is possible, but not certain, that this attribute’s
value changes over time, false otherwise.
UsdAttribute::ValueMightBeTimeVarying
class pxr.Usd.ClipsAPI
UsdClipsAPI is an API schema that provides an interface to a prim’s
clip metadata. Clips are a”value resolution”feature that allows one to
specify a sequence of usd files (clips) to be consulted, over time, as
a source of varying overrides for the prims at and beneath this prim
in namespace.
SetClipAssetPaths() establishes the set of clips that can be
consulted. SetClipActive() specifies the ordering of clip application
over time (clips can be repeated), while SetClipTimes() specifies
time-mapping from stage-time to clip-time for the clip active at a
given stage-time, which allows for time-dilation and repetition of
clips. Finally, SetClipPrimPath() determines the path within each clip
that will map to this prim, i.e. the location within the clip at which
we will look for opinions for this prim.
The clip asset paths, times and active metadata can also be specified
through template clip metadata. This can be desirable when your set of
assets is very large, as the template metadata is much more concise.
SetClipTemplateAssetPath() establishes the asset identifier pattern of
the set of clips to be consulted. SetClipTemplateStride() ,
SetClipTemplateEndTime() , and SetClipTemplateStartTime() specify the
range in which USD will search, based on the template. From the set of
resolved asset paths, times and active will be derived internally.
A prim may have multiple”clip sets” named sets of clips that each
have their own values for the metadata described above. For example, a
prim might have a clip set named”Clips_1”that specifies some group of
clip asset paths, and another clip set named”Clips_2”that uses an
entirely different set of clip asset paths. These clip sets are
composed across composition arcs, so clip sets for a prim may be
defined in multiple sublayers or references, for example. Individual
metadata for a given clip set may be sparsely overridden.
Important facts about clips:
Within the layerstack in which clips are established, the
opinions within the clips will be weaker than any local opinions in
the layerstack, but em stronger than varying opinions coming across
references and variants.
We will never look for metadata or default opinions in clips
when performing value resolution on the owning stage, since these
quantities must be time-invariant.
This leads to the common structure in which we reference a model
asset on a prim, and then author clips at the same site: the asset
reference will provide the topology and unvarying data for the model,
while the clips will provide the time-sampled animation.
For further information, see Sequencable, Re-timable Animated”Value
Clips”
Methods:
ComputeClipAssetPaths(clipSet)
Computes and resolves the list of clip asset paths used by the clip set named clipSet .
GenerateClipManifest(clipSet, ...)
Create a clip manifest containing entries for all attributes in the value clips for clip set clipSet .
GenerateClipManifestFromLayers
classmethod GenerateClipManifestFromLayers(clipLayers, clipPrimPath) -> Layer
Get
classmethod Get(stage, path) -> ClipsAPI
GetClipActive(activeClips, clipSet)
List of pairs (time, clip index) indicating the time on the stage at which the clip in the clip set named clipSet specified by the clip index is active.
GetClipAssetPaths(assetPaths, clipSet)
List of asset paths to the clips in the clip set named clipSet .
GetClipManifestAssetPath(manifestAssetPath, ...)
Asset path for the clip manifest for the clip set named clipSet .
GetClipPrimPath(primPath, clipSet)
Path to the prim in the clips in the clip set named clipSet from which time samples will be read.
GetClipSets(clipSets)
ListOp that may be used to affect how opinions from clip sets are applied during value resolution.
GetClipTemplateActiveOffset(...)
A double representing the offset value used by USD when determining the active period for each clip.
GetClipTemplateAssetPath(...)
A template string representing a set of assets to be used as clips for the clip set named clipSet .
GetClipTemplateEndTime(clipTemplateEndTime, ...)
A double which indicates the end of the range USD will use to to search for asset paths for the clip set named clipSet .
GetClipTemplateStartTime(...)
A double which indicates the start of the range USD will use to search for asset paths for the clip set named clipSet .
GetClipTemplateStride(clipTemplateStride, ...)
A double representing the increment value USD will use when searching for asset paths for the clip set named clipSet .
GetClipTimes(clipTimes, clipSet)
List of pairs (stage time, clip time) indicating the time in the active clip in the clip set named clipSet that should be consulted for values at the corresponding stage time.
GetClips(clips)
Dictionary that contains the definition of the clip sets on this prim.
GetInterpolateMissingClipValues(interpolate, ...)
param interpolate
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
SetClipActive(activeClips, clipSet)
Set the active clip metadata for the clip set named clipSet .
SetClipAssetPaths(assetPaths, clipSet)
Set the clip asset paths for the clip set named clipSet .
SetClipManifestAssetPath(manifestAssetPath, ...)
Set the clip manifest asset path for this prim.
SetClipPrimPath(primPath, clipSet)
Set the clip prim path for the clip set named clipSet .
SetClipSets(clipSets)
Set the clip sets list op for this prim.
SetClipTemplateActiveOffset(...)
Set the clip template offset for the clip set named clipSet .
SetClipTemplateAssetPath(...)
Set the clip template asset path for the clip set named clipSet .
SetClipTemplateEndTime(clipTemplateEndTime, ...)
Set the template end time for the clipset named clipSet .
SetClipTemplateStartTime(...)
Set the template start time for the clip set named clipSet .
SetClipTemplateStride(clipTemplateStride, ...)
Set the template stride for the clip set named clipSet .
SetClipTimes(clipTimes, clipSet)
Set the clip times metadata for this prim.
SetClips(clips)
Set the clips dictionary for this prim.
SetInterpolateMissingClipValues(interpolate, ...)
Set whether missing clip values are interpolated from surrounding clips.
ComputeClipAssetPaths(clipSet) → VtArray[AssetPath]
Computes and resolves the list of clip asset paths used by the clip
set named clipSet .
This is the same list of paths that would be used during value
resolution.
If the clip set is defined using template clip metadata, this function
will compute the asset paths based on the template parameters.
Otherwise this function will use the authored clipAssetPaths.
Parameters
clipSet (str) –
ComputeClipAssetPaths() -> VtArray[AssetPath]
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
GenerateClipManifest(clipSet, writeBlocksForClipsWithMissingValues) → Layer
Create a clip manifest containing entries for all attributes in the
value clips for clip set clipSet .
This returns an anonymous layer that can be exported and reused (
SetClipManifestAssetPath). If writeBlocksForClipsWithMissingValues
is true , the generated manifest will have value blocks authored
for each attribute at the activation times of clips that do not
contain time samples for that attribute. This accelerates searches
done when the interpolation of missing clip values is enabled. See
GetInterpolateMissingClipValues and Interpolating Missing Values in
Clip Set for more details.
Returns an invalid SdfLayerRefPtr on failure.
Parameters
clipSet (str) –
writeBlocksForClipsWithMissingValues (bool) –
GenerateClipManifest(writeBlocksForClipsWithMissingValues) -> Layer
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
writeBlocksForClipsWithMissingValues (bool) –
static GenerateClipManifestFromLayers()
classmethod GenerateClipManifestFromLayers(clipLayers, clipPrimPath) -> Layer
Create a clip manifest containing entries for all attributes in the
given clipLayers that belong to the prim at clipPrimPath and
all descendants.
This returns an anonymous layer that can be exported and reused (
SetClipManifestAssetPath). Returns an invalid SdfLayerRefPtr on
failure.
Parameters
clipLayers (list[SdfLayerHandle]) –
clipPrimPath (Path) –
static Get()
classmethod Get(stage, path) -> ClipsAPI
Return a UsdClipsAPI 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:
UsdClipsAPI(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetClipActive(activeClips, clipSet) → bool
List of pairs (time, clip index) indicating the time on the stage at
which the clip in the clip set named clipSet specified by the clip
index is active.
For instance, a value of [(0.0, 0), (20.0, 1)] indicates that clip 0
is active at time 0 and clip 1 is active at time 20.
Parameters
activeClips (Vec2dArray) –
clipSet (str) –
GetClipActive(activeClips) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
activeClips (Vec2dArray) –
GetClipAssetPaths(assetPaths, clipSet) → bool
List of asset paths to the clips in the clip set named clipSet .
This list is unordered, but elements in this list are referred to by
index in other clip-related fields.
Parameters
assetPaths (VtArray[AssetPath]) –
clipSet (str) –
GetClipAssetPaths(assetPaths) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
assetPaths (VtArray[AssetPath]) –
GetClipManifestAssetPath(manifestAssetPath, clipSet) → bool
Asset path for the clip manifest for the clip set named clipSet .
The clip manifest indicates which attributes have time samples
authored in the clips specified on this prim. During value resolution,
clips will only be examined if the attribute exists and is declared as
varying in the manifest. See Clip Manifest for more details.
For instance, if this prim’s path is</Prim_1>, the clip prim path
is</Prim>, and we want values for the attribute</Prim_1.size>, we will
only look within this prim’s clips if the attribute</Prim.size>exists
and is varying in the manifest.
Parameters
manifestAssetPath (AssetPath) –
clipSet (str) –
GetClipManifestAssetPath(manifestAssetPath) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
manifestAssetPath (AssetPath) –
GetClipPrimPath(primPath, clipSet) → bool
Path to the prim in the clips in the clip set named clipSet from
which time samples will be read.
This prim’s path will be substituted with this value to determine the
final path in the clip from which to read data. For instance, if this
prims’path is’/Prim_1’, the clip prim path is’/Prim’, and we want to
get values for the attribute’/Prim_1.size’. The clip prim path will be
substituted in, yielding’/Prim.size’, and each clip will be examined
for values at that path.
Parameters
primPath (str) –
clipSet (str) –
GetClipPrimPath(primPath) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
primPath (str) –
GetClipSets(clipSets) → bool
ListOp that may be used to affect how opinions from clip sets are
applied during value resolution.
By default, clip sets in a layer stack are examined in lexicographical
order by name for attribute values during value resolution. The clip
sets listOp can be used to reorder the clip sets in a layer stack or
remove them entirely from consideration during value resolution
without modifying the clips dictionary.
This is not the list of clip sets that are authored on this prim. To
retrieve that information, use GetClips to examine the clips
dictionary directly.
This function returns the clip sets listOp from the current edit
target.
Parameters
clipSets (StringListOp) –
GetClipTemplateActiveOffset(clipTemplateActiveOffset, clipSet) → bool
A double representing the offset value used by USD when determining
the active period for each clip.
Parameters
clipTemplateActiveOffset (float) –
clipSet (str) –
GetClipTemplateActiveOffset(clipTemplateActiveOffset) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
clipTemplateActiveOffset (float) –
GetClipTemplateAssetPath(clipTemplateAssetPath, clipSet) → bool
A template string representing a set of assets to be used as clips for
the clip set named clipSet .
This string can be of two forms:
integer frames: path/basename.###.usd
subinteger frames: path/basename.##.##.usd.
For the integer portion of the specification, USD will take a
particular time, determined by the template start time, stride, and
end time, and pad it with zeros up to the number of hashes provided so
long as the number of hashes is greater than the digits required to
specify the integer value.
For instance:
time = 12, template asset path = foo.##.usd =>foo.12.usd time = 12,
template asset path = foo.###.usd =>foo.012.usd time = 333, template
asset path = foo.#.usd =>foo.333.usd
In the case of subinteger portion of a specifications, USD requires
the specification to be exact.
For instance:
time = 1.15, template asset path = foo.#.###.usd =>foo.1.150.usd time
= 1.145, template asset path = foo.#.##.usd =>foo.1.15.usd time = 1.1,
template asset path = foo.#.##.usd =>foo.1.10.usd
Note that USD requires that hash groups be adjacent in the string, and
that there only be one or two such groups.
Parameters
clipTemplateAssetPath (str) –
clipSet (str) –
GetClipTemplateAssetPath(clipTemplateAssetPath) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
clipTemplateAssetPath (str) –
GetClipTemplateEndTime(clipTemplateEndTime, clipSet) → bool
A double which indicates the end of the range USD will use to to
search for asset paths for the clip set named clipSet .
This value is inclusive in that range.
GetClipTemplateAssetPath.
Parameters
clipTemplateEndTime (float) –
clipSet (str) –
GetClipTemplateEndTime(clipTemplateEndTime) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
clipTemplateEndTime (float) –
GetClipTemplateStartTime(clipTemplateStartTime, clipSet) → bool
A double which indicates the start of the range USD will use to search
for asset paths for the clip set named clipSet .
This value is inclusive in that range.
GetClipTemplateAssetPath.
Parameters
clipTemplateStartTime (float) –
clipSet (str) –
GetClipTemplateStartTime(clipTemplateStartTime) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
clipTemplateStartTime (float) –
GetClipTemplateStride(clipTemplateStride, clipSet) → bool
A double representing the increment value USD will use when searching
for asset paths for the clip set named clipSet .
GetClipTemplateAssetPath.
Parameters
clipTemplateStride (float) –
clipSet (str) –
GetClipTemplateStride(clipTemplateStride) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
clipTemplateStride (float) –
GetClipTimes(clipTimes, clipSet) → bool
List of pairs (stage time, clip time) indicating the time in the
active clip in the clip set named clipSet that should be consulted
for values at the corresponding stage time.
During value resolution, this list will be sorted by stage time; times
will then be linearly interpolated between consecutive entries. For
instance, for clip times [(0.0, 0.0), (10.0, 20.0)], at stage time 0,
values from the active clip at time 0 will be used, at stage time 5,
values from the active clip at time 10, and at stage time 10, clip
values at time 20.
Parameters
clipTimes (Vec2dArray) –
clipSet (str) –
GetClipTimes(clipTimes) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
clipTimes (Vec2dArray) –
GetClips(clips) → bool
Dictionary that contains the definition of the clip sets on this prim.
Each entry in this dictionary defines a clip set: the entry’s key is
the name of the clip set and the entry’s value is a dictionary
containing the metadata that specifies the clips in the set.
See UsdClipsAPIInfoKeys for the keys used for each clip set’s
dictionary, or use the other API to set or get values for a given clip
set.
Parameters
clips (VtDictionary) –
GetInterpolateMissingClipValues(interpolate, clipSet) → bool
Parameters
interpolate (bool) –
clipSet (str) –
GetInterpolateMissingClipValues(interpolate) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
Parameters
interpolate (bool) –
static GetSchemaAttributeNames()
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) –
SetClipActive(activeClips, clipSet) → bool
Set the active clip metadata for the clip set named clipSet .
GetClipActive()
Parameters
activeClips (Vec2dArray) –
clipSet (str) –
SetClipActive(activeClips) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
activeClips (Vec2dArray) –
SetClipAssetPaths(assetPaths, clipSet) → bool
Set the clip asset paths for the clip set named clipSet .
GetClipAssetPaths()
Parameters
assetPaths (VtArray[AssetPath]) –
clipSet (str) –
SetClipAssetPaths(assetPaths) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
assetPaths (VtArray[AssetPath]) –
SetClipManifestAssetPath(manifestAssetPath, clipSet) → bool
Set the clip manifest asset path for this prim.
GetClipManifestAssetPath()
Parameters
manifestAssetPath (AssetPath) –
clipSet (str) –
SetClipManifestAssetPath(manifestAssetPath) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
manifestAssetPath (AssetPath) –
SetClipPrimPath(primPath, clipSet) → bool
Set the clip prim path for the clip set named clipSet .
GetClipPrimPath()
Parameters
primPath (str) –
clipSet (str) –
SetClipPrimPath(primPath) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
primPath (str) –
SetClipSets(clipSets) → bool
Set the clip sets list op for this prim.
GetClipSets
Parameters
clipSets (StringListOp) –
SetClipTemplateActiveOffset(clipTemplateActiveOffset, clipSet) → bool
Set the clip template offset for the clip set named clipSet .
GetClipTemplateActiveOffset
Parameters
clipTemplateActiveOffset (float) –
clipSet (str) –
SetClipTemplateActiveOffset(clipTemplateActiveOffset) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
clipTemplateActiveOffset (float) –
SetClipTemplateAssetPath(clipTemplateAssetPath, clipSet) → bool
Set the clip template asset path for the clip set named clipSet .
GetClipTemplateAssetPath
Parameters
clipTemplateAssetPath (str) –
clipSet (str) –
SetClipTemplateAssetPath(clipTemplateAssetPath) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
clipTemplateAssetPath (str) –
SetClipTemplateEndTime(clipTemplateEndTime, clipSet) → bool
Set the template end time for the clipset named clipSet .
GetClipTemplateEndTime()
Parameters
clipTemplateEndTime (float) –
clipSet (str) –
SetClipTemplateEndTime(clipTemplateEndTime) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
clipTemplateEndTime (float) –
SetClipTemplateStartTime(clipTemplateStartTime, clipSet) → bool
Set the template start time for the clip set named clipSet .
GetClipTemplateStartTime
Parameters
clipTemplateStartTime (float) –
clipSet (str) –
SetClipTemplateStartTime(clipTemplateStartTime) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
clipTemplateStartTime (float) –
SetClipTemplateStride(clipTemplateStride, clipSet) → bool
Set the template stride for the clip set named clipSet .
GetClipTemplateStride()
Parameters
clipTemplateStride (float) –
clipSet (str) –
SetClipTemplateStride(clipTemplateStride) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
clipTemplateStride (float) –
SetClipTimes(clipTimes, clipSet) → bool
Set the clip times metadata for this prim.
GetClipTimes()
Parameters
clipTimes (Vec2dArray) –
clipSet (str) –
SetClipTimes(clipTimes) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
UsdClipsAPISetNames
Parameters
clipTimes (Vec2dArray) –
SetClips(clips) → bool
Set the clips dictionary for this prim.
GetClips
Parameters
clips (VtDictionary) –
SetInterpolateMissingClipValues(interpolate, clipSet) → bool
Set whether missing clip values are interpolated from surrounding
clips.
Parameters
interpolate (bool) –
clipSet (str) –
SetInterpolateMissingClipValues(interpolate) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This function operates on the default clip set.
Parameters
interpolate (bool) –
class pxr.Usd.CollectionAPI
This is a general purpose API schema, used to describe a collection of
heterogeneous objects within the scene.”Objects”here may be prims or
properties belonging to prims or other collections. It’s an add-on
schema that can be applied many times to a prim with different
collection names.
A collection allows an enumeration of a set of paths to include and a
set of paths to exclude. Whether the descendants of an included path
are members of a collection are decided by its expansion rule (see
below). If the collection excludes paths that are not descendents of
included paths, the collection implicitly includes the root path</>.
If such a collection also includes paths that are not descendants of
the excluded paths, it is considered invalid, since the intention is
ambiguous.
All the properties authored by the schema are namespaced
under”collection:”. The given name of the collection provides
additional namespacing for the various per-collection properties,
which include the following:
uniform token collection: *collectionName* :expansionRule -
specified how the paths that are included in the collection must be
expanded to determine its members. Possible values include:
explicitOnly - only paths in the includes rel targets and not
in the excludes rel targets belong to the collection.
expandPrims - all the prims at or below the includes rel-
targets (and not under the excludes rel-targets) belong to the
collection. Any property paths included in the collection would, of
course, also be honored. This is the default behavior as it satisfies
most use cases.
expandPrimsAndProperties - like expandPrims, but also
includes all properties on all matched prims. We’re still not quite
sure what the use cases are for this, but you can use it to capture a
whole lot of UsdObjects very concisely.
bool collection: *collectionName* :includeRoot - boolean
attribute indicating whether the pseudo-root path</>should be counted
as one of the included target paths. The fallback is false. This
separate attribute is required because relationships cannot directly
target the root.
rel collection: *collectionName* :includes - specifies a list
of targets that are included in the collection. This can target prims
or properties directly. A collection can insert the rules of another
collection by making its includes relationship target the
collection:{collectionName} property on the owning prim of the
collection to be included. Such a property may not (and typically does
not) exist on the UsdStage, but it is the path that is used to refer
to the collection. It is important to note that including another
collection does not guarantee the contents of that collection will be
in the final collection; instead, the rules are merged. This means,
for example, an exclude entry may exclude a portion of the included
collection. When a collection includes one or more collections, the
order in which targets are added to the includes relationship may
become significant, if there are conflicting opinions about the same
path. Targets that are added later are considered to be stronger than
earlier targets for the same path.
rel collection: *collectionName* :excludes - specifies a list
of targets that are excluded below the included paths in this
collection. This can target prims or properties directly, but cannot
target another collection. This is to keep the membership
determining logic simple, efficient and easier to reason about.
Finally, it is invalid for a collection to exclude paths that are not
included in it. The presence of such”orphaned”excluded paths will not
affect the set of paths included in the collection, but may affect the
performance of querying membership of a path in the collection (see
UsdCollectionAPI::MembershipQuery::IsPathIncluded) or of enumerating
the objects belonging to the collection (see
UsdCollectionAPI::GetIncludedObjects).
Implicit inclusion
In some scenarios it is useful to express a collection that includes
everything except certain paths. To support this, a collection that
has an exclude that is not a descendent of any include will include
the root path</>.
Creating collections in C++
For any described attribute Fallback Value or Allowed Values
below that are text/tokens, the actual token is published and defined
in UsdTokens. So to set an attribute to the value”rightHanded”, use
UsdTokens->rightHanded as the value.
Methods:
Apply
classmethod Apply(prim, name) -> CollectionAPI
BlockCollection()
Blocks the targets of the includes and excludes relationships of the collection, making it<* empty if"includeRoot"is false (or unset) or.
CanApply
classmethod CanApply(prim, name, whyNot) -> bool
CanContainPropertyName
classmethod CanContainPropertyName(name) -> bool
ComputeIncludedObjects
classmethod ComputeIncludedObjects(query, stage, pred) -> set[Object]
ComputeIncludedPaths
classmethod ComputeIncludedPaths(query, stage, pred) -> SdfPathSet
ComputeMembershipQuery()
Computes and returns a UsdCollectionMembershipQuery object which can be used to query inclusion or exclusion of paths in the collection.
CreateExcludesRel()
See GetExcludesRel() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateExpansionRuleAttr(defaultValue, ...)
See GetExpansionRuleAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateIncludeRootAttr(defaultValue, ...)
See GetIncludeRootAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateIncludesRel()
See GetIncludesRel() , and also Create vs Get Property Methods for when to use Get vs Create.
ExcludePath(pathToExclude)
Excludes or removes the given path, pathToExclude from the collection.
Get
classmethod Get(stage, path) -> CollectionAPI
GetAll
classmethod GetAll(prim) -> list[CollectionAPI]
GetAllCollections
classmethod GetAllCollections(prim) -> list[CollectionAPI]
GetCollection
classmethod GetCollection(stage, collectionPath) -> CollectionAPI
GetCollectionPath()
Returns the canonical path that represents this collection.
GetExcludesRel()
Specifies a list of targets that are excluded below the included paths in this collection.
GetExpansionRuleAttr()
Specifies how the paths that are included in the collection must be expanded to determine its members.
GetIncludeRootAttr()
Boolean attribute indicating whether the pseudo-root path</>should be counted as one of the included target paths.
GetIncludesRel()
Specifies a list of targets that are included in the collection.
GetName()
Returns the name of this multiple-apply schema instance.
GetNamedCollectionPath
classmethod GetNamedCollectionPath(prim, collectionName) -> Path
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
HasNoIncludedPaths()
Returns true if the collection has nothing included in it.
IncludePath(pathToInclude)
Includes or adds the given path, pathToInclude in the collection.
IsCollectionAPIPath
classmethod IsCollectionAPIPath(path, name) -> bool
IsSchemaPropertyBaseName
classmethod IsSchemaPropertyBaseName(baseName) -> bool
ResetCollection()
Resets the collection by clearing both the includes and excludes targets of the collection in the current UsdEditTarget.
Validate(reason)
Validates the collection by checking the following rules:
static Apply()
classmethod Apply(prim, name) -> CollectionAPI
Applies this multiple-apply API schema to the given prim along
with the given instance name, name .
This information is stored by adding”CollectionAPI:<i>name</i>”to the
token-valued, listOp metadata apiSchemas on the prim. For example,
if name is’instance1’, the token’CollectionAPI:instance1’is added
to’apiSchemas’.
A valid UsdCollectionAPI object is returned upon success. An invalid
(or empty) UsdCollectionAPI 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) –
BlockCollection() → bool
Blocks the targets of the includes and excludes relationships of the
collection, making it<* empty if”includeRoot”is false (or unset)
or.
include everything if”includeRoot”is true. (assuming there are
no opinions in stronger edit targets).
static CanApply()
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) –
static CanContainPropertyName()
classmethod CanContainPropertyName(name) -> bool
Test whether a given name contains the”collection:”prefix.
Parameters
name (str) –
static ComputeIncludedObjects()
classmethod ComputeIncludedObjects(query, stage, pred) -> set[Object]
Returns all the usd objects that satisfy the predicate, pred in
the collection represented by the UsdCollectionMembershipQuery object,
query .
The results depends on the load state of the UsdStage, stage .
Parameters
query (UsdCollectionMembershipQuery) –
stage (UsdStageWeak) –
pred (_PrimFlagsPredicate) –
static ComputeIncludedPaths()
classmethod ComputeIncludedPaths(query, stage, pred) -> SdfPathSet
Returns all the paths that satisfy the predicate, pred in the
collection represented by the UsdCollectionMembershipQuery object,
query .
The result depends on the load state of the UsdStage, stage .
Parameters
query (UsdCollectionMembershipQuery) –
stage (UsdStageWeak) –
pred (_PrimFlagsPredicate) –
ComputeMembershipQuery() → UsdCollectionMembershipQuery
Computes and returns a UsdCollectionMembershipQuery object which can
be used to query inclusion or exclusion of paths in the collection.
ComputeMembershipQuery(query) -> None
Populates the UsdCollectionMembershipQuery object with data from this
collection, so it can be used to query inclusion or exclusion of
paths.
Parameters
query (UsdCollectionMembershipQuery) –
CreateExcludesRel() → Relationship
See GetExcludesRel() , and also Create vs Get Property Methods for
when to use Get vs Create.
CreateExpansionRuleAttr(defaultValue, writeSparsely) → Attribute
See GetExpansionRuleAttr() , 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) –
CreateIncludeRootAttr(defaultValue, writeSparsely) → Attribute
See GetIncludeRootAttr() , 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) –
CreateIncludesRel() → Relationship
See GetIncludesRel() , and also Create vs Get Property Methods for
when to use Get vs Create.
ExcludePath(pathToExclude) → bool
Excludes or removes the given path, pathToExclude from the
collection.
If the collection is empty, the collection becomes one that includes
all paths except the givne path. Otherwise, this does nothing if the
path is not included in the collection.
This does not modify the expansion-rule of the collection. Hence, if
the expansionRule is expandPrims or expandPrimsAndProperties, then
the descendants of pathToExclude will also be excluded from the
collection, unless explicitly included.
UsdCollectionAPI::IncludePath()
Parameters
pathToExclude (Path) –
static Get()
classmethod Get(stage, path) -> CollectionAPI
Return a UsdCollectionAPI 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>.collection:name.
This is shorthand for the following:
TfToken name = SdfPath::StripNamespace(path.GetToken());
UsdCollectionAPI(
stage->GetPrimAtPath(path.GetPrimPath()), name);
Parameters
stage (Stage) –
path (Path) –
Get(prim, name) -> CollectionAPI
Return a UsdCollectionAPI with name name holding the prim prim
.
Shorthand for UsdCollectionAPI(prim, name);
Parameters
prim (Prim) –
name (str) –
static GetAll()
classmethod GetAll(prim) -> list[CollectionAPI]
Return a vector of all named instances of UsdCollectionAPI on the
given prim .
Parameters
prim (Prim) –
static GetAllCollections()
classmethod GetAllCollections(prim) -> list[CollectionAPI]
Returns all the named collections on the given USD prim.
Deprecated
Use GetAll(prim) instead.
Parameters
prim (Prim) –
static GetCollection()
classmethod GetCollection(stage, collectionPath) -> CollectionAPI
Returns the collection represented by the given collection path,
collectionPath on the given USD stage.
Parameters
stage (Stage) –
collectionPath (Path) –
GetCollection(prim, name) -> CollectionAPI
Returns the schema object representing a collection named name on
the given prim .
Parameters
prim (Prim) –
name (str) –
GetCollectionPath() → Path
Returns the canonical path that represents this collection.
This points to a property named”collection:{collectionName}”on the
prim defining the collection (which won’t really exist as a property
on the UsdStage, but will be used to refer to the collection). This is
the path to be used to”include”this collection in another collection.
GetExcludesRel() → Relationship
Specifies a list of targets that are excluded below the included paths
in this collection.
This can target prims or properties directly, but cannot target
another collection. This is to keep the membership determining logic
simple, efficient and easier to reason about. Finally, it is invalid
for a collection to exclude paths that are not included in it. The
presence of such”orphaned”excluded paths will not affect the set of
paths included in the collection, but may affect the performance of
querying membership of a path in the collection (see
UsdCollectionAPI::MembershipQuery::IsPathIncluded) or of enumerating
the objects belonging to the collection (see
UsdCollectionAPI::GetIncludedObjects).
GetExpansionRuleAttr() → Attribute
Specifies how the paths that are included in the collection must be
expanded to determine its members.
Declaration
uniform token expansionRule ="expandPrims"
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
explicitOnly, expandPrims, expandPrimsAndProperties
GetIncludeRootAttr() → Attribute
Boolean attribute indicating whether the pseudo-root path</>should be
counted as one of the included target paths.
The fallback is false. This separate attribute is required because
relationships cannot directly target the root.
Declaration
uniform bool includeRoot
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
Variability
SdfVariabilityUniform
GetIncludesRel() → Relationship
Specifies a list of targets that are included in the collection.
This can target prims or properties directly. A collection can insert
the rules of another collection by making its includes relationship
target the collection:{collectionName} property on the owning prim
of the collection to be included
GetName() → str
Returns the name of this multiple-apply schema instance.
static GetNamedCollectionPath()
classmethod GetNamedCollectionPath(prim, collectionName) -> Path
Returns the canonical path to the collection named, name on the
given prim, prim .
GetCollectionPath()
Parameters
prim (Prim) –
collectionName (str) –
static GetSchemaAttributeNames()
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) –
HasNoIncludedPaths() → bool
Returns true if the collection has nothing included in it.
This requires both that the includes relationship have no target
paths, and that the includeRoot attribute be false. Note that there
may be cases where the collection has no objects included in it even
when HasNoIncludedPaths() returns false. For example, if the included
objects are unloaded or if the included objects are also excluded.
IncludePath(pathToInclude) → bool
Includes or adds the given path, pathToInclude in the collection.
This does nothing if the path is already included in the collection.
This does not modify the expansion-rule of the collection. Hence, if
the expansionRule is expandPrims or expandPrimsAndProperties, then
the descendants of pathToInclude will be also included in the
collection unless explicitly excluded.
UsdCollectionAPI::ExcludePath()
Parameters
pathToInclude (Path) –
static IsCollectionAPIPath()
classmethod IsCollectionAPIPath(path, name) -> bool
Checks if the given path path is of an API schema of type
CollectionAPI.
If so, it stores the instance name of the schema in name and
returns true. Otherwise, it returns false.
Parameters
path (Path) –
name (str) –
static IsSchemaPropertyBaseName()
classmethod IsSchemaPropertyBaseName(baseName) -> bool
Checks if the given name baseName is the base name of a property
of CollectionAPI.
Parameters
baseName (str) –
ResetCollection() → bool
Resets the collection by clearing both the includes and excludes
targets of the collection in the current UsdEditTarget.
This does not modify the”includeRoot”attribute which is used to
include or exclude everything (i.e. the pseudoRoot) in the USD stage.
Validate(reason) → bool
Validates the collection by checking the following rules:
a collection’s expansionRule should be one
of”explicitOnly”,”expandPrims”or”expandPrimsAndProperties”.
a collection should not have have a circular dependency on
another collection.
a collection should not have both includes and excludes among its
top-level rules
Parameters
reason (str) –
class pxr.Usd.CompositionArc
Methods:
GetArcType
GetIntroducingLayer
GetIntroducingListEditor
GetIntroducingNode
GetIntroducingPrimPath
GetTargetLayer
GetTargetNode
GetTargetPrimPath
HasSpecs
IsAncestral
IsImplicit
IsIntroducedInRootLayerPrimSpec
IsIntroducedInRootLayerStack
MakeResolveTargetStrongerThan
MakeResolveTargetUpTo
GetArcType()
GetIntroducingLayer()
GetIntroducingListEditor()
GetIntroducingNode()
GetIntroducingPrimPath()
GetTargetLayer()
GetTargetNode()
GetTargetPrimPath()
HasSpecs()
IsAncestral()
IsImplicit()
IsIntroducedInRootLayerPrimSpec()
IsIntroducedInRootLayerStack()
MakeResolveTargetStrongerThan()
MakeResolveTargetUpTo()
class pxr.Usd.CrateInfo
A class for introspecting the underlying qualities of
.usdc’crate’files, for diagnostic purposes.
Classes:
Section
SummaryStats
Methods:
GetFileVersion()
Return the file version.
GetSections()
Return the named file sections, their location and sizes in the file.
GetSoftwareVersion()
Return the software version.
GetSummaryStats()
Return summary statistics structure for this file.
Open
classmethod Open(fileName) -> CrateInfo
class Section
Attributes:
name
size
start
property name
property size
property start
class SummaryStats
Attributes:
numSpecs
numUniqueFieldSets
numUniqueFields
numUniquePaths
numUniqueStrings
numUniqueTokens
property numSpecs
property numUniqueFieldSets
property numUniqueFields
property numUniquePaths
property numUniqueStrings
property numUniqueTokens
GetFileVersion() → str
Return the file version.
GetSections() → list[Section]
Return the named file sections, their location and sizes in the file.
GetSoftwareVersion() → str
Return the software version.
GetSummaryStats() → SummaryStats
Return summary statistics structure for this file.
static Open()
classmethod Open(fileName) -> CrateInfo
Attempt to open and read fileName .
Parameters
fileName (str) –
class pxr.Usd.EditContext
A utility class to temporarily modify a stage’s current EditTarget
during an execution scope.
This is an”RAII”-like object meant to be used as an automatic local
variable. Upon construction, it sets a given stage’s EditTarget, and
upon destruction it restores the stage’s EditTarget to what it was
previously.
Example usage, temporarily overriding a stage’s EditTarget to direct
an edit to the stage’s session layer. When the ctx object expires,
it restores the stage’s EditTarget to whatever it was previously.
void SetVisState(const UsdPrim & prim, bool vis) {
UsdEditContext ctx(prim.GetStage(),
prim.GetStage()->GetSessionLayer());
prim.GetAttribute("visible").Set(vis);
}
Threading Note
When one thread is mutating a UsdStage, it is unsafe for any other
thread to either query or mutate it. Using this class with a stage in
such a way that it modifies the stage’s EditTarget constitutes a
mutation.
class pxr.Usd.EditTarget
Defines a mapping from scene graph paths to Sdf spec paths in a
SdfLayer where edits should be directed, or up to where to perform
partial composition.
A UsdEditTarget can represent an arbitrary point in a composition
graph for the purposes of placing edits and resolving values. This
enables editing and resolving across references, classes, variants,
and payloads.
In the simplest case, an EditTarget represents a single layer in a
stage’s local LayerStack. In this case, the mapping that transforms
scene graph paths to spec paths in the layer is the identity function.
That is, the UsdAttribute path’/World/Foo.avar’would map to the
SdfPropertySpec path’/World/Foo.avar’.
For a more complex example, suppose’/World/Foo’in’Shot.usda’is a
reference to’/Model’in’Model.usda’. One can construct a UsdEditTarget
that maps scene graph paths from the’Shot.usda’stage across the
reference to the appropriate paths in the’Model.usda’layer. For
example, the UsdAttribute ‘/World/Foo.avar’would map to the
SdfPropertySpec ‘/Model.avar’. Paths in the stage composed
at’Shot.usda’that weren’t prefixed by’/World/Foo’would not have a
valid mapping to’Model.usda’.
EditTargets may also work for any other kind of arc or series of arcs.
This allows for editing across variants, classes, and payloads, or in
a variant on the far side of a reference, for example.
In addition to mapping scene paths to spec paths for editing,
EditTargets may also be used to identify points in the composition
graph for partial composition. Though it doesn’t currently exist, a
UsdCompose API that takes UsdEditTarget arguments may someday be
provided.
For convenience and deployment ease, SdfLayerHandles will implicitly
convert to UsdEditTargets. A UsdEditTarget constructed in this way
means direct opinions in a layer in a stage’s local LayerStack.
Methods:
ComposeOver(weaker)
Return a new EditTarget composed over weaker.
ForLocalDirectVariant
classmethod ForLocalDirectVariant(layer, varSelPath) -> EditTarget
GetLayer()
Return the layer this EditTarget contains.
GetMapFunction()
Returns the PcpMapFunction representing the map from source specs (including any variant selections) to the stage.
GetPrimSpecForScenePath(scenePath)
Convenience function for getting the PrimSpec in the edit target's layer for scenePath.
GetPropertySpecForScenePath(scenePath)
param scenePath
GetSpecForScenePath(scenePath)
param scenePath
IsNull()
Return true if this EditTarget is null.
IsValid()
Return true if this EditTarget is valid, false otherwise.
MapToSpecPath(scenePath)
Map the provided scenePath into a SdfSpec path for the EditTarget's layer, according to the EditTarget's mapping.
ComposeOver(weaker) → EditTarget
Return a new EditTarget composed over weaker.
This is typically used to make an EditTarget”explicit”. For example,
an edit target with a layer but with no mapping and no LayerStack
identifier indicates a layer in the local LayerStack of a composed
scene. However, an EditTarget with the same layer but an explicit
identity mapping and the LayerStack identifier of the composed scene
may be desired. This can be obtained by composing a partial (e.g.
layer only) EditTarget over an explicit EditTarget with layer, mapping
and layer stack identifier.
Parameters
weaker (EditTarget) –
static ForLocalDirectVariant()
classmethod ForLocalDirectVariant(layer, varSelPath) -> EditTarget
Convenience constructor for editing a direct variant in a local
LayerStack.
The varSelPath must be a prim variant selection path (see
SdfPath::IsPrimVariantSelectionPath() ).
Parameters
layer (Layer) –
varSelPath (Path) –
GetLayer() → Layer
Return the layer this EditTarget contains.
GetLayer() -> Layer
GetMapFunction() → MapFunction
Returns the PcpMapFunction representing the map from source specs
(including any variant selections) to the stage.
GetPrimSpecForScenePath(scenePath) → PrimSpec
Convenience function for getting the PrimSpec in the edit target’s
layer for scenePath.
This is equivalent to
target.GetLayer()->GetPrimAtPath(target.MapToSpecPath(scenePath)) if
target has a valid layer. If this target IsNull or there is no valid
mapping from scenePath to a SdfPrimSpec path in the layer, return
null.
Parameters
scenePath (Path) –
GetPropertySpecForScenePath(scenePath) → PropertySpec
Parameters
scenePath (Path) –
GetSpecForScenePath(scenePath) → Spec
Parameters
scenePath (Path) –
IsNull() → bool
Return true if this EditTarget is null.
Null EditTargets map paths unchanged, and have no layer or LayerStack
identifier.
IsValid() → bool
Return true if this EditTarget is valid, false otherwise.
Edit targets are considered valid when they have a layer.
MapToSpecPath(scenePath) → Path
Map the provided scenePath into a SdfSpec path for the EditTarget’s
layer, according to the EditTarget’s mapping.
Null edit targets and EditTargets for which IsLocalLayer are true
return scenePath unchanged.
Parameters
scenePath (Path) –
class pxr.Usd.Inherits
A proxy class for applying listOp edits to the inherit paths list for
a prim.
All paths passed to the UsdInherits API are expected to be in the
namespace of the owning prim’s stage. Subroot prim inherit paths will
be translated from this namespace to the namespace of the current edit
target, if necessary. If a path cannot be translated, a coding error
will be issued and no changes will be made. Root prim inherit paths
will not be translated.
Methods:
AddInherit(primPath, position)
Adds a path to the inheritPaths listOp at the current EditTarget, in the position specified by position .
ClearInherits()
Removes the authored inheritPaths listOp edits at the current edit target.
GetAllDirectInherits()
Return all the paths in this prim's stage's local layer stack that would compose into this prim via direct inherits (excluding prim specs that would be composed into this prim due to inherits authored on ancestral prims) in strong-to-weak order.
GetPrim()
Return the prim this object is bound to.
RemoveInherit(primPath)
Removes the specified path from the inheritPaths listOp at the current EditTarget.
SetInherits(items)
Explicitly set the inherited paths, potentially blocking weaker opinions that add or remove items, returning true on success, false if the edit could not be performed.
AddInherit(primPath, position) → bool
Adds a path to the inheritPaths listOp at the current EditTarget, in
the position specified by position .
Parameters
primPath (Path) –
position (ListPosition) –
ClearInherits() → bool
Removes the authored inheritPaths listOp edits at the current edit
target.
GetAllDirectInherits() → list[SdfPath]
Return all the paths in this prim’s stage’s local layer stack that
would compose into this prim via direct inherits (excluding prim specs
that would be composed into this prim due to inherits authored on
ancestral prims) in strong-to-weak order.
Note that there currently may not be any scene description at these
paths on the stage. This returns all the potential places that such
opinions could appear.
GetPrim() → Prim
Return the prim this object is bound to.
GetPrim() -> Prim
RemoveInherit(primPath) → bool
Removes the specified path from the inheritPaths listOp at the current
EditTarget.
Parameters
primPath (Path) –
SetInherits(items) → bool
Explicitly set the inherited paths, potentially blocking weaker
opinions that add or remove items, returning true on success, false if
the edit could not be performed.
Parameters
items (list[SdfPath]) –
class pxr.Usd.InterpolationType
Methods:
GetValueFromName
Attributes:
allValues
static GetValueFromName()
allValues = (Usd.InterpolationTypeHeld, Usd.InterpolationTypeLinear)
class pxr.Usd.ListPosition
Methods:
GetValueFromName
Attributes:
allValues
static GetValueFromName()
allValues = (Usd.ListPositionFrontOfPrependList, Usd.ListPositionBackOfPrependList, Usd.ListPositionFrontOfAppendList, Usd.ListPositionBackOfAppendList)
class pxr.Usd.LoadPolicy
Methods:
GetValueFromName
Attributes:
allValues
static GetValueFromName()
allValues = (Usd.LoadWithDescendants, Usd.LoadWithoutDescendants)
class pxr.Usd.ModelAPI
UsdModelAPI is an API schema that provides an interface to a prim’s
model qualities, if it does, in fact, represent the root prim of a
model.
The first and foremost model quality is its kind, i.e. the metadata
that establishes it as a model (See KindRegistry). UsdModelAPI
provides various methods for setting and querying the prim’s kind, as
well as queries (also available on UsdPrim) for asking what category
of model the prim is. See Kind and Model-ness.
UsdModelAPI also provides access to a prim’s assetInfo data. While any
prim can host assetInfo, it is common that published (referenced)
assets are packaged as models, therefore it is convenient to provide
access to the one from the other.
Classes:
KindValidation
Option for validating queries to a prim's kind metadata.
Methods:
Get
classmethod Get(stage, path) -> ModelAPI
GetAssetIdentifier(identifier)
Returns the model's asset identifier as authored in the composed assetInfo dictionary.
GetAssetInfo(info)
Returns the model's composed assetInfo dictionary.
GetAssetName(assetName)
Returns the model's asset name from the composed assetInfo dictionary.
GetAssetVersion(version)
Returns the model's resolved asset version.
GetKind(kind)
Retrieve the authored kind for this prim.
GetPayloadAssetDependencies(assetDeps)
Returns the list of asset dependencies referenced inside the payload of the model.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
IsGroup()
Return true if this prim represents a model group, based on its kind metadata.
IsKind(baseKind, validation)
Return true if the prim's kind metadata is or inherits from baseKind as defined by the Kind Registry.
IsModel()
Return true if this prim represents a model, based on its kind metadata.
SetAssetIdentifier(identifier)
Sets the model's asset identifier to the given asset path, identifier .
SetAssetInfo(info)
Sets the model's assetInfo dictionary to info in the current edit target.
SetAssetName(assetName)
Sets the model's asset name to assetName .
SetAssetVersion(version)
Sets the model's asset version string.
SetKind(kind)
Author a kind for this prim, at the current UsdEditTarget.
SetPayloadAssetDependencies(assetDeps)
Sets the list of external asset dependencies referenced inside the payload of a model.
Attributes:
KindValidationModelHierarchy
KindValidationNone
class KindValidation
Option for validating queries to a prim’s kind metadata.
IsKind()
Methods:
GetValueFromName
Attributes:
allValues
static GetValueFromName()
allValues = (Usd.ModelAPI.KindValidationNone, Usd.ModelAPI.KindValidationModelHierarchy)
static Get()
classmethod Get(stage, path) -> ModelAPI
Return a UsdModelAPI 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:
UsdModelAPI(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetAssetIdentifier(identifier) → bool
Returns the model’s asset identifier as authored in the composed
assetInfo dictionary.
The asset identifier can be used to resolve the model’s root layer via
the asset resolver plugin.
Parameters
identifier (AssetPath) –
GetAssetInfo(info) → bool
Returns the model’s composed assetInfo dictionary.
The asset info dictionary is used to annotate models with various data
related to asset management. For example, asset name, identifier,
version etc.
The elements of this dictionary are composed element-wise, and are
nestable.
Parameters
info (VtDictionary) –
GetAssetName(assetName) → bool
Returns the model’s asset name from the composed assetInfo dictionary.
The asset name is the name of the asset, as would be used in a
database query.
Parameters
assetName (str) –
GetAssetVersion(version) → bool
Returns the model’s resolved asset version.
If you publish assets with an embedded version, then you may receive
that version string. You may, however, cause your authoring tools to
record the resolved version at the time at which a reference to the
asset was added to an aggregate, at the referencing site. In such a
pipeline, this API will always return that stronger opinion, even if
the asset is republished with a newer version, and even though that
newer version may be the one that is resolved when the UsdStage is
opened.
Parameters
version (str) –
GetKind(kind) → bool
Retrieve the authored kind for this prim.
To test whether the returned kind matches a particular
known”clientKind”:
TfToken kind;
bool isClientKind = UsdModelAPI(prim).GetKind(&kind) and
KindRegistry::IsA(kind, clientKind);
true if there was an authored kind that was successfully read,
otherwise false.
The Kind module for further details on how to use Kind for
classification, and how to extend the taxonomy.
Parameters
kind (str) –
GetPayloadAssetDependencies(assetDeps) → bool
Returns the list of asset dependencies referenced inside the payload
of the model.
This typically contains identifiers of external assets that are
referenced inside the model’s payload. When the model is created, this
list is compiled and set at the root of the model. This enables
efficient dependency analysis without the need to include the model’s
payload.
Parameters
assetDeps (VtArray[AssetPath]) –
static GetSchemaAttributeNames()
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) –
IsGroup() → bool
Return true if this prim represents a model group, based on its kind
metadata.
IsKind(baseKind, validation) → bool
Return true if the prim’s kind metadata is or inherits from
baseKind as defined by the Kind Registry.
If validation is KindValidationModelHierarchy (the default), then
this also ensures that if baseKind is a model, the prim conforms to
the rules of model hierarchy, as defined by IsModel. If set to
KindValidationNone, no additional validation is done.
IsModel and IsGroup are preferrable to IsKind(“model”) as they are
optimized for fast traversal.
If a prim’s model hierarchy is not valid, it is possible that that
prim.IsModel() and prim.IsKind(“model”,
Usd.ModelAPI.KindValidationNone) return different answers. (As a
corallary, this is also true for for prim.IsGroup())
Parameters
baseKind (str) –
validation (KindValidation) –
IsModel() → bool
Return true if this prim represents a model, based on its kind
metadata.
SetAssetIdentifier(identifier) → None
Sets the model’s asset identifier to the given asset path,
identifier .
GetAssetIdentifier()
Parameters
identifier (AssetPath) –
SetAssetInfo(info) → None
Sets the model’s assetInfo dictionary to info in the current edit
target.
Parameters
info (VtDictionary) –
SetAssetName(assetName) → None
Sets the model’s asset name to assetName .
GetAssetName()
Parameters
assetName (str) –
SetAssetVersion(version) → None
Sets the model’s asset version string.
GetAssetVersion()
Parameters
version (str) –
SetKind(kind) → bool
Author a kind for this prim, at the current UsdEditTarget.
true if kind was successully authored, otherwise false.
Parameters
kind (str) –
SetPayloadAssetDependencies(assetDeps) → None
Sets the list of external asset dependencies referenced inside the
payload of a model.
GetPayloadAssetDependencies()
Parameters
assetDeps (VtArray[AssetPath]) –
KindValidationModelHierarchy = Usd.ModelAPI.KindValidationModelHierarchy
KindValidationNone = Usd.ModelAPI.KindValidationNone
class pxr.Usd.Notice
Container class for Usd notices
Classes:
LayerMutingChanged
ObjectsChanged
StageContentsChanged
StageEditTargetChanged
StageNotice
class LayerMutingChanged
Methods:
GetMutedLayers
GetUnmutedLayers
GetMutedLayers()
GetUnmutedLayers()
class ObjectsChanged
Methods:
AffectedObject
ChangedInfoOnly
GetChangedFields
GetChangedInfoOnlyPaths
GetFastUpdates
GetResyncedPaths
HasChangedFields
ResyncedObject
AffectedObject()
ChangedInfoOnly()
GetChangedFields()
GetChangedInfoOnlyPaths()
GetFastUpdates()
GetResyncedPaths()
HasChangedFields()
ResyncedObject()
class StageContentsChanged
class StageEditTargetChanged
class StageNotice
Methods:
GetStage
GetStage()
class pxr.Usd.Object
Base class for Usd scenegraph objects, providing common API.
The commonality between the three types of scenegraph objects in Usd (
UsdPrim, UsdAttribute, UsdRelationship) is that they can all have
metadata. Other objects in the API ( UsdReferences, UsdVariantSets,
etc.) simply are kinds of metadata.
UsdObject ‘s API primarily provides schema for interacting with the
metadata common to all the scenegraph objects, as well as generic
access to metadata.
section Usd_UsdObject_Lifetime Lifetime Management and Object Validity
Every derived class of UsdObject supports explicit detection of object
validity through an explicit-bool operator, so client code should
always be able use objects safely, even across edits to the owning
UsdStage. UsdObject classes also perform some level of validity
checking upon every use, in order to facilitate debugging of unsafe
code, although we reserve the right to activate that behavior only in
debug builds, if it becomes compelling to do so for performance
reasons. This per-use checking will cause a fatal error upon failing
the inline validity check, with an error message describing the
namespace location of the dereferenced object on its owning UsdStage.
Methods:
ClearAssetInfo()
Clear the authored opinion for this object's assetInfo dictionary at the current EditTarget.
ClearAssetInfoByKey(keyPath)
Clear the authored opinion identified by keyPath in this object's assetInfo dictionary at the current EditTarget.
ClearCustomData()
Clear the authored opinion for this object's customData dictionary at the current EditTarget.
ClearCustomDataByKey(keyPath)
Clear the authored opinion identified by keyPath in this object's customData dictionary at the current EditTarget.
ClearDocumentation()
Clears this object's documentation (metadata) in the current EditTarget (only).
ClearHidden()
Clears the opinion for"Hidden"at the current EditTarget.
ClearMetadata(key)
Clears the authored key's value at the current EditTarget, returning false on error.
ClearMetadataByDictKey(key, keyPath)
Clear any authored value identified by key and keyPath at the current EditTarget.
GetAllAuthoredMetadata()
Resolve and return all user-authored metadata on this object, sorted lexicographically.
GetAllMetadata()
Resolve and return all metadata (including both authored and fallback values) on this object, sorted lexicographically.
GetAssetInfo()
Return this object's composed assetInfo dictionary.
GetAssetInfoByKey(keyPath)
Return the element identified by keyPath in this object's composed assetInfo dictionary.
GetCustomData()
Return this object's composed customData dictionary.
GetCustomDataByKey(keyPath)
Return the element identified by keyPath in this object's composed customData dictionary.
GetDescription()
Return a string that provides a brief summary description of the object.
GetDocumentation()
Return this object's documentation (metadata).
GetMetadata(key, value)
Resolve the requested metadatum named key into value , returning true on success.
GetMetadataByDictKey(key, keyPath, value)
Resolve the requested dictionary sub-element keyPath of dictionary-valued metadatum named key into value , returning true on success.
GetName()
Return the full name of this object, i.e.
GetNamespaceDelimiter
classmethod GetNamespaceDelimiter() -> char
GetPath()
Return the complete scene path to this object on its UsdStage, which may (UsdPrim) or may not (all other subclasses) return a cached result.
GetPrim()
Return this object if it is a prim, otherwise return this object's nearest owning prim.
GetPrimPath()
Return this object's path if this object is a prim, otherwise this object's nearest owning prim's path.
GetStage()
Return the stage that owns the object, and to whose state and lifetime this object's validity is tied.
HasAssetInfo()
Return true if there are any authored or fallback opinions for this object's assetInfo dictionary, false otherwise.
HasAssetInfoKey(keyPath)
Return true if there are any authored or fallback opinions for the element identified by keyPath in this object's assetInfo dictionary, false otherwise.
HasAuthoredAssetInfo()
Return true if there are any authored opinions (excluding fallback) for this object's assetInfo dictionary, false otherwise.
HasAuthoredAssetInfoKey(keyPath)
Return true if there are any authored opinions (excluding fallback) for the element identified by keyPath in this object's assetInfo dictionary, false otherwise.
HasAuthoredCustomData()
Return true if there are any authored opinions (excluding fallback) for this object's customData dictionary, false otherwise.
HasAuthoredCustomDataKey(keyPath)
Return true if there are any authored opinions (excluding fallback) for the element identified by keyPath in this object's customData dictionary, false otherwise.
HasAuthoredDocumentation()
Returns true if documentation was explicitly authored and GetMetadata() will return a meaningful value for documentation.
HasAuthoredHidden()
Returns true if hidden was explicitly authored and GetMetadata() will return a meaningful value for Hidden.
HasAuthoredMetadata(key)
Returns true if the key has an authored value, false if no value was authored or the only value available is a prim's metadata fallback.
HasAuthoredMetadataDictKey(key, keyPath)
Return true if there exists any authored opinion (excluding fallbacks) for key and keyPath .
HasCustomData()
Return true if there are any authored or fallback opinions for this object's customData dictionary, false otherwise.
HasCustomDataKey(keyPath)
Return true if there are any authored or fallback opinions for the element identified by keyPath in this object's customData dictionary, false otherwise.
HasMetadata(key)
Returns true if the key has a meaningful value, that is, if GetMetadata() will provide a value, either because it was authored or because a prim's metadata fallback will be provided.
HasMetadataDictKey(key, keyPath)
Return true if there exists any authored or fallback opinion for key and keyPath .
IsHidden()
Gets the value of the'hidden'metadata field, false if not authored.
IsValid()
Return true if this is a valid object, false otherwise.
SetAssetInfo(customData)
Author this object's assetInfo dictionary to assetInfo at the current EditTarget.
SetAssetInfoByKey(keyPath, value)
Author the element identified by keyPath in this object's assetInfo dictionary at the current EditTarget.
SetCustomData(customData)
Author this object's customData dictionary to customData at the current EditTarget.
SetCustomDataByKey(keyPath, value)
Author the element identified by keyPath in this object's customData dictionary at the current EditTarget.
SetDocumentation(doc)
Sets this object's documentation (metadata).
SetHidden(hidden)
Sets the value of the'hidden'metadata field.
SetMetadata(key, value)
Set metadatum key's value to value .
SetMetadataByDictKey(key, keyPath, value)
Author value to the field identified by key and keyPath at the current EditTarget.
ClearAssetInfo() → None
Clear the authored opinion for this object’s assetInfo dictionary at
the current EditTarget.
Do nothing if there is no such authored opinion.
ClearAssetInfoByKey(keyPath) → None
Clear the authored opinion identified by keyPath in this object’s
assetInfo dictionary at the current EditTarget.
The keyPath is a’:’-separated path identifying a value in
subdictionaries. Do nothing if there is no such authored opinion.
Parameters
keyPath (str) –
ClearCustomData() → None
Clear the authored opinion for this object’s customData dictionary at
the current EditTarget.
Do nothing if there is no such authored opinion.
ClearCustomDataByKey(keyPath) → None
Clear the authored opinion identified by keyPath in this object’s
customData dictionary at the current EditTarget.
The keyPath is a’:’-separated path identifying a value in
subdictionaries. Do nothing if there is no such authored opinion.
Parameters
keyPath (str) –
ClearDocumentation() → bool
Clears this object’s documentation (metadata) in the current
EditTarget (only).
Returns true on success.
ClearHidden() → bool
Clears the opinion for”Hidden”at the current EditTarget.
ClearMetadata(key) → bool
Clears the authored key’s value at the current EditTarget, returning
false on error.
If no value is present, this method is a no-op and returns true. It is
considered an error to call ClearMetadata when no spec is present for
this UsdObject, i.e. if the object has no presence in the current
UsdEditTarget.
General Metadata in USD
Parameters
key (str) –
ClearMetadataByDictKey(key, keyPath) → bool
Clear any authored value identified by key and keyPath at the
current EditTarget.
The keyPath is a’:’-separated path identifying a path in
subdictionaries stored in the metadata field at key . Return true
if the value is cleared successfully, false otherwise.
Dictionary-valued Metadata
Parameters
key (str) –
keyPath (str) –
GetAllAuthoredMetadata() → UsdMetadataValueMap
Resolve and return all user-authored metadata on this object, sorted
lexicographically.
This method does not return field keys for composition arcs, such as
references, inherits, payloads, sublayers, variants, or primChildren,
nor does it return the default value or timeSamples.
GetAllMetadata() → UsdMetadataValueMap
Resolve and return all metadata (including both authored and fallback
values) on this object, sorted lexicographically.
This method does not return field keys for composition arcs, such as
references, inherits, payloads, sublayers, variants, or primChildren,
nor does it return the default value or timeSamples.
GetAssetInfo() → VtDictionary
Return this object’s composed assetInfo dictionary.
The asset info dictionary is used to annotate objects 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.
The elements of this dictionary are composed element-wise, and are
nestable.
There is no means to query an assetInfo field’s valuetype other than
fetching the value and interrogating it.
GetAssetInfoByKey()
GetAssetInfoByKey(keyPath) → VtValue
Return the element identified by keyPath in this object’s composed
assetInfo dictionary.
The keyPath is a’:’-separated path identifying a value in
subdictionaries. This is in general more efficient than composing the
entire assetInfo dictionary than pulling out one sub-element.
Parameters
keyPath (str) –
GetCustomData() → VtDictionary
Return this object’s composed customData dictionary.
CustomData is”custom metadata”, a place for applications and users to
put uniform data that is entirely dynamic and subject to no schema
known to Usd. Unlike metadata like’hidden’,’displayName’etc, which
must be declared in code or a data file that is considered part of
one’s Usd distribution (e.g. a plugInfo.json file) to be used,
customData keys and the datatypes of their corresponding values are ad
hoc. No validation will ever be performed that values for the same key
in different layers are of the same type - strongest simply wins.
Dictionaries like customData are composed element-wise, and are
nestable.
There is no means to query a customData field’s valuetype other than
fetching the value and interrogating it.
GetCustomDataByKey()
GetCustomDataByKey(keyPath) → VtValue
Return the element identified by keyPath in this object’s composed
customData dictionary.
The keyPath is a’:’-separated path identifying a value in
subdictionaries. This is in general more efficient than composing the
entire customData dictionary and then pulling out one sub-element.
Parameters
keyPath (str) –
GetDescription() → str
Return a string that provides a brief summary description of the
object.
This method, along with IsValid() /bool_operator, is always safe to
call on a possibly-expired object, and the description will specify
whether the object is valid or expired, along with a few other bits of
data.
GetDocumentation() → str
Return this object’s documentation (metadata).
This returns the empty string if no documentation has been set.
SetDocumentation()
GetMetadata(key, value) → bool
Resolve the requested metadatum named key into value ,
returning true on success.
false if key was not resolvable, or if value's type T
differed from that of the resolved metadatum.
For any composition-related metadata, as enumerated in
GetAllMetadata() , this method will return only the strongest opinion
found, not applying the composition rules used by Pcp to process the
data. For more processed/composed views of composition data, please
refer to the specific interface classes, such as UsdReferences,
UsdInherits, UsdVariantSets, etc.
General Metadata in USD
Parameters
key (str) –
value (T) –
GetMetadata(key, value) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Type-erased access.
Parameters
key (str) –
value (VtValue) –
GetMetadataByDictKey(key, keyPath, value) → bool
Resolve the requested dictionary sub-element keyPath of
dictionary-valued metadatum named key into value , returning
true on success.
If you know you neeed just a small number of elements from a
dictionary, accessing them element-wise using this method can be much
less expensive than fetching the entire dictionary with
GetMetadata(key).
false if key was not resolvable, or if value's type T
differed from that of the resolved metadatum. The keyPath is
a’:’-separated path addressing an element in subdictionaries.
Dictionary-valued Metadata
Parameters
key (str) –
keyPath (str) –
value (T) –
GetMetadataByDictKey(key, keyPath, value) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
key (str) –
keyPath (str) –
value (VtValue) –
GetName() → str
Return the full name of this object, i.e.
the last component of its SdfPath in namespace.
This is equivalent to, but generally cheaper than, GetPath()
.GetNameToken()
static GetNamespaceDelimiter()
classmethod GetNamespaceDelimiter() -> char
GetPath() → Path
Return the complete scene path to this object on its UsdStage, which
may (UsdPrim) or may not (all other subclasses) return a cached
result.
GetPrim() → Prim
Return this object if it is a prim, otherwise return this object’s
nearest owning prim.
GetPrimPath() → Path
Return this object’s path if this object is a prim, otherwise this
object’s nearest owning prim’s path.
Equivalent to GetPrim() . GetPath() .
GetStage() → UsdStageWeak
Return the stage that owns the object, and to whose state and lifetime
this object’s validity is tied.
HasAssetInfo() → bool
Return true if there are any authored or fallback opinions for this
object’s assetInfo dictionary, false otherwise.
HasAssetInfoKey(keyPath) → bool
Return true if there are any authored or fallback opinions for the
element identified by keyPath in this object’s assetInfo
dictionary, false otherwise.
The keyPath is a’:’-separated path identifying a value in
subdictionaries.
Parameters
keyPath (str) –
HasAuthoredAssetInfo() → bool
Return true if there are any authored opinions (excluding fallback)
for this object’s assetInfo dictionary, false otherwise.
HasAuthoredAssetInfoKey(keyPath) → bool
Return true if there are any authored opinions (excluding fallback)
for the element identified by keyPath in this object’s assetInfo
dictionary, false otherwise.
The keyPath is a’:’-separated path identifying a value in
subdictionaries.
Parameters
keyPath (str) –
HasAuthoredCustomData() → bool
Return true if there are any authored opinions (excluding fallback)
for this object’s customData dictionary, false otherwise.
HasAuthoredCustomDataKey(keyPath) → bool
Return true if there are any authored opinions (excluding fallback)
for the element identified by keyPath in this object’s customData
dictionary, false otherwise.
The keyPath is a’:’-separated path identifying a value in
subdictionaries.
Parameters
keyPath (str) –
HasAuthoredDocumentation() → bool
Returns true if documentation was explicitly authored and
GetMetadata() will return a meaningful value for documentation.
HasAuthoredHidden() → bool
Returns true if hidden was explicitly authored and GetMetadata() will
return a meaningful value for Hidden.
Note that IsHidden returns a fallback value (false) when hidden is not
authored.
HasAuthoredMetadata(key) → bool
Returns true if the key has an authored value, false if no value was
authored or the only value available is a prim’s metadata fallback.
Parameters
key (str) –
HasAuthoredMetadataDictKey(key, keyPath) → bool
Return true if there exists any authored opinion (excluding fallbacks)
for key and keyPath .
The keyPath is a’:’-separated path identifying a value in
subdictionaries stored in the metadata field at key .
Dictionary-valued Metadata
Parameters
key (str) –
keyPath (str) –
HasCustomData() → bool
Return true if there are any authored or fallback opinions for this
object’s customData dictionary, false otherwise.
HasCustomDataKey(keyPath) → bool
Return true if there are any authored or fallback opinions for the
element identified by keyPath in this object’s customData
dictionary, false otherwise.
The keyPath is a’:’-separated path identifying a value in
subdictionaries.
Parameters
keyPath (str) –
HasMetadata(key) → bool
Returns true if the key has a meaningful value, that is, if
GetMetadata() will provide a value, either because it was authored or
because a prim’s metadata fallback will be provided.
Parameters
key (str) –
HasMetadataDictKey(key, keyPath) → bool
Return true if there exists any authored or fallback opinion for
key and keyPath .
The keyPath is a’:’-separated path identifying a value in
subdictionaries stored in the metadata field at key .
Dictionary-valued Metadata
Parameters
key (str) –
keyPath (str) –
IsHidden() → bool
Gets the value of the’hidden’metadata field, false if not authored.
When an object is marked as hidden, it is an indicator to clients who
generically display objects (such as GUI widgets) that this object
should not be included, unless explicitly asked for. Although this is
just a hint and thus up to each application to interpret, we use it
primarily as a way of simplifying hierarchy displays, by hiding only
the representation of the object itself, not its subtree,
instead”pulling up”everything below it one level in the hierarchical
nesting.
Note again that this is a hint for UI only - it should not be
interpreted by any renderer as making a prim invisible to drawing.
IsValid() → bool
Return true if this is a valid object, false otherwise.
SetAssetInfo(customData) → None
Author this object’s assetInfo dictionary to assetInfo at the
current EditTarget.
Parameters
customData (VtDictionary) –
SetAssetInfoByKey(keyPath, value) → None
Author the element identified by keyPath in this object’s
assetInfo dictionary at the current EditTarget.
The keyPath is a’:’-separated path identifying a value in
subdictionaries.
Parameters
keyPath (str) –
value (VtValue) –
SetCustomData(customData) → None
Author this object’s customData dictionary to customData at the
current EditTarget.
Parameters
customData (VtDictionary) –
SetCustomDataByKey(keyPath, value) → None
Author the element identified by keyPath in this object’s
customData dictionary at the current EditTarget.
The keyPath is a’:’-separated path identifying a value in
subdictionaries.
Parameters
keyPath (str) –
value (VtValue) –
SetDocumentation(doc) → bool
Sets this object’s documentation (metadata). Returns true on success.
Parameters
doc (str) –
SetHidden(hidden) → bool
Sets the value of the’hidden’metadata field.
See IsHidden() for details.
Parameters
hidden (bool) –
SetMetadata(key, value) → bool
Set metadatum key's value to value .
false if value's type does not match the schema type for key .
General Metadata in USD
Parameters
key (str) –
value (T) –
SetMetadata(key, value) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
key (str) –
value (VtValue) –
SetMetadataByDictKey(key, keyPath, value) → bool
Author value to the field identified by key and keyPath at
the current EditTarget.
The keyPath is a’:’-separated path identifying a value in
subdictionaries stored in the metadata field at key . Return true
if the value is authored successfully, false otherwise.
Dictionary-valued Metadata
Parameters
key (str) –
keyPath (str) –
value (T) –
SetMetadataByDictKey(key, keyPath, value) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
key (str) –
keyPath (str) –
value (VtValue) –
class pxr.Usd.Payloads
UsdPayloads provides an interface to authoring and introspecting
payloads. Payloads behave the same as Usd references except that
payloads can be optionally loaded.
Methods:
AddInternalPayload(primPath, layerOffset, ...)
Add an internal payload to the specified prim.
AddPayload(payload, position)
Adds a payload to the payload listOp at the current EditTarget, in the position specified by position .
ClearPayloads()
Removes the authored payload listOp edits at the current EditTarget.
GetPrim()
Return the prim this object is bound to.
RemovePayload(ref)
Removes the specified payload from the payloads listOp at the current EditTarget.
SetPayloads(items)
Explicitly set the payloads, potentially blocking weaker opinions that add or remove items.
AddInternalPayload(primPath, layerOffset, position) → bool
Add an internal payload to the specified prim.
Internal Payloads
Parameters
primPath (Path) –
layerOffset (LayerOffset) –
position (ListPosition) –
AddPayload(payload, position) → bool
Adds a payload to the payload listOp at the current EditTarget, in the
position specified by position .
Why adding references may fail for explanation of expectations on
payload and what return values and errors to expect, and ListOps
and List Editing for details on list editing and composition of
listOps.
Parameters
payload (Payload) –
position (ListPosition) –
AddPayload(identifier, primPath, layerOffset, position) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
identifier (str) –
primPath (Path) –
layerOffset (LayerOffset) –
position (ListPosition) –
AddPayload(identifier, layerOffset, position) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Payloads Without Prim Paths
Parameters
identifier (str) –
layerOffset (LayerOffset) –
position (ListPosition) –
ClearPayloads() → bool
Removes the authored payload listOp edits at the current EditTarget.
The same caveats for Remove() apply to Clear(). In fact, Clear() may
actually increase the number of composed payloads, if the listOp being
cleared contained the”remove”operator.
ListOps and List Editing
GetPrim() → Prim
Return the prim this object is bound to.
GetPrim() -> Prim
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
RemovePayload(ref) → bool
Removes the specified payload from the payloads listOp at the current
EditTarget.
This does not necessarily eliminate the payload completely, as it may
be added or set in another layer in the same LayerStack as the current
EditTarget.
ListOps and List Editing
Parameters
ref (Payload) –
SetPayloads(items) → bool
Explicitly set the payloads, potentially blocking weaker opinions that
add or remove items.
Why adding payloads may fail for explanation of expectations on
items and what return values and errors to expect, and ListOps and
List Editing for details on list editing and composition of listOps.
Parameters
items (list[SdfPayload]) –
class pxr.Usd.Prim
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is
the embodiment of a”Prim”as described in the Universal Scene
Description Composition Compendium
A UsdPrim is the principal container of other types of scene
description. It provides API for accessing and creating all of the
contained kinds of scene description, which include:
UsdVariantSets - all VariantSets on the prim ( GetVariantSets() ,
GetVariantSet() )
UsdReferences - all references on the prim ( GetReferences() )
UsdInherits - all inherits on the prim ( GetInherits() )
UsdSpecializes - all specializes on the prim ( GetSpecializes() )
As well as access to the API objects for properties contained within
the prim - UsdPrim as well as all of the following classes are
subclasses of UsdObject :
UsdProperty - generic access to all attributes and relationships.
A UsdProperty can be queried and cast to a UsdAttribute or
UsdRelationship using UsdObject::Is<>() and UsdObject::As<>() . (
GetPropertyNames() , GetProperties() , GetPropertiesInNamespace() ,
GetPropertyOrder() , SetPropertyOrder() )
UsdAttribute - access to default and timesampled attribute
values, as well as value resolution information, and attribute-
specific metadata ( CreateAttribute() , GetAttribute() ,
GetAttributes() , HasAttribute() )
UsdRelationship - access to authoring and resolving relationships
to other prims and properties ( CreateRelationship() ,
GetRelationship() , GetRelationships() , HasRelationship() )
UsdPrim also provides access to iteration through its prim children,
optionally making use of the prim predicates facility ( GetChildren()
, GetAllChildren() , GetFilteredChildren() ).
## Management
Clients acquire UsdPrim objects, which act like weak/guarded pointers
to persistent objects owned and managed by their originating UsdStage.
We provide the following guarantees for a UsdPrim acquired via
UsdStage::GetPrimAtPath() or UsdStage::OverridePrim() or
UsdStage::DefinePrim() :
As long as no further mutations to the structure of the UsdStage
are made, the UsdPrim will still be valid. Loading and Unloading are
considered structural mutations.
When the UsdStage ‘s structure is mutated, the thread
performing the mutation will receive a UsdNotice::ObjectsChanged
notice after the stage has been reconfigured, which provides details
as to what prims may have been created or destroyed, and what prims
may simply have changed in some structural way.
Prim access in”reader”threads should be limited to GetPrimAtPath() ,
which will never cause a mutation to the Stage or its layers.
Please refer to UsdNotice for a listing of the events that could cause
UsdNotice::ObjectsChanged to be emitted.
Methods:
AddAppliedSchema(appliedSchemaName)
Adds the applied API schema name token appliedSchemaName to the apiSchemas metadata for this prim at the current edit target.
ApplyAPI()
Applies a single-apply API schema with the given C++ type'SchemaType'to this prim in the current edit target.
CanApplyAPI(whyNot)
}@
ClearActive()
Remove the authored'active'opinion at the current EditTarget.
ClearChildrenReorder()
Remove the opinion for the metadata used to reorder children of this prim at the current EditTarget.
ClearInstanceable()
Remove the authored'instanceable'opinion at the current EditTarget.
ClearPayload()
Deprecated
ClearPropertyOrder()
Remove the opinion for propertyOrder metadata on this prim at the current EditTarget.
ClearTypeName()
Clear the opinion for this Prim's typeName at the current edit target.
ComputeExpandedPrimIndex()
Compute the prim index containing all sites that could contribute opinions to this prim.
CreateAttribute(name, typeName, custom, ...)
Author scene description for the attribute named attrName at the current EditTarget if none already exists.
CreateRelationship(relName, custom)
Author scene description for the relationship named relName at the current EditTarget if none already exists.
FindAllAttributeConnectionPaths(pred, ...)
Search the prim subtree rooted at this prim for attributes for which predicate returns true, collect their connection source paths and return them in an arbitrary order.
FindAllRelationshipTargetPaths(pred, ...)
Search the prim subtree rooted at this prim for relationships for which predicate returns true, collect their target paths and return them in an arbitrary order.
GetAllChildren()
Return all this prim's children as an iterable range.
GetAllChildrenNames()
Return the names of the child prims in the order they appear when iterating over GetAllChildren.
GetAppliedSchemas()
Return a vector containing the names of API schemas which have been applied to this prim.
GetAttribute(attrName)
Return a UsdAttribute with the name attrName.
GetAttributeAtPath(path)
Returns the attribute at path on the same stage as this prim.
GetAttributes()
Like GetProperties() , but exclude all relationships from the result.
GetAuthoredAttributes()
Like GetAttributes() , but exclude attributes without authored scene description from the result.
GetAuthoredProperties(predicate)
Return this prim's properties (attributes and relationships) that have authored scene description, ordered by name according to the strongest propertyOrder statement in scene description if one exists, otherwise ordered according to TfDictionaryLessThan.
GetAuthoredPropertiesInNamespace(namespaces)
Like GetPropertiesInNamespace() , but exclude properties that do not have authored scene description from the result.
GetAuthoredPropertyNames(predicate)
Return this prim's property names (attributes and relationships) that have authored scene description, ordered according to the strongest propertyOrder statement in scene description if one exists, otherwise ordered according to TfDictionaryLessThan.
GetAuthoredRelationships()
Like GetRelationships() , but exclude relationships without authored scene description from the result.
GetChild(name)
Return this prim's direct child named name if it has one, otherwise return an invalid UsdPrim.
GetChildren()
Return this prim's active, loaded, defined, non-abstract children as an iterable range.
GetChildrenNames()
Return the names of the child prims in the order they appear when iterating over GetChildren.
GetChildrenReorder()
Return the strongest opinion for the metadata used to reorder children of this prim.
GetFilteredChildren(predicate)
Return a subset of all of this prim's children filtered by predicate as an iterable range.
GetFilteredChildrenNames(predicate)
Return the names of the child prims in the order they appear when iterating over GetFilteredChildren( predicate ).
GetFilteredNextSibling(predicate)
Return this prim's next sibling that matches predicate if it has one, otherwise return the invalid UsdPrim.
GetInherits()
Return a UsdInherits object that allows one to add, remove, or mutate inherits at the currently set UsdEditTarget.
GetInstances()
If this prim is a prototype prim, returns all prims that are instances of this prototype.
GetNextSibling()
Return this prim's next active, loaded, defined, non-abstract sibling if it has one, otherwise return an invalid UsdPrim.
GetObjectAtPath(path)
Returns the object at path on the same stage as this prim.
GetParent()
Return this prim's parent prim.
GetPayloads()
Return a UsdPayloads object that allows one to add, remove, or mutate payloads at the currently set UsdEditTarget.
GetPrimAtPath(path)
Returns the prim at path on the same stage as this prim.
GetPrimDefinition()
Return this prim's definition based on the prim's type if the type is a registered prim type.
GetPrimInPrototype()
If this prim is an instance proxy, return the UsdPrim for the corresponding prim in the instance's prototype.
GetPrimIndex()
Return the cached prim index containing all sites that can contribute opinions to this prim.
GetPrimStack()
Return all the authored SdfPrimSpecs that may contain opinions for this prim in order from strong to weak.
GetPrimStackWithLayerOffsets()
Return all the authored SdfPrimSpecs that may contain opinions for this prim in order from strong to weak paired with the cumulative layer offset from the stage's root layer to the layer containing the prim spec.
GetPrimTypeInfo()
Return the prim's full type info composed from its type name, applied API schemas, and any fallback types defined on the stage for unrecognized prim type names.
GetProperties(predicate)
Return all of this prim's properties (attributes and relationships), including all builtin properties, ordered by name according to the strongest propertyOrder statement in scene description if one exists, otherwise ordered according to TfDictionaryLessThan.
GetPropertiesInNamespace(namespaces)
Return this prim's properties that are inside the given property namespace ordered according to the strongest propertyOrder statement in scene description if one exists, otherwise ordered according to TfDictionaryLessThan.
GetProperty(propName)
Return a UsdProperty with the name propName.
GetPropertyAtPath(path)
Returns the property at path on the same stage as this prim.
GetPropertyNames(predicate)
Return all of this prim's property names (attributes and relationships), including all builtin properties.
GetPropertyOrder()
Return the strongest propertyOrder metadata value authored on this prim.
GetPrototype()
If this prim is an instance, return the UsdPrim for the corresponding prototype.
GetReferences()
Return a UsdReferences object that allows one to add, remove, or mutate references at the currently set UsdEditTarget.
GetRelationship(relName)
Return a UsdRelationship with the name relName.
GetRelationshipAtPath(path)
Returns the relationship at path on the same stage as this prim.
GetRelationships()
Like GetProperties() , but exclude all attributes from the result.
GetSpecializes()
Return a UsdSpecializes object that allows one to add, remove, or mutate specializes at the currently set UsdEditTarget.
GetSpecifier()
Return this prim's composed specifier.
GetTypeName()
Return this prim's composed type name.
GetVariantSet(variantSetName)
Retrieve a specifically named VariantSet for editing or constructing a UsdEditTarget.
GetVariantSets()
Return a UsdVariantSets object representing all the VariantSets present on this prim.
HasAPI()
Using HasAPI in C++
HasAttribute(attrName)
Return true if this prim has an attribute named attrName , false otherwise.
HasAuthoredActive()
Return true if this prim has an authored opinion for'active', false otherwise.
HasAuthoredInherits()
Return true if this prim has any authored inherits.
HasAuthoredInstanceable()
Return true if this prim has an authored opinion for'instanceable', false otherwise.
HasAuthoredPayloads()
Return true if this prim has any authored payloads.
HasAuthoredReferences()
Return true if this prim has any authored references.
HasAuthoredSpecializes()
Returns true if this prim has any authored specializes.
HasAuthoredTypeName()
Return true if a typeName has been authored.
HasDefiningSpecifier()
Return true if this prim has a specifier of type SdfSpecifierDef or SdfSpecifierClass.
HasPayload()
Deprecated
HasProperty(propName)
Return true if this prim has an property named propName , false otherwise.
HasRelationship(relName)
Return true if this prim has a relationship named relName , false otherwise.
HasVariantSets()
Return true if this prim has any authored VariantSets.
IsA()
Return true if the prim's schema type, is or inherits schema type T.
IsAbstract()
Return true if this prim or any of its ancestors is a class.
IsActive()
Return true if this prim is active, meaning neither it nor any of its ancestors have active=false.
IsDefined()
Return true if this prim and all its ancestors have defining specifiers, false otherwise.
IsGroup()
Return true if this prim is a model group based on its kind metadata, false otherwise.
IsInPrototype()
Return true if this prim is a prototype prim or a descendant of a prototype prim, false otherwise.
IsInstance()
Return true if this prim is an instance of a prototype, false otherwise.
IsInstanceProxy()
Return true if this prim is an instance proxy, false otherwise.
IsInstanceable()
Return true if this prim has been marked as instanceable.
IsLoaded()
Return true if this prim is active, and either it is loadable and it is loaded, or its nearest loadable ancestor is loaded, or it has no loadable ancestor; false otherwise.
IsModel()
Return true if this prim is a model based on its kind metadata, false otherwise.
IsPathInPrototype
classmethod IsPathInPrototype(path) -> bool
IsPrototype()
Return true if this prim is an instancing prototype prim, false otherwise.
IsPrototypePath
classmethod IsPrototypePath(path) -> bool
IsPseudoRoot()
Returns true if the prim is the pseudo root.
Load(policy)
Load this prim, all its ancestors, and by default all its descendants.
MakeResolveTargetStrongerThanEditTarget(...)
Creates and returns a resolve target that, when passed to a UsdAttributeQuery for one of this prim's attributes, causes value resolution to only consider specs that are stronger than the spec that would be authored for this prim when using the given editTarget .
MakeResolveTargetUpToEditTarget(editTarget)
Creates and returns a resolve target that, when passed to a UsdAttributeQuery for one of this prim's attributes, causes value resolution to only consider weaker specs up to and including the spec that would be authored for this prim when using the given editTarget .
RemoveAPI()
Removes a single-apply API schema with the given C++ type'SchemaType'from this prim in the current edit target.
RemoveAppliedSchema(appliedSchemaName)
Removes the applied API schema name token appliedSchemaName from the apiSchemas metadata for this prim at the current edit target.
RemoveProperty(propName)
Remove all scene description for the property with the given propName in the current UsdEditTarget.
SetActive(active)
Author'active'metadata for this prim at the current EditTarget.
SetChildrenReorder(order)
Author an opinion for the metadata used to reorder children of this prim at the current EditTarget.
SetInstanceable(instanceable)
Author'instanceable'metadata for this prim at the current EditTarget.
SetPayload(payload)
Deprecated
SetPropertyOrder(order)
Author an opinion for propertyOrder metadata on this prim at the current EditTarget.
SetSpecifier(specifier)
Author an opinion for this Prim's specifier at the current edit target.
SetTypeName(typeName)
Author this Prim's typeName at the current EditTarget.
Unload()
Unloads this prim and all its descendants.
AddAppliedSchema(appliedSchemaName) → bool
Adds the applied API schema name token appliedSchemaName to the
apiSchemas metadata for this prim at the current edit target.
For multiple-apply schemas the name token should include the instance
name for the applied schema, for example’CollectionAPI:plasticStuff’.
The name will only be added if the list operation at the edit target
does not already have this applied schema in its explicit, prepended,
or appended lists and is always added to the end of either the
prepended or explicit items.
Returns true upon success or if the API schema is already applied in
the current edit target.
An error is issued and false returned for any of the following
conditions:
this prim is not a valid prim for editing
this prim is valid, but cannot be reached or overridden in the
current edit target
the schema name cannot be added to the apiSchemas listOp metadata
Unlike ApplyAPI this method does not require that the name token
refer to a valid API schema type. ApplyAPI is the preferred method for
applying valid API schemas.
Parameters
appliedSchemaName (str) –
ApplyAPI() → bool
Applies a single-apply API schema with the given C++
type’SchemaType’to this prim in the current edit target.
This information is stored by adding the API schema’s name token to
the token-valued, listOp metadata apiSchemas on this prim.
Returns true upon success or if the API schema is already applied in
the current edit target.
An error is issued and false returned for any of the following
conditions:
this prim is not a valid prim for editing
this prim is valid, but cannot be reached or overridden in the
current edit target
the schema name cannot be added to the apiSchemas listOp metadata
ApplyAPI(schemaType) -> bool
Non-templated overload of the templated ApplyAPI above.
This function behaves exactly like the templated ApplyAPI except for
the runtime schemaType validation which happens at compile time in the
templated version. This method is provided for python clients. Use of
the templated ApplyAPI is preferred.
Parameters
schemaType (Type) –
ApplyAPI(instanceName) -> bool
Applies a multiple-apply API schema with the given C++
type’SchemaType’and instance name instanceName to this prim in the
current edit target.
This information is stored in the token-valued, listOp metadata
apiSchemas on this prim. For example, if SchemaType is’
UsdCollectionAPI ‘and instanceName is’plasticStuff’, the
name’CollectionAPI:plasticStuff’is added to the’apiSchemas’listOp
metadata.
Returns true upon success or if the API schema is already applied with
this instanceName in the current edit target.
An error is issued and false returned for any of the following
conditions:
instanceName is empty
this prim is not a valid prim for editing
this prim is valid, but cannot be reached or overridden in the
current edit target
the schema name cannot be added to the apiSchemas listOp metadata
Parameters
instanceName (str) –
ApplyAPI(schemaType, instanceName) -> bool
Non-templated overload of the templated ApplyAPI above.
This function behaves exactly like the templated ApplyAPI except for
the runtime schemaType validation which happens at compile time in the
templated version. This method is provided for python clients. Use of
the templated ApplyAPI is preferred.
Parameters
schemaType (Type) –
instanceName (str) –
CanApplyAPI(whyNot) → bool
}@
Returns whether a single-apply API schema with the given C++
type’SchemaType’can be applied to this prim. If the return value is
false, and whyNot is provided, the reason the schema cannot be
applied is written to whyNot.
Whether the schema can be applied is determined by the schema type
definition which may specify that the API schema can only be applied
to certain prim types.
The return value of this function only indicates whether it would be
valid to apply this schema to the prim. It has no bearing on whether
calling ApplyAPI will be successful or not.
Parameters
whyNot (str) –
CanApplyAPI(schemaType, whyNot) -> bool
Non-templated overload of the templated CanApplyAPI above.
This function behaves exactly like the templated CanApplyAPI except
for the runtime schemaType validation which happens at compile time in
the templated version. This method is provided for python clients. Use
of the templated CanApplyAPI is preferred.
Parameters
schemaType (Type) –
whyNot (str) –
CanApplyAPI(instanceName, whyNot) -> bool
Returns whether a multiple-apply API schema with the given C++
type’SchemaType’can be applied to this prim with the given
instanceName .
If the return value is false, and whyNot is provided, the reason
the schema cannot be applied is written to whyNot.
Whether the schema can be applied is determined by the schema type
definition which may specify that the API schema can only be applied
to certain prim types. It also determines whether the instance name is
a valid instance name for the multiple apply schema.
The return value of this function only indicates whether it would be
valid to apply this schema to the prim. It has no bearing on whether
calling ApplyAPI will be successful or not.
Parameters
instanceName (str) –
whyNot (str) –
CanApplyAPI(schemaType, instanceName, whyNot) -> bool
Non-templated overload of the templated CanApplyAPI above.
This function behaves exactly like the templated CanApplyAPI except
for the runtime schemaType validation which happens at compile time in
the templated version. This method is provided for python clients. Use
of the templated CanApplyAPI is preferred.
Parameters
schemaType (Type) –
instanceName (str) –
whyNot (str) –
ClearActive() → bool
Remove the authored’active’opinion at the current EditTarget.
Do nothing if there is no authored opinion.
See How”active”Affects Prims on a UsdStage for the effects of
activating or deactivating a prim.
ClearChildrenReorder() → None
Remove the opinion for the metadata used to reorder children of this
prim at the current EditTarget.
ClearInstanceable() → bool
Remove the authored’instanceable’opinion at the current EditTarget.
Do nothing if there is no authored opinion.
ClearPayload() → bool
Deprecated
Clears the payload at the current EditTarget for this prim. Return
false if the payload could not be cleared.
ClearPropertyOrder() → None
Remove the opinion for propertyOrder metadata on this prim at the
current EditTarget.
ClearTypeName() → bool
Clear the opinion for this Prim’s typeName at the current edit target.
ComputeExpandedPrimIndex() → PrimIndex
Compute the prim index containing all sites that could contribute
opinions to this prim.
This function is similar to UsdPrim::GetPrimIndex. However, the
returned prim index includes all sites that could possibly contribute
opinions to this prim, not just the sites that currently do so. This
is useful in certain situations; for example, this could be used to
generate a list of sites where clients could make edits to affect this
prim, or for debugging purposes.
This function may be relatively slow, since it will recompute the prim
index on every call. Clients should prefer UsdPrim::GetPrimIndex
unless the additional site information is truly needed.
CreateAttribute(name, typeName, custom, variability) → Attribute
Author scene description for the attribute named attrName at the
current EditTarget if none already exists.
Return a valid attribute if scene description was successfully
authored or if it already existed, return invalid attribute otherwise.
Note that the supplied typeName and custom arguments are only used
in one specific case. See below for details.
Suggested use:
if (UsdAttribute myAttr = prim.CreateAttribute(\.\.\.)) {
// success.
}
To call this, GetPrim() must return a valid prim.
If a spec for this attribute already exists at the current edit
target, do nothing.
If a spec for attrName of a different spec type (e.g. a
relationship) exists at the current EditTarget, issue an error.
If name refers to a builtin attribute according to the prim’s
definition, author an attribute spec with required metadata from the
definition.
If name refers to a builtin relationship, issue an error.
If there exists an absolute strongest authored attribute spec for
attrName, author an attribute spec at the current EditTarget by
copying required metadata from that strongest spec.
If there exists an absolute strongest authored relationship spec
for attrName, issue an error.
Otherwise author an attribute spec at the current EditTarget
using the provided typeName and custom for the required metadata
fields. Note that these supplied arguments are only ever used in this
particular circumstance, in all other cases they are ignored.
Parameters
name (str) –
typeName (ValueTypeName) –
custom (bool) –
variability (Variability) –
CreateAttribute(name, typeName, variability) -> Attribute
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Create a custom attribute with name , typeName and
variability .
Parameters
name (str) –
typeName (ValueTypeName) –
variability (Variability) –
CreateAttribute(nameElts, typeName, custom, variability) -> Attribute
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This overload of CreateAttribute() accepts a vector of name components
used to construct a namespaced property name.
For details, see Names, Namespace Ordering, and Property Namespaces
Parameters
nameElts (list[str]) –
typeName (ValueTypeName) –
custom (bool) –
variability (Variability) –
CreateAttribute(nameElts, typeName, variability) -> Attribute
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Create a custom attribute with nameElts , typeName , and
variability .
Parameters
nameElts (list[str]) –
typeName (ValueTypeName) –
variability (Variability) –
CreateRelationship(relName, custom) → Relationship
Author scene description for the relationship named relName at the
current EditTarget if none already exists.
Return a valid relationship if scene description was successfully
authored or if it already existed, return an invalid relationship
otherwise.
Suggested use:
if (UsdRelationship myRel = prim.CreateRelationship(\.\.\.)) {
// success.
}
To call this, GetPrim() must return a valid prim.
If a spec for this relationship already exists at the current
edit target, do nothing.
If a spec for relName of a different spec type (e.g. an
attribute) exists at the current EditTarget, issue an error.
If name refers to a builtin relationship according to the
prim’s definition, author a relationship spec with required metadata
from the definition.
If name refers to a builtin attribute, issue an error.
If there exists an absolute strongest authored relationship spec
for relName, author a relationship spec at the current EditTarget by
copying required metadata from that strongest spec.
If there exists an absolute strongest authored attribute spec for
relName, issue an error.
Otherwise author a uniform relationship spec at the current
EditTarget, honoring custom .
Parameters
relName (str) –
custom (bool) –
CreateRelationship(nameElts, custom) -> Relationship
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
This overload of CreateRelationship() accepts a vector of name
components used to construct a namespaced property name.
For details, see Names, Namespace Ordering, and Property Namespaces
Parameters
nameElts (list[str]) –
custom (bool) –
FindAllAttributeConnectionPaths(pred, recurseOnSources) → list[SdfPath]
Search the prim subtree rooted at this prim for attributes for which
predicate returns true, collect their connection source paths and
return them in an arbitrary order.
If recurseOnSources is true, act as if this function was invoked
on the connected prims and owning prims of connected properties also
and return the union.
Parameters
pred (function[bool( Attribute )]) –
recurseOnSources (bool) –
FindAllRelationshipTargetPaths(pred, recurseOnTargets) → list[SdfPath]
Search the prim subtree rooted at this prim for relationships for
which predicate returns true, collect their target paths and
return them in an arbitrary order.
If recurseOnTargets is true, act as if this function was invoked
on the targeted prims and owning prims of targeted properties also
(but not of forwarding relationships) and return the union.
Parameters
pred (function[bool( Relationship )]) –
recurseOnTargets (bool) –
GetAllChildren() → SiblingRange
Return all this prim’s children as an iterable range.
GetAllChildrenNames() → list[TfToken]
Return the names of the child prims in the order they appear when
iterating over GetAllChildren.
GetAppliedSchemas() → list[TfToken]
Return a vector containing the names of API schemas which have been
applied to this prim.
This includes both the authored API schemas applied using the Apply()
method on the particular schema class as well as any built-in API
schemas that are automatically included through the prim type’s prim
definition. To get only the authored API schemas use GetPrimTypeInfo
instead.
GetAttribute(attrName) → Attribute
Return a UsdAttribute with the name attrName.
The attribute returned may or may not actually exist so it must be
checked for validity. Suggested use:
if (UsdAttribute myAttr = prim.GetAttribute("myAttr")) {
// myAttr is safe to use.
// Edits to the owning stage requires subsequent validation.
} else {
// myAttr was not defined/authored
}
Parameters
attrName (str) –
GetAttributeAtPath(path) → Attribute
Returns the attribute at path on the same stage as this prim.
If path is relative, it will be anchored to the path of this prim.
There is no guarantee that this method returns an attribute on this
prim. This is only guaranteed if path is a purely relative property
path.
GetAttribute(const TfToken&) const
UsdStage::GetAttributeAtPath(const SdfPath&) const
Parameters
path (Path) –
GetAttributes() → list[Attribute]
Like GetProperties() , but exclude all relationships from the result.
GetAuthoredAttributes() → list[Attribute]
Like GetAttributes() , but exclude attributes without authored scene
description from the result.
See UsdProperty::IsAuthored() .
GetAuthoredProperties(predicate) → list[Property]
Return this prim’s properties (attributes and relationships) that have
authored scene description, ordered by name according to the strongest
propertyOrder statement in scene description if one exists, otherwise
ordered according to TfDictionaryLessThan.
If a valid predicate is passed in, then only authored properties
whose names pass the predicate are included in the result. This is
useful if the client is interested only in a subset of authored
properties on the prim. For example, only the ones in a given
namespace or only the ones needed to compute a value.
GetProperties()
UsdProperty::IsAuthored()
Parameters
predicate (PropertyPredicateFunc) –
GetAuthoredPropertiesInNamespace(namespaces) → list[Property]
Like GetPropertiesInNamespace() , but exclude properties that do not
have authored scene description from the result.
See UsdProperty::IsAuthored() .
For details of namespaced properties, see Names, Namespace Ordering,
and Property Namespaces
Parameters
namespaces (list[str]) –
GetAuthoredPropertiesInNamespace(namespaces) -> list[Property]
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
namespaces must be an already-concatenated ordered set of
namespaces, and may or may not terminate with the namespace-separator
character.
If namespaces is empty, this method is equivalent to
GetAuthoredProperties() .
Parameters
namespaces (str) –
GetAuthoredPropertyNames(predicate) → list[TfToken]
Return this prim’s property names (attributes and relationships) that
have authored scene description, ordered according to the strongest
propertyOrder statement in scene description if one exists, otherwise
ordered according to TfDictionaryLessThan.
If a valid predicate is passed in, then only the authored
properties whose names pass the predicate are included in the result.
This is useful if the client is interested only in a subset of
authored properties on the prim. For example, only the ones in a given
namespace or only the ones needed to compute a value.
GetPropertyNames()
UsdProperty::IsAuthored()
Parameters
predicate (PropertyPredicateFunc) –
GetAuthoredRelationships() → list[Relationship]
Like GetRelationships() , but exclude relationships without authored
scene description from the result.
See UsdProperty::IsAuthored() .
GetChild(name) → Prim
Return this prim’s direct child named name if it has one,
otherwise return an invalid UsdPrim.
Equivalent to:
prim.GetStage()->GetPrimAtPath(prim.GetPath().AppendChild(name))
Parameters
name (str) –
GetChildren() → SiblingRange
Return this prim’s active, loaded, defined, non-abstract children as
an iterable range.
Equivalent to:
GetFilteredChildren(UsdPrimDefaultPredicate)
See Prim predicate flags and UsdPrimDefaultPredicate for more
information.
GetChildrenNames() → list[TfToken]
Return the names of the child prims in the order they appear when
iterating over GetChildren.
GetChildrenReorder() → list[TfToken]
Return the strongest opinion for the metadata used to reorder children
of this prim.
Due to how reordering of prim children is composed, this value cannot
be relied on to get the actual order of the prim’s children. Use
GetChidrenNames, GetAllChildrenNames, GetFilteredChildrenNames to get
the true child order if needed.
GetFilteredChildren(predicate) → SiblingRange
Return a subset of all of this prim’s children filtered by
predicate as an iterable range.
The predicate is generated by combining a series of prim flag
terms with either&&or || and !.
Example usage:
// Get all active model children.
GetFilteredChildren(UsdPrimIsActive && UsdPrimIsModel);
// Get all model children that pass the default predicate.
GetFilteredChildren(UsdPrimDefaultPredicate && UsdPrimIsModel);
If this prim is an instance, no children will be returned unless
UsdTraverseInstanceProxies is used to allow instance proxies to be
returned, or if this prim is itself an instance proxy.
See Prim predicate flags and UsdPrimDefaultPredicate for more
information.
Parameters
predicate (_PrimFlagsPredicate) –
GetFilteredChildrenNames(predicate) → list[TfToken]
Return the names of the child prims in the order they appear when
iterating over GetFilteredChildren( predicate ).
Parameters
predicate (_PrimFlagsPredicate) –
GetFilteredNextSibling(predicate) → Prim
Return this prim’s next sibling that matches predicate if it has
one, otherwise return the invalid UsdPrim.
See Prim predicate flags and UsdPrimDefaultPredicate for more
information.
Parameters
predicate (_PrimFlagsPredicate) –
GetInherits() → Inherits
Return a UsdInherits object that allows one to add, remove, or mutate
inherits at the currently set UsdEditTarget.
While the UsdInherits object has no methods for listing the
currently authored inherits on a prim, one can use a
UsdPrimCompositionQuery to query the inherits arcs that are composed
by this prim.
UsdPrimCompositionQuery::GetDirectInherits
GetInstances() → list[Prim]
If this prim is a prototype prim, returns all prims that are instances
of this prototype.
Otherwise, returns an empty vector.
Note that this function will return prims in prototypes for instances
that are nested beneath other instances.
GetNextSibling() → Prim
Return this prim’s next active, loaded, defined, non-abstract sibling
if it has one, otherwise return an invalid UsdPrim.
Equivalent to:
GetFilteredNextSibling(UsdPrimDefaultPredicate)
See Prim predicate flags and UsdPrimDefaultPredicate for more
information.
GetObjectAtPath(path) → Object
Returns the object at path on the same stage as this prim.
If path is is relative, it will be anchored to the path of this prim.
UsdStage::GetObjectAtPath(const SdfPath&) const
Parameters
path (Path) –
GetParent() → Prim
Return this prim’s parent prim.
Return an invalid UsdPrim if this is a root prim.
GetPayloads() → Payloads
Return a UsdPayloads object that allows one to add, remove, or mutate
payloads at the currently set UsdEditTarget.
While the UsdPayloads object has no methods for listing the
currently authored payloads on a prim, one can use a
UsdPrimCompositionQuery to query the payload arcs that are composed by
this prim.
GetPrimAtPath(path) → Prim
Returns the prim at path on the same stage as this prim.
If path is is relative, it will be anchored to the path of this prim.
UsdStage::GetPrimAtPath(const SdfPath&) const
Parameters
path (Path) –
GetPrimDefinition() → PrimDefinition
Return this prim’s definition based on the prim’s type if the type is
a registered prim type.
Returns an empty prim definition if it is not.
GetPrimInPrototype() → Prim
If this prim is an instance proxy, return the UsdPrim for the
corresponding prim in the instance’s prototype.
Otherwise, return an invalid UsdPrim.
GetPrimIndex() → PrimIndex
Return the cached prim index containing all sites that can contribute
opinions to this prim.
The prim index can be used to examine the composition arcs and scene
description sites that can contribute to this prim’s property and
metadata values.
The prim index returned by this function is optimized and may not
include sites that do not contribute opinions to this prim. Use
UsdPrim::ComputeExpandedPrimIndex to compute a prim index that
includes all possible sites that could contribute opinions.
This prim index will be empty for prototype prims. This ensures that
these prims do not provide any attribute or metadata values. For all
other prims in prototypes, this is the prim index that was chosen to
be shared with all other instances. In either case, the prim index’s
path will not be the same as the prim’s path.
Prim indexes may be invalidated by changes to the UsdStage and cannot
detect if they are expired. Clients should avoid keeping copies of the
prim index across such changes, which include scene description
changes or changes to load state.
GetPrimStack() → list[SdfPrimSpecHandle]
Return all the authored SdfPrimSpecs that may contain opinions for
this prim in order from strong to weak.
This does not include all the places where contributing prim specs
could potentially be created; rather, it includes only those prim
specs that already exist. To discover all the places that prim specs
could be authored that would contribute opinions, see”Composition
Structure”
Use this method for debugging and diagnostic purposes. It is not
advisable to retain a PrimStack for expedited metadata value
resolution, since not all metadata resolves with
simple”strongestopinion wins”semantics.
GetPrimStackWithLayerOffsets() → list[tuple[PrimSpec, LayerOffset]]
Return all the authored SdfPrimSpecs that may contain opinions for
this prim in order from strong to weak paired with the cumulative
layer offset from the stage’s root layer to the layer containing the
prim spec.
This behaves exactly the same as UsdPrim::GetPrimStack with the
addition of providing the cumulative layer offset of each spec’s
layer.
Use this method for debugging and diagnostic purposes. It is not
advisable to retain a PrimStack for expedited metadata value
resolution, since not all metadata resolves with
simple”strongestopinion wins”semantics.
GetPrimTypeInfo() → PrimTypeInfo
Return the prim’s full type info composed from its type name, applied
API schemas, and any fallback types defined on the stage for
unrecognized prim type names.
The returned type structure contains the”true”schema type used to
create this prim’s prim definition and answer the IsA query. This
value is cached and efficient to query. The cached values are
guaranteed to exist for (at least) as long as the prim’s stage is
open.
GetTypeName
GetAppliedSchemas
Fallback Prim Types
GetProperties(predicate) → list[Property]
Return all of this prim’s properties (attributes and relationships),
including all builtin properties, ordered by name according to the
strongest propertyOrder statement in scene description if one exists,
otherwise ordered according to TfDictionaryLessThan.
If a valid predicate is passed in, then only properties whose
names pass the predicate are included in the result. This is useful
if the client is interested only in a subset of properties on the
prim. For example, only the ones in a given namespace or only the ones
needed to compute a value.
To obtain only either attributes or relationships, use either
GetAttributes() or GetRelationships() .
To determine whether a property is either an attribute or a
relationship, use the UsdObject::As() and UsdObject::Is() methods in
C++:
// Use As<>() to obtain a subclass instance.
if (UsdAttribute attr = property.As<UsdAttribute>()) {
// use attribute 'attr'.
else if (UsdRelationship rel = property.As<UsdRelationship>()) {
// use relationship 'rel'.
}
// Use Is<>() to discriminate only.
if (property.Is<UsdAttribute>()) {
// property is an attribute.
}
In Python, use the standard isinstance() function:
if isinstance(property, Usd.Attribute):
# property is a Usd.Attribute.
elif isinstance(property, Usd.Relationship):
# property is a Usd.Relationship.
GetAuthoredProperties()
UsdProperty::IsAuthored()
Parameters
predicate (PropertyPredicateFunc) –
GetPropertiesInNamespace(namespaces) → list[Property]
Return this prim’s properties that are inside the given property
namespace ordered according to the strongest propertyOrder statement
in scene description if one exists, otherwise ordered according to
TfDictionaryLessThan.
A namespaces argument whose elements are [“ri”,”attribute”] will
return all the properties under the namespace”ri:attribute”,
i.e.”ri:attribute:*”. An empty namespaces argument is equivalent
to GetProperties() .
For details of namespaced properties, see Names, Namespace Ordering,
and Property Namespaces
Parameters
namespaces (list[str]) –
GetPropertiesInNamespace(namespaces) -> list[Property]
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
namespaces must be an already-concatenated ordered set of
namespaces, and may or may not terminate with the namespace-separator
character.
If namespaces is empty, this method is equivalent to
GetProperties() .
Parameters
namespaces (str) –
GetProperty(propName) → Property
Return a UsdProperty with the name propName.
The property returned may or may not actually exist so it must be
checked for validity. Suggested use:
if (UsdProperty myProp = prim.GetProperty("myProp")) {
// myProp is safe to use.
// Edits to the owning stage requires subsequent validation.
} else {
// myProp was not defined/authored
}
Parameters
propName (str) –
GetPropertyAtPath(path) → Property
Returns the property at path on the same stage as this prim.
If path is relative, it will be anchored to the path of this prim.
There is no guarantee that this method returns a property on this
prim. This is only guaranteed if path is a purely relative property
path.
GetProperty(const TfToken&) const
UsdStage::GetPropertyAtPath(const SdfPath&) const
Parameters
path (Path) –
GetPropertyNames(predicate) → list[TfToken]
Return all of this prim’s property names (attributes and
relationships), including all builtin properties.
If a valid predicate is passed in, then only properties whose
names pass the predicate are included in the result. This is useful if
the client is interested only in a subset of properties on the prim.
For example, only the ones in a given namespace or only the ones
needed to compute a value.
GetAuthoredPropertyNames()
UsdProperty::IsAuthored()
Parameters
predicate (PropertyPredicateFunc) –
GetPropertyOrder() → list[TfToken]
Return the strongest propertyOrder metadata value authored on this
prim.
GetPrototype() → Prim
If this prim is an instance, return the UsdPrim for the corresponding
prototype.
Otherwise, return an invalid UsdPrim.
GetReferences() → References
Return a UsdReferences object that allows one to add, remove, or
mutate references at the currently set UsdEditTarget.
While the UsdReferences object has no methods for listing the
currently authored references on a prim, one can use a
UsdPrimCompositionQuery to query the reference arcs that are composed
by this prim.
UsdPrimCompositionQuery::GetDirectReferences
GetRelationship(relName) → Relationship
Return a UsdRelationship with the name relName.
The relationship returned may or may not actually exist so it must
be checked for validity. Suggested use:
if (UsdRelationship myRel = prim.GetRelationship("myRel")) {
// myRel is safe to use.
// Edits to the owning stage requires subsequent validation.
} else {
// myRel was not defined/authored
}
Parameters
relName (str) –
GetRelationshipAtPath(path) → Relationship
Returns the relationship at path on the same stage as this prim.
If path is relative, it will be anchored to the path of this prim.
There is no guarantee that this method returns a relationship on this
prim. This is only guaranteed if path is a purely relative property
path.
GetRelationship(const TfToken&) const
UsdStage::GetRelationshipAtPath(const SdfPath&) const
Parameters
path (Path) –
GetRelationships() → list[Relationship]
Like GetProperties() , but exclude all attributes from the result.
GetSpecializes() → Specializes
Return a UsdSpecializes object that allows one to add, remove, or
mutate specializes at the currently set UsdEditTarget.
While the UsdSpecializes object has no methods for listing the
currently authored specializes on a prim, one can use a
UsdPrimCompositionQuery to query the specializes arcs that are
composed by this prim.
GetSpecifier() → Specifier
Return this prim’s composed specifier.
GetTypeName() → str
Return this prim’s composed type name.
This value is cached and is efficient to query. Note that this is just
the composed type name as authored and may not represent the full type
of the prim and its prim definition. If you need to reason about the
actual type of the prim, use GetPrimTypeInfo instead as it accounts
for recognized schemas, applied API schemas, fallback types, etc.
GetVariantSet(variantSetName) → VariantSet
Retrieve a specifically named VariantSet for editing or constructing a
UsdEditTarget.
This is a shortcut for
prim.GetVariantSets().GetVariantSet(variantSetName)
Parameters
variantSetName (str) –
GetVariantSets() → VariantSets
Return a UsdVariantSets object representing all the VariantSets
present on this prim.
The returned object also provides the API for adding new VariantSets
to the prim.
HasAPI() → enable_if[T.schemaKind != SchemaKind.MultipleApplyAPI, bool].type
Using HasAPI in C++
UsdPrim prim = stage->OverridePrim("/path/to/prim");
MyDomainBozAPI = MyDomainBozAPI::Apply(prim);
assert(prim.HasAPI<MyDomainBozAPI>());
UsdCollectionAPI collAPI = UsdCollectionAPI::Apply(prim,
/\*instanceName\*/ TfToken("geom"))
assert(prim.HasAPI<UsdCollectionAPI>()
assert(prim.HasAPI<UsdCollectionAPI>(/\*instanceName\*/ TfToken("geom")))
The python version of this method takes as an argument the TfType of
the API schema class. Similar validation of the schema type is
performed in python at run-time and a coding error is issued if the
given type is not a valid applied API schema.
Using HasAPI in Python
prim = stage.OverridePrim("/path/to/prim")
bozAPI = MyDomain.BozAPI.Apply(prim)
assert prim.HasAPI(MyDomain.BozAPI)
collAPI = Usd.CollectionAPI.Apply(prim, "geom")
assert(prim.HasAPI(Usd.CollectionAPI))
assert(prim.HasAPI(Usd.CollectionAPI, instanceName="geom"))
Return true if the UsdPrim has had a single API schema represented by
the C++ class type T applied to it through the Apply() method
provided on the API schema class.
HasAPI(instanceName) -> enable_if[T.schemaKind== SchemaKind.MultipleApplyAPI, bool].type
Return true if the UsdPrim has had a multiple-apply API schema
represented by the C++ class type T applied to it through the
Apply() method provided on the API schema class.
instanceName , if non-empty is used to determine if a particular
instance of a multiple-apply API schema (eg. UsdCollectionAPI) has
been applied to the prim, otherwise this returns true if any instance
of the multiple-apply API has been applied.
Parameters
instanceName (str) –
HasAPI(schemaType, instanceName) -> bool
Return true if a prim has an API schema with TfType schemaType .
instanceName , if non-empty is used to determine if a particular
instance of a multiple-apply API schema (eg. UsdCollectionAPI) has
been applied to the prim. A coding error is issued if a non-empty
instanceName is passed in and T represents a single-apply API
schema.
This function behaves exactly like the templated HasAPI functions
except for the runtime schemaType validation which happens at compile
time in the templated versions. This method is provided for python
clients. Use of the templated HasAPI functions are preferred.
Parameters
schemaType (Type) –
instanceName (str) –
HasAttribute(attrName) → bool
Return true if this prim has an attribute named attrName , false
otherwise.
Parameters
attrName (str) –
HasAuthoredActive() → bool
Return true if this prim has an authored opinion for’active’, false
otherwise.
See How”active”Affects Prims on a UsdStage for what it means for a
prim to be active.
HasAuthoredInherits() → bool
Return true if this prim has any authored inherits.
HasAuthoredInstanceable() → bool
Return true if this prim has an authored opinion for’instanceable’,
false otherwise.
HasAuthoredPayloads() → bool
Return true if this prim has any authored payloads.
HasAuthoredReferences() → bool
Return true if this prim has any authored references.
HasAuthoredSpecializes() → bool
Returns true if this prim has any authored specializes.
HasAuthoredTypeName() → bool
Return true if a typeName has been authored.
HasDefiningSpecifier() → bool
Return true if this prim has a specifier of type SdfSpecifierDef or
SdfSpecifierClass.
SdfIsDefiningSpecifier
HasPayload() → bool
Deprecated
Return true if a payload is present on this prim.
Payloads: Impact of Using and Not Using
HasProperty(propName) → bool
Return true if this prim has an property named propName , false
otherwise.
Parameters
propName (str) –
HasRelationship(relName) → bool
Return true if this prim has a relationship named relName , false
otherwise.
Parameters
relName (str) –
HasVariantSets() → bool
Return true if this prim has any authored VariantSets.
this connotes only the existence of one of more VariantSets, not
that such VariantSets necessarily contain any variants or variant
opinions.
IsA() → bool
Return true if the prim’s schema type, is or inherits schema type T.
GetPrimTypeInfo
UsdPrimTypeInfo::GetSchemaType
Fallback Prim Types
IsA(schemaType) -> bool
Return true if the prim’s schema type is or inherits schemaType .
GetPrimTypeInfo
UsdPrimTypeInfo::GetSchemaType
Fallback Prim Types
Parameters
schemaType (Type) –
IsAbstract() → bool
Return true if this prim or any of its ancestors is a class.
IsActive() → bool
Return true if this prim is active, meaning neither it nor any of its
ancestors have active=false.
Return false otherwise.
See How”active”Affects Prims on a UsdStage for what it means for a
prim to be active.
IsDefined() → bool
Return true if this prim and all its ancestors have defining
specifiers, false otherwise.
SdfIsDefiningSpecifier.
IsGroup() → bool
Return true if this prim is a model group based on its kind metadata,
false otherwise.
If this prim is a group, it is also necessarily a model.
IsInPrototype() → bool
Return true if this prim is a prototype prim or a descendant of a
prototype prim, false otherwise.
IsPrototype
IsInstance() → bool
Return true if this prim is an instance of a prototype, false
otherwise.
If this prim is an instance, calling GetPrototype() will return the
UsdPrim for the corresponding prototype prim.
IsInstanceProxy() → bool
Return true if this prim is an instance proxy, false otherwise.
An instance proxy prim represents a descendent of an instance prim.
IsInstanceable() → bool
Return true if this prim has been marked as instanceable.
Note that this is not the same as IsInstance() . A prim may return
true for IsInstanceable() and false for IsInstance() if this prim is
not active or if it is marked as instanceable but contains no
instanceable data.
IsLoaded() → bool
Return true if this prim is active, and either it is loadable and it
is loaded, or its nearest loadable ancestor is loaded, or it has
no loadable ancestor; false otherwise.
IsModel() → bool
Return true if this prim is a model based on its kind metadata, false
otherwise.
static IsPathInPrototype()
classmethod IsPathInPrototype(path) -> bool
Return true if the given path identifies a prototype prim or a
prim or property descendant of a prototype prim, false otherwise.
IsPrototypePath
Parameters
path (Path) –
IsPrototype() → bool
Return true if this prim is an instancing prototype prim, false
otherwise.
IsInPrototype
static IsPrototypePath()
classmethod IsPrototypePath(path) -> bool
Return true if the given path identifies a prototype prim, false
otherwise.
This function will return false for prim and property paths that are
descendants of a prototype prim path.
IsPathInPrototype
Parameters
path (Path) –
IsPseudoRoot() → bool
Returns true if the prim is the pseudo root.
Equivalent to
prim.GetPath() == SdfPath::AbsoluteRootPath()
Load(policy) → None
Load this prim, all its ancestors, and by default all its descendants.
If loadPolicy is UsdLoadWithoutDescendants, then load only this
prim and its ancestors.
See UsdStage::Load for additional details.
Parameters
policy (LoadPolicy) –
MakeResolveTargetStrongerThanEditTarget(editTarget) → ResolveTarget
Creates and returns a resolve target that, when passed to a
UsdAttributeQuery for one of this prim’s attributes, causes value
resolution to only consider specs that are stronger than the spec that
would be authored for this prim when using the given editTarget .
If the edit target would not affect any specs that could contribute to
this prim, a null resolve target is returned.
Parameters
editTarget (EditTarget) –
MakeResolveTargetUpToEditTarget(editTarget) → ResolveTarget
Creates and returns a resolve target that, when passed to a
UsdAttributeQuery for one of this prim’s attributes, causes value
resolution to only consider weaker specs up to and including the spec
that would be authored for this prim when using the given
editTarget .
If the edit target would not affect any specs that could contribute to
this prim, a null resolve target is returned.
Parameters
editTarget (EditTarget) –
RemoveAPI() → bool
Removes a single-apply API schema with the given C++
type’SchemaType’from this prim in the current edit target.
This is done by removing the API schema’s name token from the token-
valued, listOp metadata apiSchemas on this prim as well as authoring
an explicit deletion of schema name from the listOp.
Returns true upon success or if the API schema is already deleted in
the current edit target.
An error is issued and false returned for any of the following
conditions:
this prim is not a valid prim for editing
this prim is valid, but cannot be reached or overridden in the
current edit target
the schema name cannot be deleted in the apiSchemas listOp
metadata
RemoveAPI(schemaType) -> bool
Non-templated overload of the templated RemoveAPI above.
This function behaves exactly like the templated RemoveAPI except for
the runtime schemaType validation which happens at compile time in the
templated version. This method is provided for python clients. Use of
the templated RemoveAPI is preferred.
Parameters
schemaType (Type) –
RemoveAPI(instanceName) -> bool
Removes a multiple-apply API schema with the given C++
type’SchemaType’and instance name instanceName from this prim in
the current edit target.
This is done by removing the instanced schema name token from the
token-valued, listOp metadata apiSchemas on this prim as well as
authoring an explicit deletion of the name from the listOp. For
example, if SchemaType is’ UsdCollectionAPI ‘and instanceName
is’plasticStuff’, the name’CollectionAPI:plasticStuff’is deleted from
the’apiSchemas’listOp metadata.
Returns true upon success or if the API schema with this
instanceName is already deleted in the current edit target.
An error is issued and false returned for any of the following
conditions:
instanceName is empty
this prim is not a valid prim for editing
this prim is valid, but cannot be reached or overridden in the
current edit target
the schema name cannot be deleted in the apiSchemas listOp
metadata
Parameters
instanceName (str) –
RemoveAPI(schemaType, instanceName) -> bool
Non-templated overload of the templated RemoveAPI above.
This function behaves exactly like the templated RemoveAPI except for
the runtime schemaType validation which happens at compile time in the
templated version. This method is provided for python clients. Use of
the templated RemoveAPI is preferred.
Parameters
schemaType (Type) –
instanceName (str) –
RemoveAppliedSchema(appliedSchemaName) → bool
Removes the applied API schema name token appliedSchemaName from
the apiSchemas metadata for this prim at the current edit target.
For multiple-apply schemas the name token should include the instance
name for the applied schema, for example’CollectionAPI:plasticStuff’
For an explicit list operation, this removes the applied schema name
from the explicit items list if it was present. For a non-explicit
list operation, this will remove any occurrence of the applied schema
name from the prepended and appended item as well as adding it to the
deleted items list.
Returns true upon success or if the API schema is already deleted in
the current edit target.
An error is issued and false returned for any of the following
conditions:
this prim is not a valid prim for editing
this prim is valid, but cannot be reached or overridden in the
current edit target
the schema name cannot be deleted in the apiSchemas listOp
metadata
Unlike RemoveAPI this method does not require that the name token
refer to a valid API schema type. RemoveAPI is the preferred method
for removing valid API schemas.
Parameters
appliedSchemaName (str) –
RemoveProperty(propName) → bool
Remove all scene description for the property with the given
propName in the current UsdEditTarget.
Return true if the property is removed, false otherwise.
Because this method can only remove opinions about the property from
the current EditTarget, you may generally find it more useful to use
UsdAttribute::Block() , which will ensure that all values from the
EditTarget and weaker layers for the property will be ignored.
Parameters
propName (str) –
SetActive(active) → bool
Author’active’metadata for this prim at the current EditTarget.
See How”active”Affects Prims on a UsdStage for the effects of
activating or deactivating a prim.
Parameters
active (bool) –
SetChildrenReorder(order) → None
Author an opinion for the metadata used to reorder children of this
prim at the current EditTarget.
Parameters
order (list[TfToken]) –
SetInstanceable(instanceable) → bool
Author’instanceable’metadata for this prim at the current EditTarget.
Parameters
instanceable (bool) –
SetPayload(payload) → bool
Deprecated
Author payload metadata for this prim at the current edit target.
Return true on success, false if the value could not be set.
Payloads: Impact of Using and Not Using
Parameters
payload (Payload) –
SetPayload(assetPath, primPath) -> bool
Deprecated
Shorthand for SetPayload(SdfPayload(assetPath, primPath)).
Parameters
assetPath (str) –
primPath (Path) –
SetPayload(layer, primPath) -> bool
Deprecated
Shorthand for SetPayload( SdfPayload (layer->GetIdentifier(),
primPath)).
Parameters
layer (Layer) –
primPath (Path) –
SetPropertyOrder(order) → None
Author an opinion for propertyOrder metadata on this prim at the
current EditTarget.
Parameters
order (list[TfToken]) –
SetSpecifier(specifier) → bool
Author an opinion for this Prim’s specifier at the current edit
target.
Parameters
specifier (Specifier) –
SetTypeName(typeName) → bool
Author this Prim’s typeName at the current EditTarget.
Parameters
typeName (str) –
Unload() → None
Unloads this prim and all its descendants.
See UsdStage::Unload for additional details.
class pxr.Usd.PrimCompositionQuery
Object for making optionally filtered composition queries about a
prim. It creates a list of strength ordering
UsdPrimCompositionQueryArc that can be filtered by a combination of
criteria and returned.
## Invalidation
This object does not listen for change notification. If a consumer is
holding on to a UsdPrimCompositionQuery, it is their responsibility to
dispose of it in response to a resync change to the associated prim.
Failing to do so may result in incorrect values or crashes due to
dereferencing invalid objects.
Classes:
ArcIntroducedFilter
Choices for filtering composition arcs based on where the arc is introduced.
ArcTypeFilter
Choices for filtering composition arcs based on arc type.
DependencyTypeFilter
Choices for filtering composition arcs on dependency type.
Filter
HasSpecsFilter
Choices for filtering composition arcs on whether the node contributes specs to the prim.
Methods:
GetCompositionArcs()
Return a list of composition arcs for this query's prim using the current query filter.
GetDirectInherits
classmethod GetDirectInherits(prim) -> PrimCompositionQuery
GetDirectReferences
classmethod GetDirectReferences(prim) -> PrimCompositionQuery
GetDirectRootLayerArcs
classmethod GetDirectRootLayerArcs(prim) -> PrimCompositionQuery
Attributes:
filter
Filter
class ArcIntroducedFilter
Choices for filtering composition arcs based on where the arc is
introduced.
Attributes:
All
IntroducedInRootLayerPrimSpec
IntroducedInRootLayerStack
names
values
All = pxr.Usd.ArcIntroducedFilter.All
IntroducedInRootLayerPrimSpec = pxr.Usd.ArcIntroducedFilter.IntroducedInRootLayerPrimSpec
IntroducedInRootLayerStack = pxr.Usd.ArcIntroducedFilter.IntroducedInRootLayerStack
names = {'All': pxr.Usd.ArcIntroducedFilter.All, 'IntroducedInRootLayerPrimSpec': pxr.Usd.ArcIntroducedFilter.IntroducedInRootLayerPrimSpec, 'IntroducedInRootLayerStack': pxr.Usd.ArcIntroducedFilter.IntroducedInRootLayerStack}
values = {0: pxr.Usd.ArcIntroducedFilter.All, 1: pxr.Usd.ArcIntroducedFilter.IntroducedInRootLayerStack, 2: pxr.Usd.ArcIntroducedFilter.IntroducedInRootLayerPrimSpec}
class ArcTypeFilter
Choices for filtering composition arcs based on arc type.
Attributes:
All
Inherit
InheritOrSpecialize
NotInheritOrSpecialize
NotReferenceOrPayload
NotVariant
Payload
Reference
ReferenceOrPayload
Specialize
Variant
names
values
All = pxr.Usd.ArcTypeFilter.All
Inherit = pxr.Usd.ArcTypeFilter.Inherit
InheritOrSpecialize = pxr.Usd.ArcTypeFilter.InheritOrSpecialize
NotInheritOrSpecialize = pxr.Usd.ArcTypeFilter.NotInheritOrSpecialize
NotReferenceOrPayload = pxr.Usd.ArcTypeFilter.NotReferenceOrPayload
NotVariant = pxr.Usd.ArcTypeFilter.NotVariant
Payload = pxr.Usd.ArcTypeFilter.Payload
Reference = pxr.Usd.ArcTypeFilter.Reference
ReferenceOrPayload = pxr.Usd.ArcTypeFilter.ReferenceOrPayload
Specialize = pxr.Usd.ArcTypeFilter.Specialize
Variant = pxr.Usd.ArcTypeFilter.Variant
names = {'All': pxr.Usd.ArcTypeFilter.All, 'Inherit': pxr.Usd.ArcTypeFilter.Inherit, 'InheritOrSpecialize': pxr.Usd.ArcTypeFilter.InheritOrSpecialize, 'NotInheritOrSpecialize': pxr.Usd.ArcTypeFilter.NotInheritOrSpecialize, 'NotReferenceOrPayload': pxr.Usd.ArcTypeFilter.NotReferenceOrPayload, 'NotVariant': pxr.Usd.ArcTypeFilter.NotVariant, 'Payload': pxr.Usd.ArcTypeFilter.Payload, 'Reference': pxr.Usd.ArcTypeFilter.Reference, 'ReferenceOrPayload': pxr.Usd.ArcTypeFilter.ReferenceOrPayload, 'Specialize': pxr.Usd.ArcTypeFilter.Specialize, 'Variant': pxr.Usd.ArcTypeFilter.Variant}
values = {0: pxr.Usd.ArcTypeFilter.All, 1: pxr.Usd.ArcTypeFilter.Reference, 2: pxr.Usd.ArcTypeFilter.Payload, 3: pxr.Usd.ArcTypeFilter.Inherit, 4: pxr.Usd.ArcTypeFilter.Specialize, 5: pxr.Usd.ArcTypeFilter.Variant, 6: pxr.Usd.ArcTypeFilter.ReferenceOrPayload, 7: pxr.Usd.ArcTypeFilter.InheritOrSpecialize, 8: pxr.Usd.ArcTypeFilter.NotReferenceOrPayload, 9: pxr.Usd.ArcTypeFilter.NotInheritOrSpecialize, 10: pxr.Usd.ArcTypeFilter.NotVariant}
class DependencyTypeFilter
Choices for filtering composition arcs on dependency type.
This can be direct (arc introduced at the prim’s level in namespace)
or ancestral (arc introduced by a namespace parent of the prim).
Attributes:
All
Ancestral
Direct
names
values
All = pxr.Usd.DependencyTypeFilter.All
Ancestral = pxr.Usd.DependencyTypeFilter.Ancestral
Direct = pxr.Usd.DependencyTypeFilter.Direct
names = {'All': pxr.Usd.DependencyTypeFilter.All, 'Ancestral': pxr.Usd.DependencyTypeFilter.Ancestral, 'Direct': pxr.Usd.DependencyTypeFilter.Direct}
values = {0: pxr.Usd.DependencyTypeFilter.All, 1: pxr.Usd.DependencyTypeFilter.Direct, 2: pxr.Usd.DependencyTypeFilter.Ancestral}
class Filter
Attributes:
arcIntroducedFilter
arcTypeFilter
dependencyTypeFilter
hasSpecsFilter
property arcIntroducedFilter
property arcTypeFilter
property dependencyTypeFilter
property hasSpecsFilter
class HasSpecsFilter
Choices for filtering composition arcs on whether the node contributes
specs to the prim.
Attributes:
All
HasNoSpecs
HasSpecs
names
values
All = pxr.Usd.HasSpecsFilter.All
HasNoSpecs = pxr.Usd.HasSpecsFilter.HasNoSpecs
HasSpecs = pxr.Usd.HasSpecsFilter.HasSpecs
names = {'All': pxr.Usd.HasSpecsFilter.All, 'HasNoSpecs': pxr.Usd.HasSpecsFilter.HasNoSpecs, 'HasSpecs': pxr.Usd.HasSpecsFilter.HasSpecs}
values = {0: pxr.Usd.HasSpecsFilter.All, 1: pxr.Usd.HasSpecsFilter.HasSpecs, 2: pxr.Usd.HasSpecsFilter.HasNoSpecs}
GetCompositionArcs() → list[UsdPrimCompositionQueryArc]
Return a list of composition arcs for this query’s prim using the
current query filter.
The composition arcs are always returned in order from strongest to
weakest regardless of the filter.
static GetDirectInherits()
classmethod GetDirectInherits(prim) -> PrimCompositionQuery
Returns a prim composition query for the given prim with a preset
filter that only returns inherit arcs that are not ancestral.
Parameters
prim (Prim) –
static GetDirectReferences()
classmethod GetDirectReferences(prim) -> PrimCompositionQuery
Returns a prim composition query for the given prim with a preset
filter that only returns reference arcs that are not ancestral.
Parameters
prim (Prim) –
static GetDirectRootLayerArcs()
classmethod GetDirectRootLayerArcs(prim) -> PrimCompositionQuery
Returns a prim composition query for the given prim with a preset
filter that only returns direct arcs that were introduced by opinions
defined in a layer in the root layer stack.
Parameters
prim (Prim) –
property filter
Filter
Return a copy of the current filter parameters.
type : None
Change the filter for this query.
Type
type
class pxr.Usd.PrimDefinition
Class representing the builtin definition of a prim given the schemas
registered in the schema registry.
It provides access to the the builtin properties and metadata of a
prim whose type is defined by this definition.
Instances of this class can only be created by the UsdSchemaRegistry.
Methods:
FlattenTo(layer, path, newSpecSpecifier)
Copies the contents of this prim definition to a prim spec on the given layer at the given path .
GetAppliedAPISchemas()
Return the list of names of the API schemas that have been applied to this prim definition in order.
GetAttributeFallbackValue(attrName, value)
Retrieves the fallback value for the attribute named attrName and stores it in value if possible.
GetDocumentation()
Returns the documentation metadata defined by the prim definition for the prim itself.
GetMetadata(key, value)
Retrieves the fallback value for the metadata field named key , that is defined by this prim definition for the prim itself and stores it in value if possible.
GetMetadataByDictKey(key, keyPath, value)
Retrieves the value at keyPath from the fallback dictionary value for the dictionary metadata field named key , that is defined by this prim definition for the prim itself, and stores it in value if possible.
GetPropertyDocumentation(propName)
Returns the documentation metadata defined by the prim definition for the property named propName if it exists.
GetPropertyMetadata(propName, key, value)
Retrieves the fallback value for the metadata field named key , that is defined by this prim definition for the property named propName , and stores it in value if possible.
GetPropertyMetadataByDictKey(propName, key, ...)
Retrieves the value at keyPath from the fallback dictionary value for the dictionary metadata field named key , that is defined by this prim definition for the property named propName , and stores it in value if possible.
GetPropertyNames()
Return the list of names of builtin properties for this prim definition.
GetSchemaAttributeSpec(attrName)
This is a convenience method.
GetSchemaPropertySpec(propName)
Return the property spec that defines the fallback for the property named propName on prims of this prim definition's type.
GetSchemaRelationshipSpec(relName)
This is a convenience method.
ListMetadataFields()
Returns the list of names of metadata fields that are defined by this prim definition for the prim itself.
ListPropertyMetadataFields(propName)
Returns the list of names of metadata fields that are defined by this prim definition for property propName if a property named propName exists.
FlattenTo(layer, path, newSpecSpecifier) → bool
Copies the contents of this prim definition to a prim spec on the
given layer at the given path .
This includes the entire property spec for each of this definition’s
built-in properties as well as all of this definition’s prim metadata.
If the prim definition represents a concrete prim type, the type name
of the prim spec is set to the the type name of this prim definition.
Otherwise the type name is set to empty. The’apiSchemas’metadata on
the prim spec will always be explicitly set to the combined list of
all API schemas applied to this prim definition, i.e. the list
returned by UsdPrimDefinition::GetAppliedAPISchemas. Note that if this
prim definition is an API schema prim definition (see
UsdSchemaRegistry::FindAppliedAPIPrimDefinition) then’apiSchemas’will
be empty as this prim definition does not”have”an applied API because
instead it”is”an applied API.
If there is no prim spec at the given path , a new prim spec is
created at that path with the specifier newSpecSpecifier . Any
necessary ancestor specs will be created as well but they will always
be created as overs. If a spec does exist at path , then all of
its properties and schema allowed metadata are cleared before it is
populated from the prim definition.
Parameters
layer (Layer) –
path (Path) –
newSpecSpecifier (Specifier) –
FlattenTo(parent, name, newSpecSpecifier) -> Prim
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Copies the contents of this prim definition to a prim spec at the
current edit target for a prim with the given name under the prim
parent .
Parameters
parent (Prim) –
name (str) –
newSpecSpecifier (Specifier) –
FlattenTo(prim, newSpecSpecifier) -> Prim
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Copies the contents of this prim definition to a prim spec at the
current edit target for the given prim .
Parameters
prim (Prim) –
newSpecSpecifier (Specifier) –
GetAppliedAPISchemas() → list[TfToken]
Return the list of names of the API schemas that have been applied to
this prim definition in order.
GetAttributeFallbackValue(attrName, value) → bool
Retrieves the fallback value for the attribute named attrName and
stores it in value if possible.
Returns true if the attribute exists in this prim definition and it
has a fallback value defined. Returns false otherwise.
Parameters
attrName (str) –
value (T) –
GetDocumentation() → str
Returns the documentation metadata defined by the prim definition for
the prim itself.
GetMetadata(key, value) → bool
Retrieves the fallback value for the metadata field named key ,
that is defined by this prim definition for the prim itself and stores
it in value if possible.
Returns true if a fallback value is defined for the given metadata
key . Returns false otherwise.
Parameters
key (str) –
value (T) –
GetMetadataByDictKey(key, keyPath, value) → bool
Retrieves the value at keyPath from the fallback dictionary value
for the dictionary metadata field named key , that is defined by
this prim definition for the prim itself, and stores it in value
if possible.
Returns true if a fallback dictionary value is defined for the given
metadata key and it contains a value at keyPath . Returns
false otherwise.
Parameters
key (str) –
keyPath (str) –
value (T) –
GetPropertyDocumentation(propName) → str
Returns the documentation metadata defined by the prim definition for
the property named propName if it exists.
Parameters
propName (str) –
GetPropertyMetadata(propName, key, value) → bool
Retrieves the fallback value for the metadata field named key ,
that is defined by this prim definition for the property named
propName , and stores it in value if possible.
Returns true if a fallback value is defined for the given metadata
key for the named property. Returns false otherwise.
Parameters
propName (str) –
key (str) –
value (T) –
GetPropertyMetadataByDictKey(propName, key, keyPath, value) → bool
Retrieves the value at keyPath from the fallback dictionary value
for the dictionary metadata field named key , that is defined by
this prim definition for the property named propName , and stores
it in value if possible.
Returns true if a fallback dictionary value is defined for the given
metadata key for the named property and it contains a value at
keyPath . Returns false otherwise.
Parameters
propName (str) –
key (str) –
keyPath (str) –
value (T) –
GetPropertyNames() → list[TfToken]
Return the list of names of builtin properties for this prim
definition.
GetSchemaAttributeSpec(attrName) → AttributeSpec
This is a convenience method.
It is shorthand for TfDynamic_cast<SdfAttributeSpecHandle>(
GetSchemaPropertySpec(primType, attrName));
Parameters
attrName (str) –
GetSchemaPropertySpec(propName) → PropertySpec
Return the property spec that defines the fallback for the property
named propName on prims of this prim definition’s type.
Return null if there is no such property spec.
Parameters
propName (str) –
GetSchemaRelationshipSpec(relName) → RelationshipSpec
This is a convenience method.
It is shorthand for TfDynamic_cast<SdfRelationshipSpecHandle>(
GetSchemaPropertySpec(primType, relName));
Parameters
relName (str) –
ListMetadataFields() → list[TfToken]
Returns the list of names of metadata fields that are defined by this
prim definition for the prim itself.
ListPropertyMetadataFields(propName) → list[TfToken]
Returns the list of names of metadata fields that are defined by this
prim definition for property propName if a property named
propName exists.
Parameters
propName (str) –
class pxr.Usd.PrimRange
An forward-iterable range that traverses a subtree of prims rooted at
a given prim in depth-first order.
In addition to depth-first order, UsdPrimRange provides the optional
ability to traverse in depth-first pre- and post-order wher prims
appear twice in the range; first before all descendants and then again
immediately after all descendants. This is useful for maintaining
state associated with subtrees, in a stack-like fashion. See
UsdPrimRange::iterator::IsPostVisit() to detect when an iterator is
visiting a prim for the second time.
There are several constructors providing different levels of
configurability; ultimately, one can provide a prim predicate for a
custom iteration, just as one would use UsdPrim::GetFilteredChildren()
in a custom recursion.
Why would one want to use a UsdPrimRange rather than just iterating
over the results of UsdPrim::GetFilteredDescendants() ? Primarily, if
one of the following applies:
You need to perform pre-and-post-order processing
You may want to prune sub-trees from processing (see
UsdPrimRange::iterator::PruneChildren() )
You want to treat the root prim itself uniformly with its
descendents (GetFilteredDescendants() will not return the root prim
itself, while UsdPrimRange will - see UsdPrimRange::Stage for an
exception).
Using UsdPrimRange in C++
UsdPrimRange provides standard container-like semantics. For example:
// simple range-for iteration
for (UsdPrim prim: UsdPrimRange(rootPrim)) {
ProcessPrim(prim);
}
// using stl algorithms
std::vector<UsdPrim> meshes;
auto range = stage->Traverse();
std::copy_if(range.begin(), range.end(), std::back_inserter(meshes),
[](UsdPrim const &) { return prim.IsA<UsdGeomMesh>(); });
// iterator-based iterating, with subtree pruning
UsdPrimRange range(rootPrim);
for (auto iter = range.begin(); iter != range.end(); ++iter) {
if (UsdModelAPI(\*iter).GetKind() == KindTokens->component) {
iter.PruneChildren();
}
else {
nonComponents.push_back(\*iter);
}
}
Using Usd.PrimRange in python
The python wrapping for PrimRange is python-iterable, so it can used
directly as the object of a”for x in...”clause; however in that
usage one loses access to PrimRange methods such as PruneChildren()
and IsPostVisit(). Simply create the iterator outside the loop to
overcome this limitation. Finally, in python, prim predicates must be
combined with bit-wise operators rather than logical operators because
the latter are not overridable.
# simple iteration
for prim in Usd.PrimRange(rootPrim):
ProcessPrim(prim)
# filtered range using iterator to invoke iterator methods
it = iter(Usd.PrimRange.Stage(stage, Usd.PrimIsLoaded & ~Usd.PrimIsAbstract))
for prim in it:
if Usd.ModelAPI(prim).GetKind() == Kind.Tokens.component:
it.PruneChildren()
else:
nonComponents.append(prim)
Finally, since iterators in python are not directly dereferencable, we
provide the python only methods GetCurrentPrim() and IsValid(),
documented in the python help system.
Methods:
AllPrims
classmethod AllPrims(start) -> PrimRange
AllPrimsPreAndPostVisit
classmethod AllPrimsPreAndPostVisit(start) -> PrimRange
IsValid
true if the iterator is not yet exhausted
PreAndPostVisit
classmethod PreAndPostVisit(start) -> PrimRange
Stage
classmethod Stage(stage, predicate) -> PrimRange
static AllPrims()
classmethod AllPrims(start) -> PrimRange
Construct a PrimRange that traverses the subtree rooted at start
in depth-first order, visiting all prims (including deactivated,
undefined, and abstract prims).
Parameters
start (Prim) –
static AllPrimsPreAndPostVisit()
classmethod AllPrimsPreAndPostVisit(start) -> PrimRange
Construct a PrimRange that traverses the subtree rooted at start
in depth-first order, visiting all prims (including deactivated,
undefined, and abstract prims) with pre- and post-order visitation.
Pre- and post-order visitation means that each prim appears twice in
the range; not only prior to all its descendants as with an ordinary
traversal but also immediately following its descendants. This lets
client code maintain state for subtrees. See
UsdPrimRange::iterator::IsPostVisit() .
Parameters
start (Prim) –
IsValid()
true if the iterator is not yet exhausted
static PreAndPostVisit()
classmethod PreAndPostVisit(start) -> PrimRange
Create a PrimRange that traverses the subtree rooted at start in
depth-first order, visiting prims that pass the default predicate (as
defined by UsdPrimDefaultPredicate) with pre- and post-order
visitation.
Pre- and post-order visitation means that each prim appears twice in
the range; not only prior to all its descendants as with an ordinary
traversal but also immediately following its descendants. This lets
client code maintain state for subtrees. See
UsdPrimRange::iterator::IsPostVisit() .
Parameters
start (Prim) –
PreAndPostVisit(start, predicate) -> PrimRange
Create a PrimRange that traverses the subtree rooted at start in
depth-first order, visiting prims that pass predicate with pre-
and post-order visitation.
Pre- and post-order visitation means that each prim appears twice in
the range; not only prior to all its descendants as with an ordinary
traversal but also immediately following its descendants. This lets
client code maintain state for subtrees. See
UsdPrimRange::iterator::IsPostVisit() .
Parameters
start (Prim) –
predicate (_PrimFlagsPredicate) –
static Stage()
classmethod Stage(stage, predicate) -> PrimRange
Create a PrimRange that traverses all the prims on stage , and
visits those that pass the default predicate (as defined by
UsdPrimDefaultPredicate).
Parameters
stage (Stage) –
predicate (_PrimFlagsPredicate) –
class pxr.Usd.PrimTypeInfo
Class that holds the full type information for a prim.
It holds the type name, applied API schema names, and possibly a
mapped schema type name which represent a unique full type. The info
this holds is used to cache and provide the”real”schema type for the
prim’s type name regardless of whether it is a recognized prim type or
not. The optional”mapped schema type name”is used to obtain a valid
schema type for an unrecognized prim type name if the stage provides a
fallback type for the unrecognized type. This class also provides
access to the prim definition that defines all the built-in properties
and metadata of a prim of this type.
Methods:
GetAppliedAPISchemas()
Returns the list of applied API schemas, directly authored on the prim, that impart additional properties on its prim definition.
GetEmptyPrimType
classmethod GetEmptyPrimType() -> PrimTypeInfo
GetPrimDefinition()
Returns the prim definition associated with this prim type's schema type and applied API schemas.
GetSchemaType()
Returns the TfType of the actual concrete schema that prims of this type will use to create their prim definition.
GetSchemaTypeName()
Returns the type name associated with the schema type returned from GetSchemaType.
GetTypeName()
Returns the concrete prim type name.
GetAppliedAPISchemas() → list[TfToken]
Returns the list of applied API schemas, directly authored on the
prim, that impart additional properties on its prim definition.
This does NOT include the applied API schemas that may be defined in
the conrete prim type’s prim definition..
static GetEmptyPrimType()
classmethod GetEmptyPrimType() -> PrimTypeInfo
Returns the empty prim type info.
GetPrimDefinition() → PrimDefinition
Returns the prim definition associated with this prim type’s schema
type and applied API schemas.
GetSchemaType() → Type
Returns the TfType of the actual concrete schema that prims of this
type will use to create their prim definition.
Typically, this will be the type registered in the schema registry for
the concrete prim type returned by GetTypeName. But if the stage
provided this type info with a fallback type because the prim type
name is not a recognized schema, this will return the provided
fallback schema type instead.
Fallback Prim Types
GetSchemaTypeName() → str
Returns the type name associated with the schema type returned from
GetSchemaType.
This will always be equivalent to calling
UsdSchemaRegistry::GetConcreteSchemaTypeName on the type returned by
GetSchemaType and will typically be the same as GetTypeName as long as
the prim type name is a recognized prim type.
Fallback Prim Types
GetTypeName() → str
Returns the concrete prim type name.
class pxr.Usd.Property
Base class for UsdAttribute and UsdRelationship scenegraph objects.
UsdProperty has a bool conversion operator that validates that the
property IsDefined() and thus valid for querying and authoring values
and metadata. This is a fairly expensive query that we do not
cache, so if client code retains UsdProperty objects it should manage
its object validity closely for performance. An ideal pattern is to
listen for UsdNotice::StageContentsChanged notifications, and
revalidate/refetch retained UsdObjects only then and otherwise use
them without validity checking.
Methods:
ClearDisplayGroup()
Clears this property's display group (metadata) in the current EditTarget (only).
ClearDisplayName()
Clears this property's display name (metadata) in the current EditTarget (only).
FlattenTo(parent)
Flattens this property to a property spec with the same name beneath the given parent prim in the edit target of its owning stage.
GetBaseName()
Return this property's name with all namespace prefixes removed, i.e.
GetDisplayGroup()
Return this property's display group (metadata).
GetDisplayName()
Return this property's display name (metadata).
GetNamespace()
Return this property's complete namespace prefix.
GetNestedDisplayGroups()
Return this property's displayGroup as a sequence of groups to be nested, or an empty vector if displayGroup is empty or not authored.
GetPropertyStack(time)
Returns a strength-ordered list of property specs that provide opinions for this property.
GetPropertyStackWithLayerOffsets(time)
Returns a strength-ordered list of property specs that provide opinions for this property paired with the cumulative layer offset from the stage's root layer to the layer containing the property spec.
HasAuthoredDisplayGroup()
Returns true if displayGroup was explicitly authored and GetMetadata() will return a meaningful value for displayGroup.
HasAuthoredDisplayName()
Returns true if displayName was explicitly authored and GetMetadata() will return a meaningful value for displayName.
IsAuthored()
Return true if there are any authored opinions for this property in any layer that contributes to this stage, false otherwise.
IsAuthoredAt(editTarget)
Return true if there is an SdfPropertySpec authored for this property at the given editTarget, otherwise return false.
IsCustom()
Return true if this is a custom property (i.e., not part of a prim schema).
IsDefined()
Return true if this is a builtin property or if the strongest authored SdfPropertySpec for this property's path matches this property's dynamic type.
SetCustom(isCustom)
Set the value for custom at the current EditTarget, return true on success, false if the value can not be written.
SetDisplayGroup(displayGroup)
Sets this property's display group (metadata).
SetDisplayName(name)
Sets this property's display name (metadata).
SetNestedDisplayGroups(nestedGroups)
Sets this property's display group (metadata) to the nested sequence.
SplitName()
Return this property's name elements including namespaces and its base name as the final element.
ClearDisplayGroup() → bool
Clears this property’s display group (metadata) in the current
EditTarget (only).
Returns true on success.
ClearDisplayName() → bool
Clears this property’s display name (metadata) in the current
EditTarget (only).
Returns true on success.
FlattenTo(parent) → Property
Flattens this property to a property spec with the same name beneath
the given parent prim in the edit target of its owning stage.
The parent prim may belong to a different stage than this
property’s owning stage.
Flattening authors all authored resolved values and metadata for this
property into the destination property spec. If this property is a
builtin property, fallback values and metadata will also be authored
if the destination property has a different fallback value or no
fallback value, or if the destination property has an authored value
that overrides its fallback.
Attribute connections and relationship targets that target an object
beneath this property’s owning prim will be remapped to target objects
beneath the destination parent prim.
If the destination spec already exists, it will be overwritten.
UsdStage::Flatten
Parameters
parent (Prim) –
FlattenTo(parent, propName) -> Property
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Flattens this property to a property spec with the given propName
beneath the given parent prim in the edit target of its owning
stage.
The parent prim may belong to a different stage than this
property’s owning stage.
Parameters
parent (Prim) –
propName (str) –
FlattenTo(property) -> Property
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Flattens this property to a property spec for the given property
in the edit target of its owning prim’s stage.
The property owning prim may belong to a different stage than this
property’s owning stage.
Parameters
property (Property) –
GetBaseName() → str
Return this property’s name with all namespace prefixes removed, i.e.
the last component of the return value of GetName()
This is generally the property’s”client name”; property namespaces are
often used to group related properties together. The namespace
prefixes the property name but many consumers will care only about un-
namespaced name, i.e. its BaseName. For more information, see Names,
Namespace Ordering, and Property Namespaces
GetDisplayGroup() → str
Return this property’s display group (metadata).
This returns the empty token if no display group has been set.
SetDisplayGroup()
GetDisplayName() → str
Return this property’s display name (metadata).
This returns the empty string if no display name has been set.
SetDisplayName()
GetNamespace() → str
Return this property’s complete namespace prefix.
Return the empty token if this property has no namespaces.
This is the complement of GetBaseName() , although it does not
contain a trailing namespace delimiter
GetNestedDisplayGroups() → list[str]
Return this property’s displayGroup as a sequence of groups to be
nested, or an empty vector if displayGroup is empty or not authored.
GetPropertyStack(time) → list[SdfPropertySpecHandle]
Returns a strength-ordered list of property specs that provide
opinions for this property.
If time is UsdTimeCode::Default() , or this property is a
UsdRelationship (which are never affected by clips), we will not
consider value clips for opinions. For any other time , for a
UsdAttribute, clips whose samples may contribute an opinion will be
included. These specs are ordered from strongest to weakest opinion,
although if time requires interpolation between two adjacent
clips, both clips will appear, sequentially.
The results returned by this method are meant for debugging and
diagnostic purposes. It is not advisable to retain a PropertyStack
for the purposes of expedited value resolution for properties, since
the makeup of an attribute’s PropertyStack may itself be time-varying.
To expedite repeated value resolution of attributes, you should
instead retain a UsdAttributeQuery .
UsdClipsAPI
Parameters
time (TimeCode) –
GetPropertyStackWithLayerOffsets(time) → list[tuple[PropertySpec, LayerOffset]]
Returns a strength-ordered list of property specs that provide
opinions for this property paired with the cumulative layer offset
from the stage’s root layer to the layer containing the property spec.
This behaves exactly the same as UsdProperty::GetPropertyStack with
the addition of providing the cumulative layer offset of each spec’s
layer.
The results returned by this method are meant for debugging and
diagnostic purposes. It is not advisable to retain a PropertyStack
for the purposes of expedited value resolution for properties, since
the makeup of an attribute’s PropertyStack may itself be time-varying.
To expedite repeated value resolution of attributes, you should
instead retain a UsdAttributeQuery .
Parameters
time (TimeCode) –
HasAuthoredDisplayGroup() → bool
Returns true if displayGroup was explicitly authored and GetMetadata()
will return a meaningful value for displayGroup.
HasAuthoredDisplayName() → bool
Returns true if displayName was explicitly authored and GetMetadata()
will return a meaningful value for displayName.
IsAuthored() → bool
Return true if there are any authored opinions for this property in
any layer that contributes to this stage, false otherwise.
IsAuthoredAt(editTarget) → bool
Return true if there is an SdfPropertySpec authored for this property
at the given editTarget, otherwise return false.
Note that this method does not do partial composition. It does not
consider whether authored scene description exists at editTarget or
weaker, only exactly at the given editTarget.
Parameters
editTarget (EditTarget) –
IsCustom() → bool
Return true if this is a custom property (i.e., not part of a prim
schema).
The’custom’modifier in USD serves the same function as
Alembic’s’userProperties’, which is to say as a categorization for ad
hoc client data not formalized into any schema, and therefore not
carrying an expectation of specific processing by consuming
applications.
IsDefined() → bool
Return true if this is a builtin property or if the strongest authored
SdfPropertySpec for this property’s path matches this property’s
dynamic type.
That is, SdfRelationshipSpec in case this is a UsdRelationship, and
SdfAttributeSpec in case this is a UsdAttribute. Return false if
this property’s prim has expired.
For attributes, a true return does not imply that this attribute
possesses a value, only that has been declared, is of a certain type
and variability, and that it is safe to use to query and author values
and metadata.
SetCustom(isCustom) → bool
Set the value for custom at the current EditTarget, return true on
success, false if the value can not be written.
Note that this value should not be changed as it is typically
either automatically authored or provided by a property definition.
This method is provided primarily for fixing invalid scene
description.
Parameters
isCustom (bool) –
SetDisplayGroup(displayGroup) → bool
Sets this property’s display group (metadata).
Returns true on success.
DisplayGroup provides UI hinting for grouping related properties
together for display. We define a convention for specifying nesting of
groups by recognizing the property namespace separator in displayGroup
as denoting group-nesting.
SetNestedDisplayGroups()
Parameters
displayGroup (str) –
SetDisplayName(name) → bool
Sets this property’s display name (metadata).
Returns true on success.
DisplayName is meant to be a descriptive label, not necessarily an
alternate identifier; therefore there is no restriction on which
characters can appear in it.
Parameters
name (str) –
SetNestedDisplayGroups(nestedGroups) → bool
Sets this property’s display group (metadata) to the nested sequence.
Returns true on success.
A displayGroup set with this method can still be retrieved with
GetDisplayGroup() , with the namespace separator embedded in the
result. If nestedGroups is empty, we author an empty string for
displayGroup.
SetDisplayGroup()
Parameters
nestedGroups (list[str]) –
SplitName() → list[str]
Return this property’s name elements including namespaces and its base
name as the final element.
class pxr.Usd.References
UsdReferences provides an interface to authoring and introspecting
references in Usd.
References are the primary operator for”encapsulated aggregation”of
scene description. aggregation means that references let us build up
rich scenes by composing scene description recorded in a (most often)
different layer. A scene can reference the same layer many times at
different locations in a scene’s namespace. Referenced scene
description can be overridden in the referencing (or stronger) layers,
allowing each instance of the reference to be directly
customized/overridden. Encapsulated means that regardless of how
much scene description is in the referenced layer, only the scene
description under and composed from (via other composition arcs in the
referenced layer) the targeted prim will be composed into the
aggregate scene. Multiple references to the same layer will result in
the layer being opened and retained in memory only once, although each
referencing prim will compose unique prim indices for the tree rooted
at the referenced prim.
## Important Qualities and Effective Use of References
Any prim can host zero, one or multiple references
References are list editable; that is, they compose differently
than ordinary properties and metadata. In any given LayerStack, each
authored reference operation at the same SdfPath location in each
layer (i.e. on the same prim) will compose into an aggregate result by
adding to, removing from, or replacing”weaker”references.
References can target the same LayerStack in which they are
authored, as long as doing so does not introduce a cycle in the
composition graph. See Expressing”internal”references to the
containing LayerStack
The identifier component of a reference in the provided API
can be a resolvable asset-path to some external layer, empty, in which
case the reference targets the root layer of the LayerStack containing
the referencing layer, or the identifier of an existing anonymous, in-
memory-only SdfLayer. Care should be exercised in the latter case:
calling Export() on an anonymous layer to serialize it to a file will
not attempt to replace any references to anonymous layers with
references to file-backed layers.
Opinions brought in by reference on an ancestor prim are weaker
than opinions brought in by references on a descendant prim.
References may omit the target prim path if the referenced layer has
the’defaultPrim’metadata set. In this case, the reference targets
the’defaultPrim’in the referenced layer. A layer’s defaultPrim can be
authored and accessed on a UsdStage whose root layer is the layer in
question: see UsdStage::GetDefaultPrim() and
UsdStage::SetDefaultPrim() . One can also author defaultPrim directly
on an SdfLayer - see SdfLayer::GetDefaultPrim() ,
SdfLayer::SetDefaultPrim() .
References may omit the identifier specifying the referenced layer.
This creates an”internal”reference. During composition, the referenced
layer will be resolved to the root layer of the LayerStack containing
the layer where the reference was authored. See AddInternalReference()
.
References may target any prim in a layer. In the simplest and most
common case, a root prim in a layer will be referenced. However,
referencing sub-root prims can be useful in a variety of other cases;
for example, a user might organize prims into a meaningful hierarchy
in a layer for display purposes, then use sub-root references to
reference a selection from that hierarchy into a scene.
Sub-root references have subtle behaviors with respect to opinions and
composition arcs authored on ancestors of the referenced prim. Users
should carefully consider this when deciding whether to use sub-root
references. These issues can be avoided by not authoring any
properties or metadata on ancestors of prims that are meant to be
referenced.
Consider the following example:
\* shot.usda | \* asset.usda
|
#usda 1.0 | #usda 1.0
|
over "Class" | class "Class"
{ | {
over "B" | }
{ |
over "Model" | def "A" (
{ | inherits = </Class>
int a = 3 | )
} | {
} | token purpose = "render"
} |
| def "B" (
over "A" | variantSets = "type"
{ | variants = {
over "B" ( | string type = "a"
# variant selection won't be used | }
variants = { | )
string type = "b" | {
} | variantSet "type" = {
) | "a" {
{ | def "Model"
} | {
} | int a = 1
| }
def "ReferencedModel" ( | }
references = @./asset.usda@</A/B/Model> | "b" {
) | def "Model"
{ | {
} | int a = 2
| }
| }
| }
| }
| }
- Property and metadata opinions on the ancestors of the referenced
prim *are not* present in the composed stage and will never contribute
to any computations. In this example, the opinion for the attribute
/A.purpose in asset.usda will never be visible in the UsdStage for
shot.usda.
- Property and metadata opinions due to ancestral composition arcs
*are* present in the composed stage. In this example, the attribute
/Class/B/Model.a in shot.usda will be present in the UsdStage for
shot.usda, even though the inherit arc is authored on an ancestor of
the referenced prim.
- A consequence of these rules is that users might not be able to
override ancestral variant selections that affect the referenced prim.
In this example, the Model prim being referenced comes from the
variant selection {type=a} on prim /A/B in asset.usda. The {type=b}
variant cannot be selected in shot.usda, even if prims with the same
hierarchy happen to exist there. There are various workarounds for
this; in this example, the {type=b} variant selection could be
authored on /Class/B/Model in shot.usda instead because of the inherit
arc that was established on prim /A.
AddReference() and SetReferences() can each fail for a number of
reasons. If one of the specified prim targets for one of the
references is not a prim, we will generate an error, fail to author
any scene description, and return false . If anything goes wrong
in attempting to write the reference, we also return false, and the
reference will also remain unauthored. Otherwise, if the reference was
successfully authored, we will return true . A successful
reference authoring operation may still generate composition errors!
Just because the reference you specified was syntactically correct and
therefore successfully authored, does not imply it was meaningful. If
you wish to ensure that the reference you are about to author will be
meaningfully consumable by your stage, you are strongly encouraged to
ensure it will resolve to an actual file by using
UsdStage::ResolveIdentifierToEditTarget() before authoring the
reference.
When adding an internal reference, the given prim path is expected to
be in the namespace of the owning prim’s stage. Sub-root prim paths
will be translated from this namespace to the namespace of the current
edit target, if necessary. If a path cannot be translated, a coding
error will be issued and no changes will be made. Non-sub-root paths
will not be translated.
Immediately upon successful authoring of the reference (before
returning from AddReference() , RemoveReference() , ClearReferences()
, or SetReferences() ), the UsdStage on which the reference was
authored will recompose the subtree rooted at the prim hosting the
reference. If the provided identifier does not resolve to a layer that
is already opened or that can be opened in the usd format, or if the
provided primPath is not an actual prim in that layer, the stage’s
recomposition will fail, and pass on composition errors to the client.
Methods:
AddInternalReference(primPath, layerOffset, ...)
Add an internal reference to the specified prim.
AddReference(ref, position)
Adds a reference to the reference listOp at the current EditTarget, in the position specified by position .
ClearReferences()
Removes the authored reference listOp edits at the current EditTarget.
GetPrim()
Return the prim this object is bound to.
RemoveReference(ref)
Removes the specified reference from the references listOp at the current EditTarget.
SetReferences(items)
Explicitly set the references, potentially blocking weaker opinions that add or remove items.
AddInternalReference(primPath, layerOffset, position) → bool
Add an internal reference to the specified prim.
Internal References
Parameters
primPath (Path) –
layerOffset (LayerOffset) –
position (ListPosition) –
AddReference(ref, position) → bool
Adds a reference to the reference listOp at the current EditTarget, in
the position specified by position .
Why adding references may fail for explanation of expectations on
ref and what return values and errors to expect, and ListOps and
List Editing for details on list editing and composition of listOps.
Parameters
ref (Reference) –
position (ListPosition) –
AddReference(identifier, primPath, layerOffset, position) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
identifier (str) –
primPath (Path) –
layerOffset (LayerOffset) –
position (ListPosition) –
AddReference(identifier, layerOffset, position) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
References Without Prim Paths
Parameters
identifier (str) –
layerOffset (LayerOffset) –
position (ListPosition) –
ClearReferences() → bool
Removes the authored reference listOp edits at the current EditTarget.
The same caveats for Remove() apply to Clear(). In fact, Clear() may
actually increase the number of composed references, if the listOp
being cleared contained the”remove”operator.
ListOps and List Editing
GetPrim() → Prim
Return the prim this object is bound to.
GetPrim() -> Prim
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
RemoveReference(ref) → bool
Removes the specified reference from the references listOp at the
current EditTarget.
This does not necessarily eliminate the reference completely, as it
may be added or set in another layer in the same LayerStack as the
current EditTarget.
ListOps and List Editing
Parameters
ref (Reference) –
SetReferences(items) → bool
Explicitly set the references, potentially blocking weaker opinions
that add or remove items.
Why adding references may fail for explanation of expectations on
ref and what return values and errors to expect, and ListOps and
List Editing for details on list editing and composition of listOps.
Parameters
items (list[SdfReference]) –
class pxr.Usd.Relationship
A UsdRelationship creates dependencies between scenegraph objects by
allowing a prim to target other prims, attributes, or relationships.
## Relationship Characteristics
A UsdRelationship is a pointer to other objects, which are named by
their scenegraph paths. When authoring relationships, the target
parameters should be scenegraph paths in the composed namespace of the
UsdStage into which you are authoring. If your edits are targeted to a
different layer, across various composition arcs (because you
specified a non-default UsdEditTarget), the target’s path will be
automatically translated into the proper namespace.
A single UsdRelationship can target multiple other objects, which can
be of UsdPrim, UsdAttribute, or UsdRelationship type. UsdRelationship
participates in”list editing”, which means that stronger layers in a
composed scene can add, remove, or reorder targets authored on the
relationship in weaker layers without stomping the weaker opinions,
although stomping behavior is still possible, via SetTargets() .
An authored relationship creates a dependency of the targeting prim on
the targeted prim(s). We consider these dependencies to
be”loaddependencies”, which means that when we load the targeting
prim’s”load group”, we will also load the targeted prims’load groups,
to ensure that all the data required to render the model containing
the targeting prim is composed and available.
Like UsdAttribute, UsdRelationship objects are meant to be ephemeral,
live on the stack, and be cheap to refetch from their owning UsdPrim.
Unlike UsdAttribute s, which can either be uniform over all time or
vary in value over time, UsdRelationship is always uniform.
## Relationship Restrictions
When authoring relationship targets in a stage’s local LayerStack, all
target paths are legal (Note we may restrict this prior to launch to
only allowing targeting of already-extant scenegraph objects).
However, a relationship target that is legal in a local LayerStack may
become unreachable when the stage’s root layer is referenced into an
aggregate, and will cause an error when attempting to load/compose the
aggregate.
This can happen because references encapsulate just the tree whose
root is targeted in the reference - no other scene description in the
referenced layer will be composed into the aggregate. So if some
descendant prim of the referenced root targets a relationship to
another tree in the same layer, that relationship would dangle, and
the client will error in GetTargets() or GetForwardedTargets() .
Authoring targets to objects within prototypes is not allowed, since
prototype prims do not have a stable identity across runs. Consumers
must author targets to the object within an instance instead.
Relationships authored in a descendent prim of a referenced prim may
not target the referenced prim itself or any of its immediate child
properties if the referencing prim is instanceable. Allowing this
would break the ability for this relationship to be instanced and
shared by multiple instances it would force consumers of
relationships within prototypes to resolve targets in the context of
each of that prototype’s instances.
## Relationship Forwarding
Because a relationship can target another relationship, we can and do
provide the ability to resolve chained or forwarded relationships.
This can be useful in several situations, including:
Combining relationships with VariantSets to create
demultiplexers. A prim can host a relationship that serves as
a”binding post”for other prims to target. The prim also hosts
a”bindingVariant” UsdVariantSet whose variants each modulate the
target of the binding-post relationship. We can now change the
forwarded target of all prims targeting the binding-post by simply
switching the bindingVariant VariantSet. We will work through this
example in the USD reference manual.
Defining a relationship as part of a model’s interface (so that
it can be targeted in model hierarchy with no models loaded), which,
inside the model’s payload, forwards to prims useful to a client, the
set of which may vary depending on the model’s configured VariantSets.
Methods:
AddTarget(target, position)
Adds target to the list of targets, in the position specified by position .
ClearTargets(removeSpec)
Remove all opinions about the target list from the current edit target.
GetForwardedTargets(targets)
Compose this relationship's ultimate targets, taking into account"relationship forwarding", and fill targets with the result.
GetTargets(targets)
Compose this relationship's targets and fill targets with the result.
HasAuthoredTargets()
Returns true if any target path opinions have been authored.
RemoveTarget(target)
Removes target from the list of targets.
SetTargets(targets)
Make the authoring layer's opinion of the targets list explicit, and set exactly to targets .
AddTarget(target, position) → bool
Adds target to the list of targets, in the position specified by
position .
Passing paths to prototype prims or any other objects in prototypes
will cause an error to be issued. It is not valid to author targets to
these objects.
What data this actually authors depends on what data is currently
authored in the authoring layer, with respect to list-editing
semantics, which we will document soon
Parameters
target (Path) –
position (ListPosition) –
ClearTargets(removeSpec) → bool
Remove all opinions about the target list 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
removeSpec (bool) –
GetForwardedTargets(targets) → bool
Compose this relationship’s ultimate targets, taking into
account”relationship forwarding”, and fill targets with the
result.
All preexisting elements in targets are lost. This method never
inserts relationship paths in targets .
Returns true if any of the visited relationships that are not”purely
forwarding”has an authored opinion for its target paths and no
composition errors were encountered while computing any targets.
Purely forwarding, in this context, means the relationship has at
least one target but all of its targets are paths to other
relationships. Note that authored opinions may include opinions that
clear the targets and a return value of true does not necessarily
indicate that targets will not be empty.
Returns false otherwise. When composition errors occur, this function
continues to collect successfully composed targets, but returns false
to indicate to the caller that errors occurred.
When a forwarded target cannot be determined, e.g. due to a
composition error, no value is returned for that target; the
alternative would be to return the relationship path at which the
forwarded targets could not be composed, however this would require
all callers of GetForwardedTargets() to account for unexpected
relationship paths being returned with the expected target results.
For example, a particular caller may expect only prim paths in the
target vector, but when composition errors occur, relationships would
be included, potentially triggering additional down stream errors.
See Relationship Forwarding for details on the semantics.
The result is not cached, so will be recomputed on every query.
Parameters
targets (list[SdfPath]) –
GetTargets(targets) → bool
Compose this relationship’s targets and fill targets with the
result.
All preexisting elements in targets are lost.
Returns true if any target path opinions have been authored and no
composition errors were encountered, returns false otherwise. Note
that authored opinions may include opinions that clear the targets and
a return value of true does not necessarily indicate that targets
will contain any target paths.
See Relationship Targets and Attribute Connections for details on
behavior when targets point to objects beneath instance prims.
The result is not cached, so will be recomputed on every query.
Parameters
targets (list[SdfPath]) –
HasAuthoredTargets() → bool
Returns true if any target path opinions have been authored.
Note that this may include opinions that clear targets and may not
indicate that target paths will exist for this relationship.
RemoveTarget(target) → bool
Removes target from the list of targets.
Passing paths to prototype prims or any other objects in prototypes
will cause an error to be issued. It is not valid to author targets to
these objects.
Parameters
target (Path) –
SetTargets(targets) → bool
Make the authoring layer’s opinion of the targets list explicit, and
set exactly to targets .
Passing paths to prototype prims or any other objects in prototypes
will cause an error to be issued. It is not valid to author targets to
these objects.
If any target in targets is invalid, no targets will be authored
and this function will return false.
Parameters
targets (list[SdfPath]) –
class pxr.Usd.ResolveInfo
Container for information about the source of an attribute’s value,
i.e. the’resolved’location of the attribute.
For more details, see TimeSamples, Defaults, and Value Resolution.
Methods:
GetNode()
Return the node within the containing PcpPrimIndex that provided the resolved value opinion.
GetSource()
Return the source of the associated attribute's value.
ValueIsBlocked()
Return true if this UsdResolveInfo represents an attribute whose value is blocked.
GetNode() → NodeRef
Return the node within the containing PcpPrimIndex that provided the
resolved value opinion.
GetSource() → ResolveInfoSource
Return the source of the associated attribute’s value.
ValueIsBlocked() → bool
Return true if this UsdResolveInfo represents an attribute whose value
is blocked.
UsdAttribute::Block()
class pxr.Usd.ResolveInfoSource
Methods:
GetValueFromName
Attributes:
allValues
static GetValueFromName()
allValues = (Usd.ResolveInfoSourceNone, Usd.ResolveInfoSourceFallback, Usd.ResolveInfoSourceDefault, Usd.ResolveInfoSourceTimeSamples, Usd.ResolveInfoSourceValueClips)
class pxr.Usd.ResolveTarget
Defines a subrange of nodes and layers within a prim’s prim index to
consider when performing value resolution for the prim’s attributes. A
resolve target can then be passed to UsdAttributeQuery during its
construction to have all of the queries made by the UsdAttributeQuery
use the resolve target’s subrange for their value resolution.
Resolve targets can be created via methods on
UsdPrimCompositionQueryArc to to limit value resolution to a subrange
of the prim’s composed specs that are no stronger that arc, or a
subrange of specs that is strictly stronger than that arc (optionally
providing a particular layer within the arc’s layer stack to further
limit the range of specs).
Alternatively, resolve targets can also be created via methods on
UsdPrim that can limit value resolution to either up to or stronger
than the spec that would be edited when setting a value for the prim
using the given UsdEditTarget.
Unlike UsdEditTarget, a UsdResolveTarget is only relevant to the prim
it is created for and can only be used in a UsdAttributeQuery for
attributes on this prim.
## Invalidation
This object does not listen for change notification. If a consumer is
holding on to a UsdResolveTarget, it is their responsibility to
dispose of it in response to a resync change to the associated prim.
Failing to do so may result in incorrect values or crashes due to
dereferencing invalid objects.
Methods:
GetPrimIndex()
Get the prim index of the resolve target.
GetStartLayer()
Returns the layer in the layer stack of the start node that value resolution with this resolve target will start at.
GetStartNode()
Returns the node that value resolution with this resolve target will start at.
GetStopLayer()
Returns the layer in the layer stack of the stop node that value resolution with this resolve target will stop at.
GetStopNode()
Returns the node that value resolution with this resolve target will stop at when the"stop at"layer is reached.
IsNull()
Returns true if this is a null resolve target.
GetPrimIndex() → PrimIndex
Get the prim index of the resolve target.
GetStartLayer() → Layer
Returns the layer in the layer stack of the start node that value
resolution with this resolve target will start at.
GetStartNode() → NodeRef
Returns the node that value resolution with this resolve target will
start at.
GetStopLayer() → Layer
Returns the layer in the layer stack of the stop node that value
resolution with this resolve target will stop at.
GetStopNode() → NodeRef
Returns the node that value resolution with this resolve target will
stop at when the”stop at”layer is reached.
IsNull() → bool
Returns true if this is a null resolve target.
class pxr.Usd.SchemaBase
The base class for all schema types in Usd.
Schema objects hold a UsdPrim internally and provide a layer of
specific named API atop the underlying scene graph.
Schema objects are polymorphic but they are intended to be created as
automatic local variables, so they may be passed and returned by-
value. This leaves them subject to slicing. This means that if one
passes a SpecificSchema instance to a function that takes a
UsdSchemaBase by-value, all the polymorphic behavior specific to
SpecificSchema is lost.
To avoid slicing, it is encouraged that functions taking schema object
arguments take them by const& if const access is sufficient,
otherwise by non-const pointer.
Methods:
GetPath()
Shorthand for GetPrim() -> GetPath() .
GetPrim()
Return this schema object's held prim.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
GetSchemaClassPrimDefinition()
Return the prim definition associated with this schema instance if one exists, otherwise return null.
GetSchemaKind()
Returns the kind of schema this class is.
IsAPISchema()
Returns whether this is an API schema or not.
IsAppliedAPISchema()
Returns whether this is an applied API schema or not.
IsConcrete()
Returns whether or not this class corresponds to a concrete instantiable prim type in scene description.
IsMultipleApplyAPISchema()
Returns whether this is an applied API schema or not.
IsTyped()
Returns whether or not this class inherits from UsdTyped.
GetPath() → Path
Shorthand for GetPrim() -> GetPath() .
GetPrim() → Prim
Return this schema object’s held prim.
static GetSchemaAttributeNames()
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Parameters
includeInherited (bool) –
GetSchemaClassPrimDefinition() → PrimDefinition
Return the prim definition associated with this schema instance if one
exists, otherwise return null.
This does not use the held prim’s type. To get the held prim
instance’s definition, use UsdPrim::GetPrimDefinition() .
UsdPrim::GetPrimDefinition()
GetSchemaKind() → SchemaKind
Returns the kind of schema this class is.
IsAPISchema() → bool
Returns whether this is an API schema or not.
IsAppliedAPISchema() → bool
Returns whether this is an applied API schema or not.
If this returns true this class will have an Apply() method
IsConcrete() → bool
Returns whether or not this class corresponds to a concrete
instantiable prim type in scene description.
If this is true, GetStaticPrimDefinition() will return a valid prim
definition with a non-empty typeName.
IsMultipleApplyAPISchema() → bool
Returns whether this is an applied API schema or not.
If this returns true the constructor, Get and Apply methods of this
class will take in the name of the API schema instance.
IsTyped() → bool
Returns whether or not this class inherits from UsdTyped.
Types which inherit from UsdTyped can impart a typename on a UsdPrim.
class pxr.Usd.SchemaKind
Attributes:
AbstractBase
AbstractTyped
ConcreteTyped
Invalid
MultipleApplyAPI
NonAppliedAPI
SingleApplyAPI
names
values
AbstractBase = pxr.Usd.SchemaKind.AbstractBase
AbstractTyped = pxr.Usd.SchemaKind.AbstractTyped
ConcreteTyped = pxr.Usd.SchemaKind.ConcreteTyped
Invalid = pxr.Usd.SchemaKind.Invalid
MultipleApplyAPI = pxr.Usd.SchemaKind.MultipleApplyAPI
NonAppliedAPI = pxr.Usd.SchemaKind.NonAppliedAPI
SingleApplyAPI = pxr.Usd.SchemaKind.SingleApplyAPI
names = {'AbstractBase': pxr.Usd.SchemaKind.AbstractBase, 'AbstractTyped': pxr.Usd.SchemaKind.AbstractTyped, 'ConcreteTyped': pxr.Usd.SchemaKind.ConcreteTyped, 'Invalid': pxr.Usd.SchemaKind.Invalid, 'MultipleApplyAPI': pxr.Usd.SchemaKind.MultipleApplyAPI, 'NonAppliedAPI': pxr.Usd.SchemaKind.NonAppliedAPI, 'SingleApplyAPI': pxr.Usd.SchemaKind.SingleApplyAPI}
values = {0: pxr.Usd.SchemaKind.Invalid, 1: pxr.Usd.SchemaKind.AbstractBase, 2: pxr.Usd.SchemaKind.AbstractTyped, 3: pxr.Usd.SchemaKind.ConcreteTyped, 4: pxr.Usd.SchemaKind.NonAppliedAPI, 5: pxr.Usd.SchemaKind.SingleApplyAPI, 6: pxr.Usd.SchemaKind.MultipleApplyAPI}
class pxr.Usd.SchemaRegistry
Singleton registry that provides access to schema type information and
the prim definitions for registered Usd”IsA”and applied API schema
types. It also contains the data from the generated schemas that is
used by prim definitions to provide properties and fallbacks.
The data contained herein comes from the generatedSchema.usda file
(generated when a schema.usda file is processed by usdGenSchema) of
each schema-defining module. The registry expects each schema type to
be represented as a single prim spec with its inheritance flattened,
i.e. the prim spec contains a union of all its local and class
inherited property specs and metadata fields.
It is used by the Usd core, via UsdPrimDefinition, to determine how to
create scene description for unauthored”built-in”properties of schema
classes, to enumerate all properties for a given schema class, and
finally to provide fallback values for unauthored built-in properties.
Methods:
BuildComposedPrimDefinition(primType, ...)
Composes and returns a new UsdPrimDefinition from the given primType and list of appliedSchemas .
FindAppliedAPIPrimDefinition(typeName)
Finds the prim definition for the given typeName token if typeName is a registered applied API schema type.
FindConcretePrimDefinition(typeName)
Finds the prim definition for the given typeName token if typeName is a registered concrete typed schema type.
GetAPISchemaCanOnlyApplyToTypeNames
classmethod GetAPISchemaCanOnlyApplyToTypeNames(apiSchemaName, instanceName) -> list[TfToken]
GetAPISchemaTypeName
classmethod GetAPISchemaTypeName(schemaType) -> str
GetAPITypeFromSchemaTypeName
classmethod GetAPITypeFromSchemaTypeName(typeName) -> Type
GetAutoApplyAPISchemas
classmethod GetAutoApplyAPISchemas() -> map[str, list[TfToken]]
GetConcreteSchemaTypeName
classmethod GetConcreteSchemaTypeName(schemaType) -> str
GetConcreteTypeFromSchemaTypeName
classmethod GetConcreteTypeFromSchemaTypeName(typeName) -> Type
GetEmptyPrimDefinition()
Returns the empty prim definition.
GetFallbackPrimTypes()
Returns a dictionary mapping concrete schema prim type names to a VtTokenArray of fallback prim type names if fallback types are defined for the schema type in its registered schema.
GetMultipleApplyNameTemplateBaseName
classmethod GetMultipleApplyNameTemplateBaseName(nameTemplate) -> str
GetSchemaKind
classmethod GetSchemaKind(schemaType) -> SchemaKind
GetSchemaTypeName
classmethod GetSchemaTypeName(schemaType) -> str
GetTypeFromName
classmethod GetTypeFromName(typeName) -> Type
GetTypeFromSchemaTypeName
classmethod GetTypeFromSchemaTypeName(typeName) -> Type
GetTypeNameAndInstance
classmethod GetTypeNameAndInstance(apiSchemaName) -> tuple[str, str]
IsAbstract
classmethod IsAbstract(primType) -> bool
IsAllowedAPISchemaInstanceName
classmethod IsAllowedAPISchemaInstanceName(apiSchemaName, instanceName) -> bool
IsAppliedAPISchema
classmethod IsAppliedAPISchema(apiSchemaType) -> bool
IsConcrete
classmethod IsConcrete(primType) -> bool
IsDisallowedField
classmethod IsDisallowedField(fieldName) -> bool
IsMultipleApplyAPISchema
classmethod IsMultipleApplyAPISchema(apiSchemaType) -> bool
IsMultipleApplyNameTemplate
classmethod IsMultipleApplyNameTemplate(nameTemplate) -> bool
IsTyped
classmethod IsTyped(primType) -> bool
MakeMultipleApplyNameInstance
classmethod MakeMultipleApplyNameInstance(nameTemplate, instanceName) -> str
MakeMultipleApplyNameTemplate
classmethod MakeMultipleApplyNameTemplate(namespacePrefix, baseName) -> str
Attributes:
expired
True if this object has expired, False otherwise.
BuildComposedPrimDefinition(primType, appliedAPISchemas) → PrimDefinition
Composes and returns a new UsdPrimDefinition from the given
primType and list of appliedSchemas .
This prim definition will contain a union of properties from the
registered prim definitions of each of the provided types.
Parameters
primType (str) –
appliedAPISchemas (list[TfToken]) –
FindAppliedAPIPrimDefinition(typeName) → PrimDefinition
Finds the prim definition for the given typeName token if
typeName is a registered applied API schema type.
Returns null if it is not.
Parameters
typeName (str) –
FindConcretePrimDefinition(typeName) → PrimDefinition
Finds the prim definition for the given typeName token if
typeName is a registered concrete typed schema type.
Returns null if it is not.
Parameters
typeName (str) –
static GetAPISchemaCanOnlyApplyToTypeNames()
classmethod GetAPISchemaCanOnlyApplyToTypeNames(apiSchemaName, instanceName) -> list[TfToken]
Returns a list of prim type names that the given apiSchemaName can
only be applied to.
A non-empty list indicates that the API schema can only be applied to
prim that are or derive from prim type names in the list. If the list
is empty, the API schema can be applied to prims of any type.
If a non-empty instanceName is provided, this will first look for
a list of”can only apply to”names specific to that instance of the API
schema and return that if found. If a list is not found for the
specific instance, it will fall back to looking for a”can only apply
to”list for just the schema name itself.
Parameters
apiSchemaName (str) –
instanceName (str) –
static GetAPISchemaTypeName()
classmethod GetAPISchemaTypeName(schemaType) -> str
Return the type name in the USD schema for API schema types only from
the given registered schemaType .
Parameters
schemaType (Type) –
static GetAPITypeFromSchemaTypeName()
classmethod GetAPITypeFromSchemaTypeName(typeName) -> Type
Return the TfType of the schema corresponding to the given API schema
type name typeName .
This the inverse of GetAPISchemaTypeNAme.
Parameters
typeName (str) –
static GetAutoApplyAPISchemas()
classmethod GetAutoApplyAPISchemas() -> map[str, list[TfToken]]
Returns a map of the names of all registered auto apply API schemas to
the list of type names each is registered to be auto applied to.
The list of type names to apply to will directly match what is
specified in the plugin metadata for each schema type. While auto
apply schemas do account for the existence and validity of the type
names and expand to include derived types of the listed types, the
type lists returned by this function do not.
static GetConcreteSchemaTypeName()
classmethod GetConcreteSchemaTypeName(schemaType) -> str
Return the type name in the USD schema for concrete prim types only
from the given registered schemaType .
Parameters
schemaType (Type) –
static GetConcreteTypeFromSchemaTypeName()
classmethod GetConcreteTypeFromSchemaTypeName(typeName) -> Type
Return the TfType of the schema corresponding to the given concrete
prim type name typeName .
This the inverse of GetConcreteSchemaTypeName.
Parameters
typeName (str) –
GetEmptyPrimDefinition() → PrimDefinition
Returns the empty prim definition.
GetFallbackPrimTypes() → VtDictionary
Returns a dictionary mapping concrete schema prim type names to a
VtTokenArray of fallback prim type names if fallback types are defined
for the schema type in its registered schema.
The standard use case for this to provide schema defined metadata that
can be saved with a stage to inform an older version of USD - that may
not have some schema types - as to which types it can used instead
when encountering a prim of one these types.
UsdStage::WriteFallbackPrimTypes
Fallback Prim Types
static GetMultipleApplyNameTemplateBaseName()
classmethod GetMultipleApplyNameTemplateBaseName(nameTemplate) -> str
Returns the base name for the multiple apply schema name template
nameTemplate .
The base name is the substring of the given name template that comes
after the instance name placeholder and the subsequent namespace
delimiter. If the given property name does not contain the instance
name placeholder, it is not a name template and the name template is
returned as is.
Parameters
nameTemplate (str) –
static GetSchemaKind()
classmethod GetSchemaKind(schemaType) -> SchemaKind
Returns the kind of the schema the given schemaType represents.
This returns UsdSchemaKind::Invalid if schemaType is not a valid
schema type or if the kind cannot be determined from type’s plugin
information.
Parameters
schemaType (Type) –
GetSchemaKind(typeName) -> SchemaKind
Returns the kind of the schema the given typeName represents.
This returns UsdSchemaKind::Invalid if typeName is not a valid
schema type name or if the kind cannot be determined from type’s
plugin information.
Parameters
typeName (str) –
static GetSchemaTypeName()
classmethod GetSchemaTypeName(schemaType) -> str
Return the type name in the USD schema for prims or API schemas of the
given registered schemaType .
Parameters
schemaType (Type) –
GetSchemaTypeName() -> str
Return the type name in the USD schema for prims or API schemas of the
given registered SchemaType .
static GetTypeFromName()
classmethod GetTypeFromName(typeName) -> Type
Finds the TfType of a schema with typeName .
This is primarily for when you have been provided Schema typeName
(perhaps from a User Interface or Script) and need to identify if a
prim’s type inherits/is that typeName. If the type name IS known, then
using the schema class is preferred.
# This code attempts to match all prims on a stage to a given
# user specified type, making the traditional schema based idioms not
# applicable.
data = parser.parse_args()
tfType = UsdSchemaRegistry.GetTypeFromName(data.type)
matchedPrims = [p for p in stage.Traverse() if p.IsA(tfType)]
It’s worth noting that GetTypeFromName(“Sphere”) ==
GetTypeFromName(“UsdGeomSphere”), as this function resolves both the
Schema’s C++ class name and any registered aliases from a modules
plugInfo.json file. However, GetTypeFromName(“Boundable”) !=
GetTypeFromName(“UsdGeomBoundable”) because type aliases don’t get
registered for abstract schema types.
Parameters
typeName (str) –
static GetTypeFromSchemaTypeName()
classmethod GetTypeFromSchemaTypeName(typeName) -> Type
Return the TfType of the schema corresponding to the given prim or API
schema name typeName .
This the inverse of GetSchemaTypeName.
Parameters
typeName (str) –
static GetTypeNameAndInstance()
classmethod GetTypeNameAndInstance(apiSchemaName) -> tuple[str, str]
Returns the schema type name and the instance name parsed from the
given apiSchemaName .
apiSchemaName is the name of an applied schema as it appears in
the list of applied schemas on a prim. For single-apply API schemas
the name will just be the schema type name. For multiple-apply schemas
the name should include the schema type name and the applied instance
name separated by a namespace delimiter, for
example’CollectionAPI:plasticStuff’.
This function returns the separated schema type name and instance name
component tokens if possible, otherwise it returns the
apiSchemaName as the type name and an empty instance name.
Note that no validation is done on the returned tokens. Clients are
advised to use GetTypeFromSchemaTypeName() to validate the typeName
token.
UsdPrim::AddAppliedSchema(const TfToken&) const
UsdPrim::GetAppliedSchemas() const
Parameters
apiSchemaName (str) –
static IsAbstract()
classmethod IsAbstract(primType) -> bool
Returns true if the prim type primType is an abstract schema type
and, unlike a concrete type, is not instantiable in scene description.
Parameters
primType (Type) –
IsAbstract(primType) -> bool
Returns true if the prim type primType is an abstract schema type
and, unlike a concrete type, is not instantiable in scene description.
Parameters
primType (str) –
static IsAllowedAPISchemaInstanceName()
classmethod IsAllowedAPISchemaInstanceName(apiSchemaName, instanceName) -> bool
Returns true if the given instanceName is an allowed instance name
for the multiple apply API schema named apiSchemaName .
Any instance name that matches the name of a property provided by the
API schema is disallowed and will return false. If the schema type has
plugin metadata that specifies allowed instance names, then only those
specified names are allowed for the schema type. If the instance name
is empty or the API is not a multiple apply schema, this will return
false.
Parameters
apiSchemaName (str) –
instanceName (str) –
static IsAppliedAPISchema()
classmethod IsAppliedAPISchema(apiSchemaType) -> bool
Returns true if apiSchemaType is an applied API schema type.
Parameters
apiSchemaType (Type) –
IsAppliedAPISchema(apiSchemaType) -> bool
Returns true if apiSchemaType is an applied API schema type.
Parameters
apiSchemaType (str) –
static IsConcrete()
classmethod IsConcrete(primType) -> bool
Returns true if the prim type primType is instantiable in scene
description.
Parameters
primType (Type) –
IsConcrete(primType) -> bool
Returns true if the prim type primType is instantiable in scene
description.
Parameters
primType (str) –
static IsDisallowedField()
classmethod IsDisallowedField(fieldName) -> bool
Returns true if the field fieldName cannot have fallback values
specified in schemas.
Fields are generally disallowed because their fallback values aren’t
used. For instance, fallback values for composition arcs aren’t used
during composition, so allowing them to be set in schemas would be
misleading.
Parameters
fieldName (str) –
static IsMultipleApplyAPISchema()
classmethod IsMultipleApplyAPISchema(apiSchemaType) -> bool
Returns true if apiSchemaType is a multiple-apply API schema type.
Parameters
apiSchemaType (Type) –
IsMultipleApplyAPISchema(apiSchemaType) -> bool
Returns true if apiSchemaType is a multiple-apply API schema type.
Parameters
apiSchemaType (str) –
static IsMultipleApplyNameTemplate()
classmethod IsMultipleApplyNameTemplate(nameTemplate) -> bool
Returns true if nameTemplate is a multiple apply schema name
template.
The given nameTemplate is a name template if and only if it
contains the instance name place holder”__INSTANCE_NAME__”as an exact
match as one of the tokenized components of the name tokenized by the
namespace delimiter.
Parameters
nameTemplate (str) –
static IsTyped()
classmethod IsTyped(primType) -> bool
Returns true if the prim type primType inherits from UsdTyped.
Parameters
primType (Type) –
static MakeMultipleApplyNameInstance()
classmethod MakeMultipleApplyNameInstance(nameTemplate, instanceName) -> str
Returns an instance of a multiple apply schema name from the given
nameTemplate for the given instanceName .
The returned name is created by replacing the instance name
placeholder”__INSTANCE_NAME__”in the name template with the given
instance name. If the instance name placeholder is not found in
nameTemplate , then the name template is not multiple apply name
template and is returned as is.
Note that the instance name placeholder must be found as an exact full
word match with one of the tokenized components of the name template,
when tokenized by the namespace delimiter, in order for it to be
treated as a placeholder and substituted with the instance name.
Parameters
nameTemplate (str) –
instanceName (str) –
static MakeMultipleApplyNameTemplate()
classmethod MakeMultipleApplyNameTemplate(namespacePrefix, baseName) -> str
Creates a name template that can represent a property or API schema
that belongs to a multiple apply schema and will therefore have
multiple instances with different names.
The name template is created by joining the namespacePrefix , the
instance name placeholder”__INSTANCE_NAME__”, and the baseName
using the namespace delimiter. Therefore the returned name template
will be of one of the following forms depending on whether either of
the inputs is empty:
namespacePrefix: INSTANCE_NAME :baseName
namespacePrefix: INSTANCE_NAME
INSTANCE_NAME :baseName
INSTANCE_NAME
Name templates can be passed to MakeMultipleApplyNameInstance along
with an instance name to create the name for a particular instance.
Parameters
namespacePrefix (str) –
baseName (str) –
property expired
True if this object has expired, False otherwise.
class pxr.Usd.Specializes
A proxy class for applying listOp edits to the specializes list for a
prim.
All paths passed to the UsdSpecializes API are expected to be in the
namespace of the owning prim’s stage. Subroot prim specializes paths
will be translated from this namespace to the namespace of the current
edit target, if necessary. If a path cannot be translated, a coding
error will be issued and no changes will be made. Root prim
specializes paths will not be translated.
Methods:
AddSpecialize(primPath, position)
Adds a path to the specializes listOp at the current EditTarget, in the position specified by position .
ClearSpecializes()
Removes the authored specializes listOp edits at the current edit target.
GetPrim()
Return the prim this object is bound to.
RemoveSpecialize(primPath)
Removes the specified path from the specializes listOp at the current EditTarget.
SetSpecializes(items)
Explicitly set specializes paths, potentially blocking weaker opinions that add or remove items, returning true on success, false if the edit could not be performed.
AddSpecialize(primPath, position) → bool
Adds a path to the specializes listOp at the current EditTarget, in
the position specified by position .
Parameters
primPath (Path) –
position (ListPosition) –
ClearSpecializes() → bool
Removes the authored specializes listOp edits at the current edit
target.
GetPrim() → Prim
Return the prim this object is bound to.
GetPrim() -> Prim
RemoveSpecialize(primPath) → bool
Removes the specified path from the specializes listOp at the current
EditTarget.
Parameters
primPath (Path) –
SetSpecializes(items) → bool
Explicitly set specializes paths, potentially blocking weaker opinions
that add or remove items, returning true on success, false if the edit
could not be performed.
Parameters
items (list[SdfPath]) –
class pxr.Usd.Stage
The outermost container for scene description, which owns and presents
composed prims as a scenegraph, following the composition recipe
recursively described in its associated”root layer”.
USD derives its persistent-storage scalability by combining and
reusing simple compositions into richer aggregates using referencing
and layering with sparse overrides. Ultimately, every composition
(i.e.”scene”) is identifiable by its root layer, i.e. the .usd
file, and a scene is instantiated in an application on a UsdStage that
presents a composed view of the scene’s root layer. Each simple
composition referenced into a larger composition could be presented on
its own UsdStage, at the same (or not) time that it is participating
in the larger composition on its own UsdStage; all of the underlying
layers will be shared by the two stages, while each maintains its own
scenegraph of composed prims.
A UsdStage has sole ownership over the UsdPrim ‘s with which it is
populated, and retains shared ownership (with other stages and
direct clients of SdfLayer ‘s, via the Sdf_LayerRegistry that
underlies all SdfLayer creation methods) of layers. It provides
roughly five categories of API that address different aspects of scene
management:
Stage lifetime management methods for constructing and initially
populating a UsdStage from an existing layer file, or one that will be
created as a result, in memory or on the filesystem.
Load/unload working set management methods that allow you to
specify which payloads should be included and excluded from the
stage’s composition.
Variant management methods to manage policy for which variant to
use when composing prims that provide a named variant set, but do not
specify a selection.
Prim access, creation, and mutation methods that allow you to
find, create, or remove a prim identified by a path on the stage. This
group also provides methods for efficiently traversing the prims on
the stage.
Layers and EditTargets methods provide access to the layers in
the stage’s root LayerStack (i.e. the root layer and all of its
recursive sublayers), and the ability to set a UsdEditTarget into
which all subsequent mutations to objects associated with the stage
(e.g. prims, properties, etc) will go.
Serialization methods for”flattening”a composition (to varying
degrees), and exporting a completely flattened view of the stage to a
string or file. These methods can be very useful for targeted asset
optimization and debugging, though care should be exercized with large
scenes, as flattening defeats some of the benefits of referenced scene
description, and may produce very large results, especially in file
formats that do not support data de-duplication, like the usda ASCII
format!
## Stage Session Layers
Each UsdStage can possess an optional”session layer”. The purpose of a
session layer is to hold ephemeral edits that modify a UsdStage ‘s
contents or behavior in a way that is useful to the client, but should
not be considered as permanent mutations to be recorded upon export. A
very common use of session layers is to make variant selections, to
pick a specific LOD or shading variation, for example. The session
layer is also frequently used to perform interactive vising/invsning
of geometry and assets in the scene. A session layer, if present,
contributes to a UsdStage ‘s identity, for purposes of stage-caching,
etc.
Classes:
InitialLoadSet
Specifies the initial set of prims to load when opening a UsdStage.
Methods:
ClearDefaultPrim()
Clear the default prim layer metadata in this stage's root layer.
ClearMetadata(key)
Clear the value of stage metadatum key , if the stage's current UsdEditTarget is the root or session layer.
ClearMetadataByDictKey(key, keyPath)
Clear any authored value identified by key and keyPath at the current EditTarget.
CreateClassPrim(rootPrimPath)
Author an SdfPrimSpec with specifier == SdfSpecifierClass for the class at root prim path path at the current EditTarget.
CreateInMemory
classmethod CreateInMemory(load) -> Stage
CreateNew
classmethod CreateNew(identifier, load) -> Stage
DefinePrim(path, typeName)
Attempt to ensure a UsdPrim at path is defined (according to UsdPrim::IsDefined() ) on this stage.
ExpandPopulationMask(relPred, attrPred)
Expand this stage's population mask to include the targets of all relationships that pass relPred and connections to all attributes that pass attrPred recursively.
Export(filename, addSourceFileComment, args)
Writes out the composite scene as a single flattened layer into filename.
ExportToString(result, addSourceFileComment)
Writes the composite scene as a flattened Usd text representation into the given string.
FindLoadable(rootPath)
Returns an SdfPathSet of all paths that can be loaded.
Flatten(addSourceFileComment)
Returns a single, anonymous, merged layer for this composite scene.
GetAttributeAtPath(path)
Return the UsdAttribute at path , or an invalid UsdAttribute if none exists.
GetColorConfigFallbacks
classmethod GetColorConfigFallbacks(colorConfiguration, colorManagementSystem) -> None
GetColorConfiguration()
Returns the default color configuration used to interpret the per- attribute color-spaces in the composed USD stage.
GetColorManagementSystem()
Sets the name of the color management system to be used for loading and interpreting the color configuration file.
GetDefaultPrim()
Return the root UsdPrim on this stage whose name is the root layer's defaultPrim metadata's value.
GetEditTarget()
Return the stage's EditTarget.
GetEditTargetForLocalLayer(i)
Return a UsdEditTarget for editing the layer at index i in the layer stack.
GetEndTimeCode()
Returns the stage's end timeCode.
GetFramesPerSecond()
Returns the stage's framesPerSecond value.
GetGlobalVariantFallbacks
classmethod GetGlobalVariantFallbacks() -> PcpVariantFallbackMap
GetInterpolationType()
Returns the interpolation type used during value resolution for all attributes on this stage.
GetLayerStack(includeSessionLayers)
Return this stage's local layers in strong-to-weak order.
GetLoadRules()
Return the stage's current UsdStageLoadRules governing payload inclusion.
GetLoadSet()
Returns a set of all loaded paths.
GetMetadata(key, value)
Return in value an authored or fallback value (if one was defined for the given metadatum) for Stage metadatum key .
GetMetadataByDictKey(key, keyPath, value)
Resolve the requested dictionary sub-element keyPath of dictionary-valued metadatum named key , returning the resolved value.
GetMutedLayers()
Returns a vector of all layers that have been muted on this stage.
GetObjectAtPath(path)
Return the UsdObject at path , or an invalid UsdObject if none exists.
GetPathResolverContext()
Return the path resolver context for all path resolution during composition of this stage.
GetPopulationMask()
Return this stage's population mask.
GetPrimAtPath(path)
Return the UsdPrim at path , or an invalid UsdPrim if none exists.
GetPropertyAtPath(path)
Return the UsdProperty at path , or an invalid UsdProperty if none exists.
GetPrototypes()
Returns all native instancing prototype prims.
GetPseudoRoot()
Return the stage's"pseudo-root"prim, whose name is defined by Usd.
GetRelationshipAtPath(path)
Return the UsdAttribute at path , or an invalid UsdAttribute if none exists.
GetRootLayer()
Return this stage's root layer.
GetSessionLayer()
Return this stage's root session layer.
GetStartTimeCode()
Returns the stage's start timeCode.
GetTimeCodesPerSecond()
Returns the stage's timeCodesPerSecond value.
GetUsedLayers(includeClipLayers)
Return a vector of all of the layers currently consumed by this stage, as determined by the composition arcs that were traversed to compose and populate the stage.
HasAuthoredMetadata(key)
Returns true if the key has an authored value, false if no value was authored or the only value available is the SdfSchema 's metadata fallback.
HasAuthoredMetadataDictKey(key, keyPath)
Return true if there exists any authored opinion (excluding fallbacks) for key and keyPath .
HasAuthoredTimeCodeRange()
Returns true if the stage has both start and end timeCodes authored in the session layer or the root layer of the stage.
HasDefaultPrim()
Return true if this stage's root layer has an authored opinion for the default prim layer metadata.
HasLocalLayer(layer)
Return true if layer is one of the layers in this stage's local, root layerStack.
HasMetadata(key)
Returns true if the key has a meaningful value, that is, if GetMetadata() will provide a value, either because it was authored or because the Stage metadata was defined with a meaningful fallback value.
HasMetadataDictKey(key, keyPath)
Return true if there exists any authored or fallback opinion for key and keyPath .
IsLayerMuted(layerIdentifier)
Returns true if the layer specified by layerIdentifier is muted in this cache, false otherwise.
IsSupportedFile
classmethod IsSupportedFile(filePath) -> bool
Load(path, policy)
Modify this stage's load rules to load the prim at path , its ancestors, and all of its descendants if policy is UsdLoadWithDescendants.
LoadAndUnload(loadSet, unloadSet, policy)
Unload and load the given path sets.
MuteAndUnmuteLayers(muteLayers, unmuteLayers)
Mute and unmute the layers identified in muteLayers and unmuteLayers .
MuteLayer(layerIdentifier)
Mute the layer identified by layerIdentifier .
Open
classmethod Open(filePath, load) -> Stage
OpenMasked
classmethod OpenMasked(filePath, mask, load) -> Stage
OverridePrim(path)
Attempt to ensure a UsdPrim at path exists on this stage.
Reload()
Calls SdfLayer::Reload on all layers contributing to this stage, except session layers and sublayers of session layers.
RemovePrim(path)
Remove all scene description for the given path and its subtree in the current UsdEditTarget.
ResolveIdentifierToEditTarget(identifier)
Resolve the given identifier using this stage's ArResolverContext and the layer of its GetEditTarget() as an anchor for relative references (e.g.
Save()
Calls SdfLayer::Save on all dirty layers contributing to this stage except session layers and sublayers of session layers.
SaveSessionLayers()
Calls SdfLayer::Save on all dirty session layers and sublayers of session layers contributing to this stage.
SetColorConfigFallbacks
classmethod SetColorConfigFallbacks(colorConfiguration, colorManagementSystem) -> None
SetColorConfiguration(colorConfig)
Sets the default color configuration to be used to interpret the per- attribute color-spaces in the composed USD stage.
SetColorManagementSystem(cms)
Sets the name of the color management system used to interpret the color configuration file pointed at by the colorConfiguration metadata.
SetDefaultPrim(prim)
Set the default prim layer metadata in this stage's root layer.
SetEditTarget(editTarget)
Set the stage's EditTarget.
SetEndTimeCode(arg1)
Sets the stage's end timeCode.
SetFramesPerSecond(framesPerSecond)
Sets the stage's framesPerSecond value.
SetGlobalVariantFallbacks
classmethod SetGlobalVariantFallbacks(fallbacks) -> None
SetInterpolationType(interpolationType)
Sets the interpolation type used during value resolution for all attributes on this stage.
SetLoadRules(rules)
Set the UsdStageLoadRules to govern payload inclusion on this stage.
SetMetadata(key, value)
Set the value of Stage metadatum key to value , if the stage's current UsdEditTarget is the root or session layer.
SetMetadataByDictKey(key, keyPath, value)
Author value to the field identified by key and keyPath at the current EditTarget.
SetPopulationMask(mask)
Set this stage's population mask and recompose the stage.
SetStartTimeCode(arg1)
Sets the stage's start timeCode.
SetTimeCodesPerSecond(timeCodesPerSecond)
Sets the stage's timeCodesPerSecond value.
Traverse()
Traverse the active, loaded, defined, non-abstract prims on this stage depth-first.
TraverseAll()
Traverse all the prims on this stage depth-first.
Unload(path)
Modify this stage's load rules to unload the prim and its descendants specified by path .
UnmuteLayer(layerIdentifier)
Unmute the layer identified by layerIdentifier if it had previously been muted.
WriteFallbackPrimTypes()
Writes the fallback prim types defined in the schema registry to the stage as dictionary valued fallback prim type metadata.
Attributes:
LoadAll
LoadNone
expired
True if this object has expired, False otherwise.
class InitialLoadSet
Specifies the initial set of prims to load when opening a UsdStage.
Methods:
GetValueFromName
Attributes:
allValues
static GetValueFromName()
allValues = (Usd.Stage.LoadAll, Usd.Stage.LoadNone)
ClearDefaultPrim() → None
Clear the default prim layer metadata in this stage’s root layer.
This is shorthand for:
stage->GetRootLayer()->ClearDefaultPrim();
Note that this function always authors to the stage's root layer. To
author to a different layer, use the SdfLayer::SetDefaultPrim() API.
ClearMetadata(key) → bool
Clear the value of stage metadatum key , if the stage’s current
UsdEditTarget is the root or session layer.
If the current EditTarget is any other layer, raise a coding error.
true if authoring was successful, false otherwise. Generates a coding
error if key is not allowed as layer metadata.
General Metadata in USD
Parameters
key (str) –
ClearMetadataByDictKey(key, keyPath) → bool
Clear any authored value identified by key and keyPath at the
current EditTarget.
The keyPath is a’:’-separated path identifying a path in
subdictionaries stored in the metadata field at key . If
keyPath is empty, no action is taken.
true if the value is cleared successfully, false otherwise. Generates
a coding error if key is not allowed as layer metadata.
Dictionary-valued Metadata
Parameters
key (str) –
keyPath (str) –
CreateClassPrim(rootPrimPath) → Prim
Author an SdfPrimSpec with specifier == SdfSpecifierClass for
the class at root prim path path at the current EditTarget.
The current EditTarget must have UsdEditTarget::IsLocalLayer() ==
true.
The given path must be an absolute, root prim path that does not
contain any variant selections.
If a defined ( UsdPrim::IsDefined() ) non-class prim already exists at
path , issue an error and return an invalid UsdPrim.
If it is impossible to author the necessary PrimSpec, issue an error
and return an invalid UsdPrim.
Parameters
rootPrimPath (Path) –
static CreateInMemory()
classmethod CreateInMemory(load) -> Stage
Creates a new stage only in memory, analogous to creating an anonymous
SdfLayer.
If pathResolverContext is provided it will be bound when creating
the root layer at identifier and whenever asset path resolution is
done for this stage, regardless of what other context may be bound at
that time. Otherwise Usd will create the root layer with no context
bound, then create a context for all future asset path resolution for
the stage by calling ArResolver::CreateDefaultContext.
The initial set of prims to load on the stage can be specified using
the load parameter.
UsdStage::InitialLoadSet. Invoking an overload that does not take a
sessionLayer argument will create a stage with an anonymous in-
memory session layer. To create a stage without a session layer, pass
TfNullPtr (or None in python) as the sessionLayer argument.
Parameters
load (InitialLoadSet) –
CreateInMemory(identifier, load) -> Stage
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
identifier (str) –
load (InitialLoadSet) –
CreateInMemory(identifier, pathResolverContext, load) -> Stage
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
identifier (str) –
pathResolverContext (ResolverContext) –
load (InitialLoadSet) –
CreateInMemory(identifier, sessionLayer, load) -> Stage
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
identifier (str) –
sessionLayer (Layer) –
load (InitialLoadSet) –
CreateInMemory(identifier, sessionLayer, pathResolverContext, load) -> Stage
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
identifier (str) –
sessionLayer (Layer) –
pathResolverContext (ResolverContext) –
load (InitialLoadSet) –
static CreateNew()
classmethod CreateNew(identifier, load) -> Stage
Create a new stage with root layer identifier , destroying
potentially existing files with that identifier; it is considered an
error if an existing, open layer is present with this identifier.
SdfLayer::CreateNew() Invoking an overload that does not take a
sessionLayer argument will create a stage with an anonymous in-
memory session layer. To create a stage without a session layer, pass
TfNullPtr (or None in python) as the sessionLayer argument. The
initial set of prims to load on the stage can be specified using the
load parameter.
UsdStage::InitialLoadSet. If pathResolverContext is provided it
will be bound when creating the root layer at identifier and
whenever asset path resolution is done for this stage, regardless of
what other context may be bound at that time. Otherwise Usd will
create the root layer with no context bound, then create a context for
all future asset path resolution for the stage by calling
ArResolver::CreateDefaultContextForAsset with the root layer’s
repository path if the layer has one, otherwise its resolved path.
Parameters
identifier (str) –
load (InitialLoadSet) –
CreateNew(identifier, sessionLayer, load) -> Stage
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
identifier (str) –
sessionLayer (Layer) –
load (InitialLoadSet) –
CreateNew(identifier, sessionLayer, pathResolverContext, load) -> Stage
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
identifier (str) –
sessionLayer (Layer) –
pathResolverContext (ResolverContext) –
load (InitialLoadSet) –
CreateNew(identifier, pathResolverContext, load) -> Stage
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
identifier (str) –
pathResolverContext (ResolverContext) –
load (InitialLoadSet) –
DefinePrim(path, typeName) → Prim
Attempt to ensure a UsdPrim at path is defined (according to
UsdPrim::IsDefined() ) on this stage.
If a prim at path is already defined on this stage and
typeName is empty or equal to the existing prim’s typeName, return
that prim. Otherwise author an SdfPrimSpec with specifier ==
SdfSpecifierDef and typeName 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 or one of the ancestors of path is inactive on the
UsdStage), issue an error and return an invalid UsdPrim.
Note that this method may return a defined prim whose typeName does
not match the supplied typeName , in case a stronger typeName
opinion overrides the opinion at the current EditTarget.
Parameters
path (Path) –
typeName (str) –
ExpandPopulationMask(relPred, attrPred) → None
Expand this stage’s population mask to include the targets of all
relationships that pass relPred and connections to all attributes
that pass attrPred recursively.
If relPred is null, include all relationship targets; if
attrPred is null, include all connections.
This function can be used, for example, to expand a population mask
for a given prim to include bound materials, if those bound materials
are expressed as relationships or attribute connections.
See also UsdPrim::FindAllRelationshipTargetPaths() and
UsdPrim::FindAllAttributeConnectionPaths() .
Parameters
relPred (function[bool( Relationship )]) –
attrPred (function[bool( Attribute )]) –
Export(filename, addSourceFileComment, args) → bool
Writes out the composite scene as a single flattened layer into
filename.
If addSourceFileComment is true, a comment in the output layer will
mention the input layer it was generated from.
See UsdStage::Flatten for details of the flattening transformation.
Parameters
filename (str) –
addSourceFileComment (bool) –
args (Layer.FileFormatArguments) –
ExportToString(result, addSourceFileComment) → bool
Writes the composite scene as a flattened Usd text representation into
the given string.
If addSourceFileComment is true, a comment in the output layer will
mention the input layer it was generated from.
See UsdStage::Flatten for details of the flattening transformation.
Parameters
result (str) –
addSourceFileComment (bool) –
FindLoadable(rootPath) → SdfPathSet
Returns an SdfPathSet of all paths that can be loaded.
Note that this method does not return paths to inactive prims as they
cannot be loaded.
The set returned includes loaded and unloaded paths. To determine the
set of unloaded paths, one can diff this set with the current load
set, for example:
SdfPathSet loaded = stage->GetLoadSet(),
all = stage->FindLoadable(),
result;
std::set_difference(loaded.begin(), loaded.end(),
all.begin(), all.end(),
std::inserter(result, result.end()));
See Working Set Management for more information.
Parameters
rootPath (Path) –
Flatten(addSourceFileComment) → Layer
Returns a single, anonymous, merged layer for this composite scene.
Specifically, this function removes most composition metadata and
authors the resolved values for each object directly into the
flattened layer.
All VariantSets are removed and only the currently selected variants
will be present in the resulting layer.
Class prims will still exist, however all inherits arcs will have been
removed and the inherited data will be copied onto each child object.
Composition arcs authored on the class itself will be flattened into
the class.
Flatten preserves scenegraph instancing by creating independent roots
for each prototype currently composed on this stage, and adding a
single internal reference arc on each instance prim to its
corresponding prototype.
Time samples across sublayer offsets will will have the time offset
and scale applied to each time index.
Finally, any deactivated prims will be pruned from the result.
Parameters
addSourceFileComment (bool) –
GetAttributeAtPath(path) → Attribute
Return the UsdAttribute at path , or an invalid UsdAttribute if
none exists.
This is equivalent to
stage.GetObjectAtPath(path).As<UsdAttribute>();
GetObjectAtPath(const SdfPath&) const
Parameters
path (Path) –
static GetColorConfigFallbacks()
classmethod GetColorConfigFallbacks(colorConfiguration, colorManagementSystem) -> None
Returns the global fallback values
of’colorConfiguration’and’colorManagementSystem’.
These are set in the plugInfo.json file of a plugin, but can be
overridden by calling the static method SetColorConfigFallbacks() .
The python wrapping of this method returns a tuple containing
(colorConfiguration, colorManagementSystem).
SetColorConfigFallbacks, Color Configuration API
Parameters
colorConfiguration (AssetPath) –
colorManagementSystem (str) –
GetColorConfiguration() → AssetPath
Returns the default color configuration used to interpret the per-
attribute color-spaces in the composed USD stage.
Color Configuration API
GetColorManagementSystem() → str
Sets the name of the color management system to be used for loading
and interpreting the color configuration file.
Color Configuration API
GetDefaultPrim() → Prim
Return the root UsdPrim on this stage whose name is the root layer’s
defaultPrim metadata’s value.
Return an invalid prim if there is no such prim or if the root layer’s
defaultPrim metadata is unset or is not a valid prim name. Note that
this function only examines this stage’s rootLayer. It does not
consider sublayers of the rootLayer. See also
SdfLayer::GetDefaultPrim() .
GetEditTarget() → EditTarget
Return the stage’s EditTarget.
GetEditTargetForLocalLayer(i) → EditTarget
Return a UsdEditTarget for editing the layer at index i in the layer
stack.
This edit target will incorporate any layer time offset that applies
to the sublayer.
Parameters
i (int) –
GetEditTargetForLocalLayer(layer) -> EditTarget
Return a UsdEditTarget for editing the given local layer.
If the given layer appears more than once in the layer stack, the time
offset to the first occurrence will be used.
Parameters
layer (Layer) –
GetEndTimeCode() → float
Returns the stage’s end timeCode.
If the stage has an associated session layer with an end timeCode
opinion, this value is returned. Otherwise, the end timeCode opinion
from the root layer is returned.
GetFramesPerSecond() → float
Returns the stage’s framesPerSecond value.
This makes an advisory statement about how the contained data can be
most usefully consumed and presented. It’s primarily an indication of
the expected playback rate for the data, but a timeline editing tool
might also want to use this to decide how to scale and label its
timeline.
The default value of framesPerSecond is 24.
static GetGlobalVariantFallbacks()
classmethod GetGlobalVariantFallbacks() -> PcpVariantFallbackMap
Get the global variant fallback preferences used in new UsdStages.
GetInterpolationType() → InterpolationType
Returns the interpolation type used during value resolution for all
attributes on this stage.
GetLayerStack(includeSessionLayers) → list[SdfLayerHandle]
Return this stage’s local layers in strong-to-weak order.
If includeSessionLayers is true, return the linearized strong-to-
weak sublayers rooted at the stage’s session layer followed by the
linearized strong-to-weak sublayers rooted at this stage’s root layer.
If includeSessionLayers is false, omit the sublayers rooted at this
stage’s session layer.
Parameters
includeSessionLayers (bool) –
GetLoadRules() → StageLoadRules
Return the stage’s current UsdStageLoadRules governing payload
inclusion.
See Working Set Management for more information.
GetLoadSet() → SdfPathSet
Returns a set of all loaded paths.
The paths returned are both those that have been explicitly loaded and
those that were loaded as a result of dependencies, ancestors or
descendants of explicitly loaded paths.
This method does not return paths to inactive prims.
See Working Set Management for more information.
GetMetadata(key, value) → bool
Return in value an authored or fallback value (if one was defined
for the given metadatum) for Stage metadatum key .
Order of resolution is session layer, followed by root layer, else
fallback to the SdfSchema.
true if we successfully retrieved a value of the requested type; false
if key is not allowed as layer metadata or no value was found.
Generates a coding error if we retrieved a stored value of a type
other than the requested type
General Metadata in USD
Parameters
key (str) –
value (T) –
GetMetadata(key, value) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
key (str) –
value (VtValue) –
GetMetadataByDictKey(key, keyPath, value) → bool
Resolve the requested dictionary sub-element keyPath of
dictionary-valued metadatum named key , returning the resolved
value.
If you know you need just a small number of elements from a
dictionary, accessing them element-wise using this method can be much
less expensive than fetching the entire dictionary with
GetMetadata(key).
true if we successfully retrieved a value of the requested type; false
if key is not allowed as layer metadata or no value was found.
Generates a coding error if we retrieved a stored value of a type
other than the requested type The keyPath is a’:’-separated path
addressing an element in subdictionaries. If keyPath is empty,
returns an empty VtValue.
Parameters
key (str) –
keyPath (str) –
value (T) –
GetMetadataByDictKey(key, keyPath, value) -> bool
overload
Parameters
key (str) –
keyPath (str) –
value (VtValue) –
GetMutedLayers() → list[str]
Returns a vector of all layers that have been muted on this stage.
GetObjectAtPath(path) → Object
Return the UsdObject at path , or an invalid UsdObject if none
exists.
If path indicates a prim beneath an instance, returns an instance
proxy prim if a prim exists at the corresponding path in that
instance’s prototype. If path indicates a property beneath a child
of an instance, returns a property whose parent prim is an instance
proxy prim.
Example:
if (UsdObject obj = stage->GetObjectAtPath(path)) {
if (UsdPrim prim = obj.As<UsdPrim>()) {
// Do things with prim
}
else if (UsdProperty prop = obj.As<UsdProperty>()) {
// Do things with property. We can also cast to
// UsdRelationship or UsdAttribute using this same pattern.
}
}
else {
// No object at specified path
}
Parameters
path (Path) –
GetPathResolverContext() → ResolverContext
Return the path resolver context for all path resolution during
composition of this stage.
Useful for external clients that want to resolve paths with the same
context as this stage, or create new stages with the same context.
GetPopulationMask() → StagePopulationMask
Return this stage’s population mask.
GetPrimAtPath(path) → Prim
Return the UsdPrim at path , or an invalid UsdPrim if none exists.
If path indicates a prim beneath an instance, returns an instance
proxy prim if a prim exists at the corresponding path in that
instance’s prototype.
Unlike OverridePrim() and DefinePrim() , this method will never author
scene description, and therefore is safe to use as a”reader”in the Usd
multi-threading model.
Parameters
path (Path) –
GetPropertyAtPath(path) → Property
Return the UsdProperty at path , or an invalid UsdProperty if none
exists.
This is equivalent to
stage.GetObjectAtPath(path).As<UsdProperty>();
GetObjectAtPath(const SdfPath&) const
Parameters
path (Path) –
GetPrototypes() → list[Prim]
Returns all native instancing prototype prims.
GetPseudoRoot() → Prim
Return the stage’s”pseudo-root”prim, whose name is defined by Usd.
The stage’s named root prims are namespace children of this prim,
which exists to make the namespace hierarchy a tree instead of a
forest. This simplifies algorithms that want to traverse all prims.
A UsdStage always has a pseudo-root prim, unless there was an error
opening or creating the stage, in which case this method returns an
invalid UsdPrim.
GetRelationshipAtPath(path) → Relationship
Return the UsdAttribute at path , or an invalid UsdAttribute if
none exists.
This is equivalent to
stage.GetObjectAtPath(path).As<UsdRelationship>();
GetObjectAtPath(const SdfPath&) const
Parameters
path (Path) –
GetRootLayer() → Layer
Return this stage’s root layer.
GetSessionLayer() → Layer
Return this stage’s root session layer.
GetStartTimeCode() → float
Returns the stage’s start timeCode.
If the stage has an associated session layer with a start timeCode
opinion, this value is returned. Otherwise, the start timeCode opinion
from the root layer is returned.
GetTimeCodesPerSecond() → float
Returns the stage’s timeCodesPerSecond value.
The timeCodesPerSecond value scales the time ordinate for the samples
contained in the stage to seconds. If timeCodesPerSecond is 24, then a
sample at time ordinate 24 should be viewed exactly one second after
the sample at time ordinate 0.
Like SdfLayer::GetTimeCodesPerSecond, this accessor uses a dynamic
fallback to framesPerSecond. The order of precedence is:
timeCodesPerSecond from session layer
timeCodesPerSecond from root layer
framesPerSecond from session layer
framesPerSecond from root layer
fallback value of 24
GetUsedLayers(includeClipLayers) → list[SdfLayerHandle]
Return a vector of all of the layers currently consumed by this
stage, as determined by the composition arcs that were traversed to
compose and populate the stage.
The list of consumed layers will change with the stage’s load-set and
variant selections, so the return value should be considered only a
snapshot. The return value will include the stage’s session layer, if
it has one. If includeClipLayers is true, we will also include all
of the layers that this stage has had to open so far to perform value
resolution of attributes affected by Value Clips
Parameters
includeClipLayers (bool) –
HasAuthoredMetadata(key) → bool
Returns true if the key has an authored value, false if no
value was authored or the only value available is the SdfSchema ‘s
metadata fallback.
If a value for a metadatum not legal to author on layers is present
in the root or session layer (which could happen through hand-editing
or use of certain low-level API’s), this method will still return
false .
Parameters
key (str) –
HasAuthoredMetadataDictKey(key, keyPath) → bool
Return true if there exists any authored opinion (excluding fallbacks)
for key and keyPath .
The keyPath is a’:’-separated path identifying a value in
subdictionaries stored in the metadata field at key . If
keyPath is empty, returns false .
Dictionary-valued Metadata
Parameters
key (str) –
keyPath (str) –
HasAuthoredTimeCodeRange() → bool
Returns true if the stage has both start and end timeCodes authored in
the session layer or the root layer of the stage.
HasDefaultPrim() → bool
Return true if this stage’s root layer has an authored opinion for the
default prim layer metadata.
This is shorthand for:
stage->GetRootLayer()->HasDefaultPrim();
Note that this function only consults the stage's root layer. To
consult a different layer, use the SdfLayer::HasDefaultPrim() API.
HasLocalLayer(layer) → bool
Return true if layer is one of the layers in this stage’s local,
root layerStack.
Parameters
layer (Layer) –
HasMetadata(key) → bool
Returns true if the key has a meaningful value, that is, if
GetMetadata() will provide a value, either because it was authored or
because the Stage metadata was defined with a meaningful fallback
value.
Returns false if key is not allowed as layer metadata.
Parameters
key (str) –
HasMetadataDictKey(key, keyPath) → bool
Return true if there exists any authored or fallback opinion for
key and keyPath .
The keyPath is a’:’-separated path identifying a value in
subdictionaries stored in the metadata field at key . If
keyPath is empty, returns false .
Returns false if key is not allowed as layer metadata.
Dictionary-valued Metadata
Parameters
key (str) –
keyPath (str) –
IsLayerMuted(layerIdentifier) → bool
Returns true if the layer specified by layerIdentifier is muted in
this cache, false otherwise.
See documentation on MuteLayer for details on how layerIdentifier
is compared to the layers that have been muted.
Parameters
layerIdentifier (str) –
static IsSupportedFile()
classmethod IsSupportedFile(filePath) -> bool
Indicates whether the specified file is supported by UsdStage.
This function is a cheap way to determine whether a file might be
open-able with UsdStage::Open. It is purely based on the given
filePath and does not open the file or perform analysis on the
contents. As such, UsdStage::Open may still fail even if this function
returns true.
Parameters
filePath (str) –
Load(path, policy) → Prim
Modify this stage’s load rules to load the prim at path , its
ancestors, and all of its descendants if policy is
UsdLoadWithDescendants.
If policy is UsdLoadWithoutDescendants, then payloads on
descendant prims are not loaded.
See Working Set Management for more information.
Parameters
path (Path) –
policy (LoadPolicy) –
LoadAndUnload(loadSet, unloadSet, policy) → None
Unload and load the given path sets.
The effect is as if the unload set were processed first followed by
the load set.
This is equivalent to calling UsdStage::Unload for each item in the
unloadSet followed by UsdStage::Load for each item in the loadSet,
however this method is more efficient as all operations are committed
in a single batch. The policy argument is described in the
documentation for Load() .
See Working Set Management for more information.
Parameters
loadSet (SdfPathSet) –
unloadSet (SdfPathSet) –
policy (LoadPolicy) –
MuteAndUnmuteLayers(muteLayers, unmuteLayers) → None
Mute and unmute the layers identified in muteLayers and
unmuteLayers .
This is equivalent to calling UsdStage::UnmuteLayer for each layer in
unmuteLayers followed by UsdStage::MuteLayer for each layer in
muteLayers , however this method is more efficient as all
operations are committed in a single batch.
Parameters
muteLayers (list[str]) –
unmuteLayers (list[str]) –
MuteLayer(layerIdentifier) → None
Mute the layer identified by layerIdentifier .
Muted layers are ignored by the stage; they do not participate in
value resolution or composition and do not appear in any LayerStack.
If the root layer of a reference or payload LayerStack 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 stage’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 stage 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.
Muting a layer that has not been used by this stage is not an error.
If that layer is encountered later, muting will take effect and that
layer will be ignored.
The root layer of this stage may not be muted; attempting to do so
will generate a coding error.
Parameters
layerIdentifier (str) –
static Open()
classmethod Open(filePath, load) -> Stage
Attempt to find a matching existing stage in a cache if
UsdStageCacheContext objects exist on the stack.
Failing that, create a new stage and recursively compose prims defined
within and referenced by the layer at filePath , which must
already exist.
The initial set of prims to load on the stage can be specified using
the load parameter.
UsdStage::InitialLoadSet. If pathResolverContext is provided it
will be bound when opening the root layer at filePath and whenever
asset path resolution is done for this stage, regardless of what other
context may be bound at that time. Otherwise Usd will open the root
layer with no context bound, then create a context for all future
asset path resolution for the stage by calling
ArResolver::CreateDefaultContextForAsset with the layer’s repository
path if the layer has one, otherwise its resolved path.
Parameters
filePath (str) –
load (InitialLoadSet) –
Open(filePath, pathResolverContext, load) -> Stage
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
filePath (str) –
pathResolverContext (ResolverContext) –
load (InitialLoadSet) –
Open(rootLayer, load) -> Stage
Open a stage rooted at rootLayer .
Attempt to find a stage that matches the passed arguments in a
UsdStageCache if UsdStageCacheContext objects exist on the calling
stack. If a matching stage is found, return that stage. Otherwise,
create a new stage rooted at rootLayer .
Invoking an overload that does not take a sessionLayer argument
will create a stage with an anonymous in-memory session layer. To
create a stage without a session layer, pass TfNullPtr (or None in
python) as the sessionLayer argument.
The initial set of prims to load on the stage can be specified using
the load parameter.
UsdStage::InitialLoadSet. If pathResolverContext is provided it
will be bound when whenever asset path resolution is done for this
stage, regardless of what other context may be bound at that time.
Otherwise Usd will create a context for all future asset path
resolution for the stage by calling
ArResolver::CreateDefaultContextForAsset with the layer’s repository
path if the layer has one, otherwise its resolved path.
When searching for a matching stage in bound UsdStageCache s, only the
provided arguments matter for cache lookup. For example, if only a
root layer (or a root layer file path) is provided, the first stage
found in any cache that has that root layer is returned. So, for
example if you require that the stage have no session layer, you must
explicitly specify TfNullPtr (or None in python) for the sessionLayer
argument.
Parameters
rootLayer (Layer) –
load (InitialLoadSet) –
Open(rootLayer, sessionLayer, load) -> Stage
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
rootLayer (Layer) –
sessionLayer (Layer) –
load (InitialLoadSet) –
Open(rootLayer, pathResolverContext, load) -> Stage
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
rootLayer (Layer) –
pathResolverContext (ResolverContext) –
load (InitialLoadSet) –
Open(rootLayer, sessionLayer, pathResolverContext, load) -> Stage
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
rootLayer (Layer) –
sessionLayer (Layer) –
pathResolverContext (ResolverContext) –
load (InitialLoadSet) –
static OpenMasked()
classmethod OpenMasked(filePath, mask, load) -> Stage
Create a new stage and recursively compose prims defined within and
referenced by the layer at filePath which must already exist,
subject to mask .
These OpenMasked() methods do not automatically consult or populate
UsdStageCache s.
The initial set of prims to load on the stage can be specified using
the load parameter.
UsdStage::InitialLoadSet. If pathResolverContext is provided it
will be bound when opening the root layer at filePath and whenever
asset path resolution is done for this stage, regardless of what other
context may be bound at that time. Otherwise Usd will open the root
layer with no context bound, then create a context for all future
asset path resolution for the stage by calling
ArResolver::CreateDefaultContextForAsset with the layer’s repository
path if the layer has one, otherwise its resolved path.
Parameters
filePath (str) –
mask (StagePopulationMask) –
load (InitialLoadSet) –
OpenMasked(filePath, pathResolverContext, mask, load) -> Stage
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
filePath (str) –
pathResolverContext (ResolverContext) –
mask (StagePopulationMask) –
load (InitialLoadSet) –
OpenMasked(rootLayer, mask, load) -> Stage
Open a stage rooted at rootLayer and with limited population
subject to mask .
These OpenMasked() methods do not automatically consult or populate
UsdStageCache s.
Invoking an overload that does not take a sessionLayer argument
will create a stage with an anonymous in-memory session layer. To
create a stage without a session layer, pass TfNullPtr (or None in
python) as the sessionLayer argument.
The initial set of prims to load on the stage can be specified using
the load parameter.
UsdStage::InitialLoadSet. If pathResolverContext is provided it
will be bound when whenever asset path resolution is done for this
stage, regardless of what other context may be bound at that time.
Otherwise Usd will create a context for all future asset path
resolution for the stage by calling
ArResolver::CreateDefaultContextForAsset with the layer’s repository
path if the layer has one, otherwise its resolved path.
Parameters
rootLayer (Layer) –
mask (StagePopulationMask) –
load (InitialLoadSet) –
OpenMasked(rootLayer, sessionLayer, mask, load) -> Stage
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
rootLayer (Layer) –
sessionLayer (Layer) –
mask (StagePopulationMask) –
load (InitialLoadSet) –
OpenMasked(rootLayer, pathResolverContext, mask, load) -> Stage
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
rootLayer (Layer) –
pathResolverContext (ResolverContext) –
mask (StagePopulationMask) –
load (InitialLoadSet) –
OpenMasked(rootLayer, sessionLayer, pathResolverContext, mask, load) -> Stage
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
rootLayer (Layer) –
sessionLayer (Layer) –
pathResolverContext (ResolverContext) –
mask (StagePopulationMask) –
load (InitialLoadSet) –
OverridePrim(path) → Prim
Attempt to ensure a UsdPrim at path exists on this stage.
If a prim already exists at path , return it. Otherwise author
SdfPrimSpecs with specifier == SdfSpecifierOver and empty
typeName at the current EditTarget to create this prim and any
nonexistent ancestors, then return it.
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.
If an ancestor of path identifies an inactive prim, author scene
description as described above but return an invalid prim, since the
resulting prim is descendant to an inactive prim.
Parameters
path (Path) –
Reload() → None
Calls SdfLayer::Reload on all layers contributing to this stage,
except session layers and sublayers of session layers.
This includes non-session sublayers, references and payloads. Note
that reloading anonymous layers clears their content, so invoking
Reload() on a stage constructed via CreateInMemory() will clear its
root layer.
This method is considered a mutation, which has potentially global
effect! Unlike the various Load() methods whose actions affect only
this stage, Reload() may cause layers to change their contents,
and because layers are global resources shared by potentially many
Stages, calling Reload() on one stage may result in a mutation to any
number of stages. In general, unless you are highly confident your
stage is the only consumer of its layers, you should only call
Reload() when you are assured no other threads may be reading from any
Stages.
RemovePrim(path) → bool
Remove all scene description for the given path and its subtree
in the current UsdEditTarget.
This method does not do what you might initially think! Calling this
function will not necessarily cause the UsdPrim at path on this
stage to disappear. Completely eradicating a prim from a composition
can be an involved process, involving edits to many contributing
layers, some of which (in many circumstances) will not be editable by
a client. This method is a surgical instrument that can be used
iteratively to effect complete removal of a prim and its subtree from
namespace, assuming the proper permissions are acquired, but more
commonly it is used to perform layer-level operations; e.g.: ensuring
that a given layer (as expressed by a UsdEditTarget) provides no
opinions for a prim and its subtree.
Generally, if your eye is attracted to this method, you probably want
to instead use UsdPrim::SetActive(false), which will provide the
composed effect of removing the prim and its subtree from the
composition, without actually removing any scene description, which as
a bonus, means that the effect is reversible at a later time!
Parameters
path (Path) –
ResolveIdentifierToEditTarget(identifier) → str
Resolve the given identifier using this stage’s ArResolverContext and
the layer of its GetEditTarget() as an anchor for relative references
(e.g.
@./siblingFile.usd@).
a non-empty string containing either the same identifier that was
passed in (if the identifier refers to an already-opened layer or
an”anonymous”, in-memory layer), or a resolved layer filepath. If the
identifier was not resolvable, return the empty string.
Parameters
identifier (str) –
Save() → None
Calls SdfLayer::Save on all dirty layers contributing to this stage
except session layers and sublayers of session layers.
This function will emit a warning and skip each dirty anonymous layer
it encounters, since anonymous layers cannot be saved with
SdfLayer::Save. These layers must be manually exported by calling
SdfLayer::Export.
SaveSessionLayers() → None
Calls SdfLayer::Save on all dirty session layers and sublayers of
session layers contributing to this stage.
This function will emit a warning and skip each dirty anonymous layer
it encounters, since anonymous layers cannot be saved with
SdfLayer::Save. These layers must be manually exported by calling
SdfLayer::Export.
static SetColorConfigFallbacks()
classmethod SetColorConfigFallbacks(colorConfiguration, colorManagementSystem) -> None
Sets the global fallback values of color configuration metadata which
includes the’colorConfiguration’asset path and the name of the color
management system.
This overrides any fallback values authored in plugInfo files.
If the specified value of colorConfiguration or
colorManagementSystem is empty, then the corresponding fallback
value isn’t set. In other words, for this call to have an effect, at
least one value must be non-empty. Additionally, these can’t be reset
to empty values.
GetColorConfigFallbacks() Color Configuration API
Parameters
colorConfiguration (AssetPath) –
colorManagementSystem (str) –
SetColorConfiguration(colorConfig) → None
Sets the default color configuration to be used to interpret the per-
attribute color-spaces in the composed USD stage.
This is specified as asset path which can be resolved to the color
spec file.
Color Configuration API
Parameters
colorConfig (AssetPath) –
SetColorManagementSystem(cms) → None
Sets the name of the color management system used to interpret the
color configuration file pointed at by the colorConfiguration
metadata.
Color Configuration API
Parameters
cms (str) –
SetDefaultPrim(prim) → None
Set the default prim layer metadata in this stage’s root layer.
This is shorthand for:
stage->GetRootLayer()->SetDefaultPrim(prim.GetName());
Note that this function always authors to the stage's root layer. To
author to a different layer, use the SdfLayer::SetDefaultPrim() API.
Parameters
prim (Prim) –
SetEditTarget(editTarget) → None
Set the stage’s EditTarget.
If editTarget.IsLocalLayer(), check to see if it’s a layer in this
stage’s local LayerStack. If not, issue an error and do nothing. If
editTarget is invalid, issue an error and do nothing. If
editTarget differs from the stage’s current EditTarget, set the
EditTarget and send UsdNotice::StageChangedEditTarget. Otherwise do
nothing.
Parameters
editTarget (EditTarget) –
SetEndTimeCode(arg1) → None
Sets the stage’s end timeCode.
The end timeCode is set in the current EditTarget, if it is the root
layer of the stage or the session layer associated with the stage. If
the current EditTarget is neither, a warning is issued and the end
timeCode is not set.
Parameters
arg1 (float) –
SetFramesPerSecond(framesPerSecond) → None
Sets the stage’s framesPerSecond value.
The framesPerSecond value is set in the current EditTarget, if it is
the root layer of the stage or the session layer associated with the
stage. If the current EditTarget is neither, a warning is issued and
no value is set.
GetFramesPerSecond()
Parameters
framesPerSecond (float) –
static SetGlobalVariantFallbacks()
classmethod SetGlobalVariantFallbacks(fallbacks) -> None
Set the global variant fallback preferences used in new UsdStages.
This overrides any fallbacks configured in plugin metadata, and only
affects stages created after this call.
This does not affect existing UsdStages.
Parameters
fallbacks (PcpVariantFallbackMap) –
SetInterpolationType(interpolationType) → None
Sets the interpolation type used during value resolution for all
attributes on this stage.
Changing this will cause a UsdNotice::StageContentsChanged notice to
be sent, as values at times where no samples are authored may have
changed.
Parameters
interpolationType (InterpolationType) –
SetLoadRules(rules) → None
Set the UsdStageLoadRules to govern payload inclusion on this stage.
This rebuilds the stage’s entire prim hierarchy to follow rules .
Note that subsequent calls to Load() , Unload() , LoadAndUnload() will
modify this stages load rules as described in the documentation for
those member functions.
See Working Set Management for more information.
Parameters
rules (StageLoadRules) –
SetMetadata(key, value) → bool
Set the value of Stage metadatum key to value , if the stage’s
current UsdEditTarget is the root or session layer.
If the current EditTarget is any other layer, raise a coding error.
true if authoring was successful, false otherwise. Generates a coding
error if key is not allowed as layer metadata.
General Metadata in USD
Parameters
key (str) –
value (T) –
SetMetadata(key, value) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
key (str) –
value (VtValue) –
SetMetadataByDictKey(key, keyPath, value) → bool
Author value to the field identified by key and keyPath at
the current EditTarget.
The keyPath is a’:’-separated path identifying a value in
subdictionaries stored in the metadata field at key . If
keyPath is empty, no action is taken.
true if the value is authored successfully, false otherwise. Generates
a coding error if key is not allowed as layer metadata.
Dictionary-valued Metadata
Parameters
key (str) –
keyPath (str) –
value (T) –
SetMetadataByDictKey(key, keyPath, value) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Parameters
key (str) –
keyPath (str) –
value (VtValue) –
SetPopulationMask(mask) → None
Set this stage’s population mask and recompose the stage.
Parameters
mask (StagePopulationMask) –
SetStartTimeCode(arg1) → None
Sets the stage’s start timeCode.
The start timeCode is set in the current EditTarget, if it is the root
layer of the stage or the session layer associated with the stage. If
the current EditTarget is neither, a warning is issued and the start
timeCode is not set.
Parameters
arg1 (float) –
SetTimeCodesPerSecond(timeCodesPerSecond) → None
Sets the stage’s timeCodesPerSecond value.
The timeCodesPerSecond value is set in the current EditTarget, if it
is the root layer of the stage or the session layer associated with
the stage. If the current EditTarget is neither, a warning is issued
and no value is set.
GetTimeCodesPerSecond()
Parameters
timeCodesPerSecond (float) –
Traverse() → PrimRange
Traverse the active, loaded, defined, non-abstract prims on this stage
depth-first.
Traverse() returns a UsdPrimRange, which allows low-latency traversal,
with the ability to prune subtrees from traversal. It is python
iterable, so in its simplest form, one can do:
for prim in stage.Traverse():
print prim.GetPath()
If either a pre-and-post-order traversal or a traversal rooted at a
particular prim is desired, construct a UsdPrimRange directly.
This is equivalent to UsdPrimRange::Stage() .
Traverse(predicate) -> PrimRange
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Traverse the prims on this stage subject to predicate .
This is equivalent to UsdPrimRange::Stage() .
Parameters
predicate (_PrimFlagsPredicate) –
TraverseAll() → PrimRange
Traverse all the prims on this stage depth-first.
Traverse()
UsdPrimRange::Stage()
Unload(path) → None
Modify this stage’s load rules to unload the prim and its descendants
specified by path .
See Working Set Management for more information.
Parameters
path (Path) –
UnmuteLayer(layerIdentifier) → None
Unmute the layer identified by layerIdentifier if it had
previously been muted.
Parameters
layerIdentifier (str) –
WriteFallbackPrimTypes() → None
Writes the fallback prim types defined in the schema registry to the
stage as dictionary valued fallback prim type metadata.
If the stage already has fallback prim type metadata, the fallback
types from the schema registry will be added to the existing metadata,
only for types that are already present in the dictionary, i.e. this
won’t overwrite existing fallback entries.
The current edit target determines whether the metadata is written to
the root layer or the session layer. If the edit target specifies
another layer besides these, this will produce an error.
This function can be used at any point before calling Save or Export
on a stage to record the fallback types for the current schemas. This
allows another version of Usd to open this stage and treat prim types
it doesn’t recognize as a type it does recognize defined for it in
this metadata.
Fallback Prim Types UsdSchemaRegistry::GetFallbackPrimTypes
LoadAll = Usd.Stage.LoadAll
LoadNone = Usd.Stage.LoadNone
property expired
True if this object has expired, False otherwise.
class pxr.Usd.StageCache
A strongly concurrency safe collection of UsdStageRefPtr s, enabling
sharing across multiple clients and threads. See UsdStageCacheContext
for typical use cases finding UsdStage s in a cache and publishing
UsdStage s to a cache.
UsdStageCache is strongly thread safe: all operations other than
construction and destruction may be performed concurrently.
Clients typically populate and fetch UsdStage s in caches by binding a
UsdStageCacheContext object to a cache, then using the
UsdStage::Open() API. See UsdStageCacheContext for more details.
Clients may also populate and fetch directly via
UsdStageCache::Insert() , UsdStageCache::Find() ,
UsdStageCache::FindOneMatching() , and
UsdStageCache::FindAllMatching() API.
Caches provide a mechanism that associates a lightweight key,
UsdStageCache::Id, with a cached stage. A UsdStageCache::Id can be
converted to and from long int and string. This can be useful for
communicating within a third party application that cannot transmit
arbitrary C++ objects. See UsdStageCache::GetId() .
Clients may iterate all cache elements using
UsdStageCache::GetAllStages() and remove elements with
UsdStageCache::Erase() , UsdStageCache::EraseAll() , and
UsdStageCache::Clear() .
Note that this class is a regular type: it can be copied and assigned
at will. It is not a singleton. Also, since it holds a collection of
UsdStageRefPtr objects, copying it does not create new UsdStage
instances, it merely copies the RefPtrs.
Enabling the USD_STAGE_CACHE TF_DEBUG code will issue debug output for
UsdStageCache Find/Insert/Erase/Clear operations. Also see
UsdStageCache::SetDebugName() and UsdStageCache::GetDebugName() .
Classes:
Id
Methods:
Clear()
Remove all entries from this cache, leaving it empty and equivalent to a default-constructed cache.
Contains(stage)
Return true if stage is present in this cache, false otherwise.
Erase(id)
Erase the stage identified by id from this cache and return true.
EraseAll(rootLayer)
Erase all stages present in the cache with rootLayer and return the number erased.
Find(id)
Find the stage in this cache corresponding to id in this cache.
FindAllMatching(rootLayer)
Find all stages in this cache with rootLayer .
FindOneMatching(rootLayer)
Find a stage in this cache with rootLayer .
GetAllStages()
Return a vector containing the stages present in this cache.
GetDebugName()
Retrieve this cache's debug name, set with SetDebugName() .
GetId(stage)
Return the Id associated with stage in this cache.
Insert(stage)
Insert stage into this cache and return its associated Id.
IsEmpty()
Return true if this cache holds no stages, false otherwise.
SetDebugName(debugName)
Assign a debug name to this cache.
Size()
Return the number of stages present in this cache.
swap(other)
Swap the contents of this cache with other .
class Id
Methods:
FromLongInt
FromString
IsValid
ToLongInt
ToString
static FromLongInt()
static FromString()
IsValid()
ToLongInt()
ToString()
Clear() → None
Remove all entries from this cache, leaving it empty and equivalent to
a default-constructed cache.
Since the cache contains UsdStageRefPtr, erasing a stage from the
cache will only destroy the stage if no other UsdStageRefPtrs exist
referring to it.
Contains(stage) → bool
Return true if stage is present in this cache, false otherwise.
Parameters
stage (Stage) –
Contains(id) -> bool
Return true if id is present in this cache, false otherwise.
Parameters
id (Id) –
Erase(id) → bool
Erase the stage identified by id from this cache and return true.
If id is invalid or there is no associated stage in this cache, do
nothing and return false. Since the cache contains UsdStageRefPtr,
erasing a stage from the cache will only destroy the stage if no other
UsdStageRefPtrs exist referring to it.
Parameters
id (Id) –
Erase(stage) -> bool
Erase stage from this cache and return true.
If stage is not present in this cache, do nothing and return
false. Since the cache contains UsdStageRefPtr, erasing a stage from
the cache will only destroy the stage if no other UsdStageRefPtrs
exist referring to it.
Parameters
stage (Stage) –
EraseAll(rootLayer) → int
Erase all stages present in the cache with rootLayer and return
the number erased.
Since the cache contains UsdStageRefPtr, erasing a stage from the
cache will only destroy the stage if no other UsdStageRefPtrs exist
referring to it.
Parameters
rootLayer (Layer) –
EraseAll(rootLayer, sessionLayer) -> int
Erase all stages present in the cache with rootLayer and
sessionLayer and return the number erased.
Since the cache contains UsdStageRefPtr, erasing a stage from the
cache will only destroy the stage if no other UsdStageRefPtrs exist
referring to it.
Parameters
rootLayer (Layer) –
sessionLayer (Layer) –
EraseAll(rootLayer, sessionLayer, pathResolverContext) -> int
Erase all stages present in the cache with rootLayer ,
sessionLayer , and pathResolverContext and return the number
erased.
Since the cache contains UsdStageRefPtr, erasing a stage from the
cache will only destroy the stage if no other UsdStageRefPtrs exist
referring to it.
Parameters
rootLayer (Layer) –
sessionLayer (Layer) –
pathResolverContext (ResolverContext) –
Find(id) → Stage
Find the stage in this cache corresponding to id in this cache.
If id is not valid (see Id::IsValid() ) or if this cache does not
have a stage corresponding to id , return null.
Parameters
id (Id) –
FindAllMatching(rootLayer) → list[Stage]
Find all stages in this cache with rootLayer .
If there is no matching stage in this cache, return an empty vector.
Parameters
rootLayer (Layer) –
FindAllMatching(rootLayer, sessionLayer) -> list[Stage]
Find all stages in this cache with rootLayer and sessionLayer
.
If there is no matching stage in this cache, return an empty vector.
Parameters
rootLayer (Layer) –
sessionLayer (Layer) –
FindAllMatching(rootLayer, pathResolverContext) -> list[Stage]
Find all stages in this cache with rootLayer and
pathResolverContext .
If there is no matching stage in this cache, return an empty vector.
Parameters
rootLayer (Layer) –
pathResolverContext (ResolverContext) –
FindAllMatching(rootLayer, sessionLayer, pathResolverContext) -> list[Stage]
Find all stages in this cache with rootLayer , sessionLayer ,
and pathResolverContext .
If there is no matching stage in this cache, return an empty vector.
If there is more than one matching stage in this cache, return an
arbitrary matching one.
Parameters
rootLayer (Layer) –
sessionLayer (Layer) –
pathResolverContext (ResolverContext) –
FindOneMatching(rootLayer) → Stage
Find a stage in this cache with rootLayer .
If there is no matching stage in this cache, return null. If there is
more than one matching stage in this cache, return an arbitrary
matching one. See also FindAllMatching() .
Parameters
rootLayer (Layer) –
FindOneMatching(rootLayer, sessionLayer) -> Stage
Find a stage in this cache with rootLayer and sessionLayer .
If there is no matching stage in this cache, return null. If there is
more than one matching stage in this cache, return an arbitrary
matching one. See also FindAllMatching() .
Parameters
rootLayer (Layer) –
sessionLayer (Layer) –
FindOneMatching(rootLayer, pathResolverContext) -> Stage
Find a stage in this cache with rootLayer and
pathResolverContext .
If there is no matching stage in this cache, return null. If there is
more than one matching stage in this cache, return an arbitrary
matching one.
FindAllMatching()
Parameters
rootLayer (Layer) –
pathResolverContext (ResolverContext) –
FindOneMatching(rootLayer, sessionLayer, pathResolverContext) -> Stage
Find a stage in this cache with rootLayer , sessionLayer , and
pathResolverContext .
If there is no matching stage in this cache, return null. If there is
more than one matching stage in this cache, return an arbitrary
matching one.
FindAllMatching()
Parameters
rootLayer (Layer) –
sessionLayer (Layer) –
pathResolverContext (ResolverContext) –
GetAllStages() → list[Stage]
Return a vector containing the stages present in this cache.
GetDebugName() → str
Retrieve this cache’s debug name, set with SetDebugName() .
If no debug name has been assigned, return the empty string.
GetId(stage) → Id
Return the Id associated with stage in this cache.
If stage is not present in this cache, return an invalid Id.
Parameters
stage (Stage) –
Insert(stage) → Id
Insert stage into this cache and return its associated Id.
If the given stage is already present in this cache, simply return
its associated Id.
Parameters
stage (Stage) –
IsEmpty() → bool
Return true if this cache holds no stages, false otherwise.
SetDebugName(debugName) → None
Assign a debug name to this cache.
This will be emitted in debug output messages when the
USD_STAGE_CACHES debug flag is enabled. If set to the empty string,
the cache’s address will be used instead.
Parameters
debugName (str) –
Size() → int
Return the number of stages present in this cache.
swap(other) → None
Swap the contents of this cache with other .
Parameters
other (StageCache) –
class pxr.Usd.StageCacheContext
A context object that lets the UsdStage::Open() API read from or read
from and write to a UsdStageCache instance during a scope of
execution.
Code examples illustrate typical use:
{
// A stage cache to work with.
UsdStageCache stageCache;
// Bind this cache. UsdStage::Open() will attempt to find a matching
// stage in the cache. If none is found, it will open a new stage and
// insert it into the cache.
UsdStageCacheContext context(stageCache);
// Since the cache is currently empty, this Open call will not find an
// existing stage in the cache, but will insert the newly opened stage
// in it.
auto stage = UsdStage::Open(<args>);
assert(stageCache.Contains(stage));
// A subsequent Open() call with the same arguments will retrieve the
// stage from cache.
auto stage2 = UsdStage::Open(<args>);
assert(stage2 == stage);
}
The UsdStage::Open() API examines caches in UsdStageCacheContexts that
exist on the stack in the current thread in order starting with the
most recently created (deepest in the stack) to the least recently
created.
The UsdUseButDoNotPopulateCache() function makes a cache available for
UsdStage::Open() to find stages in, but newly opened stages will not
be published to it. This can be useful if you want to make use of a
cache but cannot or do not wish to mutate that cache.
Passing UsdBlockStageCaches disables cache use entirely (as if no
UsdStageCacheContexts exist on the stack), while
UsdBlockStageCachePopulation disables writing to all bound caches (as
if they were all established with UsdUseButDoNotPopulateCache()).
Threading note: Different threads have different call stacks, so
UsdStageCacheContext objects that exist in one thread’s stack do not
influence calls to UsdStage::Open() from a different thread.
class pxr.Usd.StageCacheContextBlockType
Methods:
GetValueFromName
Attributes:
allValues
static GetValueFromName()
allValues = (Usd.BlockStageCaches, Usd.BlockStageCachePopulation, Usd._NoBlock)
class pxr.Usd.StageLoadRules
This class represents rules that govern payload inclusion on
UsdStages.
Rules are represented as pairs of SdfPath and a Rule enum value, one
of AllRule, OnlyRule, and NoneRule. To understand how rules apply to
particular paths, see UsdStageLoadRules::GetEffectiveRuleForPath() .
Convenience methods for manipulating rules by
typical’Load’and’Unload’operations are provided in
UsdStageLoadRules::LoadWithoutDescendants() ,
UsdStageLoadRules::LoadWithDescendants() , UsdStageLoadRules::Unload()
.
For finer-grained rule crafting, see AddRule() .
Remove redundant rules that do not change the effective load state
with UsdStageLoadRules::Minimize() .
Classes:
Rule
These values are paired with paths to govern payload inclusion on UsdStages.
Methods:
AddRule(path, rule)
Add a literal rule.
GetEffectiveRuleForPath(path)
Return the"effective"rule for the given path .
GetRules()
Return all the rules as a vector.
IsLoaded(path)
Return true if the given path is considered loaded by these rules, or false if it is considered unloaded.
IsLoadedWithAllDescendants(path)
Return true if the given path and all descendants are considered loaded by these rules; false otherwise.
IsLoadedWithNoDescendants(path)
Return true if the given path and is considered loaded, but none of its descendants are considered loaded by these rules; false otherwise.
LoadAll
classmethod LoadAll() -> StageLoadRules
LoadAndUnload(loadSet, unloadSet, policy)
Add rules as if Unload() was called for each element of unloadSet followed by calls to either LoadWithDescendants() (if policy is UsdLoadPolicy::LoadWithDescendants) or LoadWithoutDescendants() (if policy is UsdLoadPolicy::LoadWithoutDescendants) for each element of loadSet .
LoadNone
classmethod LoadNone() -> StageLoadRules
LoadWithDescendants(path)
Add a rule indicating that path , all its ancestors, and all its descendants shall be loaded.
LoadWithoutDescendants(path)
Add a rule indicating that path and all its ancestors but none of its descendants shall be loaded.
Minimize()
Remove any redundant rules to make the set of rules as small as possible without changing behavior.
SetRules(rules)
Set literal rules, must be sorted by SdfPath::operator< .
Unload(path)
Add a rule indicating that path and all its descendants shall be unloaded.
swap(other)
Swap the contents of these rules with other .
Attributes:
AllRule
NoneRule
OnlyRule
class Rule
These values are paired with paths to govern payload inclusion on
UsdStages.
Methods:
GetValueFromName
Attributes:
allValues
static GetValueFromName()
allValues = (Usd.StageLoadRules.AllRule, Usd.StageLoadRules.OnlyRule, Usd.StageLoadRules.NoneRule)
AddRule(path, rule) → None
Add a literal rule. If there’s already a rule for path , replace
it.
Parameters
path (Path) –
rule (Rule) –
GetEffectiveRuleForPath(path) → Rule
Return the”effective”rule for the given path .
For example, if the closest ancestral rule of path is an
AllRule , return AllRule . If the closest ancestral rule of
path is for path itself and it is an OnlyRule , return
OnlyRule . Otherwise if there is a closest descendant rule to
path this is an OnlyRule or an AllRule , return
OnlyRule . Otherwise return NoneRule .
Parameters
path (Path) –
GetRules() → list[tuple[Path, Rule]]
Return all the rules as a vector.
IsLoaded(path) → bool
Return true if the given path is considered loaded by these rules,
or false if it is considered unloaded.
This is equivalent to GetEffectiveRuleForPath(path) != NoneRule.
Parameters
path (Path) –
IsLoadedWithAllDescendants(path) → bool
Return true if the given path and all descendants are considered
loaded by these rules; false otherwise.
Parameters
path (Path) –
IsLoadedWithNoDescendants(path) → bool
Return true if the given path and is considered loaded, but none
of its descendants are considered loaded by these rules; false
otherwise.
Parameters
path (Path) –
static LoadAll()
classmethod LoadAll() -> StageLoadRules
Return rules that load all payloads.
This is equivalent to default-constructed UsdStageLoadRules.
LoadAndUnload(loadSet, unloadSet, policy) → None
Add rules as if Unload() was called for each element of unloadSet
followed by calls to either LoadWithDescendants() (if policy is
UsdLoadPolicy::LoadWithDescendants) or LoadWithoutDescendants() (if
policy is UsdLoadPolicy::LoadWithoutDescendants) for each element
of loadSet .
Parameters
loadSet (SdfPathSet) –
unloadSet (SdfPathSet) –
policy (LoadPolicy) –
static LoadNone()
classmethod LoadNone() -> StageLoadRules
Return rules that load no payloads.
LoadWithDescendants(path) → None
Add a rule indicating that path , all its ancestors, and all its
descendants shall be loaded.
Any previous rules created by calling LoadWithoutDescendants() or
Unload() on this path or descendant paths are replaced by this rule.
For example, calling LoadWithoutDescendants(‘/World/sets/kitchen’)
followed by LoadWithDescendants(‘/World/sets’) will effectively remove
the rule created in the first call. See AddRule() for more direct
manipulation.
Parameters
path (Path) –
LoadWithoutDescendants(path) → None
Add a rule indicating that path and all its ancestors but none of
its descendants shall be loaded.
Any previous rules created by calling LoadWithDescendants() or
Unload() on this path or descendant paths are replaced or restricted
by this rule. For example, calling LoadWithDescendants(‘/World/sets’)
followed by LoadWithoutDescendants(‘/World/sets/kitchen’) will cause
everything under’/World/sets’to load except for those things
under’/World/sets/kitchen’. See AddRule() for more direct
manipulation.
Parameters
path (Path) –
Minimize() → None
Remove any redundant rules to make the set of rules as small as
possible without changing behavior.
SetRules(rules) → None
Set literal rules, must be sorted by SdfPath::operator< .
Parameters
rules (list[tuple[Path, Rule]]) –
SetRules(rules) -> None
Set literal rules, must be sorted by SdfPath::operator< .
Parameters
rules (list[tuple[Path, Rule]]) –
Unload(path) → None
Add a rule indicating that path and all its descendants shall be
unloaded.
Any previous rules created by calling LoadWithDescendants() or
LoadWithoutDescendants() on this path or descendant paths are replaced
or restricted by this rule. For example, calling
LoadWithDescendants(‘/World/sets’) followed by
Unload(‘/World/sets/kitchen’) will cause everything
under’/World/sets’to load, except for’/World/sets/kitchen’and
everything under it.
Parameters
path (Path) –
swap(other) → None
Swap the contents of these rules with other .
Parameters
other (StageLoadRules) –
AllRule = Usd.StageLoadRules.AllRule
NoneRule = Usd.StageLoadRules.NoneRule
OnlyRule = Usd.StageLoadRules.OnlyRule
class pxr.Usd.StagePopulationMask
This class represents a mask that may be applied to a UsdStage to
limit the set of UsdPrim s it populates. This is useful in cases where
clients have a large scene but only wish to view or query a single or
a handful of objects. For example, suppose we have a city block with
buildings, cars, crowds of people, and a couple of main characters.
Some tasks might only require looking at a single main character and
perhaps a few props. We can create a population mask with the paths to
the character and props of interest and open a UsdStage with that
mask. Usd will avoid populating the other objects in the scene, saving
time and memory. See UsdStage::OpenMasked() for more.
A mask is defined by a set of SdfPath s with the following qualities:
they are absolute prim paths (or the absolute root path), and no path
in the set is an ancestor path of any other path in the set other than
itself. For example, the set of paths [‘/a/b’,’/a/c’,’/x/y’] is a
valid mask, but the set of paths [‘/a/b’,’/a/b/c’,’/x/y’] is
redundant, since’/a/b’is an ancestor of’/a/b/c’. The path’/a/b/c’may
be removed. The GetUnion() and Add() methods ensure that no redundant
paths are added.
Default-constructed UsdStagePopulationMask s are considered empty (
IsEmpty() ) and include no paths. A population mask containing
SdfPath::AbsoluteRootPath() includes all paths.
Methods:
Add(other)
Assign this mask to be its union with other and return a reference to this mask.
All
classmethod All() -> StagePopulationMask
GetIncludedChildNames(path, childNames)
Return true if this mask includes any child prims beneath path , false otherwise.
GetIntersection(other)
Return a mask that is the intersection of this and other .
GetPaths()
Return the set of paths that define this mask.
GetUnion(other)
Return a mask that is the union of this and other .
Includes(other)
Return true if this mask is a superset of other .
IncludesSubtree(path)
Return true if this mask includes path and all paths descendant to path .
Intersection
classmethod Intersection(l, r) -> StagePopulationMask
IsEmpty()
Return true if this mask contains no paths.
Union
classmethod Union(l, r) -> StagePopulationMask
Add(other) → StagePopulationMask
Assign this mask to be its union with other and return a reference
to this mask.
Parameters
other (StagePopulationMask) –
Add(path) -> StagePopulationMask
Assign this mask to be its union with path and return a reference
to this mask.
Parameters
path (Path) –
static All()
classmethod All() -> StagePopulationMask
Return a mask that includes all paths.
This is the mask that contains the absolute root path.
GetIncludedChildNames(path, childNames) → bool
Return true if this mask includes any child prims beneath path ,
false otherwise.
If only specific child prims beneath path are included, the names
of those children will be returned in childNames . If all child
prims beneath path are included, childNames will be empty.
Parameters
path (Path) –
childNames (list[str]) –
GetIntersection(other) → StagePopulationMask
Return a mask that is the intersection of this and other .
Parameters
other (StagePopulationMask) –
GetPaths() → list[Path]
Return the set of paths that define this mask.
GetUnion(other) → StagePopulationMask
Return a mask that is the union of this and other .
Parameters
other (StagePopulationMask) –
GetUnion(path) -> StagePopulationMask
Return a mask that is the union of this and a mask containing the
single path .
Parameters
path (Path) –
Includes(other) → bool
Return true if this mask is a superset of other .
That is, if this mask includes at least every path that other
includes.
Parameters
other (StagePopulationMask) –
Includes(path) -> bool
Return true if this mask includes path .
This is true if path is one of the paths in this mask, or if it is
either a descendant or an ancestor of one of the paths in this mask.
Parameters
path (Path) –
IncludesSubtree(path) → bool
Return true if this mask includes path and all paths descendant to
path .
For example, consider a mask containing the path’/a/b’. Then the
following holds:
mask.Includes('/a') -> true
mask.Includes('/a/b') -> true
mask.IncludesSubtree('/a') -> false
mask.IncludesSubtree('/a/b') -> true
Parameters
path (Path) –
static Intersection()
classmethod Intersection(l, r) -> StagePopulationMask
Return a mask that is the intersection of l and r .
Parameters
l (StagePopulationMask) –
r (StagePopulationMask) –
IsEmpty() → bool
Return true if this mask contains no paths.
Empty masks include no paths.
static Union()
classmethod Union(l, r) -> StagePopulationMask
Return a mask that is the union of l and r .
Parameters
l (StagePopulationMask) –
r (StagePopulationMask) –
class pxr.Usd.TimeCode
Represent a time value, which may be either numeric, holding a double
value, or a sentinel value UsdTimeCode::Default() .
A UsdTimeCode does not represent an SMPTE timecode, although we may,
in future, support conversion functions between the two. Instead,
UsdTimeCode is an abstraction that acknowledges that in the principal
domains of use for USD, there are many different ways of encoding
time, and USD must be able to capture and translate between all of
them for interchange, retaining as much intent of the authoring
application as possible.
A UsdTimeCode is therefore a unitless, generic time measurement that
serves as the ordinate for time-sampled data in USD files. A client of
USD relies on the UsdStage (which in turn consults metadata authored
in its root layer) to define the mapping of TimeCodes to units like
seconds and frames.
UsdStage::GetStartTimeCode()
UsdStage::GetEndTimeCode()
UsdStage::GetTimeCodesPerSecond()
UsdStage::GetFramesPerSecond() As described in TimeSamples, Defaults,
and Value Resolution, USD optionally provides an
unvarying,’default’value for every attribute. UsdTimeCode embodies a
time value that can either be a floating-point sample time, or the
default.
All UsdAttribute and derived API that requires a time parameter
defaults to UsdTimeCode::Default() if the parameter is left
unspecified, and auto-constructs from a floating-point argument.
UsdTimeCode::EarliestTime() is provided to aid clients who wish to
retrieve the first authored timesample for any attribute.
Classes:
Tokens
Methods:
Default
classmethod Default() -> TimeCode
EarliestTime
classmethod EarliestTime() -> TimeCode
GetValue()
Return the numeric value for this time.
IsDefault()
Return true if this time represents the'default'sentinel value, false otherwise.
IsEarliestTime()
Return true if this time represents the lowest/earliest possible timeCode, false otherwise.
IsNumeric()
Return true if this time represents a numeric value, false otherwise.
SafeStep
classmethod SafeStep(maxValue, maxCompression) -> float
class Tokens
Attributes:
DEFAULT
EARLIEST
DEFAULT = 'DEFAULT'
EARLIEST = 'EARLIEST'
static Default()
classmethod Default() -> TimeCode
Produce a UsdTimeCode representing the sentinel value for’default’.
In inequality comparisons, Default() is considered less than any
numeric TimeCode, including EarliestTime() , indicative of the fact
that in UsdAttribute value resolution, the sample at Default() (if
any) is always weaker than any numeric timeSample in the same layer.
For more information, see TimeSamples, Defaults, and Value Resolution
static EarliestTime()
classmethod EarliestTime() -> TimeCode
Produce a UsdTimeCode representing the lowest/earliest possible
timeCode.
Thus, for any given timeSample s, its time ordinate t will obey:
t>= UsdTimeCode::EarliestTime()
This is useful for clients that wish to retrieve the first authored
timeSample for an attribute, as they can use
UsdTimeCode::EarliestTime() as the time argument to
UsdAttribute::Get() and UsdAttribute::GetBracketingTimeSamples()
GetValue() → float
Return the numeric value for this time.
If this time IsDefault(), return a quiet NaN value.
IsDefault() → bool
Return true if this time represents the’default’sentinel value, false
otherwise.
This is equivalent to !IsNumeric().
IsEarliestTime() → bool
Return true if this time represents the lowest/earliest possible
timeCode, false otherwise.
IsNumeric() → bool
Return true if this time represents a numeric value, false otherwise.
This is equivalent to !IsDefault().
static SafeStep()
classmethod SafeStep(maxValue, maxCompression) -> float
Produce a safe step value such that for any numeric UsdTimeCode t in
[-maxValue, maxValue], t +/- (step / maxCompression) != t with a
safety factor of 2.
This is shorthand for std::numeric_limits<double>::epsilon() *
maxValue * maxCompression * 2.0. Such a step value is recommended
for simulating jump discontinuities in time samples. For example,
author value x at time t, and value y at time t + SafeStep() . This
ensures that as the sample times are shifted and scaled, t and t +
SafeStep() remain distinct so long as they adhere to the maxValue
and maxCompression limits.
Parameters
maxValue (float) –
maxCompression (float) –
class pxr.Usd.Tokens
Attributes:
apiSchemas
clipSets
clips
collection
collection_MultipleApplyTemplate_Excludes
collection_MultipleApplyTemplate_ExpansionRule
collection_MultipleApplyTemplate_IncludeRoot
collection_MultipleApplyTemplate_Includes
exclude
expandPrims
expandPrimsAndProperties
explicitOnly
fallbackPrimTypes
apiSchemas = 'apiSchemas'
clipSets = 'clipSets'
clips = 'clips'
collection = 'collection'
collection_MultipleApplyTemplate_Excludes = 'collection:__INSTANCE_NAME__:excludes'
collection_MultipleApplyTemplate_ExpansionRule = 'collection:__INSTANCE_NAME__:expansionRule'
collection_MultipleApplyTemplate_IncludeRoot = 'collection:__INSTANCE_NAME__:includeRoot'
collection_MultipleApplyTemplate_Includes = 'collection:__INSTANCE_NAME__:includes'
exclude = 'exclude'
expandPrims = 'expandPrims'
expandPrimsAndProperties = 'expandPrimsAndProperties'
explicitOnly = 'explicitOnly'
fallbackPrimTypes = 'fallbackPrimTypes'
class pxr.Usd.Typed
The base class for all typed schemas (those that can impart a
typeName to a UsdPrim), and therefore the base class for all
instantiable and”IsA”schemas.
UsdTyped implements a typeName-based query for its override of
UsdSchemaBase::_IsCompatible() . It provides no other behavior.
Methods:
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
static GetSchemaAttributeNames()
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) –
class pxr.Usd.UsdCollectionMembershipQuery
Represents a flattened view of a collection. For more information
about collections, please see UsdCollectionAPI as a way to encode and
retrieve a collection from scene description. A
UsdCollectionMembershipQuery object can be used to answer queries
about membership of paths in the collection efficiently.
Methods:
GetAsPathExpansionRuleMap()
Returns a raw map of the paths included or excluded in the collection along with the expansion rules for the included paths.
GetIncludedCollections()
Returns a set of paths for all collections that were included in the collection from which this UsdCollectionMembershipQuery object was computed.
HasExcludes()
Returns true if the collection excludes one or more paths below an included path.
IsPathIncluded(path, expansionRule)
This is an overloaded member function, provided for convenience.
GetAsPathExpansionRuleMap() → PathExpansionRuleMap
Returns a raw map of the paths included or excluded in the collection
along with the expansion rules for the included paths.
GetIncludedCollections() → SdfPathSet
Returns a set of paths for all collections that were included in the
collection from which this UsdCollectionMembershipQuery object was
computed.
This set is recursive, so collections that were included by other
collections will be part of this set. The collection from which this
UsdCollectionMembershipQuery object was computed is not part of this
set.
HasExcludes() → bool
Returns true if the collection excludes one or more paths below an
included path.
IsPathIncluded(path, expansionRule) → bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Returns whether the given path is included in the collection from
which this UsdCollectionMembershipQuery object was computed.
This is the API that clients should use for determining if a given
object is a member of the collection. To enumerate all the members of
a collection, use UsdComputeIncludedObjectsFromCollection or
UsdComputeIncludedPathsFromCollection.
If expansionRule is not nullptr, it is set to the expansion- rule
value that caused the path to be included in or excluded from the
collection. If path is not included in the collection,
expansionRule is set to UsdTokens->exclude.
It is useful to specify this parameter and use this overload of
IsPathIncluded() , when you’re interested in traversing a subtree and
want to know whether the root of the subtree is included in a
collection. For evaluating membership of descendants of the root,
please use the other overload of IsPathIncluded() , that takes both a
path and the parent expansionRule.
The python version of this method only returns the boolean result. It
does not return expansionRule .
Parameters
path (Path) –
expansionRule (str) –
IsPathIncluded(path, parentExpansionRule, expansionRule) -> bool
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Returns whether the given path, path is included in the collection
from which this UsdCollectionMembershipQuery object was computed,
given the parent-path’s inherited expansion rule,
parentExpansionRule .
If expansionRule is not nullptr, it is set to the expansion- rule
value that caused the path to be included in or excluded from the
collection. If path is not included in the collection,
expansionRule is set to UsdTokens->exclude.
The python version of this method only returns the boolean result. It
does not return expansionRule .
Parameters
path (Path) –
parentExpansionRule (str) –
expansionRule (str) –
class pxr.Usd.UsdFileFormat
File format for USD files.
When creating a file through the SdfLayer::CreateNew() interface, the
meaningful SdfFileFormat::FileFormatArguments are as follows:
UsdUsdFileFormatTokens->FormatArg, which must be a supported
format’s’Id’. The possible values are UsdUsdaFileFormatTokens->Id or
UsdUsdcFileFormatTokens->Id.
If no UsdUsdFileFormatTokens->FormatArg is supplied, the default is
UsdUsdcFileFormatTokens->Id.
Methods:
GetUnderlyingFormatForLayer
classmethod GetUnderlyingFormatForLayer(layer) -> str
static GetUnderlyingFormatForLayer()
classmethod GetUnderlyingFormatForLayer(layer) -> str
Returns the value of the”format”argument to be used in the
FileFormatArguments when exporting or saving the given layer.
Returns an empty token if the given layer does not have this file
format.
Parameters
layer (Layer) –
class pxr.Usd.VariantSet
A UsdVariantSet represents a single VariantSet in USD (e.g.
modelingVariant or shadingVariant), which can have multiple variations
that express different sets of opinions about the scene description
rooted at the prim that defines the VariantSet.
(More detailed description of variants to follow)
Methods:
AddVariant(variantName, position)
Author a variant spec for variantName in this VariantSet at the stage's current EditTarget, in the position specified by position .
BlockVariantSelection()
Block any weaker selections for this VariantSet by authoring an empty string at the stage's current EditTarget.
ClearVariantSelection()
Clear any selection for this VariantSet from the current EditTarget.
GetName()
Return this VariantSet's name.
GetPrim()
Return this VariantSet's held prim.
GetVariantEditContext(layer)
Helper function for configuring a UsdStage 's EditTarget to author into the currently selected variant.
GetVariantEditTarget(layer)
Return a UsdEditTarget that edits the currently selected variant in this VariantSet in layer.
GetVariantNames()
Return the composed variant names for this VariantSet, ordered lexicographically.
GetVariantSelection()
Return the variant selection for this VariantSet.
HasAuthoredVariant(variantName)
Returns true if this VariantSet already possesses a variant.
HasAuthoredVariantSelection(value)
Returns true if there is a selection authored for this VariantSet in any layer.
IsValid()
Is this UsdVariantSet object usable? If not, calling any of its other methods is likely to crash.
SetVariantSelection(variantName)
Author a variant selection for this VariantSet, setting it to variantName in the stage's current EditTarget.
AddVariant(variantName, position) → bool
Author a variant spec for variantName in this VariantSet at the
stage’s current EditTarget, in the position specified by position
.
Return true if the spec was successfully authored, false otherwise.
This will create the VariantSet itself, if necessary, so as long as
UsdPrim “prim”is valid, the following should always work:
UsdVariantSet vs = prim.GetVariantSet("myVariantSet");
vs.AddVariant("myFirstVariation");
vs.SetVariantSelection("myFirstVariation");
{
UsdEditContext ctx(vs.GetVariantEditContext());
// Now all of our subsequent edits will go "inside" the
// 'myFirstVariation' variant of 'myVariantSet'
}
Parameters
variantName (str) –
position (ListPosition) –
BlockVariantSelection() → bool
Block any weaker selections for this VariantSet by authoring an empty
string at the stage’s current EditTarget.
Return true on success, false otherwise.
ClearVariantSelection() → bool
Clear any selection for this VariantSet from the current EditTarget.
Return true on success, false otherwise.
GetName() → str
Return this VariantSet’s name.
GetPrim() → Prim
Return this VariantSet’s held prim.
GetVariantEditContext(layer) → tuple[Stage, EditTarget]
Helper function for configuring a UsdStage ‘s EditTarget to author
into the currently selected variant.
Returns configuration for a UsdEditContext
To begin editing into VariantSet varSet’s currently selected
variant:
In C++, we would use the following pattern:
{
UsdEditContext ctxt(varSet.GetVariantEditContext());
// All Usd mutation of the UsdStage on which varSet sits will
// now go "inside" the currently selected variant of varSet
}
In python, the pattern is:
with varSet.GetVariantEditContext():
# Now sending mutations to current variant
See GetVariantEditTarget() for discussion of layer parameter
Parameters
layer (Layer) –
GetVariantEditTarget(layer) → EditTarget
Return a UsdEditTarget that edits the currently selected variant in
this VariantSet in layer.
If there is no currently selected variant in this VariantSet, return
an invalid EditTarget.
If layer is unspecified, then we will use the layer of our prim’s
stage’s current UsdEditTarget.
Currently, we require layer to be in the stage’s local LayerStack
(see UsdStage::HasLocalLayer() ), and will issue an error and return
an invalid EditTarget if layer is not. We may relax this restriction
in the future, if need arises, but it introduces several complications
in specification and behavior.
Parameters
layer (Layer) –
GetVariantNames() → list[str]
Return the composed variant names for this VariantSet, ordered
lexicographically.
GetVariantSelection() → str
Return the variant selection for this VariantSet.
If there is no selection, return the empty string.
HasAuthoredVariant(variantName) → bool
Returns true if this VariantSet already possesses a variant.
Parameters
variantName (str) –
HasAuthoredVariantSelection(value) → bool
Returns true if there is a selection authored for this VariantSet in
any layer.
If requested, the variant selection (if any) will be returned in
value .
Parameters
value (str) –
IsValid() → bool
Is this UsdVariantSet object usable? If not, calling any of its other
methods is likely to crash.
SetVariantSelection(variantName) → bool
Author a variant selection for this VariantSet, setting it to
variantName in the stage’s current EditTarget.
If variantName is empty, clear the variant selection (see
ClearVariantSelection). Call BlockVariantSelection to explicitly set
an empty variant selection.
Return true if the selection was successfully authored or cleared,
false otherwise.
Parameters
variantName (str) –
class pxr.Usd.VariantSets
UsdVariantSets represents the collection of VariantSets that are
present on a UsdPrim.
A UsdVariantSets object, retrieved from a prim via
UsdPrim::GetVariantSets() , provides the API for interrogating and
modifying the composed list of VariantSets active defined on the prim,
and also the facility for authoring a VariantSet selection for any
of those VariantSets.
Methods:
AddVariantSet(variantSetName, position)
Find an existing, or create a new VariantSet on the originating UsdPrim, named variantSetName .
GetAllVariantSelections()
Returns the composed map of all variant selections authored on the the originating UsdPrim, regardless of whether a corresponding variant set exists.
GetNames(names)
Compute the list of all VariantSets authored on the originating UsdPrim.
GetVariantSelection(variantSetName)
Return the composed variant selection for the VariantSet named variantSetName.
GetVariantSet(variantSetName)
Return a UsdVariantSet object for variantSetName .
HasVariantSet(variantSetName)
Returns true if a VariantSet named variantSetName exists on the originating prim.
SetSelection(variantSetName, variantName)
param variantSetName
AddVariantSet(variantSetName, position) → VariantSet
Find an existing, or create a new VariantSet on the originating
UsdPrim, named variantSetName .
This step is not always necessary, because if this UsdVariantSets
object is valid, then
varSetsObj.GetVariantSet(variantSetName).AddVariant(variantName);
will always succeed, creating the VariantSet first, if necessary.
This method exists for situations in which you want to create a
VariantSet without necessarily populating it with variants.
Parameters
variantSetName (str) –
position (ListPosition) –
GetAllVariantSelections() → SdfVariantSelectionMap
Returns the composed map of all variant selections authored on the the
originating UsdPrim, regardless of whether a corresponding variant set
exists.
GetNames(names) → bool
Compute the list of all VariantSets authored on the originating
UsdPrim.
Always return true. Clear the contents of names and store the
result there.
Parameters
names (list[str]) –
GetNames() -> list[str]
Return a list of all VariantSets authored on the originating UsdPrim.
GetVariantSelection(variantSetName) → str
Return the composed variant selection for the VariantSet named
variantSetName.
If there is no selection, (or variantSetName does not exist)
return the empty string.
Parameters
variantSetName (str) –
GetVariantSet(variantSetName) → VariantSet
Return a UsdVariantSet object for variantSetName .
This always succeeds, although the returned VariantSet will be invalid
if the originating prim is invalid
Parameters
variantSetName (str) –
HasVariantSet(variantSetName) → bool
Returns true if a VariantSet named variantSetName exists on the
originating prim.
Parameters
variantSetName (str) –
SetSelection(variantSetName, variantName) → bool
Parameters
variantSetName (str) –
variantName (str) –
class pxr.Usd.ZipFile
Class for reading a zip file. This class is primarily intended to
support the .usdz file format. It is not a general-purpose zip reader,
as it does not implement the full zip file specification. In
particular:
This class does not natively support decompressing data from a
zip archive. Clients may access the data exactly as stored in the file
and perform their own decompression if desired.
This class does not rely on the central directory in order to
read the contents of the file. This allows it to operate on partial
zip archives. However, this also means it may handle certain zip files
incorrectly. For example, if a file was deleted from a zip archive by
just removing its central directory header, that file will still be
found by this class.
Classes:
FileInfo
Methods:
DumpContents()
Print out listing of contents of this zip archive to stdout.
GetFile
GetFileInfo
GetFileNames
Open
classmethod Open(filePath) -> ZipFile
class FileInfo
Attributes:
compressionMethod
dataOffset
encrypted
size
uncompressedSize
property compressionMethod
property dataOffset
property encrypted
property size
property uncompressedSize
DumpContents() → None
Print out listing of contents of this zip archive to stdout.
For diagnostic purposes only.
GetFile()
GetFileInfo()
GetFileNames()
static Open()
classmethod Open(filePath) -> ZipFile
Opens the zip archive at filePath .
Returns invalid object on error.
Parameters
filePath (str) –
Open(asset) -> ZipFile
Opens the zip archive asset .
Returns invalid object on error.
Parameters
asset (ArAsset) –
class pxr.Usd.ZipFileWriter
Class for writing a zip file. This class is primarily intended to
support the .usdz file format. It is not a general-purpose zip writer,
as it does not implement the full zip file specification. However, all
files written by this class should be valid zip files and readable by
external zip modules and utilities.
Methods:
AddFile(filePath, filePathInArchive)
Adds the file at filePath to the zip archive with no compression applied.
CreateNew
classmethod CreateNew(filePath) -> ZipFileWriter
Discard()
Discards the zip archive so that it is not saved to the destination file path.
Save()
Finalizes the zip archive and saves it to the destination file path.
AddFile(filePath, filePathInArchive) → str
Adds the file at filePath to the zip archive with no compression
applied.
If filePathInArchive is non-empty, the file will be added at that
path in the archive. Otherwise, it will be added at filePath .
Returns the file path used to identify the file in the zip archive on
success. This path conforms to the zip file specification and may not
be the same as filePath or filePathInArchive . Returns an
empty string on failure.
Parameters
filePath (str) –
filePathInArchive (str) –
static CreateNew()
classmethod CreateNew(filePath) -> ZipFileWriter
Create a new file writer with filePath as the destination file
path where the zip archive will be written.
The zip file will not be written to filePath until the writer is
destroyed or Save() is called.
Returns an invalid object on error.
Parameters
filePath (str) –
Discard() → None
Discards the zip archive so that it is not saved to the destination
file path.
Once discarded, the file writer is invalid and may not be reused.
Save() → bool
Finalizes the zip archive and saves it to the destination file path.
Once saved, the file writer is invalid and may not be reused. Returns
true on success, false otherwise.
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023. |
.gitattributes | *.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.lz4 filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
# Audio files - uncompressed
*.pcm filter=lfs diff=lfs merge=lfs -text
*.sam filter=lfs diff=lfs merge=lfs -text
*.raw filter=lfs diff=lfs merge=lfs -text
# Audio files - compressed
*.aac filter=lfs diff=lfs merge=lfs -text
*.flac filter=lfs diff=lfs merge=lfs -text
*.mp3 filter=lfs diff=lfs merge=lfs -text
*.ogg filter=lfs diff=lfs merge=lfs -text
*.wav filter=lfs diff=lfs merge=lfs -text
# Image files - uncompressed
*.bmp filter=lfs diff=lfs merge=lfs -text
*.gif filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.tiff filter=lfs diff=lfs merge=lfs -text
# Image files - compressed
*.jpg filter=lfs diff=lfs merge=lfs -text
*.jpeg filter=lfs diff=lfs merge=lfs -text
*.webp filter=lfs diff=lfs merge=lfs -text |
1_6_1.md | 1.6.10 — Omniverse Launcher latest documentation
Omniverse Launcher
»
Omniverse Launcher »
Release Notes »
1.6.10
# 1.6.10
Release Date: Sept 2022
## Added
Integrated Navigator filesystem directly into the Nucleus tab.
Added “Show in folder” option for downloaded files in Navigator.
Extension installation.
/open command for opening files with installed applications.
Added links for Nucleus Cache in the library.
Display an icon for external packages on the Exchange tab.
Added new UI for Omniverse Drive 2.
Added Ukrainian language translations to locale.
## Fixed
Updated dependencies to address minor potential security vulnerabilities.
Improved error reporting when files are used by other processes.
Fixed an issue where pressing Enter closed modal dialogs.
Fixed selecting all notifications when users click on the notification bell.
Fixed “Invalid time value” error displayed for some OS locales on startup.
Fixed an issue where Launcher displayed dates in different formats on the Library tab.
Fixed scrolling the language selection in the settings displayed during the first installation.
Fixed triggering Google Translate dialog on the login result page.
Fixed displaying user settings and notifications behind Nucleus installation dialog.
Fixed an issue where Launcher couldn’t download new updates after the first downloaded patch.
Fixed translations.
© Copyright 2023-2024, NVIDIA.
Last updated on Apr 15, 2024. |
testing_exts_python.md | Testing Extensions with Python — kit-manual 105.1 documentation
kit-manual
»
Testing Extensions with Python
# Testing Extensions with Python
This guide covers the practical part of testing extensions with Python. Both for extensions developed in the kit repo and outside.
For information on testing extensions with C++ / doctest, look here, although there is some overlap, because it can be preferable to test C++ code from python bindings.
The Kit Sdk includes the omni.kit.test extension and a set of build scripts (in premake5-public.lua file) to run extension tests.
It supports two types of testing:
* python tests (unittest with async/await support)
* c++ tests (doctest)
It is generally preferred to test C++ code from python using bindings where feasible. In this way, the bindings are also tested, and that promotes writing bindings to your C++ code. Most of this guide focuses on python tests, but there is a C++ section at the very end.
## Adding Extension Test: Build Scripts
If your extension’s premake5.lua file defines the extension project in usual way:
local ext = get_current_extension_info()
project_ext (ext)
It should already have corresponding bat/sh files generated in the _build folder, e.g.: _build\windows-x86_64\release\tests-[extension_name].bat
Even if you haven’t written any actual tests, it is already useful. It is a startup/shutdown test, that verifies that all extension dependencies are correct, python imports are working, and that it can start and exit without any errors.
An empty extension test entry is already an important one. Wrong or missing dependencies are a source of many future issues. Extensions are often developed in the context of certain apps and have implicit expectations. When used in other apps they do not work. Or when the extension load order randomly changes and other extensions you implicitly depend on start to load after you.
## How does it work?
You can look inside Kit’s premake5-public.lua file to find the details on how it happens, follow the function project_ext(ext, args).
If you look inside that shell script, it basically runs an empty Kit + omni.kit.test + passes your extension. That will run the test system process which in turn will run another, tested process, which is basically: empty Kit + omni.kit.test + --enable [your extension].
The test system process prints each command it uses to spawn a new process. You can copy that command and use exactly the same command for debugging purposes.
You may ask why we spawn a process, which spawns another process? And both have omni.kit.test? Many reasons:
Test system process monitors tested process:
It can kill it in case of timeout.
Reads return code. If != 0 indicates test failure.
Reads stdout/stderr for error messages.
Test system process reads extension.toml of the tested extension in advance. That allows us to specify test settings, cmd args, etc.
It can run many extension tests in parallel.
It can download extensions from the registry before testing.
omni.kit.test has separate modules for both test system process (exttests.py) and tested process (unittests.py).
## Writing First Test
Tested process runs with omni.kit.test which has the unittests module. It is a wrapper on top of python’s standard unittest framework.
It adds support for async/await usage in tests. Allowing test methods to be async and run for many updates/frames. For instance, a test can at any point call await omni.kit.app.get_app().next_update_async() and thus yield test code execution until next update.
All the methods in the python standard unittest can be used normally (like self.assertEqual etc).
If your extension for instance is defined:
[[python.module]]
name = "omni.foo"
Your tests must go into the omni.foo.tests module. The testing framework will try to import tests submodule for every python module, in order to discover them. This has a few benefits:
It only gets imported in the test run. Thus it can use test-only dependencies or run more expensive code. There is no need to depend on omni.kit.test everywhere.
It gets imported after other python modules. This way public modules can be imported and used in tests as if the tests are written externally (but still inside of an extension). In this way, the public API can be tested.
An actual test code can look like this:
# NOTE:
# omni.kit.test - python's standard library unittest module with additional wrapping to add support for async/await tests
# For most things refer to the unittest docs: https://docs.python.org/3/library/unittest.html
import omni.kit.test
# Import extension python module we are testing with absolute import path, as if we are an external user (i.e. a different extension)
import example.python_ext
# Having a test class dervived from omni.kit.test.AsyncTestCase declared on the root of the module will make it auto-discoverable by omni.kit.test
class Test(omni.kit.test.AsyncTestCase):
# Before running each test
async def setUp(self):
pass
# After running each test
async def tearDown(self):
pass
# Actual test, notice it is an "async" function, so "await" can be used if needed
async def test_hello_public_function(self):
result = example.python_ext.some_public_function(4)
self.assertEqual(result, 256)
All the concepts here are from the standard unittest framework. Test methods start with test_. You need to inherit a base test class, which will be created, setUp() will be called before each test, tearDown() after. Everything can be async or “sync”.
## Test Settings
### Test Settings: Basics
The [[test]] section of extension.toml allows control of how to run a test process. We aim to make that configuration empty and for the defaults to be reasonable. We also strive to make tests run as close as possible to a real-usage run, making test environments the same as production.
However, you can specify which errors to ignore, what additional dependencies to bring, change the timeout, pass extra args etc. All the details are in Kit’s Extensions doc.
Below is an example, it shows how to:
add extra arguments
add test only dependencies (extensions)
change timeout
include and exclude error messages from failing tests
[[test]]
args = ["--/some/setting=1"]
dependencies = ["omni.kit.capture"]
timeout = 666
stdoutFailPatterns.include = ["*[error]*", "*[fatal]*"]
stdoutFailPatterns.exclude = [
"*Leaking graphics objects*", # Exclude graphics leaks until fixed
]
### Test Settings: Where to look for python tests?
By default test system process (exttests.py) reads all [[python.module]] entries from the tested extension and searches for tests in each of them. You can override it by explicitly setting where to look for tests:
[[test]]
pythonTests.include = ["omni.foo.*"]
pythonTests.exclude = ["omni.foo.bar.*"]
This is useful if you want to bring tests from other extensions. Especially, when testing apps.
### Test Settings: Multiple test processes
Each [[test]] entry is a new process. Thus by default, each extension will run one test process to run all the python tests for that extension.
When adding multiple entries they must be named to distinguish them (in artifacts, logs, etc):
[[test]]
name = "basic"
pythonTests.include = [ "omni.foo.*basic*" ]
[[test]]
name = "other"
pythonTests.include = [ "omni.foo.*other*" ]
To select which process to run: pass -n [wildcard], where [wildcard] is a name. * are supported:
> _build\windows-x86_64\release\tests-example.python_ext.bat -n other
### Test Settings: Disable test on certain platform
Any setting in extension.toml can be set per platform, using filters. Read more about them in “Extensions” doc. For example, to disable tests on Windows, the enabled setting can be overridden:
[[test]]
name = "some_test"
"filter:platform"."windows-x86_64".enabled = false
## Running Your Test
To run your test just call the shell script described above: _build\windows-x86_64\release\tests-[extension_name].bat.
### Run subset of tests
Pass -f [wildcard], where [wildcard] is a name of the test or part of the name. * are supported:
> _build\windows-x86_64\release\tests-example.python_ext.bat -f "public_function"
### Run subset of tests using Tests Sampling
Pass --/exts/omni.kit.test/testExtSamplingFactor=N, where N is a number between 0.0 and 1.0, 0.0 meaning no tests will be run and 1.0 all tests will run and 0.5 means 50% of tests will run.
To have this behavior on local build you need an additional parameter: --/exts/omni.kit.test/testExtSamplingContext='local'
> _build\windows-x86_64\release\tests-example.python_ext.bat --/exts/omni.kit.test/testExtSamplingFactor=0.5 --/exts/omni.kit.test/testExtSamplingContext='local'
### Run tests from a file
To run tests from a file use --/exts/omni.kit.test/runTestsFromFile='' with the name of the file to read.
Note: each time the tests run a playlist will be generated, useful to replay tests in a specific order or a subset of tests.
> _build\windows-x86_64\release\tests-example.python_ext.bat --/exts/omni.kit.test/runTestsFromFile='C:/dev/ov/kit/exttest_omni_foo_playlist_1.log'
### Retry Strategy
There are 4 supported retry strategies:
no-retry -> run tests once
retry-on-failure -> run up to N times, stop at first success (N = testExtMaxTestRunCount)
iterations -> run tests N times (N = testExtMaxTestRunCount)
rerun-until-failure -> run up to N times, stop at first failure (N = testExtMaxTestRunCount)
For example to retry tests up to 3 times (if a flaky test occurs) use this command:
> _build\windows-x86_64\release\tests-example.python_ext.bat --/exts/omni.kit.test/testExtRetryStrategy='retry-on-failure' --/exts/omni.kit.test/testExtMaxTestRunCount=3
### Developing Tests
Pass --dev or --/exts/omni.kit.test/testExtUIMode=1. That will start a window with a list of tests instead of immediately running them. Here you can select tests to run. Change code, extension hot reloads, run again. E.g.:
> _build\windows-x86_64\release\tests-example.python_ext.bat --dev
Note that this test run environment is a bit different. Extra extensions required to render a basic UI are enabled.
### Tests Code Coverage (Python)
Pass --coverage. That will run your tests and produce a coverage report at the end (HTML format):
> _build\windows-x86_64\release\tests-example.python_ext.bat --coverage
The output will look like this:
Generating a Test Report...
> Coverage for example.python_ext:default is 49.8%
> Full report available here C:/dev/ov/kit/kit/_testoutput/test_report/index.html
The HTML file will have 3 tabs. The coverage tab will display the coverage per file. Click on a filename to see the actual code coverage for that file.
Based on the Google Code Coverage Best Practices the general guideline for extension coverage is defined as: 60% is acceptable, 75% is commendable and 90% is exemplary.
The settings to modify the Coverage behavior are found in the extension.toml file of omni.kit.test, for example pyCoverageThreshold to modify the threshold and filter flags like pyCoverageIncludeDependencies to modify the filtering.
Note: the python code coverage is done with Coverage.py. If you need to exclude code from Coverage you can consult this section.
The python code coverage is done with Coverage.py. If you need to exclude code from Coverage you can consult this section.
For example any line with a comment # pragma : no cover is excluded. If that line introduces a clause, for example, an if clause, or a function or class definition, then the entire clause is also excluded.
if example: # pragma: no cover
print("this line and the `if example:` branch will be excluded")
print("this line not excluded")
### Debugging Coverage
If you see strange coverage results, the easiest way to understand what is going is to modify test_coverage.py from omni.kit.test. In def startup(self) comment out the source=self._settings.filter line and also remove all items in self._coverage.config.disable_warnings. Coverage will run without any filter and will report all warnings, giving more insights. List of warnings can be seen here.
### Disabling a python test
Use decorators from unittest module, e.g.:
@unittest.skip("Fails on Linux now, to be fixed") # OM-12345
async def test_create_delete(self):
...
### Pass extra cmd args to the test
To pass extra arguments for debugging purposes (for permanent use [[test]] config part) there are 2 ways:
all arguments after -- will be passed, e.g. _build\windows-x86_64\release\tests-[extension_name].bat -- -v --/app/printConfig=1
use /exts/omni.kit.test/testExtArgs setting, e,g,: --/exts/omni.kit.test/testExtArgs/0="-v"
### Choose an app to run tests in
All tests run in a context of an app, which by default is an empty app: "${kit}/apps/omni.app.test_ext.kit". You can instead pass your own kit file, where you can define any extra settings.
In this kit file you can change testing environment, enable some debug settings or extensions. omni.app.test_ext_kit_sdk.kit app kit comes with a few useful settings commented.
### Test Output
For each test process, omni.kit.test provides a directory it can write test outputs to (logs, images, etc):
import omni.kit.test
output_dir = omni.kit.test.get_test_output_path()
Or using test_output token:
output_dir = carb.tokens.get_tokens_interface().resolve("${test_output}")
When running on CI this folder becomes a build artifact.
### Python debugger
To enable python debugger you can use omni.kit.debug.python extension. One way is to uncomment in omni.app.test_ext.kit:
# "omni.kit.debug.python" = {}
You can use VSCode to attach a python debugger. Look into omni.kit.debug.python extension.toml for more settings, and check the FAQ section for a walkthrough.
### Wait for the debugger to attach
If you want to attach a debugger, you can run with the -d flag. When Kit runs with -d, it stops and wait for debugger to attach, which can also can be skipped. Since we run 2 processes, you likely want to attach to the second one - skip the first one. E.g.:
λ _build\windows-x86_64\release\tests-example.python_ext.bat -d
[omni.kit.app] Waiting for debugger to attach, press any key to skip... [pid: 19052]
[Info] [carb] Logging to file: C:/projects/extensions/kit-template/_build/windows-x86_64/release//logs/Kit/kit/103.0/kit_20211018_160436.log
Test output path: C:\projects\extensions\kit-template\_testoutput
Running 1 Extension Test(s).
|||||||||||||||||||||||||||||| [EXTENSION TEST START: example.python_ext-0.2.1] ||||||||||||||||||||||||||||||
>>> running process: C:\projects\extensions\kit-template\_build\windows-x86_64\release\kit\kit.exe ${kit}/apps/omni.app.test_ext.kit --enable example.python_ext-0.2.1 --/log/flushStandardStreamOutput=1 --/app/name=exttest_example.python_ext-0.2.1 --/log/file='C:\projects\extensions\kit-template\_testoutput/exttest_example.python_ext-0.2.1/exttest_example.python_ext-0.2.1_2021-10-18T16-04-37.log' --/crashreporter/dumpDir='C:\projects\extensions\kit-template\_testoutput/exttest_example.python_ext-0.2.1' --/plugins/carb.profiler-cpu.plugin/saveProfile=1 --/plugins/carb.profiler-cpu.plugin/compressProfile=1 --/app/profileFromStart=1 --/plugins/carb.profiler-cpu.plugin/filePath='C:\projects\extensions\kit-template\_testoutput/exttest_example.python_ext-0.2.1/ct_exttest_example.python_ext-0.2.1_2021-10-18T16-04-37.gz' --ext-folder c:/projects/extensions/kit-template/_build/windows-x86_64/release/kit/extsPhysics --ext-folder c:/projects/extensions/kit-converters/_build/windows-x86_64/release/exts --ext-folder C:/projects/extensions/kit-template/_build/windows-x86_64/release/exts --ext-folder C:/projects/extensions/kit-template/_build/windows-x86_64/release/apps --enable omni.kit.test --/exts/omni.kit.test/runTestsAndQuit=true --/exts/omni.kit.test/includeTests/0='example.python_ext.*' --portable-root C:\projects\extensions\kit-template\_build\windows-x86_64\release\/ -d
|| [omni.kit.app] Waiting for debugger to attach, press any key to skip... [pid: 22940]
Alternatively, pass -d directly to the second process by putting it after --:
_build\windows-x86_64\release\tests-[extension_name].bat -- -d
### Reading Logs
Each process writes own log file. Paths to those files are printed to stdout. You can run with -v to increase the verbosity of standard output.
### Run from Extension Manager
You can also run tests from UI. Run any Kit with UI, for instance omni.app.mini.kit. Go to Extension Manager, find your extension, open Tests tab. Here you can run the same tests.
It will also run a separate process and works exactly the same way as running from the shell script.
## Marking tests as unreliable
It is often the case that certain tests can fail randomly, with some probability. That can block CI/CD pipelines and lowers the trust into the TC state.
In that case:
Create a ticket with Kit:UnreliableTests label
Mark a test as unreliable and leave the ticket number in the comment
Unreliable tests do not run as part of the regular CI pipeline. They run in the separate nightly TC job.
There are 2 ways to mark a test as unreliable:
Mark whole test process as unreliable:
[[test]]
unreliable = true
Mark specific python tests as unreliable:
[[test]]
pythonTests.unreliable = [ "*test_name" ]
## Running unreliable tests
To run unreliable tests (and only them) pass --/exts/omni.kit.test/testExtRunUnreliableTests=1 to the test runner:
> _build\windows-x86_64\release\tests-example.python_ext.bat --/exts/omni.kit.test/testExtRunUnreliableTests=1
## Listing tests
To list tests without running, pass --/exts/omni.kit.test/printTestsAndQuit=1. That will still take some time to start the tested extension. It is a limitation of the testing system that it can’t find tests without setting up python environment:
> _build\windows-x86_64\release\tests-example.python_ext.bat --/exts/omni.kit.test/printTestsAndQuit=1
Look for lines like:
|| ========================================
|| Printing All Tests (count: 6):
|| ========================================
|| omni.kit.commands.tests.test_commands.TestCommands.test_callbacks
|| omni.kit.commands.tests.test_commands.TestCommands.test_command_parameters
|| omni.kit.commands.tests.test_commands.TestCommands.test_commands
|| omni.kit.commands.tests.test_commands.TestCommands.test_error
|| omni.kit.commands.tests.test_commands.TestCommands.test_group
|| omni.kit.commands.tests.test_commands.TestCommands.test_multiple_calls
Accordingly, to list unreliable tests add --/exts/omni.kit.test/testExtRunUnreliableTests=1:
> _build\windows-x86_64\release\tests-example.python_ext.bat --/exts/omni.kit.test/testExtRunUnreliableTests=1 --/exts/omni.kit.test/printTestsAndQuit=1
## repo_test: Running All Tests
To run all tests in the repo we use repo_test repo tool. Which is yet another process that runs before anything. It globs all the files according to repo.toml [repo_test] section configuration and runs them.
It is one entry point to run all sorts of tests. Different kinds of tests are grouped into suites. By default, it will run one suite, but you can select which suite to run with --suite [suite name]. Look at repo.toml for entries like [repo_test.suites.pythontests]. In that example: pythontests is a suite name.
You can also choose a build config to run tests on: -c release or -c debug. In kit the default is debug, in other repos: release.
Run all tests in the repo:
> repo.bat test
or
> repo.bat test --suite pythontests -c release
Just print them:
> repo.bat test -l
To filter tests:
> repo.bat test -f foobar
For more options (as usual):
> repo.bat test -h
### Excluding Tests from TC:
You can control which shell scripts to run with repo_test in repo.toml:
[[repo_test.suites.alltests.group]]
# Run all test
include = [
"tests-*${shell_ext}"
]
exclude = [
"tests-example.cpp_ext*", # Exclude some script
]
args = []
Check before running with:
> repo.bat test -l
## Adding Info to Failed Test Summary
If a test fails, a summary is printed to stdout that looks like so:
[fail] Extension Test failed. Details:
Cmd: kit.exe ...
Return code: 13
Failure reasons:
Process return code: 13 != 0.
Failing tests: ['test_all (omni.example.ui.tests.example_ui_test.TestExampleUi)']
You can add more fields to this summary by printing special pragmas to stdout from your tests (in fact,
the Failing tests field above is done this way). For example, if you were to add the line
print("##omni.kit.test[set, foo, bah]") to the test above, then the summary would look like so:
[fail] Extension Test failed. Details:
Cmd: kit.exe ...
Return code: 13
Failure reasons:
Process return code: 13 != 0.
Failing tests: ['test_all (omni.example.ui.tests.example_ui_test.TestExampleUi)']
foo: bah
Pragma operations must appear at the start of a line. They should appear on their own, and any further
pragmas on the same line will be ignored.
Available pragma operations are:
set: Set a field. Example: ##omni.kit.test[set, foo, bah]
append: Append to a list field. Example: ##omni.kit.test[append, foo, bah]
Note that if a pragma fails for any reason (the syntax is incorrect; you try to append to a value that
was previously set), it will be silently ignored.
## omni.kit.ui_test: Writing UI tests
Many extensions build various windows and widgets using omni.ui. The best way to test them is by simulating user interactions with the UI. For that omni.kit.ui_test extension can be used.
omni.kit.ui_test provides a way to query UI elements and interact with them. To start add test dependency to this extension:
[[test]]
dependencies = [
"omni.kit.ui_test",
]
Now you can import and use it in tests. Example:
import omni.kit.ui_test as ui_test
async def test_button(self):
# Find a button
button = ui_test.find("Nice Window//Frame/**/Button[*]")
# button is a reference, actual omni.ui.Widget can be accessed:
print(type(button.widget)) # <class 'omni.ui._ui.Button'>
# Click on button
await button.click())
Refer to omni.kit.ui_test documentation for more examples and API.
## (Advanced) Generating new tests or adapting discovered tests at runtime
Python unit tests are discovered at runtime. We introduced a way to adapt and/or extend the list of tests
by implementing custom omni.kit.test.AsyncTestCase class with def generate_extra_tests(self) method.
This method allows:
changes to discovered test case by mutating self instance
generation of new test cases by returning a list of them
In general, this method is preferred when same set of tests needs to be validated with multiple different
configurations. For example, when developing new subsystems while maintaining the old ones.
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023. |
omni.ui.ItemModelHelper.md | ItemModelHelper — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
ItemModelHelper
# ItemModelHelper
class omni.ui.ItemModelHelper
Bases: pybind11_object
The ItemModelHelper class provides the basic functionality for item widget classes.
Methods
__init__(*args, **kwargs)
Attributes
model
Returns the current model.
__init__(*args, **kwargs)
property model
Returns the current model.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.FloatDrag.md | FloatDrag — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
FloatDrag
# FloatDrag
class omni.ui.FloatDrag
Bases: FloatSlider
The drag widget that looks like a field but it’s possible to change the value with dragging.
Methods
__init__(self[, model])
Construct FloatDrag.
Attributes
__init__(self: omni.ui._ui.FloatDrag, model: omni.ui._ui.AbstractValueModel = None, **kwargs) → None
Construct FloatDrag.
`kwargsdict`See below
### Keyword Arguments:
`minfloat`This property holds the slider’s minimum value.
`maxfloat`This property holds the slider’s maximum value.
`stepfloat`This property controls the steping speed on the drag.
`formatstr`This property overrides automatic formatting if needed.
`precisionuint32_t`This property holds the slider value’s float precision.
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.FloatField.md | FloatField — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
FloatField
# FloatField
class omni.ui.FloatField
Bases: AbstractField
The FloatField widget is a one-line text editor with a string model.
Methods
__init__(self[, model])
Construct FloatField.
Attributes
precision
This property holds the field value's float precision.
__init__(self: omni.ui._ui.FloatField, model: omni.ui._ui.AbstractValueModel = None, **kwargs) → None
Construct FloatField.
`kwargsdict`See below
### Keyword Arguments:
`precisionuint32_t`This property holds the field value’s float precision.
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
property precision
This property holds the field value’s float precision.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.workspace_utils.compare_workspace.md | compare_workspace — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Submodules »
omni.ui.workspace_utils »
omni.ui.workspace_utils Functions »
compare_workspace
# compare_workspace
omni.ui.workspace_utils.compare_workspace(workspace_dump: ~typing.List[~typing.Any], compare_delegate: ~omni.ui.workspace_utils.CompareDelegate = <omni.ui.workspace_utils.CompareDelegate object>)
Compare current docked windows according to the workspace description.
### Arguments
`workspace_dumpList[Any]`The dictionary with the description of the layout. It’s the dict
received from `dump_workspace`.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.Inspector.md | Inspector — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
Inspector
# Inspector
class omni.ui.Inspector
Bases: pybind11_object
Inspector is the helper to check the internal state of the widget. It’s not recommended to use it for the routine UI.
Methods
__init__(*args, **kwargs)
begin_computed_height_metric()
Start counting how many times Widget::setComputedHeight is called
begin_computed_width_metric()
Start counting how many times Widget::setComputedWidth is called
end_computed_height_metric()
Start counting how many times Widget::setComputedHeight is called and return the number
end_computed_width_metric()
Start counting how many times Widget::setComputedWidth is called and return the number
get_children(widget)
Get the children of the given Widget.
get_resolved_style(widget)
Get the resolved style of the given Widget.
get_stored_font_atlases()
Provides the information about font atlases
__init__(*args, **kwargs)
static begin_computed_height_metric() → None
Start counting how many times Widget::setComputedHeight is called
static begin_computed_width_metric() → None
Start counting how many times Widget::setComputedWidth is called
static end_computed_height_metric() → int
Start counting how many times Widget::setComputedHeight is called and return the number
static end_computed_width_metric() → int
Start counting how many times Widget::setComputedWidth is called and return the number
static get_children(widget: omni.ui._ui.Widget) → List[omni.ui._ui.Widget]
Get the children of the given Widget.
static get_resolved_style(widget: omni.ui._ui.Widget) → omni::ui::StyleContainer
Get the resolved style of the given Widget.
static get_stored_font_atlases() → List[Tuple[str, int]]
Provides the information about font atlases
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
publishing_exts.md | Publishing Extensions — kit-manual 105.1 documentation
kit-manual
»
Publishing Extensions
# Publishing Extensions
Extensions are published to the registry to be used by downstream apps and extensions.
Kit documentation: Publishing covers how to do it manually with the command line or UI. However, we suggest automating that process in CI.
Extensions are published using the repo publish_exts tool that comes with Kit. The [repo_publish_exts] section of repo.toml lists which extensions to publish. E.g.:
[repo_publish_exts]
# Extensions to publish, include and exclude among those discovered by kit. Wildcards are supported.
exts.include = [
"omni.foo.bar",
]
exts.exclude = []
Typically, CI scripts are setup to run repo publish_exts -c release (and debug) on every green commit to master, after builds and tests pass. That publishes any new extension version. For versions that were already published, nothing happens. So the version number needs to be incremented for publishing to have any effect.
You can test publishing locally with a “dry” run using -n flag:
repo publish_exts -c release -n
It is important to remember that some extensions (typically C++, native) have a separate package per platform, so we need to run publishing separately on each platform and publish for each configuration (debug and release). This is especially important to satisfy all required dependencies for downstream consumers.
## Publish Verification
The extension system verifies extensions before publishing. It checks basic things like the extension icon being present, that the changelog is correct, that a name and description field are present, etc. Those checks are recommended, but not required. You can control them with a setting for repo_publish_exts:
[repo_publish_exts]
publish_verification = false
To only run the verification step, without publishing, use the --verify flag:
repo publish_exts -c release --verify
It is recommended to run the verification step as part of build, to catch issues early.
## Other Publish Tool Settings
As with any repo tool, to find other available settings for the publish tool, look into its repo_tools.toml file. Since it comes with Kit, this file is a part of the kit-sdk package and can be found at: _build/$platform/$config/kit/dev/repo_tools.toml
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023. |
1_8_2.md | 1.8.2 — Omniverse Launcher latest documentation
Omniverse Launcher
»
Omniverse Launcher »
Release Notes »
1.8.2
# 1.8.2
Release Date: Dec 2022
## Added
Added new UI elements on Exchange cards to filter releases by release channel. A release is classified as Alpha, Beta, Release, or Enterprise, depending on its maturity and stability. If an Alpha or Beta release is selected, a banner appears on the main image to emphasize the relative risk of that release. Alpha or Beta releases may not be feature complete or fully stable. Versions classified as Release (also known as GA or General Availability) are feature complete and stable. Release versions that are supported for Enterprise customers appear in the Enterprise list.
Added release classification labels and Beta banner (when applicable) to the Library tab.
© Copyright 2023-2024, NVIDIA.
Last updated on Apr 15, 2024. |
omni.ui.ToolButton.md | ToolButton — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
ToolButton
# ToolButton
class omni.ui.ToolButton
Bases: Button, ValueModelHelper
ToolButton is functionally similar to Button, but provides a model that determines if the button is checked. This button toggles between checked (on) and unchecked (off) when the user clicks it.
Methods
__init__(self[, model])
Construct a checkable button with the model.
Attributes
__init__(self: omni.ui._ui.ToolButton, model: omni.ui._ui.AbstractValueModel = None, **kwargs) → None
Construct a checkable button with the model. If the bodel is not provided, then the default model is created.
### Arguments:
`model :`The model that determines if the button is checked.
`kwargsdict`See below
### Keyword Arguments:
`textstr`This property holds the button’s text.
`image_urlstr`This property holds the button’s optional image URL.
`image_widthfloat`This property holds the width of the image widget. Do not use this function to find the width of the image.
`image_heightfloat`This property holds the height of the image widget. Do not use this function to find the height of the image.
`spacingfloat`Sets a non-stretchable space in points between image and text.
`clicked_fnCallable[[], None]`Sets the function that will be called when when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button).
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.Spacer.md | Spacer — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
Spacer
# Spacer
class omni.ui.Spacer
Bases: Widget
The Spacer class provides blank space.
Normally, it’s used to place other widgets correctly in a layout.
Methods
__init__(self, **kwargs)
Construct Spacer.
Attributes
__init__(self: omni.ui._ui.Spacer, **kwargs) → None
Construct Spacer.
`kwargsdict`See below
### Keyword Arguments:
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
omni.ui.ProgressBar.md | ProgressBar — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
ProgressBar
# ProgressBar
class omni.ui.ProgressBar
Bases: Widget, ValueModelHelper
A progressbar is a classic widget for showing the progress of an operation.
Methods
__init__(self[, model])
Construct ProgressBar.
Attributes
__init__(self: omni.ui._ui.ProgressBar, model: omni.ui._ui.AbstractValueModel = None, **kwargs) → None
Construct ProgressBar.
### Arguments:
`model :`The model that determines if the button is checked.
`kwargsdict`See below
### Keyword Arguments:
`widthui.Length`This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
`heightui.Length`This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
`namestr`The name of the widget that user can set.
`style_type_name_overridestr`By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
`identifierstr`An optional identifier of the widget we can use to refer to it in queries.
`visiblebool`This property holds whether the widget is visible.
`visibleMinfloat`If the current zoom factor and DPI is less than this value, the widget is not visible.
`visibleMaxfloat`If the current zoom factor and DPI is bigger than this value, the widget is not visible.
`tooltipstr`Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
`tooltip_fnCallable`Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
`tooltip_offset_xfloat`Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`tooltip_offset_yfloat`Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
`enabledbool`This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
`selectedbool`This property holds a flag that specifies the widget has to use eSelected state of the style.
`checkedbool`This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`draggingbool`This property holds if the widget is being dragged.
`opaque_for_mouse_eventsbool`If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clippedbool`The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fnCallable`Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fnCallable`Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fnCallable`Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fnCallable`Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fnCallable`Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fnCallable`Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fnCallable`Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fnCallable`Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fnCallable`Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fnCallable`Called when the size of the widget is changed.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
http-api.md | HTTP API — Omniverse Launcher latest documentation
Omniverse Launcher
»
Omniverse Launcher »
HTTP API
# HTTP API
Launcher uses port 33480 to provide the HTTP API that can be used by other programs to retrieve information
about the current session or get the list of installed apps.
This document describes all available HTTP endpoints supported by Launcher.
## Authentication
### [GET] /auth
Returns Starfleet information about the current user session.
Method: GET
Content type: application/json
#### Response
Property
Type
Description
email
string
Email used for authentication. Can be used to uniquely identify a user.
username
string
Preferred username displayed in the UI. This field should not be used for unique user identification. Use email field instead.
accessToken
string
The access token returned from Starfleet.
idToken
string
The ID token used in Starfleet for retrieving user’s information.
expires
Date
The access token expiration date in ISO format.
#### Errors
Status
Description
HTTP401
User is not authenticated.
## Installed apps and connectors
Launcher classifies all installed apps and connectors as _components_.
### [GET] /components
Returns the list of all installed apps and connectors.
Method: GET
Content type: application/json
#### Response
Returns a list with the following Component objects (? means that the property is optional):
Property
Type
Description
slug
string
The unique component name.
name
string
The full displayed component name.
version
string
The latest version of this component available for download. Use installedVersions to check installed versions.
shortName
string
The short name used in the side menu.
kind
string
Specifies the component kind: apps or connectors.
category
string
The category used for grouping this component in the library.
productArea
_string?_
Represents the product area – one product area can include multiple components that can be installed separately. Displayed in the component card title.
installedVersions
InstalledVersions
Lists versions of this component installed by the user.
description
string[]
Paragraphs with component description, supports markdown and HTML.
platforms
string[]
Represents OSs where this component can be installed.
settings
Settings[]
Represents settings used for installing this component.
image
_URL?_
The image displayed on the detailed page.
card
_URL?_
The image displayed on the card on the Exchange tab.
icon
_URL?_
The icon displayed in the component card title.
tags
string[]
Tags shown below the component description.
featured
boolean
Defines if this component is shown in the featured section.
featuredImage
_URL?_
The image displayed in the featured section.
links
string[]
Hyperlinks displayed in the library and in the component details.
#### Installed Versions
Property
Type
Description
all
string[]
All installed versions of this component.
current
string
The current installed version that is used for launching the component.
latest
string
The latest version of this component installed by the user.
#### Settings
Property
Type
Description
slug
string
The unique component name.
version
string
The installed component version associated with these settings.
packages
Package[]
Thin packages used by this version.
path
string
The path to the main package.
base
string
The base path for the component that contains all packages.
showInLibrary
boolean
Defines whether this component should be displayed in the library.
sideBySide
boolean
Defines whether this component supports side-by-side installations. If side-by-side installations are not supported, then Launcher removes all previous component versions on install.
runWithLauncher
boolean
Specifies whether this component should be started automatically with Launcher.
launch
_Script?_
The script used for launching the component.
open
_Script?_
The script used for opening omniverse:// links.
preInstall
_Script?_
The script used before the installation starts.
install
_Script?_
The main script for installing the component.
postInstall
_Script?_
The script used after the installation.
register
_Script?_
The script used when the user selects this component version.
unregister
_Script?_
The script used to clean up the system when uses selects another component version.
finalize
_Script?_
The script used after all previous versions of this component are unregistered and uninstalled from the system. Only runs if side-by-side installations are not supported.
preUninstall
_Script?_
The script used before the uninstall.
uninstall
_Script?_
The main script for uninstalling the component.
postUninstall
_Script?_
The script used after the uninstall.
#### Script
Property
Type
Description
path
string
Path to the script.
root
string
Defines where the component is installed.
args
_string[]?_
Specifies all command line arguments used for the script.
environment
Map<string, string>
Specifies all predefined environment variables used for the script.
#### Package
Property
Type
Description
name
string
The unique package name.
url
string
The unsigned URL for downloading the package. Can’t be used directly, must be signed first.
hash
string
The package hash. Used to deduplicate installed packages.
main
_boolean?_
Specifies if this package is the main package of the component. Main packages contain launcher.toml files and installation scripts.
### [GET] /components/:slug
Returns information about the installed component with the specified slug.
Method: GET
Content type: application/json
Response
Returns a Component object. See details in Installed apps and connectors .
#### Errors
Status
Description
HTTP404
Component with the specified slug is not installed.
© Copyright 2023-2024, NVIDIA.
Last updated on Apr 15, 2024. |
omni.ui.UIPreferencesExtension.md | UIPreferencesExtension — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
UIPreferencesExtension
# UIPreferencesExtension
class omni.ui.UIPreferencesExtension
Bases: IExt
Methods
on_shutdown()
on_startup(ext_id)
__init__(self: omni.ext._extensions.IExt) → None
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
uninstall_apps.md | Uninstalling Apps (Win & Linux) — Omniverse Launcher latest documentation
Omniverse Launcher
»
Omniverse Launcher »
Installation Guide »
Uninstalling Apps (Win & Linux)
# Uninstalling Apps (Win & Linux)
Uninstalling Applications Guide for Windows & Linux
There are two methods to uninstall Omniverse applications within the IT Managed Launcher.
Users can directly uninstall Omniverse applications from within the Launcher (no IT Manager required)
IT Managers can uninstall Omniverse applications using a command line argument.
Uninstalling from within the IT Managed Launcher is very quick and straightforward.
1) Select the small Hamburger Menu icon next to the installed Omniverse Application and choose Settings.
2) From the resulting floating dialog, choose the version of the application you want to remove and click Uninstall.
Note
If you have multiple versions of the same Omniverse application installed, you can remove any of them without disturbing the other versions.
To uninstall applications using the Custom Protocol URL is designed for IT Managers and Systems Administrators to use. In this case, you’ll need to identify the application by name as well as its version number since a user can have multiple versions of the same application installed on their workstation.
Like the install command, uninstalling adheres to the following base structure:
omniverse-launcher://uninstall?slug=<slug>^&version=<version>
To find the slug and version information needed to run this command, do the following:
1) Go to the Omniverse Enterprise Web Portal.
2) Within the Apps section, find the Omniverse foundation application that is installed on a local workstation and select its tile.
3) Look at the URL in the browser bar of that tile and at the end, you’ll see the application name.
This application name represents the slug for the uninstall process.
Note
Pay attention to any underscores or other characters in the application name as those will be required for the slug name. In the example above, the name usd_explorer is the correct name for the slug parameter.
4) Next, within the IT Managed Launcher, go to the Library tab and look at the version number listed beneath the Launch button. This indicates the version you should refer to in the uninstall command.
Once you have both pieces of information, you can invoke the command as follows.
WINDOWS:
DOS Command: start ominverse-launcher://uninstall?slug=usd_explorer^&version=2023.2.0
Note
Notice the ‘^’ character before the ‘&’ character. This is needed for DOS, otherwise it will be interpreted as new window popup
PowerShell: "start ominverse-launcher://uninstall?slug=usd_explorer&version=2023.2.0"
LINUX:
xdg-open "omniverse-launcher://uninstall?slug=usd_explorer&version=2023.2.0"
Once the command is triggered, the selected Omniverse application will be uninstalled from the IT Managed Launcher.
© Copyright 2023-2024, NVIDIA.
Last updated on Apr 15, 2024. |
omni.ui.ColorStore.md | ColorStore — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
ColorStore
# ColorStore
class omni.ui.ColorStore
Bases: pybind11_object
A singleton that stores all the UI Style color properties of omni.ui.
Methods
__init__(*args, **kwargs)
find(name)
Return the index of the color with specific name.
store(name, color)
Save the color by name.
__init__(*args, **kwargs)
static find(name: str) → int
Return the index of the color with specific name.
static store(name: str, color: int) → None
Save the color by name.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |
logging.md | Logging — kit-manual 105.1 documentation
kit-manual
»
Logging
# Logging
For logging Carbonite is used.
By default info level logging is written to a file. Path to log file is written to stdout among the first lines when Kit starts.
At runtime path to a log file can be found in setting: /log/file or using ${logs} token.
## Python Logging
Python standard logging is redirected to Carbonite logger and it is recommended to use it instead.
## Code Examples
### Logging with python
# Logging/Log
# Carbonite logger is used both for python and C++:
import carb
carb.log_info("123")
carb.log_warn("456")
carb.log_error("789")
# For python it is recommended to use std python logging, which also redirected to Carbonite
# It also captures file path and loc
import logging
logger = logging.getLogger(__name__)
logger.info("123")
logger.warning("456")
logger.error("789")
### Logging with C++
#include <carb/logging/Log.h>
CARB_LOG_INFO("123")
CARB_LOG_WARN("456")
CARB_LOG_ERROR("789")
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023. |
omni.ui.MainWindow.md | MainWindow — Omniverse Kit 2.25.9 documentation
Omniverse Kit
»
API (python) »
Modules »
omni.ui »
omni.ui Classes »
MainWindow
# MainWindow
class omni.ui.MainWindow
Bases: pybind11_object
The MainWindow class represents Main Window for the Application, draw optional MainMenuBar and StatusBar.
Methods
__init__(self[, show_foreground])
Construct the main window, add it to the underlying windowing system, and makes it appear.
Attributes
cpp_status_bar_enabled
Workaround to reserve space for C++ status bar.
main_frame
This represents Styling opportunity for the Window background.
main_menu_bar
The main MenuBar for the application.
show_foreground
When show_foreground is True, MainWindow prevents other windows from showing.
status_bar_frame
The StatusBar Frame is empty by default and is meant to be filled by other part of the system.
__init__(self: omni.ui._ui.MainWindow, show_foreground: bool = False, **kwargs) → None
Construct the main window, add it to the underlying windowing system, and makes it appear.
`kwargsdict`See below
### Keyword Arguments:
property cpp_status_bar_enabled
Workaround to reserve space for C++ status bar.
property main_frame
This represents Styling opportunity for the Window background.
property main_menu_bar
The main MenuBar for the application.
property show_foreground
When show_foreground is True, MainWindow prevents other windows from showing.
property status_bar_frame
The StatusBar Frame is empty by default and is meant to be filled by other part of the system.
© Copyright 2019-2024, NVIDIA.
Last updated on Mar 25, 2024. |