file_path
stringlengths 21
207
| content
stringlengths 5
1.02M
| size
int64 5
1.02M
| lang
stringclasses 9
values | avg_line_length
float64 1.33
100
| max_line_length
int64 4
993
| alphanum_fraction
float64 0.27
0.93
|
---|---|---|---|---|---|---|
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/legacy.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = []
import carb
from functools import partial
from typing import Any, Optional
def _resolve_viewport_setting(viewport_id: str, setting_name: str, isettings: carb.settings.ISettings,
legacy_key: Optional[str] = None, set_per_vp_value: bool = False,
default_if_not_found: Any = None,
usd_context_name: Optional[str] = None):
# Resolve a default Viewport setting from the most specific to the most general
# /app/viewport/usd_context_name/setting => Global signal that overrides any other (for state dependent on stage)
# /persistent/app/viewport/Viewport/Viewport0/setting => Saved setting for this specific Viewport
# /app/viewport/Viewport/Viewport0/setting => Startup value for this specific Viewport
# /app/viewport/defaults/setting => Startup value targetting all Viewports
setting_key = f"/app/viewport/{viewport_id}/{setting_name}"
persistent_key = "/persistent" + setting_key
# Return values may push the setting to persistent storage if not there already
def maybe_set_persistent_and_return(value):
# Set to persitent storage if requested
if set_per_vp_value:
isettings.set(persistent_key, value)
# Set to global storage if requested
if usd_context_name is not None:
isettings.set(f"/app/viewport/usdcontext-{usd_context_name}/{setting_name}", value)
return value
# Initial check if the setting is actually global to all Viewports on a UsdContext
if usd_context_name is not None:
value = isettings.get(f"/app/viewport/usdcontext-{usd_context_name}/{setting_name}")
if value is not None:
usd_context_name = None # No need to set back to the setting that was just read
return maybe_set_persistent_and_return(value)
# First check if there is a persistent value stored in the preferences
value = isettings.get(persistent_key)
if value is not None:
return maybe_set_persistent_and_return(value)
# Next check if a non-persitent viewport-specific default exists via toml / start-up settings
value = isettings.get(setting_key)
if value is not None:
return maybe_set_persistent_and_return(value)
# Next check if a non-persitent global default exists via toml / start-up settings
value = isettings.get(f"/app/viewport/defaults/{setting_name}")
if value is not None:
return maybe_set_persistent_and_return(value)
# Finally check if there exists a legacy key to specify the startup value
if legacy_key:
value = isettings.get(legacy_key)
if value is not None:
return maybe_set_persistent_and_return(value)
if default_if_not_found is not None:
value = maybe_set_persistent_and_return(default_if_not_found)
return value
def _setup_viewport_options(viewport_id: str, usd_context_name: str, isettings: carb.settings.ISettings):
legacy_display_options_key: str = "/persistent/app/viewport/displayOptions"
force_hide_fps_key: str = "/app/viewport/forceHideFps"
show_layer_menu_key: str = "/app/viewport/showLayerMenu"
# Map legacy bitmask values to new per-viewport keys: new_key: (bitmask, legacy_setting, is_usd_global)
persitent_to_legacy_map = {
"hud/renderFPS/visible": (1 << 0, None, False),
"guide/axis/visible": (1 << 1, None, False),
"hud/renderResolution/visible": (1 << 3, None, False),
"scene/cameras/visible": (1 << 5, "/app/viewport/show/camera", True),
"guide/grid/visible": (1 << 6, "/app/viewport/grid/enabled", False),
"guide/selection/visible": (1 << 7, "/app/viewport/outline/enabled", False),
"scene/lights/visible": (1 << 8, "/app/viewport/show/lights", True),
"scene/skeletons/visible": (1 << 9, None, True),
"scene/meshes/visible": (1 << 10, None, True),
"hud/renderProgress/visible": (1 << 11, None, False),
"scene/audio/visible": (1 << 12, "/app/viewport/show/audio", True),
"hud/deviceMemory/visible": (1 << 13, None, False),
"hud/hostMemory/visible": (1 << 14, None, False),
}
# Build some handlers to keep legacy displayOptions in sync with the new per-viewport settings
# Used as nonlocal/global in legacy_display_options_changed to check for bits toggled
# When no legacy displayOptions exists, we do not want to create it as set_default would do
legacy_display_options: int = isettings.get(legacy_display_options_key)
if legacy_display_options is None:
legacy_display_options = 32255
# Handles changes to legacy displayOptions (which are global to all viewports) and push them to our single Viewport
def legacy_display_options_changed(item: carb.dictionary.Item, event_type: carb.settings.ChangeEventType):
if event_type != carb.settings.ChangeEventType.CHANGED:
return
nonlocal legacy_display_options
isettings = carb.settings.get_settings()
# Get the previous and current displayOptions
prev_display_options, current_display_options = legacy_display_options, isettings.get(legacy_display_options_key) or 0
# If they match, nothing has changed so just exit
if prev_display_options == current_display_options:
return
# Save the current state for comparison on next change
legacy_display_options = current_display_options
# Check for any bit changes to toggle/store into the per-viepwort key
def check_bit_toggled(legacy_bitmask: int):
cur_vis = bool(current_display_options & legacy_bitmask)
return bool(prev_display_options & legacy_bitmask) != cur_vis, cur_vis
# Check if a legacy bit was flipped, and if so store it's current state into per-viewport and stage-global
# state if they are not already set to the same value.
def toggle_per_viewport_setting(legacy_bitmask: int, setting_key: str, secondary_key: Optional[str] = None):
toggled, visible = check_bit_toggled(legacy_bitmask)
if toggled:
# legacy displayOption was toggled, if it is not already matching the viewport push it there
vp_key = f"/persistent/app/viewport/{viewport_id}/{setting_key}"
if visible != bool(isettings.get(vp_key)):
isettings.set(vp_key, visible)
if secondary_key:
if visible != bool(isettings.get(secondary_key)):
isettings.set(secondary_key, visible)
return visible
for setting_key, legacy_obj in persitent_to_legacy_map.items():
# Settings may have had a displayOptions bit that was serialzed, but controlled via another setting
legacy_bitmask, secondary_key, is_usd_state = legacy_obj
visible = toggle_per_viewport_setting(legacy_bitmask, setting_key, secondary_key)
# Store to global are if the setting represent UsdStage that must be communicated across Viewports
if is_usd_state:
usd_key = f"/app/viewport/usdcontext-{usd_context_name}/{setting_key}"
if visible != bool(isettings.get(usd_key)):
isettings.set(usd_key, visible)
def legacy_value_changed(setting_key: str, item: carb.dictionary.Item, event_type: carb.settings.ChangeEventType):
if event_type != carb.settings.ChangeEventType.CHANGED:
return
legacy_obj = persitent_to_legacy_map.get(setting_key)
if not legacy_obj:
carb.log_error("No mapping for '{setting_key}' into legacy setting")
return None
isettings = carb.settings.get_settings()
legacy_key, is_stage_global = legacy_obj[1], legacy_obj[2]
per_viewport_key = f"/persistent/app/viewport/{viewport_id}/{setting_key}"
viewport_show = bool(isettings.get(per_viewport_key))
legacy_show = bool(isettings.get(legacy_key))
if legacy_show != viewport_show:
isettings.set(per_viewport_key, legacy_show)
if is_stage_global:
usd_key = f"/app/viewport/usdcontext-{usd_context_name}/{setting_key}"
if legacy_show != bool(isettings.get(usd_key)):
isettings.set(usd_key, legacy_show)
def subscribe_to_legacy_obj(setting_key: str, isettings):
legacy_obj = persitent_to_legacy_map.get(setting_key)
if legacy_obj and legacy_obj[1]:
return isettings.subscribe_to_node_change_events(legacy_obj[1], partial(legacy_value_changed, setting_key))
carb.log_error("No mapping for '{setting_key}' into legacy setting")
return None
def global_value_changed(setting_key: str, item: carb.dictionary.Item, event_type: carb.settings.ChangeEventType):
if event_type != carb.settings.ChangeEventType.CHANGED:
return
legacy_obj = persitent_to_legacy_map.get(setting_key)
if not legacy_obj:
carb.log_error("No mapping for '{setting_key}' into legacy setting")
return None
# Simply forwards the global setting to all Viewport instances attached to this UsdContext
isettings = carb.settings.get_settings()
global_visible = isettings.get(f"/app/viewport/usdcontext-{usd_context_name}/{setting_key}")
per_viewport_key = f"/persistent/app/viewport/{viewport_id}/{setting_key}"
legacy_key = legacy_obj[1]
# Push global stage state into legacy global key state (that may be watched by other consumers)
if legacy_key:
legacy_show = bool(isettings.get(legacy_key))
if legacy_show != global_visible:
isettings.set(legacy_key, global_visible)
# Push global stage state into per-viewport state
if global_visible != bool(isettings.get(per_viewport_key)):
isettings.set(per_viewport_key, global_visible)
# XXX: Special case skeletons because that is handled externally and still tied to displayOptions
# if setting_key == "scene/skeletons/visible":
# display_options = isettings.get(legacy_display_options_key)
# # If legacy display options is None, then it is not set at all: assume application doesnt want them at all
# if display_options is not None:
# legacy_bitmask = (1 << 9) # Avoid persitent_to_legacy_map.get(setting_key)[0], already know the bitmask
# if global_visible != bool(display_options & legacy_bitmask):
# display_options = display_options | (1 << 9)
# isettings.set(legacy_display_options_key, display_options)
# else:
# carb.log_warn(f"{legacy_display_options_key} is unset, assuming application does not want it")
def subscribe_to_global_obj(setting_key: str, isettings):
legacy_obj = persitent_to_legacy_map.get(setting_key)
if legacy_obj and legacy_obj[2]:
global_key = f"/app/viewport/usdcontext-{usd_context_name}/{setting_key}"
return isettings.subscribe_to_node_change_events(global_key, partial(global_value_changed, setting_key))
carb.log_error("No mapping for '{setting_key}' into global stage setting")
return None
for setting_key, legacy_obj in persitent_to_legacy_map.items():
legacy_bitmask, legacy_key, is_usd_state = legacy_obj
legacy_visible = bool(legacy_display_options & legacy_bitmask)
visible = _resolve_viewport_setting(viewport_id, setting_key, isettings, legacy_key, True, legacy_visible,
usd_context_name=usd_context_name if is_usd_state else None)
if legacy_key:
legacy_value = isettings.get(legacy_key)
if (legacy_value is None) or (legacy_value != visible):
isettings.set(legacy_key, visible)
# Now take the full resolved 'visible' value and push back into the cached legacy_display_options bitmask.
# This is so that any errant extension that still sets to displayOptions will trigger a global toggle
# of the setting for all Viewports
if legacy_visible != visible:
if visible:
legacy_display_options = legacy_display_options | legacy_bitmask
else:
legacy_display_options = legacy_display_options & ~legacy_bitmask
# Global HUD visibility: first resolve to based on new persitent per-viewport and its defaults
_resolve_viewport_setting(viewport_id, "hud/visible", isettings, None, True, True)
return (
isettings.subscribe_to_node_change_events(legacy_display_options_key, legacy_display_options_changed),
# Subscriptions to manage legacy drawing state across all Viewports
subscribe_to_legacy_obj("guide/grid/visible", isettings),
subscribe_to_legacy_obj("guide/selection/visible", isettings),
subscribe_to_legacy_obj("scene/cameras/visible", isettings),
subscribe_to_legacy_obj("scene/lights/visible", isettings),
subscribe_to_legacy_obj("scene/audio/visible", isettings),
# Subscriptions to manage UsdStage state across Viewports sharing a UsdContext
subscribe_to_global_obj("scene/cameras/visible", isettings),
subscribe_to_global_obj("scene/lights/visible", isettings),
subscribe_to_global_obj("scene/skeletons/visible", isettings),
subscribe_to_global_obj("scene/meshes/visible", isettings),
subscribe_to_global_obj("scene/audio/visible", isettings),
)
| 14,075 | Python | 53.138461 | 126 | 0.665506 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/raycast.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
from typing import Sequence, Callable
import carb
USE_RAYCAST_SETTING = "/exts/omni.kit.viewport.window/useRaycastQuery"
def perform_raycast_query(
viewport_api: "ViewportAPI",
mouse_ndc: Sequence[float],
mouse_pixel: Sequence[float],
on_complete_fn: Callable,
query_name: str = ""
):
raycast_success = False
if (
viewport_api.hydra_engine == "rtx"
and carb.settings.get_settings().get(USE_RAYCAST_SETTING)
):
try:
import omni.kit.raycast.query as rq
def rtx_query_complete(ray, result: "RayQueryResult", *args, **kwargs):
prim_path = result.get_target_usd_path()
if result.valid:
world_space_pos = result.hit_position
else:
world_space_pos = (0, 0, 0)
on_complete_fn(prim_path, world_space_pos, *args, **kwargs)
rq.utils.raycast_from_mouse_ndc(
mouse_ndc,
viewport_api,
rtx_query_complete
)
raycast_success = True
except:
pass
if not raycast_success:
viewport_api.request_query(
mouse_pixel,
on_complete_fn,
query_name=query_name
)
| 1,718 | Python | 30.254545 | 83 | 0.61234 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/layers.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ['ViewportLayers']
from .legacy import _resolve_viewport_setting
from omni.kit.viewport.registry import RegisterViewportLayer
from omni.kit.widget.viewport import ViewportWidget
from omni.kit.widget.viewport.api import ViewportAPI
import omni.ui as ui
import omni.timeline
import omni.usd
import carb
from pxr import Usd, Sdf
import traceback
from typing import Callable, Optional
import weakref
kLayerOrder = [
'omni.kit.viewport.window.ViewportLayer',
'omni.kit.viewport.window.SceneLayer',
'omni.kit.viewport.menubar.MenuBarLayer'
]
# Class to wrap the underlying omni.kit.widget.viewport.ViewportWidget into the layer-system
class _ViewportLayerItem:
def __init__(self, viewport):
self.__viewport = viewport
@property
def visible(self):
return self.__viewport.visible
@visible.setter
def visible(self, value):
self.__viewport.visible = bool(value)
# TODO: Would be nice to express AOV's as more controllable items
@property
def name(self):
return 'Render (color)'
@property
def layers(self):
return tuple()
@property
def categories(self):
return ('viewport',)
def destroy(self):
# Respond to destroy, but since this doesn't own the underlying viewport, don't forward to it
pass
# Since we're exposing ourself in the 'viewport' category expose the .viewport_api getter
@property
def viewport_api(self):
return self.__viewport.viewport_api
class ViewportLayers:
"""The Viewport Layers Widget
Holds a single viewport and manages the order of layers within a ui.ZStack
"""
# For convenience and access, promote the underlying viewport api to this widget
@property
def viewport_api(self):
return self.__viewport.viewport_api if self.__viewport else None
@property
def viewport_widget(self):
return weakref.proxy(self.__viewport)
@property
def layers(self):
for layer in self.__viewport_layers.values():
yield layer
def get_frame(self, name: str):
carb.log_error("ViewportLayers.get_frame called but parent has not provided an implementation.")
def __init__(self,
viewport_id: str,
usd_context_name: str = '',
get_frame_parent: Optional[Callable] = None,
hydra_engine_options: Optional[dict] = None,
*ui_args, **ui_kwargs):
self.__viewport_layers = {}
self.__ui_frame = None
self.__viewport = None
self.__zstack = None
self.__timeline = omni.timeline.get_timeline_interface()
self.__timeline_sub = self.__timeline.get_timeline_event_stream().create_subscription_to_pop(self.__on_timeline_event)
if get_frame_parent:
self.get_frame = get_frame_parent
isettings = carb.settings.get_settings()
# If no resolution specified, see if a knnown setting exists to use as an initial value
# This is a little complicated due to serialization but also preservation of legacy global defaults
resolution = _resolve_viewport_setting(viewport_id, 'resolution', isettings)
# If no -new- resolution setting was resolved, check against legacy setting
if resolution is None:
width = isettings.get('/app/renderer/resolution/width')
height = isettings.get('/app/renderer/resolution/height')
# Both need to be set and valid to be used
if (width is not None) and (height is not None):
# When either width or height is 0 or less, Viewport will be set to use UI size
if (width > 0) and (height > 0):
resolution = (width, height)
else:
resolution = 'fill_frame'
# Also resolve any resolution scaling to use for the Viewport
res_scale = _resolve_viewport_setting(viewport_id, 'resolutionScale', isettings,
'/app/renderer/resolution/multiplier')
# Our 'frame' is really a Z-Stack so that we can push another z-stack on top of the render
self.__ui_frame = ui.ZStack(*ui_args, **ui_kwargs)
with self.__ui_frame:
ui.Rectangle(style_type_name_override='ViewportBackgroundColor')
self.__viewport = ViewportWidget(usd_context_name, resolution=resolution,
viewport_api=ViewportAPI(usd_context_name, viewport_id,
self.__viewport_updated),
hydra_engine_options=hydra_engine_options)
# Apply the resolution scaling now that the Viewport exists
if res_scale is not None:
self.__viewport.viewport_api.resolution_scale = res_scale
# Expose the viewport itself into the layer system (factory is the key, so use the contructor)
self.__viewport_layers[_ViewportLayerItem] = _ViewportLayerItem(weakref.proxy(self.__viewport))
# Now add the notification which will be called for all layers already registered and any future ones.
RegisterViewportLayer.add_notifier(self.__viewport_layer_event)
def __viewport_updated(self, camera_path: Sdf.Path, stage: Usd.Stage):
if not self.__viewport:
return
# Get the current time-line time and push that to the Viewport
if stage:
time = self.__timeline.get_current_time()
time = Usd.TimeCode(omni.usd.get_frame_time_code(time, stage.GetTimeCodesPerSecond()))
else:
time = Usd.TimeCode.Default()
# Push the time, and let the Viewport handle any view-changed notifications
self.__viewport._viewport_changed(camera_path, stage, time)
def __on_timeline_event(self, e: carb.events.IEvent):
if self.__viewport:
event_type = e.type
if (event_type == int(omni.timeline.TimelineEventType.CURRENT_TIME_TICKED)):
viewport_api = self.__viewport.viewport_api
self.__viewport_updated(viewport_api.camera_path, viewport_api.stage)
def __viewport_layer_event(self, factory, loading):
if loading:
# A layer was registered
# Preserve the 'ViewportLayer' in our dictionary
vp_layer = self.__viewport_layers[_ViewportLayerItem]
del self.__viewport_layers[_ViewportLayerItem]
for instance in self.__viewport_layers.values():
instance.destroy()
self.__viewport_layers = {_ViewportLayerItem: vp_layer}
# Create the factory argument
factory_args = {
'usd_context_name': self.viewport_api.usd_context_name,
'layer_provider': weakref.proxy(self),
'viewport_api': self.viewport_api
}
# Clear out the old stack
if self.__zstack:
self.__zstack.destroy()
self.__zstack.clear()
with self.__ui_frame:
self.__zstack = ui.ZStack()
# Rebuild all the other layers according to our order
for factory_id, factory in RegisterViewportLayer.ordered_factories(kLayerOrder):
# Skip over things that weren't found (they may have not been registered or enabled yet)
if not factory:
continue
with self.__zstack:
try:
self.__viewport_layers[factory] = factory(factory_args.copy())
except Exception:
carb.log_error(f"Error creating layer {factory}. Traceback:\n{traceback.format_exc()}")
else:
if factory in self.__viewport_layers:
self.__viewport_layers[factory].destroy()
del self.__viewport_layers[factory]
else:
carb.log_error(f'Removing {factory} which was never instantiated')
def __del__(self):
self.destroy()
def destroy(self):
self.__timeline_sub = None
RegisterViewportLayer.remove_notifier(self.__viewport_layer_event)
for factory, instance in self.__viewport_layers.items():
instance.destroy()
self.__viewport_layers = {}
if self.__zstack:
self.__zstack.destroy()
self.__zstack = None
if self.__viewport:
self.__viewport.destroy()
self.__viewport = None
if self.__ui_frame:
self.__ui_frame.destroy()
self.__ui_frame = None
self.get_frame = None
self.__timeline = None
| 9,230 | Python | 39.845133 | 126 | 0.613759 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/viewport_actions.py | import omni.kit.actions.core
from typing import Callable, Optional
def register_actions(extension_id: str, index: int, show_fn: Callable, visible_fn: Callable) -> Optional[str]:
action_registry = omni.kit.actions.core.get_action_registry()
if not action_registry:
return None
action_name = f"show_viewport_window_{index + 1}"
action_registry.register_action(
extension_id,
action_name,
lambda: show_fn(None, not visible_fn()),
display_name="Viewport show/hide window",
description="Viewport show/hide window",
tag="Viewport Actions",
)
return action_name
def deregister_actions(extension_id: str, action_name: str) -> None:
action_registry = omni.kit.actions.core.get_action_registry()
if action_registry:
action_registry.deregister_action(extension_id, action_name)
| 868 | Python | 32.423076 | 110 | 0.685484 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/window.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ['ViewportWindow']
import weakref
import omni.ui as ui
import carb.settings
from typing import Callable, Optional, Sequence
import contextlib
class ViewportWindow(ui.Window):
__APP_WINDOW_HIDE_UI = "/app/window/hideUi"
__GAMEPAD_CONTROL = "/persistent/app/omniverse/gamepadCameraControl"
__OBJECT_CENTRIC = "/persistent/app/viewport/objectCentricNavigation"
__DOUBLE_CLICK_COI = "/persistent/app/viewport/coiDoubleClick"
active_window: Optional[weakref.ProxyType] = None
"""The Viewport Window, simple window holding a ViewportLayers widget"""
def __init__(self,
name: str | None = None,
usd_context_name: str = '',
width: int = None,
height: int = None,
flags: int = None,
style: dict = None,
usd_drop_support: bool = True,
hydra_engine_options: Optional[dict] = None,
*ui_args, **ui_kw_args):
"""ViewportWindow contructor
Args:
name (str): The name of the Window.
usd_context_name (str): The name of a UsdContext this Viewport will be viewing.
width(int): The width of the Window.
height(int): The height of the Window.
flags(int): ui.WINDOW flags to use for the Window.
style (dict): Optional style overrides to apply to the Window's frame.
*args, **kwargs: Additional arguments to pass to omni.ui.Window
"""
resolved_args = ViewportWindow.__resolve_window_args(width, height, flags)
if resolved_args:
ui_kw_args.update(resolved_args)
settings = carb.settings.get_settings()
# Create a default Window name if none is provided
# 1. Pull the setting for default-window name
# 2. Format with key usd_context_name=usd_context_name
# 3. If format leads to the same name as default-window, append ' (usd_context_name)'
#
if name is None:
name = settings.get("/exts/omni.kit.viewport.window/startup/windowName") or "Viewport"
if usd_context_name:
fmt_name = name.format(usd_context_name=usd_context_name)
if fmt_name == name:
name += f" ({usd_context_name})"
else:
name = fmt_name
super().__init__(name, *ui_args, **ui_kw_args)
self.__name = name
self.__external_drop_support = None
self.__added_frames = {}
self.__setting_subs: Sequence[carb.settings.SubscriptionId] = tuple()
self.__hide_ui_state = None
self.__minimize_window_sub = None
self.set_selected_in_dock_changed_fn(self.__selected_in_dock_changed)
self.set_docked_changed_fn(self.__dock_changed)
self.set_focused_changed_fn(self.__focused_changed)
# Window takes focus on any mouse down
self.focus_policy = ui.FocusPolicy.FOCUS_ON_ANY_MOUSE_DOWN
# Make a simple style and update it with user provided values if provided
applied_style = ViewportWindow.__g_default_style
if style:
applied_style = applied_style.copy()
applied_style.update(style)
self.set_style(applied_style)
legacy_display_subs: Optional[Sequence[carb.settings.SubscriptionId]] = None
# Basic Frame for the Viewport
from .layers import ViewportLayers
from .legacy import _setup_viewport_options
with self.frame:
self.__z_stack = ui.ZStack()
with self.__z_stack:
# Currently ViewportWindow only has/supports one embedded ViewportWidget, but give it a unique name
# that will co-operate if that ever changes.
viewport_id = f"{name}/Viewport0"
# Setup the mapping from legacy displayOptions to the persistent viewport settings
legacy_display_subs = _setup_viewport_options(viewport_id, usd_context_name, settings)
self.__viewport_layers = ViewportLayers(viewport_id=viewport_id, usd_context_name=usd_context_name,
get_frame_parent=self.get_frame, hydra_engine_options=hydra_engine_options)
# Now Viewport & Layers are completely built, if the VP has a stage attached, force a sync when omni.ui does
# layout. This works around an issue where the Viewport frame's computed-size notification may not be pushed.
self.frame.set_build_fn(self.__frame_built)
if usd_drop_support:
self.add_external_drag_drop_support()
ViewportWindow.__g_instances.append(weakref.proxy(self, ViewportWindow.__clean_instances))
self.__setting_subs = (
# Watch for hideUi notification to toggle visible items
settings.subscribe_to_node_change_events(ViewportWindow.__APP_WINDOW_HIDE_UI, self.__hide_ui),
# Watch for global gamepad enabled change
settings.subscribe_to_node_change_events(ViewportWindow.__GAMEPAD_CONTROL, self.__set_gamepad_enabled),
# Watch for global object centric movement changes
settings.subscribe_to_node_change_events(ViewportWindow.__OBJECT_CENTRIC, self.__set_object_centric),
# Watch for global double click-to-orbit
settings.subscribe_to_node_change_events(ViewportWindow.__DOUBLE_CLICK_COI, self.__set_double_click_coi),
)
# Store any additional legacy_disply_sub subscription here
if legacy_display_subs:
self.__setting_subs = self.__setting_subs + legacy_display_subs
self.__minimize_window_sub = self.app_window.get_window_minimize_event_stream().create_subscription_to_push(
self.__on_minimized,
name=f'omni.kit.viewport.window.minimization_subscription.{self}'
)
self.__set_gamepad_enabled()
self.__set_object_centric()
self.__set_double_click_coi()
def __on_minimized(self, event: carb.events.IEvent = None, *args, **kwargs):
if carb.settings.get_settings().get('/app/renderer/skipWhileMinimized'):
# If minimized, always stop rendering.
# If not minimized, restore rendering based on window docked and selected in doock or visibility
if event.payload.get('isMinimized', False):
self.viewport_api.updates_enabled = False
elif self.docked:
self.viewport_api.updates_enabled = self.selected_in_dock
else:
self.viewport_api.updates_enabled = self.visible
def __focused_changed(self, focused: bool):
if not focused:
return
prev_active, ViewportWindow.active_window = ViewportWindow.active_window, weakref.proxy(self)
with contextlib.suppress(ReferenceError):
if prev_active:
if prev_active == self:
return
prev_active.__set_gamepad_enabled(force_off=True)
self.__set_gamepad_enabled()
@staticmethod
def __resolve_window_args(width, height, flags):
settings = carb.settings.get_settings()
hide_ui = settings.get(ViewportWindow.__APP_WINDOW_HIDE_UI)
if width is None and height is None:
width = settings.get("/app/window/width")
height = settings.get("/app/window/height")
# If above settings are not set but using hideUi, set to fill main window
if hide_ui and (width is None) and (height is None):
width = ui.Workspace.get_main_window_width()
height = ui.Workspace.get_main_window_height()
# If still none, use some sane default values
if width is None and height is None:
width, height = (1280, 720 + 20)
if flags is None:
flags = ui.WINDOW_FLAGS_NO_SCROLLBAR
# Additional flags to fill main-window when hideUi is in use
if hide_ui:
flags |= ui.WINDOW_FLAGS_NO_COLLAPSE | ui.WINDOW_FLAGS_NO_RESIZE | ui.WINDOW_FLAGS_NO_MOVE | ui.WINDOW_FLAGS_NO_TITLE_BAR
ui_args = {
'width': width,
'height': height,
'flags': flags,
# Viewport is changing every frame. We can't raster it.
'raster_policy': ui.RasterPolicy.NEVER,
}
if hide_ui or settings.get("/persistent/app/viewport/noPadding"):
ui_args['padding_x'], ui_args['padding_y'] = (0, 0)
return ui_args
@property
def name(self):
return self.__name
@property
def viewport_api(self):
return self.__viewport_layers.viewport_api if self.__viewport_layers else None
@property
def viewport_widget(self):
return self.__viewport_layers.viewport_widget if self.__viewport_layers else None
def set_style(self, style):
self.frame.set_style(style)
@ui.Window.visible.setter
def visible(self, visible: bool):
ui.Window.visible.fset(self, visible)
viewport_api = self.viewport_api
if viewport_api:
if visible:
viewport_api.updates_enabled = True
elif carb.settings.get_settings().get("/app/renderer/skipWhileInvisible"):
viewport_api.updates_enabled = False
def add_external_drag_drop_support(self, callback_fn: Callable = None):
# Remove any previously registered support
prev_callback = self.remove_external_drag_drop_support()
# If no user supplied function, use the default to open a usd file
if callback_fn is None:
callback_fn = self.__external_drop
try:
from omni.kit.window.drop_support import ExternalDragDrop
self.__external_drop_support = ExternalDragDrop(window_name=self.name, drag_drop_fn=callback_fn)
return prev_callback
except ImportError:
import carb
carb.log_info('Enable omni.kit.window.drop_support for external drop support')
return False
def remove_external_drag_drop_support(self):
if self.__external_drop_support:
prev_callback = self.__external_drop_support._drag_drop_fn
self.__external_drop_support.destroy()
self.__external_drop_support = None
return prev_callback
def get_frame(self, name: str):
frame = self.__added_frames.get(name)
if frame is None:
with self.__z_stack:
frame = ui.Frame(horizontal_clipping=True)
self.__added_frames[name] = frame
return frame
def _find_viewport_layer(self, layer_id: str, category: str = None, layers=None):
def recurse_layers(layer):
if layer_id == getattr(layer, 'name', None):
if (category is None) or (category in getattr(layer, 'categories', tuple())):
return layer
for child_layer in getattr(layer, 'layers', tuple()):
found_layer = recurse_layers(child_layer)
if found_layer:
return found_layer
return recurse_layers(layers or self.__viewport_layers)
def _post_toast_message(self, message: str, message_id: str = None):
msg_layer = self._find_viewport_layer('Toast Message', 'stats')
if msg_layer:
msg_layer.add_message(message, message_id)
def __del__(self):
self.destroy()
def destroy(self):
self.remove_external_drag_drop_support()
self.set_selected_in_dock_changed_fn(None)
self.set_docked_changed_fn(None)
self.set_focused_changed_fn(None)
if self.__minimize_window_sub:
self.__minimize_window_sub = None
settings = carb.settings.get_settings()
for setting_sub in self.__setting_subs:
if setting_sub:
settings.unsubscribe_to_change_events(setting_sub)
self.__setting_subs = tuple()
if self.__viewport_layers:
self.__viewport_layers.destroy()
self.__viewport_layers = None
ViewportWindow.__clean_instances(None, self)
if self.__z_stack:
self.__z_stack.clear()
self.__z_stack.destroy()
self.__z_stack = None
if self.__added_frames:
for name, frame in self.__added_frames.items():
frame.destroy()
self.__added_frames = None
super().destroy()
# Done last as it is the active ViewportWindow until replaced or fully destroyed
with contextlib.suppress(ReferenceError):
if ViewportWindow.active_window == self:
ViewportWindow.active_window = None
def __hide_ui(self, *args, **kwargs):
class UiToggle:
def __init__(self, window: ViewportWindow):
self.__visible_layers = None
self.__tab_visible = window.dock_tab_bar_enabled
def __log_error(self, visible: bool, *args):
import traceback
carb.log_error(f"Error {'showing' if visible else 'hiding'} layer {args}. Traceback:\n{traceback.format_exc()}")
def __set_visibility(self, window: ViewportWindow, visible: bool, layer_args):
layers = set()
try:
for name, category in layer_args:
layer = window._find_viewport_layer(name, category)
if layer and getattr(layer, 'visible', visible) != visible:
layer.visible = visible
layers.add((name, category))
except Exception:
self.__log_error(visible, name, category)
return layers
def hide_ui(self, window: ViewportWindow, hide_ui: bool):
if hide_ui:
if self.__visible_layers:
return
self.__visible_layers = self.__set_visibility(window, False, (
("Axis", "guide"),
("Menubar", "menubar"),
))
window.dock_tab_bar_enabled = False
elif self.__visible_layers:
visible_layers, self.__visible_layers = self.__visible_layers, None
self.__set_visibility(window, True, visible_layers)
window.dock_tab_bar_enabled = self.__tab_visible
hide_ui = carb.settings.get_settings().get(ViewportWindow.__APP_WINDOW_HIDE_UI)
if not self.__hide_ui_state:
self.__hide_ui_state = UiToggle(self)
self.__hide_ui_state.hide_ui(self, hide_ui)
def __set_gamepad_enabled(self, *args, force_off: bool = False, **kwargs):
if not force_off:
# Get current global value
enabled = carb.settings.get_settings().get(ViewportWindow.__GAMEPAD_CONTROL)
# If gamepad set to on, only enable it for the active ViewportWindow
if enabled:
with contextlib.suppress(ReferenceError):
if ViewportWindow.active_window and ViewportWindow.active_window != self:
return
else:
enabled = False
# Dig deep into some implementation details
cam_manip_item = self._find_viewport_layer('Camera', 'manipulator')
if not cam_manip_item:
return
cam_manip_layer = getattr(cam_manip_item, 'layer', None)
if not cam_manip_layer:
return
cam_manipulator = getattr(cam_manip_layer, 'manipulator', None)
if not cam_manipulator or not hasattr(cam_manipulator, 'gamepad_enabled'):
return
cam_manipulator.gamepad_enabled = enabled
return
def __set_object_centric(self, *args, **kwargs):
settings = carb.settings.get_settings()
value = settings.get(ViewportWindow.__OBJECT_CENTRIC)
if value is not None:
settings.set("/exts/omni.kit.manipulator.camera/objectCentric/type", value)
def __set_double_click_coi(self, *args, **kwargs):
settings = carb.settings.get_settings()
value = settings.get(ViewportWindow.__DOUBLE_CLICK_COI)
if value is not None:
settings.set("/exts/omni.kit.viewport.window/coiDoubleClick", value)
def __external_drop(self, edd, payload):
import re
import os
import pathlib
import omni.usd
import omni.kit.undo
import omni.kit.commands
from pxr import Sdf, Tf
default_prim_path = Sdf.Path("/")
stage = omni.usd.get_context().get_stage()
if stage.HasDefaultPrim():
default_prim_path = stage.GetDefaultPrim().GetPath()
re_audio = re.compile(r"^.*\.(wav|wave|ogg|oga|flac|fla|mp3|m4a|spx|opus)(\?.*)?$", re.IGNORECASE)
re_usd = re.compile(r"^.*\.(usd|usda|usdc|usdz)(\?.*)?$", re.IGNORECASE)
for source_url in edd.expand_payload(payload):
if re_usd.match(source_url):
try:
import omni.kit.window.file
omni.kit.window.file.open_stage(source_url.replace(os.sep, '/'))
except ImportError:
import carb
carb.log_warn(f'Failed to import omni.kit.window.file - Cannot open stage {source_url}')
return
with omni.kit.undo.group():
for source_url in edd.expand_payload(payload):
if re_audio.match(source_url):
stem = pathlib.Path(source_url).stem
path = default_prim_path.AppendChild(Tf.MakeValidIdentifier(stem))
omni.kit.commands.execute(
"CreateAudioPrimFromAssetPath",
path_to=path,
asset_path=source_url,
usd_context=omni.usd.get_context(),
)
def __frame_built(self, *args, **kwargs):
vp_api = self.__viewport_layers.viewport_api
stage = vp_api.stage if vp_api else None
if stage:
vp_api.viewport_changed(vp_api.camera_path, stage)
# ViewportWindow owns the hideUi state, so do it now
self.__hide_ui()
def __selected_in_dock_changed(self, is_selected):
self.viewport_api.updates_enabled = is_selected if self.docked else True
def __dock_changed(self, is_docked):
self.viewport_api.updates_enabled = self.selected_in_dock if is_docked else True
@staticmethod
def set_default_style(style, overwrite: bool = False, usd_context_name: str = '', apply: bool = True):
if overwrite:
ViewportWindow.__g_default_style = style
else:
ViewportWindow.__g_default_style.update(style)
if apply:
# Apply the default to all intances of usd_context_name
for instance in ViewportWindow.get_instances(usd_context_name):
instance.set_style(ViewportWindow.__g_default_style)
@staticmethod
def get_instances(usd_context_name: str = ''):
for instance in ViewportWindow.__g_instances:
try:
viewport_api = instance.viewport_api
if not viewport_api:
continue
# None is the key for all ViewportWindows for all UsdContexts
# Otherwise compare the provided UsdContext matches the Viewports
if usd_context_name is None or usd_context_name == viewport_api.usd_context_name:
yield instance
except ReferenceError:
pass
@staticmethod
def __clean_instances(dead, self=None):
active = []
for p in ViewportWindow.__g_instances:
try:
if p and p != self:
active.append(p)
except ReferenceError:
pass
ViewportWindow.__g_instances = active
__g_instances = []
__g_default_style = {
'ViewportBackgroundColor': {
'background_color': 0xff000000
},
'ViewportStats::Root': {
'margin_width': 5,
'margin_height': 3,
},
'ViewportStats::Spacer': {
'margin': 18
},
'ViewportStats::Group': {
'margin_width': 10,
'margin_height': 5,
},
'ViewportStats::Stack': {
},
'ViewportStats::Background': {
'background_color': ui.color(0.145, 0.157, 0.165, 0.8),
'border_radius': 5,
},
'ViewportStats::Label': {
'margin_height': 1.75,
},
'ViewportStats::LabelError': {
'margin_height': 1.75,
'color': 0xff0000ff
},
'ViewportStats::LabelWarning': {
'margin_height': 1.75,
'color': 0xff00ffff
},
'ViewportStats::LabelDisabled': {
'margin_height': 1.75,
'color': ui.color("#808080")
}
}
| 21,554 | Python | 41.264706 | 137 | 0.586712 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/stats/__init__.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ['ViewportStatsLayer']
import omni.ui as ui
from omni.ui import constant as fl
from omni.gpu_foundation_factory import get_memory_info
import carb
import traceback
import time
from typing import Callable, Optional, Sequence
import weakref
from ..events.delegate import _limit_camera_velocity
LOW_MEMORY_SETTING_PATH = '/persistent/app/viewport/memory/lowFraction'
MEMORY_CHECK_FREQUENCY = '/app/viewport/memory/queryFrequency'
RTX_SPP = '/rtx/pathtracing/spp'
RTX_PT_TOTAL_SPP = '/rtx/pathtracing/totalSpp'
RTX_ACCUMULATED_LIMIT = '/rtx/raytracing/accumulationLimit'
RTX_ACCUMULATION_ENABLED = '/rtx/raytracing/enableAccumulation'
IRAY_MAX_SAMPLES = '/rtx/iray/progressive_rendering_max_samples'
TOAST_MESSAGE_KEY = '/app/viewport/toastMessage'
CAM_SPEED_MESSAGE_KEY = '/exts/omni.kit.viewport.window/cameraSpeedMessage'
HUD_MEM_TYPE_KEY = "/exts/omni.kit.viewport.window/hud/hostMemory/perProcess"
HUD_MEM_NAME_KEY = "/exts/omni.kit.viewport.window/hud/hostMemory/label"
_get_device_info = None
def _human_readable_size(size: int, binary : bool = True, decimal_places: int = 1):
def calc_human_readable(size, scale, *units):
n_units = len(units)
for i in range(n_units):
if (size < scale) or (i == n_units):
return f'{size:.{decimal_places}f} {units[i]}'
size /= scale
if binary:
return calc_human_readable(size, 1024, 'B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB')
return calc_human_readable(size, 1000, 'B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB')
# XXX: Move to omni.kit.viewport.serialization
def _resolve_hud_visibility(viewport_api, setting_key: str, isettings: carb.settings.ISettings, dflt_value: bool = True):
# Resolve initial visibility based on persitent settings or app defaults
visible_key = "/app/viewport/{vp_section}" + (f"/hud/{setting_key}/visible" if setting_key else "/hud/visible")
vp_visible = visible_key.format(vp_section=viewport_api.id)
setting_key = "/persistent" + vp_visible
visible = isettings.get(setting_key)
if visible is None:
visible = isettings.get(vp_visible)
if visible is None:
visible = isettings.get(visible_key.format(vp_section="defaults"))
if visible is None:
visible = dflt_value
# XXX: The application defaults need to get pushed into persistent data now (for display-menu)
isettings.set_default(setting_key, visible)
return (setting_key, visible)
def _get_background_alpha(settings):
bg_alpha = settings.get("/persistent/app/viewport/ui/background/opacity")
return bg_alpha if bg_alpha is not None else 1.0
class ViewportStatistic:
def __init__(self, stat_name: str, setting_key: str = None, parent = None,
alignment: ui.Alignment=ui.Alignment.RIGHT, viewport_api = None):
self.__stat_name = stat_name
self.__labels = []
self.__alignment = alignment
self.__ui_obj = self._create_ui(alignment)
self.__subscription_id: Optional[carb.settings.SubscriptionId] = None
self.__setting_key: Optional[str] = None
if setting_key:
settings = carb.settings.get_settings()
self.__setting_key, self.visible = _resolve_hud_visibility(viewport_api, setting_key, settings)
# Watch for per-viewport changes to persistent setting to control visibility
self.__subscription_id = settings.subscribe_to_node_change_events(
self.__setting_key, self._visibility_change
)
self._visibility_change(None, carb.settings.ChangeEventType.CHANGED)
def __del__(self):
self.destroy()
def _visibility_change(self, item: carb.dictionary.Item, event_type: carb.settings.ChangeEventType):
if event_type == carb.settings.ChangeEventType.CHANGED:
self.visible = bool(carb.settings.get_settings().get(self.__setting_key))
@property
def container(self):
return self.__ui_obj
def _create_ui(self, alignment: ui.Alignment):
return ui.VStack(name='Stack', height=0, style_type_name_override='ViewportStats', alignment=alignment)
def _create_label(self, text: str = '', alignment: Optional[ui.Alignment] = None):
if alignment is None:
alignment = self.alignment
return ui.Label(text, name='Label', style_type_name_override='ViewportStats', alignment=alignment)
def _destroy_labels(self):
for label in self.__labels:
label.destroy()
self.__labels = []
self.__ui_obj.clear()
# Workaround an issue where space is left where the stat was
if self.__ui_obj.visible:
self.__ui_obj.visible = False
self.__ui_obj.visible = True
def update(self, update_info: dict):
if self.skip_update(update_info):
return
stats = self.update_stats(update_info)
# If no stats, clear all the labels now
if not stats:
self._destroy_labels()
return
# If the number of stats has gotten less, need to rebuild it all
index, n_stats = 0, len(stats)
if n_stats < len(self.__labels):
self._destroy_labels()
for txt in stats:
self.set_text(txt, index)
index = index + 1
def skip_update(self, update_info: dict):
return False
def update_stats(self, update_info: dict):
return tuple()
def set_text(self, txt: str, index: int):
# If the number of stats has grown, add a new label
if index >= len(self.__labels):
with self.container:
self.__labels.append(self._create_label())
ui_obj = self.__labels[index]
ui_obj.text = txt
ui_obj.visible = txt != ''
return ui_obj
def destroy(self):
if self.__labels:
self._destroy_labels()
self.__labels = None
if self.__ui_obj:
self.__ui_obj.destroy()
self.__ui_obj = None
if self.__subscription_id:
carb.settings.get_settings().unsubscribe_to_change_events(self.__subscription_id)
self.__subscription_id = None
self.__setting_key = None
@property
def empty(self) -> bool:
return not bool(self.__labels)
@property
def alignment(self) -> ui.Alignment:
return self.__alignment
@property
def visible(self) -> bool:
return self.__ui_obj.visible
@visible.setter
def visible(self, value):
self.__ui_obj.visible = value
@property
def categories(self):
return ('stats',)
@property
def name(self):
return self.__stat_name
class ViewportDeviceStat(ViewportStatistic):
def __init__(self, *args, **kwargs):
super().__init__('Device Memory', setting_key='deviceMemory', *args, **kwargs)
self.__low_memory = []
self.__enabled = []
def skip_update(self, update_info: dict):
return update_info[MEMORY_CHECK_FREQUENCY]
def update_stats(self, update_info: dict):
stat_list = []
global _get_device_info
dev_info = _get_device_info()
self.__low_memory = []
self.__enabled = []
device_mask = update_info['viewport_api'].frame_info.get('device_mask')
for desc_idx, dev_memory in zip(range(len(dev_info)), dev_info):
available = 0
budget, usage = dev_memory['budget'], dev_memory['usage']
if budget > usage:
available = budget - usage
self.__low_memory.append((available / budget) < update_info['low_mem_fraction'])
description = dev_memory['description'] or (f'GPU {desc_idx}')
if not description:
description = 'GPU ' + desc_idx
self.__enabled.append(device_mask is not None and (device_mask & (1 << desc_idx)))
used = _human_readable_size(usage)
available = _human_readable_size(available)
stat_list.append(f'{description}: {used} used, {available} available')
return stat_list
def set_text(self, txt: str, index: int):
ui_obj = super().set_text(txt, index)
if not ui_obj:
return
elif not self.__enabled[index]:
ui_obj.name = 'LabelDisabled'
elif self.__low_memory[index]:
ui_obj.name = 'LabelError'
else:
ui_obj.name = 'Label'
class ViewportMemoryStat(ViewportStatistic):
def __init__(self, label: str | None = None, *args, **kwargs):
settings = carb.settings.get_settings()
self.__report_rss = bool(settings.get(HUD_MEM_TYPE_KEY))
self.__low_memory = False
self.__settings_subs = (
settings.subscribe_to_node_change_events(HUD_MEM_TYPE_KEY, self.__memory_type_changed),
settings.subscribe_to_node_change_events(HUD_MEM_NAME_KEY, self.__memory_type_changed)
)
if label == None:
label = settings.get(HUD_MEM_NAME_KEY) or "Host"
self.__label = label
super().__init__(f"{label} Memory", setting_key='hostMemory', *args, **kwargs)
def __memory_type_changed(self, item: carb.dictionary.Item, event_type: carb.settings.ChangeEventType):
if event_type == carb.settings.ChangeEventType.CHANGED:
settings = carb.settings.get_settings()
self.__report_rss = bool(settings.get(HUD_MEM_TYPE_KEY))
self.__label = settings.get(HUD_MEM_NAME_KEY) or self.__label
def destroy(self):
sub_ids, self.__settings_subs = self.__settings_subs, None
if self.__settings_subs:
settings = carb.settings.get_settings()
for sub in sub_ids:
settings.unsubscribe_to_change_events(sub)
def skip_update(self, update_info: dict):
return update_info[MEMORY_CHECK_FREQUENCY]
def __format_memory(self, update_info: dict, total: int | None = None, available: int | None = None, used: int | None = None):
if used is None:
used = total - available
elif available is None:
available = total - used
elif total is None:
total = available + used
self.__low_memory = (available / total) < update_info['low_mem_fraction']
return f"{self.__label} Memory: {_human_readable_size(used)} used, {_human_readable_size(available)} available"
def update_stats(self, update_info: dict):
host_info = get_memory_info(rss=self.__report_rss)
if self.__report_rss:
return [
self.__format_memory(update_info, available=host_info['available_memory'], used=host_info["rss_memory"])
]
return [
self.__format_memory(update_info, total=host_info['total_memory'], available=host_info["available_memory"])
]
def set_text(self, txt: str, index: int):
ui_obj = super().set_text(txt, index)
if ui_obj:
ui_obj.name = 'LabelError' if self.__low_memory else 'Label'
class ViewportFPS(ViewportStatistic):
def __init__(self, *args, **kwargs):
super().__init__('FPS', setting_key='renderFPS', *args, **kwargs)
self.__fps = None
self.__multiplier = 1
self.__precision = 2
def skip_update(self, update_info: dict):
# FPS update ignores freeze_frame as a signal that rendering is continuing.
fps = round(update_info['viewport_api'].fps, self.__precision)
multiplier = update_info['viewport_api'].frame_info.get('subframe_count', 1)
should_skip_update = True
if fps != self.__fps:
self.__fps = fps
should_skip_update = False
if multiplier != self.__multiplier:
self.__multiplier = multiplier
should_skip_update = False
return should_skip_update
def update_stats(self, update_info: dict):
effective_fps = self.__fps * self.__multiplier
multiplier = max(self.__multiplier, 1)
ms = 1000/effective_fps if effective_fps else 0
multiplier_str = ',' if multiplier == 1 else (' ' + ('|' * (multiplier - 1)))
return [f'FPS: {effective_fps:.{self.__precision}f}{multiplier_str} Frame time: {ms:.{self.__precision}f} ms']
class ViewportResolution(ViewportStatistic):
def __init__(self, *args, **kwargs):
super().__init__('Resolution', setting_key='renderResolution', *args, **kwargs)
self.__resolution = None
def skip_update(self, update_info: dict):
viewport_api = update_info['viewport_api']
# If Viewport is frozen to a frame, keep reolution displayed for that frame
if viewport_api.freeze_frame:
return True
resolution = viewport_api.resolution
if resolution == self.__resolution:
return True
self.__resolution = resolution
return False
def update_stats(self, update_info: dict):
return [f'{self.__resolution[0]}x{self.__resolution[1]}']
class ViewportProgress(ViewportStatistic):
def __init__(self, *args, **kwargs):
super().__init__('Progress', setting_key='renderProgress', *args, **kwargs)
self.__last_accumulated = 0
self.__total_elapsed = 0
def skip_update(self, update_info: dict):
# If Viewport is frozen to a frame, don't update progress, what's displayed should be the last valid progress we have
return update_info['viewport_api'].freeze_frame
def update_stats(self, update_info: dict):
viewport_api = update_info['viewport_api']
total, accumulated = None, viewport_api.frame_info.get('progression', None)
if accumulated is None:
return
label = 'PathTracing'
decimal_places = 2
no_limit = None
renderer = viewport_api.hydra_engine
settings = carb.settings.get_settings()
if renderer == 'rtx':
render_mode = settings.get('/rtx/rendermode')
if render_mode == 'PathTracing':
total = settings.get(RTX_PT_TOTAL_SPP)
no_limit = 0
elif settings.get(RTX_ACCUMULATION_ENABLED):
label = 'Progress'
total = settings.get(RTX_ACCUMULATED_LIMIT)
elif renderer == 'iray':
total = settings.get(IRAY_MAX_SAMPLES)
no_limit = -1
if total is None:
return None
rtx_spp = settings.get(RTX_SPP)
if rtx_spp is None:
return None
# See RenderStatus in HydraRenderResults.h
status = viewport_api.frame_info.get('status')
if accumulated <= rtx_spp:
self.__last_accumulated = 0
self.__total_elapsed = 0
# Update the elapsed time only if the rendering was a success, i.e. status 0.
elif (status == 0) and ((self.__last_accumulated < total) or (no_limit is not None and total <= no_limit)):
self.__total_elapsed = self.__total_elapsed + update_info['elapsed_time']
self.__last_accumulated = accumulated
return [f'{label}: {accumulated}/{total} spp : {self.__total_elapsed:.{decimal_places}f} sec']
class _HudMessageTime:
def __init__(self, key: str):
self.__message_time: float = 0
self.__message_fade_in: float = 0
self.__message_fade_out: float = 0
self.__settings_subs: Sequence[carb.settings.SubscriptionId] = None
self.__init(key)
def __init(self, key: str):
time_key: str = f"{key}/seconds"
fade_in_key: str = f"{key}/fadeIn"
fade_out_key: str = f"{key}/fadeOut"
settings = carb.settings.get_settings()
settings.set_default(time_key, 3)
settings.set_default(fade_in_key, 0.5)
settings.set_default(fade_out_key, 0.5)
def timing_changed(*args, **kwargs):
self.__message_time = settings.get(time_key)
self.__message_fade_in = settings.get(fade_in_key)
self.__message_fade_out = settings.get(fade_out_key)
timing_changed()
self.__settings_subs = (
settings.subscribe_to_node_change_events(time_key, timing_changed),
settings.subscribe_to_node_change_events(fade_in_key, timing_changed),
settings.subscribe_to_node_change_events(fade_out_key, timing_changed),
)
def __del__(self):
self.destroy()
def destroy(self):
if self.__settings_subs:
settings = carb.settings.get_settings()
for sub in self.__settings_subs:
settings.unsubscribe_to_change_events(sub)
self.__settings_subs = None
@property
def message_time(self) -> float:
return self.__message_time
@property
def message_fade_in(self) -> float:
return self.__message_fade_in
@property
def message_fade_out(self) -> float:
return self.__message_fade_out
@property
def total_up_time(self):
return self.message_fade_in + self.message_time
class _HudMessageTracker():
"""Calculate alpha for _HudMessageTime acounting for possibility of reversing direction mid-fade"""
def __init__(self, prev_tckr: Optional["_HudMessageTracker"] = None, message_time: Optional[_HudMessageTime] = None):
self.__time: float = 0
if prev_tckr and message_time:
# If previous object was fading in, keep alpha
if prev_tckr.__time < message_time.message_fade_in:
self.__time = prev_tckr.__time
return
# If previous object was fading out, also keep alpha, but reverse direction
total_msg_up_time = message_time.total_up_time
if prev_tckr.__time > total_msg_up_time:
self.__time = prev_tckr.__time - total_msg_up_time
return
# If previous object is already being shown at 100%, keep alpha 1
self.__time = message_time.message_fade_in
def update(self, message_time: _HudMessageTime, elapsed_time: float):
self.__time += elapsed_time
if self.__time < message_time.message_fade_in:
if message_time.message_fade_in <= 0:
return 1
return min(1, self.__time / message_time.message_fade_in)
total_msg_up_time = message_time.total_up_time
if self.__time > total_msg_up_time:
if message_time.message_fade_out <= 0:
return 0
return max(0, 1.0 - (self.__time - total_msg_up_time) / message_time.message_fade_out)
return 1
class ViewportStatisticFading(ViewportStatistic):
def __init__(self, anim_key: str, parent=None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.__message_time = _HudMessageTime(anim_key)
self.__update_sub = None
self.__alpha = 0
self.__parent = parent
def destroy(self):
self.__update_sub = None
if self.__message_time:
self.__message_time.destroy()
self.__message_time = None
super().destroy()
def _skip_update(self, update_info: dict, check_empty: Optional[Callable] = None):
# Skip updates when calld from the render-update, but return the cached alpha
if update_info.get('external_update', None) is None:
alpha = self.__alpha
update_info['alpha'] = alpha
if alpha <= 0:
self.__update_sub = None
return True
# Skip any update if no message to display
is_empty = check_empty() if check_empty else False
if is_empty:
update_info['alpha'] = 0
self.__update_sub = None
return is_empty
def _update_alpha(self, update_info: dict, accumulate_alpha: Callable):
alpha = 0
elapsed_time = update_info['elapsed_time']
if elapsed_time:
alpha = accumulate_alpha(self.__message_time, elapsed_time, alpha)
update_info['alpha'] = alpha
if alpha <= 0:
self.__update_sub = None
self.visible = False
else:
self.visible = True
return alpha
def _begin_animation(self):
# Add the updtae subscription so that messages / updates are received even when not rendering
if self.__update_sub:
return
bg_alpha = _get_background_alpha(carb.settings.get_settings())
def on_update(event: carb.events.IEvent):
# Build a dict close enough to the render-update info
update_info = {
'elapsed_time': event.payload['dt'],
'alpha': 1,
'external_update': True, # Internally tells skip_update to not skip this update
'background_alpha': bg_alpha
}
# Need to call through via parent ViewportStatsGroup to do the alpha adjustment
self.__parent._update_stats(update_info)
# Cache the updated alpha to be applied later, but kill the subscription if 0
self.__alpha = update_info.get('alpha')
import omni.kit.app
self.__update_sub = omni.kit.app.get_app().get_update_event_stream().create_subscription_to_pop(
on_update, name=f"omni.kit.viewport.window.stats.ViewportStatisticFading[{self.name}]"
)
def _end_animation(self, alpha: float = 0):
self.__update_sub = None
self.__alpha = alpha
@property
def message_time(self) -> _HudMessageTime:
return self.__message_time
class ViewportSpeed(ViewportStatisticFading):
__CAM_VELOCITY = "/persistent/app/viewport/camMoveVelocity"
__CAMERA_MANIP_MODE = "/exts/omni.kit.manipulator.camera/viewportMode"
__COLLAPSE_CAM_SPEED = "/persistent" + f"{CAM_SPEED_MESSAGE_KEY}/collapsed"
__FLY_VIEW_LOCK = "/persistent/exts/omni.kit.manipulator.camera/flyViewLock"
__FLY_VIEW_LOCK_STAT = "/persistent/exts/omni.kit.viewport.window/cameraSpeedMessage/showFlyViewLock"
def __init__(self, viewport_api, *args, **kwargs):
self.__carb_subs: Sequence[carb.settings.SubscriptionId] = None
self.__cam_speed_entry: Optional[ui.FloatField] = None
self.__cam_speed_model_sub: Optional[carb.Subscription] = None
self.__viewport_id: str = str(viewport_api.id)
self.__root_frame: Optional[ui.Frame] = None
self.__tracker: Optional[_HudMessageTracker] = None
self.__style: Optional[dict] = None
self.__focused_viewport: bool = False
self.__fly_lock: Optional[ui.ImageWithProvider] = None
super().__init__(anim_key=CAM_SPEED_MESSAGE_KEY, stat_name='Camera Speed', setting_key='cameraSpeed',
viewport_api=viewport_api, *args, **kwargs)
def update(self, update_info: dict):
if self._skip_update(update_info):
return
def accumulate_alpha(message_time: _HudMessageTime, elapsed_time: float, alpha: float):
return self.__tracker.update(message_time, elapsed_time)
self._update_alpha(update_info, accumulate_alpha)
def _create_ui(self, alignment: ui.Alignment):
ui_root = super()._create_ui(alignment=alignment)
from pathlib import Path
from omni.ui import color as cl, constant as fl
extension_path = Path(carb.tokens.get_tokens_interface().resolve("${omni.kit.viewport.window}"))
icons_path = extension_path.joinpath("data").joinpath("icons").absolute()
self.__style = {
"MouseImage": {
"image_url": str(icons_path.joinpath("mouse_wheel_dark.svg")),
},
"ExpandCollapseButton": {
"background_color": 0,
},
"ExpandCollapseButton.Image::ExpandButton": {
"image_url": str(icons_path.joinpath("speed_expand.svg")),
},
"ExpandCollapseButton.Image::CollapseButton": {
"image_url": str(icons_path.joinpath("speed_collapse.svg")),
},
"IconSeparator": {
"border_width": 45,
},
"KeyboardKey": {
"background_color": 0,
"border_width": 1.5,
"border_radius": 3
},
"KeyboardLabel": {
},
'ViewportStats::FloatField': {
"background_color": 0,
},
"FlyLockButton": {
"background_color": 0,
'padding': 15,
},
"LockedImage::Locked": {
"image_url": str(icons_path.joinpath("ignore_view_direction_on.svg")),
},
"LockedImage::UnLocked": {
"image_url": str(icons_path.joinpath("ignore_view_direction_off.svg")),
},
}
with ui_root:
self.__root_frame = ui.Frame(build_fn=self.__build_root_ui, style=self.__style)
self.__build_root_ui()
ui_root.set_mouse_hovered_fn(self.__mouse_hovered)
return ui_root
def __track_time(self):
self.__tracker = _HudMessageTracker(self.__tracker, self.message_time)
self._begin_animation()
def __toggle_cam_speed_info(self):
# Reset the timer tracking on ui interaction
self.__track_time()
# Toggle the persistan setting
settings = carb.settings.get_settings()
setting_key = self.__COLLAPSE_CAM_SPEED
collapsed = not bool(settings.get(setting_key))
settings.set(setting_key, collapsed)
def __add_mouse_item(self, label: str, tooltip: str, key_label: Optional[str] = None):
ui.Spacer(width=10)
ui.Line(width=2, alignment=ui.Alignment.V_CENTER, style_type_name_override="IconSeparator")
ui.Spacer(width=10)
with ui.VStack(width=50, alignment=ui.Alignment.CENTER):
with ui.ZStack(content_clipping=True):
if key_label:
ui.Rectangle(width=50, height=25, style_type_name_override="KeyboardKey", tooltip=tooltip)
ui.Label(key_label, alignment=ui.Alignment.CENTER, style_type_name_override="KeyboardLabel",
tooltip=tooltip)
else:
# XXX: Odd ui-layout to have the image properly centered
with ui.HStack():
ui.Spacer(width=15)
self.__fly_lock = ui.ImageWithProvider(width=50, height=30, tooltip=tooltip,
name=self.__get_lock_style_name(),
style_type_name_override="LockedImage")
ui.Spacer()
ui.Button(width=50, height=25, style_type_name_override="FlyLockButton",
clicked_fn=self.__toggle_fly_view_lock, tooltip=tooltip)
ui.Spacer(height=5)
ui.Label(label, alignment=ui.Alignment.CENTER, style_type_name_override="ViewportStats", name="Label")
def __build_cam_speed_info(self, *args, **kwargs):
mouse_tip = "Using Mouse wheel during flight navigation will adjust how fast or slow the camera will travel"
ctrl_tip = "Pressing and holding Ctrl button during flight navigation will decrease the speed the camera travels"
shft_tip = "Pressing and holding Shift button during flight navigation will increase the speed the camera travels"
settings = carb.settings.get_settings()
with ui.VStack():
ui.Spacer(height=10)
with ui.HStack():
with ui.VStack(width=50, alignment=ui.Alignment.CENTER):
with ui.HStack():
ui.Spacer(width=10)
ui.ImageWithProvider(width=30, height=30, style_type_name_override="MouseImage", tooltip=mouse_tip)
ui.Label('Speed', alignment=ui.Alignment.CENTER, style_type_name_override="ViewportStats", name="Label")
self.__add_mouse_item("Slow", ctrl_tip, "ctrl")
self.__add_mouse_item("Fast", shft_tip, "shift")
if settings.get(self.__FLY_VIEW_LOCK_STAT):
tootip = "Whether forward/backward and up/down movements ignore camera-view direction (similar to left/right strafe)"
self.__add_mouse_item("Nav Height", tootip, None)
def __build_root_ui(self, collapsed: Optional[bool] = None):
if collapsed is None:
collapsed = bool(carb.settings.get_settings().get(self.__COLLAPSE_CAM_SPEED))
with self.__root_frame:
with ui.VStack():
with ui.HStack(alignment=ui.Alignment.LEFT, content_clipping=True):
ui.Button(width=20, name="ExpandButton" if collapsed else "CollapseButton",
style_type_name_override="ExpandCollapseButton",
clicked_fn=self.__toggle_cam_speed_info)
ui.Label("Camera Speed:", style_type_name_override="ViewportStats", name="Label")
# Additional HStack container to reduce float-field shifting right when expanded
with ui.HStack(alignment=ui.Alignment.LEFT):
self.__cam_speed_entry = ui.FloatField(width=55,
style_type_name_override="ViewportStats", name="FloatField")
ui.Spacer()
ui.Spacer()
def model_changed(model: ui.AbstractValueModel):
try:
# Compare the values with a precision to avoid possibly excessive recursion
settings = carb.settings.get_settings()
model_value, carb_value = model.as_float, settings.get(self.__CAM_VELOCITY)
if round(model_value, 6) == round(carb_value, 6):
return
# Short-circuit carb event handling in __cam_vel_changed
self.__focused_viewport = False
final_value = _limit_camera_velocity(model_value, settings, "text")
settings.set(self.__CAM_VELOCITY, final_value)
if model_value != final_value:
model.set_value(final_value)
finally:
self.__focused_viewport = True
# Reset the animation counter
self.__track_time()
model = self.__cam_speed_entry.model
self.__cam_speed_entry.precision = 3
model.set_value(self.__get_camera_speed_value())
self.__cam_speed_model_sub = model.subscribe_value_changed_fn(model_changed)
if not collapsed:
self.__build_cam_speed_info()
def __get_camera_speed_value(self):
return carb.settings.get_settings().get(self.__CAM_VELOCITY) or 0
def __cam_manip_mode_changed(self, item: carb.dictionary.Item, event_type: carb.settings.ChangeEventType):
if event_type == carb.settings.ChangeEventType.CHANGED:
manip_mode = carb.settings.get_settings().get(self.__CAMERA_MANIP_MODE)
if manip_mode and manip_mode[0] == self.__viewport_id:
self.__focused_viewport = True
if manip_mode[1] == "fly":
self.__track_time()
else:
self.__focused_viewport = False
def __collapse_changed(self, item: carb.dictionary.Item, event_type: carb.settings.ChangeEventType):
if self.__root_frame and event_type == carb.settings.ChangeEventType.CHANGED:
self.__root_frame.rebuild()
def __cam_vel_changed(self, item: carb.dictionary.Item, event_type: carb.settings.ChangeEventType):
if self.__cam_speed_entry and self.__focused_viewport and event_type == carb.settings.ChangeEventType.CHANGED:
self.__cam_speed_entry.model.set_value(self.__get_camera_speed_value())
self.__track_time()
def __mouse_hovered(self, hovered: bool, *args):
if hovered:
self._end_animation(1)
else:
self._begin_animation()
def _visibility_change(self, item: carb.dictionary.Item, event_type: carb.settings.ChangeEventType):
if event_type != carb.settings.ChangeEventType.CHANGED:
return
settings = carb.settings.get_settings()
super()._visibility_change(item, event_type)
if self.visible:
# Made visible, setup additional subscriptions need now
if self.__carb_subs is None:
self.__carb_subs = (
settings.subscribe_to_node_change_events(self.__CAM_VELOCITY, self.__cam_vel_changed),
settings.subscribe_to_node_change_events(f"{self.__CAMERA_MANIP_MODE}/1", self.__cam_manip_mode_changed),
settings.subscribe_to_node_change_events(self.__COLLAPSE_CAM_SPEED, self.__collapse_changed),
settings.subscribe_to_node_change_events(self.__FLY_VIEW_LOCK_STAT, self.__show_fly_view_lock),
settings.subscribe_to_node_change_events(self.__FLY_VIEW_LOCK, self.__toggled_fly_view_lock),
)
# Handle init case from super()__init__, only want the subscritions setup, not to show the dialog
if item is not None:
self.__focused_viewport = True
self.__cam_vel_changed(None, carb.settings.ChangeEventType.CHANGED)
elif self.__carb_subs:
# Made invisible, remove uneeded subscriptions now
self.__remove_camera_subs(settings)
self._end_animation()
def __remove_camera_subs(self, settings):
carb_subs, self.__carb_subs = self.__carb_subs, None
if carb_subs:
for carb_sub in carb_subs:
settings.unsubscribe_to_change_events(carb_sub)
def __show_fly_view_lock(self, item: carb.dictionary.Item, event_type: carb.settings.ChangeEventType):
if event_type != carb.settings.ChangeEventType.CHANGED:
return
root_frame = self.__root_frame
if root_frame:
root_frame.rebuild()
def __get_lock_style_name(self):
enabled = carb.settings.get_settings().get(self.__FLY_VIEW_LOCK)
return "Locked" if enabled else "UnLocked"
def __toggled_fly_view_lock(self, item: carb.dictionary.Item, event_type: carb.settings.ChangeEventType):
if event_type != carb.settings.ChangeEventType.CHANGED:
return
lock_image = self.__fly_lock
if lock_image:
lock_image.name = self.__get_lock_style_name()
def __toggle_fly_view_lock(self):
key = self.__FLY_VIEW_LOCK
settings = carb.settings.get_settings()
settings.set(key, not bool(settings.get(key)))
def destroy(self):
self.__remove_camera_subs(carb.settings.get_settings())
self.__tracker = None
self.__fly_lock = None
if self.__root_frame:
self.__root_frame.destroy()
self.__root_frame = None
if self.__cam_speed_model_sub:
self.__cam_speed_model_sub = None
if self.__cam_speed_entry:
self.__cam_speed_entry.destroy()
self.__cam_speed_entry = None
super().destroy()
@property
def empty(self) -> bool:
return False
class ViewportMessage(ViewportStatisticFading):
class _ToastMessage(_HudMessageTracker):
"""Store a message to fade with _HudMessageTracker"""
def __init__(self, message: str, *args, **kwargs):
self.__message = message
super().__init__(*args, **kwargs)
@property
def message(self):
return self.__message
def __init__(self, *args, **kwargs):
super().__init__(anim_key=TOAST_MESSAGE_KEY, stat_name='Toast Message', setting_key="toastMessage", *args, **kwargs)
self.__messages = {}
def skip_update(self, update_info: dict):
return self._skip_update(update_info, lambda: not bool(self.__messages))
def update_stats(self, update_info: dict):
def accumulate_alpha(message_time: _HudMessageTime, elapsed_time: float, alpha: float):
self.__messages, messages = {}, self.__messages
for msg_id, msg in messages.items():
cur_alpha = msg.update(message_time, elapsed_time)
if cur_alpha:
alpha = max(cur_alpha, alpha)
self.__messages[msg_id] = msg
return alpha
self._update_alpha(update_info, accumulate_alpha)
return [obj.message for obj in self.__messages.values()]
def destroy(self):
super().destroy()
self.__messages = {}
def add_message(self, message: str, message_id: str):
self.__messages[message_id] = ViewportMessage._ToastMessage(message, self.__messages.get(message_id), self.message_time)
# Add the update subscription so that messages / updates are received even when not rendering
self._begin_animation()
def remove_message(self, message: str, message_id: str):
if message_id in self.__messages:
del self.__messages[message_id]
class ViewportStatsGroup:
def __init__(self, factories, name: str, alignment: ui.Alignment, viewport_api):
self.__alpha = 0
self.__stats = []
self.__group_name = name
self.__container = ui.ZStack(name='Root', width=0, height=0, style_type_name_override='ViewportStats')
proxy_self = weakref.proxy(self)
with self.__container:
ui.Rectangle(name='Background', style_type_name_override='ViewportStats')
with ui.VStack(name='Group', style_type_name_override='ViewportStats'):
for stat_obj in factories:
self.__stats.append(stat_obj(parent=proxy_self, alignment=alignment, viewport_api=viewport_api))
self.__container.visible = False
def __del__(self):
self.destroy()
def destroy(self):
if self.__stats:
for stat in self.__stats:
stat.destroy()
self.__stats = []
if self.__container:
self.__container.clear()
self.__container.destroy()
self.__container = None
def __set_alpha(self, alpha: float, background_alpha: float, background_alpha_changed: bool):
alpha = min(0.8, alpha)
if alpha == self.__alpha and (not background_alpha_changed):
return
self.__alpha = alpha
self.__container.set_style({
'ViewportStats::Background': {
'background_color': ui.color(0.145, 0.157, 0.165, alpha * background_alpha),
},
'ViewportStats::Label': {
'color': ui.color(1.0, 1.0, 1.0, alpha)
},
'ViewportStats::LabelError': {
'color': ui.color(1.0, 0.0, 0.0, alpha)
},
'ViewportStats::LabelWarning': {
'color': ui.color(1.0, 1.0, 0.0, alpha)
},
"MouseImage": {
"color": ui.color(1.0, 1.0, 1.0, alpha),
},
"IconSeparator": {
"color": ui.color(0.431, 0.431, 0.431, alpha),
},
"ExpandCollapseButton.Image::ExpandButton": {
"color": ui.color(0.102, 0.569, 0.772, alpha),
},
"ExpandCollapseButton.Image::CollapseButton": {
"color": ui.color(0.102, 0.569, 0.772, alpha),
},
"KeyboardKey": {
"border_color": ui.color(0.102, 0.569, 0.772, alpha),
},
"KeyboardLabel": {
"color": ui.color(0.102, 0.569, 0.772, alpha),
},
"LockedImage": {
"color": ui.color(1.0, 1.0, 1.0, alpha),
},
'ViewportStats::FloatField': {
'color': ui.color(1.0, 1.0, 1.0, alpha),
"background_selected_color": ui.color(0.431, 0.431, 0.431, alpha),
},
})
self.__container.visible = bool(alpha > 0)
def _update_stats(self, update_info: dict):
alpha = 0
any_visible = False
for stat in self.__stats:
try:
update_info['alpha'] = 1
stat.update(update_info)
any_visible = any_visible or (stat.visible and not stat.empty)
alpha = max(alpha, update_info['alpha'])
except Exception:
import traceback
carb.log_error(f"Error updating stats {stat}. Traceback:\n{traceback.format_exc()}")
alpha = alpha if any_visible else 0
self.__set_alpha(alpha, update_info.get('background_alpha'), update_info.get('background_alpha_changed'))
return alpha
@property
def visible(self):
return self.__container.visible if self.__container else False
@visible.setter
def visible(self, value):
if self.__container:
self.__container.visible = value
elif value:
carb.log_error(f"{self.__group_name} has been destroyed, cannot set visibility to True")
@property
def categories(self):
return ('stats',)
@property
def name(self):
return self.__group_name
@property
def layers(self):
for stats in self.__stats:
yield stats
class ViewportStatsLayer:
# Legacy setting that still need to be honored (transiently)
_LEGACY_FORCE_FPS_OFF = "/app/viewport/forceHideFps"
_LEGACY_LAYER_MENU_ON = "/app/viewport/showLayerMenu"
def __init__(self, desc: dict):
settings = carb.settings.get_settings()
settings.set_default(LOW_MEMORY_SETTING_PATH, 0.2)
settings.set_default(MEMORY_CHECK_FREQUENCY, 1.0)
self.__viewport_api = desc.get('viewport_api')
self.__frame_changed_sub = None
self.__disable_ui_sub: Optional[carb.SubscriptionId] = None
self.__setting_key, visible = _resolve_hud_visibility(self.__viewport_api, None, settings)
self.__bg_alpha = 0
# Check some legacy settings that control visibility and should be honored
destroy_old_key = f"/persistent/app/viewport/{self.__viewport_api.id}/hud/forceVisible"
force_vis_tmp = settings.get(destroy_old_key)
if force_vis_tmp is not None:
# Clear out this key from any further persistance
settings.destroy_item(destroy_old_key)
if force_vis_tmp:
# Store it back to the persitent setting
settings.set(self.__setting_key, True)
visible = True
# Check some legacy settings that control visibility and should be honored
if visible:
visible = self.__get_transient_visibility(settings)
self.__last_time = time.time()
self.__frequencies = {}
for key in [MEMORY_CHECK_FREQUENCY]:
value = settings.get(key)
self.__frequencies[key] = [value, value]
self.__groups: Sequence[ViewportStatsGroup] = None
self.__root:ui.Frame = ui.Frame(horizontal_clipping=True, content_clipping=1, opaque_for_mouse_events=True)
self.__disable_ui_sub = (
settings.subscribe_to_node_change_events(self.__setting_key, self.__stats_visiblity_changed),
settings.subscribe_to_node_change_events(self._LEGACY_FORCE_FPS_OFF, self.__legacy_transient_changed),
settings.subscribe_to_node_change_events(self._LEGACY_LAYER_MENU_ON, self.__legacy_transient_changed)
)
self.__stats_visiblity_changed(None, carb.settings.ChangeEventType.CHANGED)
# Workaround an issue where camera-speed HUD check should default to on
settings.set_default(f"/persistent/app/viewport/{self.__viewport_api.id}/hud/cameraSpeed/visible", True)
def __destroy_all_stats(self, value = None):
if self.__groups:
for group in self.__groups:
group.destroy()
self.__groups = value
def __build_stats_hud(self, viewport_api):
if self.__root:
self.__root.clear()
self.__destroy_all_stats([])
right_stat_factories = [
ViewportFPS,
ViewportMemoryStat,
ViewportProgress,
ViewportResolution
]
# Optional omni.hydra.engine.stats dependency
global _get_device_info
if not _get_device_info:
try:
from omni.hydra.engine.stats import get_device_info
_get_device_info = get_device_info
except ImportError:
pass
if _get_device_info:
right_stat_factories.insert(1, ViewportDeviceStat)
# XXX: Need menu-bar height
hud_top = 20 if hasattr(ui.constant, 'viewport_menubar_height') else 0
with self.__root:
with ui.VStack(height=hud_top):
ui.Spacer(name='Spacer', style_type_name_override='ViewportStats')
with ui.HStack():
with ui.VStack():
self.__groups.append(ViewportStatsGroup([ViewportSpeed],
"Viewport Speed",
ui.Alignment.LEFT,
self.__viewport_api))
self.__groups.append(ViewportStatsGroup([ViewportMessage],
"Viewport Message",
ui.Alignment.LEFT,
self.__viewport_api))
ui.Spacer(name='LeftRightSpacer', style_type_name_override='ViewportStats')
self.__groups.append(ViewportStatsGroup(right_stat_factories,
"Viewport HUD",
ui.Alignment.RIGHT,
self.__viewport_api))
def __stats_visiblity_changed(self, item: carb.dictionary.Item, event_type: carb.settings.ChangeEventType):
if event_type == carb.settings.ChangeEventType.CHANGED:
self.visible = bool(carb.settings.get_settings().get(self.__setting_key))
@staticmethod
def __get_transient_visibility(settings):
# Legacy compat, this takes precedence when explitly set to False
ll_lm_vis = settings.get(ViewportStatsLayer._LEGACY_LAYER_MENU_ON)
if (ll_lm_vis is not None) and (not bool(ll_lm_vis)):
return False
# Now check the other transient visibility
if bool(settings.get(ViewportStatsLayer._LEGACY_FORCE_FPS_OFF)):
return False
return True
def __legacy_transient_changed(self, item: carb.dictionary.Item, event_type: carb.settings.ChangeEventType):
if event_type == carb.settings.ChangeEventType.CHANGED:
if self.__get_transient_visibility(carb.settings.get_settings()):
self.__stats_visiblity_changed(None, event_type)
else:
self.visible = False
def __set_stats_enabled(self, enabled: bool):
if enabled:
viewport_api = self.__viewport_api
if not self.__groups:
self.__build_stats_hud(viewport_api)
if self.__frame_changed_sub is None:
self.__frame_changed_sub = viewport_api.subscribe_to_frame_change(self.__update_stats)
self.__update_stats(viewport_api)
else:
if self.__frame_changed_sub:
self.__frame_changed_sub.destroy()
self.__frame_changed_sub = None
if self.__root:
self.__root.clear()
self.__destroy_all_stats([])
self.__root.visible = enabled
def __make_update_info(self, viewport_api):
now = time.time()
elapsed_time, self.__last_time = now - self.__last_time, now
settings = carb.settings.get_settings()
bg_alpha = _get_background_alpha(settings)
update_info = {
'elapsed_time': elapsed_time,
'low_mem_fraction': settings.get(LOW_MEMORY_SETTING_PATH),
'viewport_api': viewport_api,
'alpha': 1,
'background_alpha': bg_alpha
}
# Signal background alpha changed
if self.__bg_alpha != bg_alpha:
self.__bg_alpha = bg_alpha
update_info['background_alpha_changed'] = True
for key, value in self.__frequencies.items():
value[0] += elapsed_time
value[1] = settings.get(key)
if value[0] >= value[1]:
value[0] = 0
update_info[key] = False
else:
update_info[key] = True
return update_info
def __update_stats(self, viewport_api):
if self.__groups:
update_info = self.__make_update_info(viewport_api)
for group in self.__groups:
group._update_stats(update_info)
def destroy(self):
ui_subs, self.__disable_ui_sub = self.__disable_ui_sub, None
if ui_subs:
settings = carb.settings.get_settings()
for ui_sub in ui_subs:
settings.unsubscribe_to_change_events(ui_sub)
self.__set_stats_enabled(False)
self.__destroy_all_stats()
if self.__root:
self.__root.clear()
self.__root = None
self.__usd_context_name = None
@property
def layers(self):
if self.__groups:
for group in self.__groups:
yield group
@property
def visible(self):
return self.__root.visible
@visible.setter
def visible(self, value):
value = bool(value)
if value:
if not self.__get_transient_visibility(carb.settings.get_settings()):
return
self.__set_stats_enabled(value)
@property
def categories(self):
return ('stats',)
@property
def name(self):
return 'All Stats'
| 51,014 | Python | 40.274272 | 137 | 0.581115 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/dragdrop/usd_prim_drop_delegate.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ['UsdPrimDropDelegate', 'UsdShadeDropDelegate']
from .scene_drop_delegate import SceneDropDelegate
import omni.ui
import omni.kit.commands
from pxr import Usd, Sdf, Gf, UsdGeom, UsdShade
import carb
from functools import partial
from typing import List, Callable
class UsdPrimDropDelegate(SceneDropDelegate):
def __init__(self, preview_setting: str = None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.reset_state()
@property
def dragging_prim(self):
return self.__usd_prim_dragged
@dragging_prim.setter
def dragging_prim(self, prim: Usd.Prim):
self.__usd_prim_dragged = prim
@property
def world_space_pos(self):
return self.__world_space_pos
@world_space_pos.setter
def world_space_pos(self, world_space_pos: Gf.Vec3d):
self.__world_space_pos = world_space_pos
def reset_state(self):
self.__usd_prim_dragged = None
self.__world_space_pos = None
def accepted(self, drop_data: dict):
self.reset_state()
# XXX: Poor deliniation of file vs Sdf.Path
prim_path = drop_data.get('mime_data')
if prim_path.find('.') > 0:
return False
# If there is no Usd.Stage, then it can't be a prim for this stage
usd_context, stage = self.get_context_and_stage(drop_data)
if stage is None:
return False
# Check if it's a path to a valid Usd.Prim and save it if so
prim = stage.GetPrimAtPath(prim_path)
if prim is None or not prim.IsValid():
return False
self.dragging_prim = prim
return True
def add_drop_marker(self, drop_data: dict, world_space_pos: Gf.Vec3d):
prim = self.dragging_prim
if prim:
self.world_space_pos = world_space_pos
super().add_drop_marker(drop_data, world_space_pos)
# Overide drop behavior, material drop doesn't draw anything
def dropped(self, drop_data: dict):
usd_context, stage = self.get_context_and_stage(drop_data)
if stage is None:
return
dropped_prim = self.dragging_prim
if (dropped_prim is None) or (not dropped_prim.IsValid()):
return
dropped_onto = drop_data.get('prim_path')
if dropped_onto is None:
return
dropped_onto = stage.GetPrimAtPath(dropped_onto)
if (dropped_onto is None) or (not dropped_onto.IsValid()):
return
dropped_onto_model = drop_data.get('model_path')
dropped_onto_model = stage.GetPrimAtPath(dropped_onto_model) if dropped_onto_model else None
self.handle_prim_drop(stage, dropped_prim, dropped_onto, dropped_onto_model)
def collect_child_paths(self, prim: Usd.Prim, filter: Callable):
had_child, children = False, []
for child in prim.GetFilteredChildren(Usd.PrimAllPrimsPredicate):
had_child = True
if filter(child):
children.append(child.GetPath())
return children if had_child else [prim.GetPath()]
def handle_prim_drop(self, dropped_prim: Usd.Prim, dropped_onto: Usd.Prim, dropped_onto_model: Usd.Prim):
raise RuntimeError(f'UsdPrimDropDelegate.dropped not overidden')
class UsdShadeDropDelegate(UsdPrimDropDelegate):
@property
def binding_strength(self):
strength = carb.settings.get_settings().get('/persistent/app/stage/materialStrength')
return strength or 'weakerThanDescendants'
@property
def honor_picking_mode(self):
return True
def reset_state(self):
super().reset_state()
self.__menu = None
def accepted(self, drop_data: dict):
if super().accepted(drop_data):
return self.dragging_prim.IsA(UsdShade.Material)
return False
# Overide draw behavior, material drop doesn't draw anything
def add_drop_marker(self, drop_data: dict, world_space_pos: Gf.Vec3d):
return
def bind_material(self, prim_paths, material_path: Sdf.Path):
self.__menu = None
omni.kit.commands.execute('BindMaterialCommand',
prim_path=prim_paths, material_path=material_path, strength=self.binding_strength
)
def show_bind_menu(self, prim_path: Sdf.Path, model_path: Sdf.Path, material_path: Sdf.Path):
import omni.kit.material.library
def __apply_material(target):
if (target):
omni.kit.commands.execute('BindMaterialCommand', prim_path=target, material_path=material_path)
omni.kit.material.library.drop_material(
prim_path.pathString,
model_path.pathString,
apply_material_fn=__apply_material
)
def handle_prim_drop(self, stage: Usd.Stage, dropped_prim: Usd.Prim, dropped_onto: Usd.Prim, dropped_onto_model: Usd.Prim):
if dropped_onto_model:
prim_path = dropped_onto.GetPath()
model_path = dropped_onto_model.GetPath()
material_path = dropped_prim.GetPath()
self.show_bind_menu(prim_path, model_path, material_path)
return
else:
prim_paths = [dropped_onto.GetPath()]
if prim_paths:
self.bind_material(prim_paths, dropped_prim.GetPath())
| 5,717 | Python | 34.296296 | 127 | 0.647717 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/dragdrop/delegate.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ['DragDropDelegate']
import weakref
class DragDropDelegate:
# Use a list to track drag-drop order so that it's deterministic in the event of clashes or cancelation.
__g_registered = []
@classmethod
def get_instances(cls):
remove = []
for wref in DragDropDelegate.__g_registered:
obj = wref()
if obj:
yield obj
else:
remove.append(wref)
for wref in remove:
DragDropDelegate.__g_registered.remove(wref)
def __init__(self):
self.__g_registered.append(weakref.ref(self, lambda r: DragDropDelegate.__g_registered.remove(r)))
def __del__(self):
self.destroy()
def destroy(self):
for wref in DragDropDelegate.__g_registered:
if wref() == self:
DragDropDelegate.__g_registered.remove(wref)
break
@property
def add_outline(self) -> bool:
return False
def accepted(self, url: str) -> bool:
return False
def update_drop_position(self, drop_data: dict) -> bool:
return True
def dropped(self, drop_data: dict) -> None:
pass
def cancel(self, drop_data: dict) -> None:
pass
| 1,679 | Python | 27.965517 | 108 | 0.633115 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/dragdrop/handler.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ['DragDropHandler']
from cmath import isfinite
import omni.ui as ui
from .delegate import DragDropDelegate
import carb
import traceback
from typing import Sequence
from pxr import Usd, UsdGeom, Sdf, Kind
from ..raycast import perform_raycast_query
class DragDropHandler:
@staticmethod
def picking_mode():
mode = carb.settings.get_settings().get('/persistent/app/viewport/pickingMode')
return mode or 'models' # 'models' is equivalent to 'kind:model.ALL'
@staticmethod
def drag_drop_colors():
try:
# Use the selection-outline color or the color below it for selection differentiation
outline_colors = carb.settings.get_settings().get('/persistent/app/viewport/outline/color')
if outline_colors and len(outline_colors) >= 4:
locator_color = None
outline_color = (outline_colors[-4], outline_colors[-3], outline_colors[-2], outline_colors[-1])
if len(outline_colors) >= 8:
secondary_lcolor = carb.settings.get_settings().get('/app/viewport/dragdrop/useSecondaryColorLocator')
secondary_ocolor = carb.settings.get_settings().get('/app/viewport/dragdrop/useSecondaryColorOutline')
if secondary_lcolor:
locator_color = (outline_colors[-8], outline_colors[-7], outline_colors[-6], outline_colors[-5])
elif secondary_ocolor:
locator_color = outline_color
if secondary_ocolor:
outline_color = (outline_colors[-8], outline_colors[-7], outline_colors[-6], outline_colors[-5])
return outline_color, locator_color or outline_color
except Exception:
carb.log_error(f'Traceback:\n{traceback.format_exc()}')
return (1.0, 0.6, 0.0, 1.0), (1.0, 0.6, 0.0, 1.0)
def get_enclosing_model(self, prim_path: str):
stage = self.viewport_api.stage
if stage:
kind_reg = Kind.Registry()
prim = stage.GetPrimAtPath(prim_path)
while prim:
model = Usd.ModelAPI(prim)
kind = model and model.GetKind()
if kind and kind_reg.IsA(kind, Kind.Tokens.model):
return prim.GetPath()
prim = prim.GetParent()
return None
def __init__(self, payload: dict):
self.__valid_drops = None
self.__add_outline = False
self.__payload = payload or {}
self.__payload['mime_data'] = None
self.__payload['usd_context_name'] = self.viewport_api.usd_context_name
self.__last_prim_path = Sdf.Path()
self.__dropped = False
colors = self.drag_drop_colors()
self.__payload['outline_color'] = colors[0]
self.__payload['locator_color'] = colors[1]
self.__last_prim_collection = set()
self.setup_outline(colors[0])
@property
def viewport_api(self):
return self.__payload['viewport_api']
def setup_outline(self, outline_color: Sequence[float], shade_color: Sequence[float] = (0, 0, 0, 0), sel_group: int = 254):
self.__sel_group = sel_group
usd_context = self.viewport_api.usd_context
self.__selected_prims = set(usd_context.get_selection().get_selected_prim_paths())
usd_context.set_selection_group_outline_color(sel_group, outline_color)
usd_context.set_selection_group_shade_color(sel_group, shade_color)
def __set_prim_outline(self, prim_path: Sdf.Path = None):
if not self.__add_outline:
return
# Save the current prim for clering later and save off the previous prim locally
last_prim_path, self.__last_prim_path = self.__last_prim_path, prim_path
usd_context = self.viewport_api.usd_context
new_path = prim_path != last_prim_path
# Restore any previous
if self.__dropped or new_path:
for sdf_path in self.__last_prim_collection:
usd_context.set_selection_group(0, sdf_path.pathString)
self.__last_prim_collection = set()
# If over a prim and not dropped, set the outline
if prim_path and new_path:
prim = usd_context.get_stage().GetPrimAtPath(prim_path)
if prim.IsA(UsdGeom.Gprim):
self.__last_prim_collection.add(prim_path)
for prim in Usd.PrimRange(prim, Usd.TraverseInstanceProxies(Usd.PrimAllPrimsPredicate)):
if prim.IsA(UsdGeom.Gprim):
self.__last_prim_collection.add(prim.GetPath())
for sdf_path in self.__last_prim_collection:
usd_context.set_selection_group(self.__sel_group, sdf_path.pathString)
def __query_complete(self, is_drop: bool, prim_path: str, world_space_pos: Sequence[float], *args):
if prim_path:
if not isfinite(world_space_pos[0]) or not isfinite(world_space_pos[1]) or not isfinite(world_space_pos[2]):
# XXX: RTX is passing inf or nan in some cases...
prim_path, world_space_pos = Sdf.Path(), (0, 0, 0)
else:
prim_path = Sdf.Path(prim_path)
else:
prim_path = Sdf.Path()
updated_drop = []
outline_path = prim_path
pick_mode = self.picking_mode()
model_path = None
if prim_path and (pick_mode == 'kind:model.ALL' or pick_mode == 'models'):
for drop_obj in self.__valid_drops:
instance = drop_obj[0]
if hasattr(instance, 'honor_picking_mode') and instance.honor_picking_mode:
model_path = self.get_enclosing_model(prim_path)
outline_path = model_path or prim_path
break
self.__set_prim_outline(outline_path)
for drop_obj in self.__valid_drops:
instance, drop_data = drop_obj
drop_data['prim_path'] = prim_path
drop_data['model_path'] = model_path
drop_data['world_space_pos'] = world_space_pos
drop_data['picking_mode'] = pick_mode
# Update common ui data changed in _perform_query
drop_data['pixel'] = self.__payload.get('pixel')
drop_data['mouse_ndc'] = self.__payload.get('mouse_ndc')
drop_data['viewport_ndc'] = self.__payload.get('viewport_ndc')
try:
if is_drop:
instance.dropped(drop_data)
elif instance.update_drop_position(drop_data):
updated_drop.append((instance, drop_data))
except Exception:
carb.log_error(f'Traceback:\n{traceback.format_exc()}')
# If it is a drop, then the action is done and clear any cached data
# otherwise store the updated list of valid drops
self.__valid_drops = None if is_drop else updated_drop
def _perform_query(self, ui_obj: ui.Widget, mouse: Sequence[float], is_drop: bool = False):
if not self.__valid_drops:
return
viewport_api = self.viewport_api
if not viewport_api:
return
# Move from screen to local space
mouse = (mouse[0] - ui_obj.screen_position_x, mouse[1] - ui_obj.screen_position_y)
# Move from ui to normalized space (0-1)
mouse = (mouse[0] / ui_obj.computed_width, mouse[1] / ui_obj.computed_height)
# Move from normalized space to normalized device space (-1, 1)
mouse = ((mouse[0] - 0.5) * 2.0, (mouse[1] - 0.5) * -2.0)
self.__payload['mouse_ndc'] = mouse
mouse, valid = viewport_api.map_ndc_to_texture_pixel(mouse)
resolution = viewport_api.resolution
vp_ndc = (mouse[0] / resolution[0], mouse[1] / resolution[1])
vp_ndc = ((vp_ndc[0] - 0.5) * 2.0, (vp_ndc[1] - 0.5) * -2.0)
self.__payload['pixel'] = mouse
self.__payload['viewport_ndc'] = vp_ndc
if valid and viewport_api.stage:
perform_raycast_query(
viewport_api=viewport_api,
mouse_ndc=self.__payload['mouse_ndc'],
mouse_pixel=mouse,
on_complete_fn=lambda *args: self.__query_complete(is_drop, *args),
query_name='omni.kit.viewport.dragdrop.DragDropHandler'
)
else:
self.__query_complete(is_drop, '', (0, 0, 0))
def accepted(self, ui_obj: ui.Widget, url_data: str):
self.__dropped = False
self.__valid_drops = None
add_outline = False
drops = []
for instance in DragDropDelegate.get_instances():
for url in url_data.splitlines():
try:
# Copy the master payload so no delegates can change it
payload = self.__payload.copy()
# Push current url into the local payload
payload['mime_data'] = url
if instance.accepted(payload):
drops.append((instance, payload))
add_outline = add_outline or instance.add_outline
except Exception:
carb.log_error(f'Traceback:\n{traceback.format_exc()}')
if drops:
self.__valid_drops = drops
self.__add_outline = add_outline
# Save this for comparison later (mime_data should be constant across the drg-drop event)
self.__payload['accepted_mime_data'] = url_data
return True
return False
def dropped(self, ui_obj: ui.Widget, event: ui._ui.WidgetMouseDropEvent):
# Save this off now
if self.__payload.get('accepted_mime_data') != event.mime_data:
carb.log_error(
"Mime data changed between accepeted and dropped\n"
+ f" accepted: {self.__payload.get('accepted_mime_data')}\n"
+ f" dropped: {event.mime_data}"
)
return
self.__dropped = True
self._perform_query(ui_obj, (event.x, event.y), True)
def cancel(self, ui_obj: ui.Widget):
prev_drops, self.__valid_drops = self.__valid_drops, []
self.__set_prim_outline()
for drop_obj in prev_drops:
try:
drop_obj[0].cancel(drop_obj[1])
except Exception:
carb.log_error(f'Traceback:\n{traceback.format_exc()}')
| 10,846 | Python | 44.767932 | 127 | 0.584271 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/dragdrop/__init__.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ['DragDropDelegate', 'create_drop_helper']
from .delegate import DragDropDelegate
from .legacy import create_drop_helper
| 566 | Python | 39.499997 | 76 | 0.79682 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/dragdrop/usd_file_drop_delegate.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ['UsdFileDropDelegate']
from .scene_drop_delegate import SceneDropDelegate
import omni.usd
import omni.kit.commands
from pxr import Gf, Sdf, Usd, UsdGeom
import carb
import os
class UsdFileDropDelegate(SceneDropDelegate):
def __init__(self, preview_setting: str = None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.__drag_to_open = False
self.__world_space_pos = None
self.__alternate_drop_marker = False
self.__pickable_collection = None
self.__preview_setting = preview_setting
# Method to allow subclassers to test url and keep all other default behavior
def ignore_url(self, url: str):
# Validate it's a USD file and there is a Stage or UsdContet to use
if not omni.usd.is_usd_readable_filetype(url):
return True
# Early out for other .usda handlers that claim the protocol
if super().is_ignored_protocol(url):
return True
if super().is_ignored_extension(url):
return True
return False
# Test if the drop should do a full preview or just a cross-hair
def drop_should_disable_preview(self):
# The case with no Usd.Stage in the UsdContext, cannot preview anything
if self.__drag_to_open:
return True
# Test if there is a seting holding whether to preview or not, and invert it
if self.__preview_setting:
return False if carb.settings.get_settings().get(self.__preview_setting) else True
return False
# Subclasses can override to provide a different -alternate- behavior. Default is to fallback to crosshairs
def add_alternate_drop_marker(self, drop_data: dict, world_space_pos: Gf.Vec3d):
self.__alternate_drop_marker = True
self.__world_space_pos = world_space_pos
super().add_drop_marker(drop_data, world_space_pos)
# Subclasses can override to clean out their -alternate- behavior.
def remove_alternate_drop_marker(self, drop_data: dict):
if self.__alternate_drop_marker:
self.__world_space_pos = None
super().remove_drop_marker(drop_data)
def reset_state(self):
self.__pickable_collection = None
return super().reset_state()
def accepted(self, drop_data: dict):
# Reset self's state
self.__drag_to_open = False
self.__world_space_pos = None
# Reset super's state
self.reset_state()
url = self.get_url(drop_data)
if self.ignore_url(url):
return False
usd_context, stage = self.get_context_and_stage(drop_data)
if not usd_context:
return False
try:
import omni.kit.window.file
except ImportError:
carb.log_warn('omni.kit.window.file must be present to drop and load a USD file without a stage')
return False
# Validate not dropping a cyclical reference
if stage:
root_layer = stage.GetRootLayer()
if url == self.normalize_sdf_path(root_layer.realPath):
return False
else:
self.__drag_to_open = True
return True
def add_drop_marker(self, drop_data: dict, world_space_pos: Gf.Vec3d):
# Try and add the USD reference, this will invoke super.add_drop_marker
# In the case it can't be accomplished, fallback to an alternate marker.
usd_prim_droped = drop_data.get('usd_prim_droped')
if usd_prim_droped is None:
if self.drop_should_disable_preview():
self.add_alternate_drop_marker(drop_data, world_space_pos)
return
elif self.__alternate_drop_marker:
self.remove_alternate_drop_marker(drop_data)
usd_prim_droped = self.add_usd_drop_marker(drop_data, world_space_pos, True)
if usd_prim_droped is None:
return
drop_data['usd_prim_droped'] = usd_prim_droped
elif self.drop_should_disable_preview():
# If preview was diabled mid-drag, undo the reference operation and add simple cross-hairs
self.remove_drop_marker(drop_data)
self.add_alternate_drop_marker(drop_data, world_space_pos)
return
# Constantly update the Prim's position, but avoid undo so that the reference/drop is what's undoable
omni.kit.commands.create('TransformPrimSRTCommand', path=usd_prim_droped, new_translation=world_space_pos).do()
self.update_pickability(drop_data, False)
def update_pickability(self, drop_data: dict, pickable: bool):
if self.__pickable_collection:
usd_context, _ = self.get_context_and_stage(drop_data)
for sdf_path in self.__pickable_collection:
usd_context.set_pickable(sdf_path.pathString, pickable)
def remove_drop_marker(self, drop_data: dict):
# If usd_prim_droped is None, fallback to super which may have added cross-hair in no-stage case
if drop_data.get('usd_prim_droped'):
omni.kit.undo.undo()
del drop_data['usd_prim_droped']
self.remove_alternate_drop_marker(drop_data)
def dropped(self, drop_data: dict):
# If usd_prim_droped is None, but drop occured fallback to super which may have added cross-hair in no-stage case
usd_prim_droped = drop_data.get('usd_prim_droped')
if usd_prim_droped is not None:
self.update_pickability(drop_data, True)
self.__pickable_collection = None
elif self.drop_should_disable_preview():
super().remove_drop_marker(drop_data)
if self.__drag_to_open:
omni.kit.window.file.open_stage(self.get_url(drop_data).replace(os.sep, '/'))
elif self.__world_space_pos:
usd_prim_path = self.add_usd_drop_marker(drop_data, self.__world_space_pos)
if usd_prim_path:
omni.kit.commands.create('TransformPrimSRTCommand', path=usd_prim_path, new_translation=self.__world_space_pos).do()
def add_usd_drop_marker(self, drop_data: dict, world_space_pos: Gf.Vec3d, pickable_collection: bool = False):
url = self.get_url(drop_data)
usd_context, stage = self.get_context_and_stage(drop_data)
sdf_layer = Sdf.Layer.FindOrOpen(url)
if not sdf_layer:
carb.log_warn(f'Could not get Sdf layer for {url}')
return None
if not sdf_layer.HasDefaultPrim():
message = f"Cannot reference {url} as it has no default prim."
try:
import omni.kit.notification_manager as nm
nm.post_notification(message, status=nm.NotificationStatus.WARNING)
except ImportError:
pass
finally:
carb.log_warn(message)
return None
new_prim_path, edit_context, relative_url = self.add_reference_to_stage(usd_context, stage, url)
if pickable_collection:
self.__pickable_collection = set()
self.__pickable_collection.add(new_prim_path)
for prim in Usd.PrimRange(usd_context.get_stage().GetPrimAtPath(new_prim_path), Usd.TraverseInstanceProxies(Usd.PrimAllPrimsPredicate)):
if prim.IsA(UsdGeom.Gprim):
self.__pickable_collection.add(prim.GetPath())
return new_prim_path
| 7,863 | Python | 41.73913 | 148 | 0.635127 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/dragdrop/legacy.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ['create_drop_helper']
from .delegate import DragDropDelegate
from typing import Callable
class _LegacyDragDropObject(DragDropDelegate):
def __init__(self, add_outline: bool, test_accepted_fn: Callable, drop_fn: Callable, pick_complete: Callable):
super().__init__()
self.__add_outline = add_outline
self.__test_accepted_fn = test_accepted_fn
self.__dropped = drop_fn
self.__pick_complete = pick_complete
@property
def add_outline(self):
return self.__add_outline
def accepted(self, drop_data: dict):
url = drop_data['mime_data']
return self.__test_accepted_fn(url) if self.__test_accepted_fn else False
def dropped(self, drop_data: dict):
url = drop_data['mime_data']
if (self.__dropped is not None) and url and self.accepted(drop_data):
prim_path = drop_data.get('prim_path')
prim_path = prim_path.pathString if prim_path else ''
usd_context_name = drop_data.get('usd_context_name', '')
payload = self.__dropped(url, prim_path, '', usd_context_name)
if payload and self.__pick_complete:
self.__pick_complete(payload, prim_path, usd_context_name)
def create_drop_helper(pickable: bool = False, add_outline: bool = True, on_drop_accepted_fn: Callable = None, on_drop_fn: Callable = None, on_pick_fn: Callable = None):
"""Add a viewport drop handler.
Args:
pickable (bool): Deprecated, use on_pick_fn to signal you want picking.
add_outline (False): True to add outline to picked prim when dropping.
on_drop_accepted_fn (Callable): Callback function to check if drop helper could handle the dragging payload.
Return True if payload accepted by this drop helper and will handle dropping later.
Args:
url (str): url in the payload.
on_drop_fn (Callable): Callback function to handle dropping. Return a payload that evaluates to True in order to block other drop handlers.
Args:
url (str): url in the payload.
target (str): picked prim path to drop.
viewport_name (str): name of viewport window.
usd_context_name (str): name of dropping usd context.
on_pick_fn (Callable): Callback function to handle pick.
Args:
payload (Any): Return value from from on_drop_fn.
target (str): picked prim path.
usd_context_name (str): name of picked usd context.
"""
if pickable:
import carb
carb.log_warn('pickable argument to create_drop_helper is deprecated, use on_pick_fn')
return _LegacyDragDropObject(add_outline, on_drop_accepted_fn, on_drop_fn, on_pick_fn)
| 3,167 | Python | 44.913043 | 169 | 0.666246 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/dragdrop/scene_drop_delegate.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ['SceneDropDelegate']
from .delegate import DragDropDelegate
import omni.usd
import omni.ui as ui
from omni.ui import scene as sc
from pxr import Gf, Tf, Sdf, Usd, UsdGeom
import carb
import os
from typing import Sequence, Tuple
class SceneDropDelegate(DragDropDelegate):
# XXX: We know these have a meanining that we don't handle, so early out
__g_ignore_protocols = set(('sky::', 'material::'))
__g_ignore_extensions = set()
@staticmethod
def add_ignored_protocol(protocol: str):
'''Add a protocol that should be ignored by default file-handlers'''
SceneDropDelegate.__g_ignore_protocols.add(protocol)
@staticmethod
def remove_ignored_protocol(protocol: str):
'''Remove a protocol that should be ignored by default file-handlers'''
SceneDropDelegate.__g_ignore_protocols.discard(protocol)
@staticmethod
def add_ignored_extension(extension: str):
'''Add a file extension that should be ignored by default file-handlers'''
SceneDropDelegate.__g_ignore_extensions.add(extension)
@staticmethod
def remove_ignored_extension(extension: str):
'''Remove a file extension that should no longer be ignored by default file-handlers'''
SceneDropDelegate.__g_ignore_extensions.discard(extension)
@staticmethod
def is_ignored_protocol(url: str):
'''Early out for other protocol handlers that claim the format'''
for protocol in SceneDropDelegate.__g_ignore_protocols:
if url.startswith(protocol):
return True
return False
@staticmethod
def is_ignored_extension(url: str):
'''Early out for other extension handlers that claim the format'''
for extension in SceneDropDelegate.__g_ignore_extensions:
if url.endswith(extension):
return True
return False
def __init__(self, *args, **kw_args):
super().__init__(*args, **kw_args)
self.__ndc_z = None
self.__color = None
self.__transform = None
self.__xf_to_screen = None
self.__max_plane_dist = 0
try:
max_plane_dist = carb.settings.get_settings().get("/exts/omni.kit.viewport.window/dragDrop/maxPlaneDistance")
max_plane_dist = float(max_plane_dist)
self.__max_plane_dist = max_plane_dist if max_plane_dist >= 0 else 0
except ValueError:
pass
@property
def add_outline(self) -> bool:
return True
@property
def honor_picking_mode(self) -> bool:
return False
def reset_state(self):
# Reset any previous cached drag-drop info
self.__ndc_z = None
self.__color = None
def accepted(self, drop_data: dict):
self.reset_state()
return True
def update_drop_position(self, drop_data: dict):
self.__color = drop_data['locator_color']
world_space_pos = self._get_world_position(drop_data)
if world_space_pos:
self.add_drop_marker(drop_data, world_space_pos)
return True
def dropped(self, drop_data: dict):
self.remove_drop_marker(drop_data)
def cancel(self, drop_data: dict):
self.remove_drop_marker(drop_data)
# Helper methods to inspect drop_data
def get_url(self, drop_data: dict):
return drop_data.get('mime_data')
def get_context_and_stage(self, drop_data: dict):
usd_context = omni.usd.get_context(drop_data['usd_context_name'])
return (usd_context, usd_context.get_stage()) if usd_context else (None, None)
@property
def color(self):
return self.__color
def make_prim_path(self, stage: Usd.Stage, url: str, prim_path: Sdf.Path = None, prim_name: str = None):
'''Make a new/unique prim path for the given url'''
if prim_path is None:
if stage.HasDefaultPrim():
prim_path = stage.GetDefaultPrim().GetPath()
else:
prim_path = Sdf.Path.absoluteRootPath
if prim_name is None:
prim_name = Tf.MakeValidIdentifier(os.path.basename(os.path.splitext(url)[0]))
return Sdf.Path(omni.usd.get_stage_next_free_path(stage, prim_path.AppendChild(prim_name).pathString, False))
def create_instanceable_reference(self, usd_context, stage: Usd.Stage, url: str, prim_path: str) -> bool:
'''Return whether to create the reference as instanceable=True'''
return carb.settings.get_settings().get('/persistent/app/stage/instanceableOnCreatingReference')
def create_as_payload(self, usd_context, stage: Usd.Stage, url: str, prim_path: str):
'''Return whether to create as a reference or payload'''
dd_import = carb.settings.get_settings().get('/persistent/app/stage/dragDropImport')
return dd_import == 'payload'
def normalize_sdf_path(self, sdf_layer_path: str):
return sdf_layer_path.replace('\\', '/')
def make_relative_to_layer(self, stage: Usd.Stage, url: str) -> str:
# XXX: PyBind omni::usd::UsdUtils::makePathRelativeToLayer
stage_layer = stage.GetEditTarget().GetLayer()
if not stage_layer.anonymous and not Sdf.Layer.IsAnonymousLayerIdentifier(url):
stage_layer_path = stage_layer.realPath
if self.normalize_sdf_path(stage_layer_path) == url:
carb.log_warn(f'Cannot reference {url} onto itself')
return
relative_url = omni.client.make_relative_url(stage_layer_path, url)
if relative_url:
# omniverse path can have '\'
return relative_url.replace('\\', '/')
return url
def add_reference_to_stage(self, usd_context, stage: Usd.Stage, url: str) -> Tuple[str, Usd.EditContext, str]:
'''Add a Usd.Prim to an exiting Usd.Stage, pointing to the url'''
# Get a realtive URL if possible
relative_url = self.make_relative_to_layer(stage, url)
# When in auto authoring mode, don't create it in the current edit target
# as it will be cleared each time to be moved to default edit layer.
edit_context = None
layers = usd_context.get_layers()
if layers and layers.get_layer_edit_mode() == omni.usd.LayerEditMode.AUTO_AUTHORING:
default_identifier = layers.get_default_edit_layer_identifier()
edit_layer = Sdf.Layer.Find(default_identifier)
if edit_layer is None:
edit_layer = stage.GetRootLayer()
edit_context = Usd.EditContext(stage, edit_layer)
new_prim_path = self.make_prim_path(stage, url)
instanceable = self.create_instanceable_reference(usd_context, stage, url, new_prim_path)
as_payload = self.create_as_payload(usd_context, stage, url, new_prim_path)
cmd_name = 'CreatePayloadCommand' if as_payload else 'CreateReferenceCommand'
omni.kit.commands.execute(cmd_name, usd_context=usd_context, path_to=new_prim_path, asset_path=url, instanceable=instanceable)
return (new_prim_path, edit_context, relative_url)
# Meant to be overriden by subclasses to draw drop information
# Default draws a cross-hair in omni.ui.scene
def add_drop_shape(self, world_space_pos: Gf.Vec3d, scale: float = 50, thickness: float = 1, color: ui.color = None):
self.__xf_to_screen = sc.Transform(scale_to=sc.Space.SCREEN)
with self.__xf_to_screen:
sc.Line((-scale, 0, 0), (scale, 0, 0), color=color, thickness=thickness)
sc.Line((0, -scale, 0), (0, scale, 0), color=color, thickness=thickness)
sc.Line((0, 0, -scale), (0, 0, scale), color=color, thickness=thickness)
def add_drop_marker(self, drop_data: dict, world_space_pos: Gf.Vec3d):
if not self.__transform:
scene_view = drop_data['scene_view']
if scene_view:
with scene_view.scene:
self.__transform = sc.Transform()
with self.__transform:
self.add_drop_shape(world_space_pos, color=self.color)
if self.__transform:
self.__transform.transform = [
1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0,
world_space_pos[0], world_space_pos[1], world_space_pos[2], 1
]
return self.__transform
def remove_drop_marker(self, drop_data: dict):
if self.__xf_to_screen:
self.__xf_to_screen.clear()
self.__xf_to_screen = None
if self.__transform:
self.__transform.clear()
self.__transform = None
# Semi and fully private methods
def __cache_screen_ndc(self, viewport_api, world_space_pos: Gf.Vec3d):
screen_space_pos = viewport_api.world_to_ndc.Transform(world_space_pos)
self.__ndc_z = screen_space_pos[2]
def _get_world_position_object(self, viewport_api, world_space_pos: Gf.Vec3d, drop_data: dict) -> Tuple[Gf.Vec3d, bool]:
"""Return a world-space position that is located between two objects as mouse is dragged over them"""
success = False
# If previosuly dragged over an object, use that as the depth to drop onto
if self.__ndc_z is None:
# Otherwise use the camera's center-of-interest as the depth
camera = viewport_api.stage.GetPrimAtPath(viewport_api.camera_path)
coi_attr = camera.GetAttribute('omni:kit:centerOfInterest')
if coi_attr:
world_space_pos = viewport_api.transform.Transform(coi_attr.Get(viewport_api.time))
self.__cache_screen_ndc(viewport_api, world_space_pos)
# If we have depth (in NDC), move (x_ndc, y_ndz, z_ndc) to a world-space position
if self.__ndc_z is not None:
success = True
mouse_ndc = drop_data['mouse_ndc']
world_space_pos = viewport_api.ndc_to_world.Transform(Gf.Vec3d(mouse_ndc[0], mouse_ndc[1], self.__ndc_z))
return (world_space_pos, success)
def _get_world_position_plane(self, viewport_api, world_space_pos: Gf.Vec3d, drop_data: dict, mode: str) -> Tuple[Gf.Vec3d, bool]:
success = False
test_one_plane = False
# User can specify plane to test against explicitly
if mode == "z":
up_axis, test_one_plane = UsdGeom.Tokens.z, True
elif mode == "x":
up_axis, test_one_plane = UsdGeom.Tokens.x, True
elif mode == "y":
up_axis, test_one_plane = UsdGeom.Tokens.y, True
else:
# Otherwise test against multiple planes unless mode is 'ground' (single plane test based on scene-up)
up_axis, test_one_plane = UsdGeom.GetStageUpAxis(viewport_api.stage), mode == "ground"
if up_axis == UsdGeom.Tokens.z:
normals = (Gf.Vec3d(0, 0, 1), Gf.Vec3d(0, 1, 0), Gf.Vec3d(1, 0, 0))
elif up_axis == UsdGeom.Tokens.x:
normals = (Gf.Vec3d(1, 0, 0), Gf.Vec3d(0, 1, 0), Gf.Vec3d(0, 0, 1))
else:
normals = (Gf.Vec3d(0, 1, 0), Gf.Vec3d(0, 0, 1), Gf.Vec3d(1, 0, 0))
def create_ray(projection: Gf.Matrix4d, view: Gf.Matrix4d, ndx_x: float, ndc_y: float, ndc_z: float = 0):
pv_imatrix = (view * projection).GetInverse()
origin = pv_imatrix.Transform(Gf.Vec3d(ndx_x, ndc_y, ndc_z))
if projection[3][3] == 1:
# Orthographic is simpler than perspective
dir = Gf.Vec3d(view[0][2], view[1][2], view[2][2]).GetNormalized()
else:
dir = pv_imatrix.Transform(Gf.Vec3d(ndx_x, ndc_y, 0.5))
dir = Gf.Vec3d(dir[0] - origin[0], dir[1] - origin[1], dir[2] - origin[2]).GetNormalized()
return (origin, dir)
def intersect_plane(normal: Gf.Vec3d, ray_orig: Gf.Vec3d, ray_dir: Gf.Vec3d, epsilon: float = 1e-5):
denom = Gf.Dot(normal, ray_dir)
if abs(denom) < epsilon:
return (None, None)
distance = Gf.Dot(-ray_orig, normal) / denom
if distance < epsilon:
return (None, None)
return (ray_orig + ray_dir * distance, distance)
# Build ray origin and direction from mouse NDC co-ordinates
mouse_ndc = drop_data['mouse_ndc']
ray_origin, ray_dir = create_ray(viewport_api.projection, viewport_api.view, mouse_ndc[0], mouse_ndc[1])
# Try normal-0, any hit on that plane wins (the Stage's ground normal)
plane0_pos, plane0_dist = intersect_plane(normals[0], ray_origin, ray_dir)
# Check that the hit distance is within tolerance (or no tolerance specified)
def distance_in_bounds(distance: float) -> bool:
if self.__max_plane_dist > 0:
return distance < self.__max_plane_dist
return True
# Return a successful hit (caching the screen-ndc in case mode fallsback/transitions to object)
def return_valid_position(position: Gf.Vec3d):
self.__cache_screen_ndc(viewport_api, position)
return (position, True)
# If the hit exists and is within the max allowed distance (or no max allowed distance) it wins
if plane0_pos and distance_in_bounds(plane0_dist):
return return_valid_position(plane0_pos)
# If testing more than one plane
if not test_one_plane:
# Check if other planes were hit, and if so use the best/closests
plane1_pos, plane1_dist = intersect_plane(normals[1], ray_origin, ray_dir)
plane2_pos, plane2_dist = intersect_plane(normals[2], ray_origin, ray_dir)
if plane1_pos and distance_in_bounds(plane1_dist):
# plane-1 hit and valid, check if plane-2 also hit and valid and use closest of the two
if plane2_pos and distance_in_bounds(plane2_dist) and (plane2_dist < plane1_dist):
return return_valid_position(plane2_pos)
# Return plane-1, plane-2 was either invalid, further, or above tolerance
return return_valid_position(plane1_pos)
elif plane2_pos and distance_in_bounds(plane2_dist):
# Return plane-2 it is valid and within tolerance
return return_valid_position(plane2_pos)
# Nothing worked, return input and False
return (world_space_pos, False)
def _get_world_position(self, drop_data: dict) -> Gf.Vec3d:
prim_path = drop_data['prim_path']
viewport_api = drop_data['viewport_api']
world_space_pos = drop_data['world_space_pos']
if world_space_pos:
world_space_pos = Gf.Vec3d(*world_space_pos)
# If there is no prim-path, deliver a best guess at world-position
if not prim_path and viewport_api.stage:
success = False
# Can change within a drag-drop operation via hotkey
mode = carb.settings.get_settings().get("/exts/omni.kit.viewport.window/dragDrop/intersectMode") or ""
if mode != "object":
world_space_pos, success = self._get_world_position_plane(viewport_api, world_space_pos, drop_data, mode)
if not success:
world_space_pos, success = self._get_world_position_object(viewport_api, world_space_pos, drop_data)
else:
self.__cache_screen_ndc(viewport_api, world_space_pos)
return world_space_pos
| 15,838 | Python | 44.777457 | 134 | 0.623374 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/dragdrop/material_file_drop_delegate.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ['MaterialFileDropDelegate']
from .usd_prim_drop_delegate import UsdShadeDropDelegate
from pxr import Sdf, Usd, UsdGeom
import carb
import os
import asyncio
from typing import List
class MaterialFileDropDelegate(UsdShadeDropDelegate):
def __init__(self, preview_setting: str = None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.__mdl_future = None
@property
def honor_picking_mode(self):
return True
# Method to allow subclassers to test url and keep all other default behavior
def accept_url(self, url: str) -> str:
# Early out for protocols not understood
if super().is_ignored_protocol(url):
return False
if super().is_ignored_extension(url):
return False
# Validate it's a USD file and there is a Stage or UsdContet to use
url_path, ext = os.path.splitext(url)
if not (ext in ['.mdl']):
return False
return url
def reset_state(self) -> None:
self.__mdl_future = None
super().reset_state()
def accepted(self, drop_data: dict) -> bool:
# Reset state (base-class implemented)
self.reset_state()
# Validate there is a UsdContext and Usd.Stage
usd_context, stage = self.get_context_and_stage(drop_data)
if not usd_context:
return False
# Test if this url should be accepted
url = self.get_url(drop_data)
url = self.accept_url(url)
if (url is None) or (not url):
return False
# Queue any remote MDL parsing
try:
import omni.kit.material.library
asyncio.ensure_future(omni.kit.material.library.get_subidentifier_from_mdl(mdl_file=url, show_alert=False))
except ImportError:
carb.log_error("Cannot import materials as omni.kit.material.library isn't loaded")
return True
def get_material_prim_location(self, stage: Usd.Stage) -> Sdf.Path:
# Place material at /Looks under root or defaultPrim
if stage.HasDefaultPrim():
looks_path = stage.GetDefaultPrim().GetPath()
else:
looks_path = Sdf.Path.absoluteRootPath
return looks_path.AppendChild('Looks')
def get_material_name(self, url: str, need_result: bool) -> List[str]:
try:
import omni.kit.material.library
# Get the material subid's
subid_list = []
def have_subids(id_list):
nonlocal subid_list
subid_list = id_list
asyncio.get_event_loop().run_until_complete(omni.kit.material.library.get_subidentifier_from_mdl(mdl_file=url, on_complete_fn=have_subids))
# covert from SubIDEntry to str
return [id.name for id in subid_list]
except ImportError:
carb.log_error("Cannot import materials as omni.kit.material.library isn't loaded")
return []
def dropped(self, drop_data: dict):
# Validate there is still a UsdContext and Usd.Stage
usd_context, stage = self.get_context_and_stage(drop_data)
if stage is None:
return
url_path = self.accept_url(drop_data.get('mime_data'))
if (url_path is None) or (not url_path):
return
try:
import omni.usd
import omni.kit.commands
omni.kit.undo.begin_group()
looks_path = self.get_material_prim_location(stage)
looks_prim = stage.GetPrimAtPath(looks_path)
looks_prim_valid = looks_prim.IsValid()
if (not looks_prim_valid) or (not UsdGeom.Scope(looks_prim)):
if looks_prim_valid:
looks_path = omni.usd.get_stage_next_free_path(stage, looks_path, False)
looks_path = Sdf.Path(looks_path)
omni.kit.commands.execute('CreatePrimCommand', prim_path=looks_path, prim_type='Scope', select_new_prim=False, context_name=drop_data.get('usd_context_name') or '')
dropped_onto = drop_data.get('prim_path')
dropped_onto_model = drop_data.get('model_path')
mtl_name = self.get_material_name(url_path, True)
num_materials = len(mtl_name) if mtl_name else 0
if num_materials < 1:
raise RuntimeError('Could not get material name from "{url_path}"')
material_prim = self.make_prim_path(stage, url_path, looks_path, mtl_name[0])
if material_prim is None:
return
if True:
try:
from omni.kit.material.library import custom_material_dialog, multi_descendents_dialog
if dropped_onto or dropped_onto_model:
# Dropped onto a Prim, use multi_descendents_dialog to choose subset or prim
def multi_descendent_chosen(prim_path):
if num_materials > 1:
custom_material_dialog(mdl_path=url_path, bind_prim_paths=[prim_path])
else:
with omni.kit.undo.group():
omni.kit.commands.execute('CreateMdlMaterialPrimCommand', mtl_url=url_path, mtl_name=mtl_name[0], mtl_path=material_prim, select_new_prim=False)
omni.kit.commands.execute('BindMaterialCommand', prim_path=prim_path, material_path=material_prim, strength=self.binding_strength)
multi_descendents_dialog(prim_paths=[dropped_onto_model if dropped_onto_model else dropped_onto], on_click_fn=multi_descendent_chosen)
elif num_materials > 1:
# Get the sub-material required
custom_material_dialog(mdl_path=url_path, bind_prim_paths=[dropped_onto])
else:
# One sub-material, not dropped onto a Prim, just create the material
omni.kit.commands.execute('CreateMdlMaterialPrimCommand', mtl_url=url_path, mtl_name=mtl_name[0], mtl_path=material_prim, select_new_prim=False)
return
except ImportError:
pass
# Fallback to UsdShadeDropDelegate.handle_prim_drop
# Need to create the material first
omni.kit.commands.execute('CreateMdlMaterialPrimCommand', mtl_url=url_path, mtl_name=mtl_name[0], mtl_path=material_prim, select_new_prim=False)
material_prim = stage.GetPrimAtPath(material_prim)
if not material_prim.IsValid():
raise RuntimeError(f'Could not create material {material_prim} for "{url_path}"')
# If the material was dropped onto nothing, its been created so done
if not dropped_onto:
return
# handle_prim_drop expects Usd.Prims, not paths
dropped_onto = stage.GetPrimAtPath(dropped_onto)
dropped_onto_model = stage.GetPrimAtPath(dropped_onto_model) if dropped_onto_model else None
self.handle_prim_drop(stage, material_prim, dropped_onto, dropped_onto_model)
except Exception:
import traceback
carb.log_error(traceback.format_exc())
finally:
omni.kit.undo.end_group()
| 7,794 | Python | 40.684492 | 180 | 0.607005 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/dragdrop/audio_file_drop_delegate.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ['AudioFileDropDelegate']
from .scene_drop_delegate import SceneDropDelegate
from pxr import Gf, Tf
import re, os
class AudioFileDropDelegate(SceneDropDelegate):
# Method to allow subclassers to test url and keep all other default behavior
def accept_url(self, url: str) -> str:
# Early out for protocols not understood
if super().is_ignored_protocol(url):
return False
if super().is_ignored_extension(url):
return False
# Validate it's a known Audio file
is_audio = re.compile(r"^.*\.(wav|wave|ogg|oga|flac|fla|mp3|m4a|spx|opus)(\?.*)?$", re.IGNORECASE).match(url)
return url if bool(is_audio) else False
def accepted(self, drop_data: dict) -> bool:
# Reset state (base-class implemented)
self.reset_state()
# Validate there is a UsdContext and Usd.Stage
usd_context, stage = self.get_context_and_stage(drop_data)
if not usd_context:
return False
# Test if this url should be accepted
url = self.get_url(drop_data)
url = self.accept_url(url)
if (url is None) or (not url):
return False
return True
def dropped(self, drop_data: dict):
self.remove_drop_marker(drop_data)
# Validate there is still a UsdContext and Usd.Stage
usd_context, stage = self.get_context_and_stage(drop_data)
if stage is None:
return
url_path = self.accept_url(drop_data.get('mime_data'))
if (url_path is None) or (not url_path):
return
import omni.usd
import omni.kit.commands
url_path = self.make_relative_to_layer(stage, url_path)
prim_path = self.make_prim_path(stage, url_path)
try:
omni.kit.undo.begin_group()
omni.kit.commands.execute('CreateAudioPrimFromAssetPath',
path_to=prim_path, asset_path=url_path, usd_context=usd_context)
world_space_pos = self._get_world_position(drop_data)
if world_space_pos:
omni.kit.commands.execute('TransformPrimCommand',
path=prim_path,
new_transform_matrix=Gf.Matrix4d().SetTranslate(world_space_pos),
usd_context_name=drop_data.get('usd_context_name', ''))
finally:
omni.kit.undo.end_group()
| 2,922 | Python | 35.5375 | 117 | 0.616359 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/scene/layer.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ['ViewportSceneLayer']
import omni.ui as ui
from omni.ui import scene as sc
from omni.kit.viewport.registry import RegisterScene
from .scenes import _flatten_matrix
from ..events import add_event_delegation, remove_event_delegation
from typing import Sequence
import carb
import traceback
import weakref
class _SceneItem():
def __init__(self, transform, instance, factory):
self.__transform = transform
self.__instance = instance
self.__transform.visible = self.__instance.visible
def __repr__(self) -> str:
return f'<class {self.__class__.__name__} {self.__instance}>'
@property
def name(self):
return self.__instance.name
@property
def visible(self):
return self.__transform.visible
@visible.setter
def visible(self, value):
self.__transform.visible = bool(value)
self.__instance.visible = bool(value)
@property
def layers(self):
return tuple()
@property
def categories(self):
return self.__instance.categories
@property
def layer(self):
return self.__instance
def destroy(self):
try:
if hasattr(self.__instance, 'destroy'):
self.__instance.destroy()
except Exception:
carb.log_error(f"Error destroying {self.__instance}. Traceback:\n{traceback.format_exc()}")
self.__instance = None
self.__transform.clear()
self.__transform = None
class ViewportSceneLayer:
"""Viewport Scene Overlay"""
@property
def layers(self):
return self.__scene_items.values()
def __view_changed(self, viewport_api):
self.__scene_view.view = _flatten_matrix(viewport_api.view)
self.__scene_view.projection = _flatten_matrix(viewport_api.projection)
def ___scene_type_added(self, factory):
# Push both our scopes onto the stack, to capture anything that's created
if not self.__scene_view:
viewport_api = self.__factory_args.get('viewport_api')
if not viewport_api:
raise RuntimeError('Cannot create a ViewportSceneLayer without a viewport')
with self.__ui_frame:
self.__scene_view = sc.SceneView(aspect_ratio_policy=sc.AspectRatioPolicy.STRETCH)
add_event_delegation(weakref.proxy(self.__scene_view), viewport_api)
# 1030 Tell the ViewportAPI that we have a SceneView we want it to be updating
if hasattr(viewport_api, 'add_scene_view'):
viewport_api.add_scene_view(self.__scene_view)
self.__view_change_sub = None
else:
self.__view_change_sub = viewport_api.subscribe_to_view_change(self.__view_changed)
# 1030 Fixes menu issue triggering selection (should remove hasattr pre 103-final)
if hasattr(self.__scene_view, 'child_windows_input'):
self.__scene_view.child_windows_input = False
with self.__scene_view.scene:
transform = sc.Transform()
with transform:
try:
# Shallow copy, but should help keeping any errant extensions from messing with one-another
instance = factory(self.__factory_args.copy())
if instance:
self.__scene_items[factory] = _SceneItem(transform, instance, factory)
except Exception:
carb.log_error(f"Error loading {factory}. Traceback:\n{traceback.format_exc()}")
def ___scene_type_removed(self, factory):
scene = self.__scene_items.get(factory)
if not scene:
return
scene.destroy()
del self.__scene_items[factory]
# Cleanup if we know we're empty
if not self.__scene_items and self.__scene_view:
self.__scene_view.destroy()
self.__scene_view = None
self.__dd_handler = None
def ___scene_type_notification(self, factory, loading):
if loading:
self.___scene_type_added(factory)
else:
self.___scene_type_removed(factory)
def __init__(self, factory_args, *args, **kwargs):
super().__init__(*args, **kwargs)
self.__scene_items = {}
self.__factory_args = factory_args
self.__ui_frame = ui.Frame()
self.__scene_view = None
self.__dd_handler = None
RegisterScene.add_notifier(self.___scene_type_notification)
def __del__(self):
self.destroy()
def destroy(self):
remove_event_delegation(self.__scene_view)
RegisterScene.remove_notifier(self.___scene_type_notification)
self.__dd_handler = None
for factory, instance in self.__scene_items.items():
try:
if hasattr(instance, 'destroy'):
instance.destroy()
except Exception:
carb.log_error(f"Error destroying {instance} from {factory}. Traceback:\n{traceback.format_exc()}")
if self.__scene_view:
scene_view, self.__scene_view = self.__scene_view, None
scene_view.destroy()
viewport_api = self.__factory_args.get('viewport_api')
if viewport_api:
if hasattr(viewport_api, 'remove_scene_view'):
viewport_api.remove_scene_view(scene_view)
else:
self.__view_change_sub = None
if self.__ui_frame:
self.__ui_frame.destroy()
self.__ui_frame = None
self.__scene_items = {}
self.__factory_args = None
| 6,070 | Python | 35.136905 | 115 | 0.602965 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/scene/scenes.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ['ViewportSceneView', 'SimpleGrid', 'SimpleOrigin', 'CameraAxis']
from typing import Optional, Sequence
import omni.ui
from omni.ui import (
scene as sc,
color as cl
)
from pxr import UsdGeom, Gf
import carb
# Simple scene items that don't yet warrant a devoted extension
def _flatten_matrix(matrix: Gf.Matrix4d):
m0, m1, m2, m3 = matrix[0], matrix[1], matrix[2], matrix[3]
return [m0[0], m0[1], m0[2], m0[3],
m1[0], m1[1], m1[2], m1[3],
m2[0], m2[1], m2[2], m2[3],
m3[0], m3[1], m3[2], m3[3]]
def _flatten_rot_matrix(matrix: Gf.Matrix3d):
m0, m1, m2 = matrix[0], matrix[1], matrix[2]
return [m0[0], m0[1], m0[2], 0,
m1[0], m1[1], m1[2], 0,
m2[0], m2[1], m2[2], 0,
0, 0, 0, 1]
class SimpleGrid:
def __init__(self, vp_args, lineCount: float = 100, lineStep: float = 10, thicknes: float = 1, color: cl = cl(0.25)):
self.__viewport_grid_vis_sub: Optional[carb.SubscriptionId] = None
self.__transform: sc.Transform = sc.Transform()
with self.__transform:
for i in range(lineCount * 2 + 1):
sc.Line(
((i - lineCount) * lineStep, 0, -lineCount * lineStep),
((i - lineCount) * lineStep, 0, lineCount * lineStep),
color=color, thickness=thicknes,
)
sc.Line(
(-lineCount * lineStep, 0, (i - lineCount) * lineStep),
(lineCount * lineStep, 0, (i - lineCount) * lineStep),
color=color, thickness=thicknes,
)
self.__vc_change = None
viewport_api = vp_args.get('viewport_api')
if viewport_api:
self.__vc_change = viewport_api.subscribe_to_view_change(self.__view_changed)
self.__viewport_api_id: str = str(viewport_api.id)
self.__viewport_grid_vis_sub = carb.settings.get_settings().subscribe_to_node_change_events(
f"/persistent/app/viewport/{self.__viewport_api_id}/guide/grid/visible",
self.__viewport_grid_display_changed
)
self.__viewport_grid_display_changed(None, carb.settings.ChangeEventType.CHANGED)
def __del__(self):
self.destroy()
def __view_changed(self, viewport_api):
stage = viewport_api.stage
up = UsdGeom.GetStageUpAxis(stage) if stage else None
if up == UsdGeom.Tokens.z:
self.__transform.transform = [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1]
elif up == UsdGeom.Tokens.x:
self.__transform.transform = [0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]
else:
self.__transform.transform = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
def __viewport_grid_display_changed(self, item: carb.dictionary.Item, event_type: carb.settings.ChangeEventType):
if event_type == carb.settings.ChangeEventType.CHANGED:
key = f"/persistent/app/viewport/{self.__viewport_api_id}/guide/grid/visible"
self.visible = bool(carb.settings.get_settings().get(key))
@property
def name(self):
return 'Grid'
@property
def categories(self):
return ['guide']
@property
def visible(self):
return self.__transform.visible
@visible.setter
def visible(self, value):
self.__transform.visible = bool(value)
def destroy(self):
if self.__viewport_grid_vis_sub is not None:
carb.settings.get_settings().unsubscribe_to_change_events(self.__viewport_grid_vis_sub)
self.__viewport_grid_vis_sub = None
if self.__vc_change:
self.__vc_change.destroy()
self.__vc_change = None
class SimpleOrigin:
def __init__(self, desc: dict, visible: bool = False, length: float = 5, thickness: float = 4):
self.__viewport_origin_vis_sub: Optional[carb.SubscriptionId] = None
self._transform: sc.Transform = sc.Transform(visible=visible)
with self._transform:
origin = (0, 0, 0)
sc.Line(origin, (length, 0, 0), color=cl.red, thickness=thickness)
sc.Line(origin, (0, length, 0), color=cl.green, thickness=thickness)
sc.Line(origin, (0, 0, length), color=cl.blue, thickness=thickness)
viewport_api = desc.get('viewport_api')
if not viewport_api:
raise RuntimeError('Cannot create CameraAxisLayer without a viewport')
self.__viewport_api_id: str = str(viewport_api.id)
self.__viewport_origin_vis_sub = carb.settings.get_settings().subscribe_to_node_change_events(
f"/persistent/app/viewport/{self.__viewport_api_id}/guide/origin/visible",
self.__viewport_origin_display_changed
)
self.__viewport_origin_display_changed(None, carb.settings.ChangeEventType.CHANGED)
def __viewport_origin_display_changed(self, item: carb.dictionary.Item, event_type: carb.settings.ChangeEventType):
if event_type == carb.settings.ChangeEventType.CHANGED:
key = f"/persistent/app/viewport/{self.__viewport_api_id}/guide/origin/visible"
self.visible = bool(carb.settings.get_settings().get(key))
@property
def name(self):
return 'Origin'
@property
def categories(self):
return ['guide']
@property
def visible(self):
return self._transform.visible
@visible.setter
def visible(self, value):
self._transform.visible = bool(value)
def destroy(self):
if self.__viewport_origin_vis_sub:
carb.settings.get_settings().unsubscribe_to_change_events(self.__viewport_origin_vis_sub)
self.__viewport_origin_vis_sub = None
class CameraAxisLayer:
CAMERA_AXIS_DEFAULT_SIZE = (60, 60)
CAMERA_AXIS_SIZE_SETTING = "/app/viewport/defaults/guide/axis/size"
def __init__(self, desc: dict):
self.__transform = None
self.__scene_view = None
self.__vc_change = None
self.__root = None
self.__change_event_subs: Optional[Sequence[carb.SubscriptionId]] = None
viewport_api = desc.get('viewport_api')
if not viewport_api:
raise RuntimeError('Cannot create CameraAxisLayer without a viewport')
settings = carb.settings.get_settings()
size = settings.get(CameraAxisLayer.CAMERA_AXIS_SIZE_SETTING) or CameraAxisLayer.CAMERA_AXIS_DEFAULT_SIZE
alignment = omni.ui.Alignment.LEFT_BOTTOM
direction = omni.ui.Direction.BOTTOM_TO_TOP
self.__root = omni.ui.Stack(direction)
with self.__root:
self.__scene_view = sc.SceneView(
alignment=alignment,
width=omni.ui.Length(size[0]),
height=omni.ui.Length(size[1])
)
omni.ui.Spacer()
thickness = 2
length = 0.5
text_offset = length + 0.25
text_size = 14
colors = (
(0.6666, 0.3765, 0.3765, 1.0),
(0.4431, 0.6392, 0.4627, 1.0),
(0.3098, 0.4901, 0.6274, 1.0),
)
labels = ('X', 'Y', 'Z')
with self.__scene_view.scene:
origin = (0, 0, 0)
self.__transform = sc.Transform()
with self.__transform:
for i in range(3):
color = colors[i]
vector = [0, 0, 0]
vector[i] = length
sc.Line(origin, vector, color=color, thickness=thickness)
vector[i] = text_offset
with sc.Transform(transform=sc.Matrix44.get_translation_matrix(vector[0], vector[1], vector[2])):
sc.Label(labels[i], color=color, alignment=omni.ui.Alignment.CENTER, size=text_size)
self.__vc_change = viewport_api.subscribe_to_view_change(self.__view_changed)
self.__viewport_api_id: str = str(viewport_api.id)
self.__change_event_subs = (
settings.subscribe_to_node_change_events(
f"/persistent/app/viewport/{self.__viewport_api_id}/guide/axis/visible",
self.__viewport_axis_display_changed
),
settings.subscribe_to_node_change_events(
f"{CameraAxisLayer.CAMERA_AXIS_SIZE_SETTING}/0", self.__viewport_axis_size_changed
),
settings.subscribe_to_node_change_events(
f"{CameraAxisLayer.CAMERA_AXIS_SIZE_SETTING}/1", self.__viewport_axis_size_changed
)
)
self.__viewport_axis_display_changed(None, carb.settings.ChangeEventType.CHANGED)
def __view_changed(self, viewport_api):
self.__transform.transform = _flatten_rot_matrix(viewport_api.view.GetOrthonormalized().ExtractRotationMatrix())
def __viewport_axis_display_changed(self, item: carb.dictionary.Item, event_type: carb.settings.ChangeEventType):
if event_type == carb.settings.ChangeEventType.CHANGED:
key = f"/persistent/app/viewport/{self.__viewport_api_id}/guide/axis/visible"
self.visible = bool(carb.settings.get_settings().get(key))
def __viewport_axis_size_changed(self, item: carb.dictionary.Item, event_type: carb.settings.ChangeEventType):
if event_type == carb.settings.ChangeEventType.CHANGED:
size = carb.settings.get_settings().get(CameraAxisLayer.CAMERA_AXIS_SIZE_SETTING)
if len(size) == 2:
self.__scene_view.width, self.__scene_view.height = omni.ui.Length(size[0]), omni.ui.Length(size[1])
def destroy(self):
if self.__change_event_subs:
settings = carb.settings.get_settings()
for sub in self.__change_event_subs:
settings.unsubscribe_to_change_events(sub)
self.__change_event_subs = None
if self.__vc_change:
self.__vc_change.destroy()
self.__vc_change = None
if self.__transform:
self.__transform.clear()
self.__transform = None
if self.__scene_view:
self.__scene_view.destroy()
self.__scene_view = None
if self.__root:
self.__root.clear()
self.__root.destroy()
self.__root = None
@property
def visible(self):
return self.__root.visible
@visible.setter
def visible(self, value):
self.__root.visible = value
@property
def categories(self):
return ['guide']
@property
def name(self):
return 'Axis'
| 10,992 | Python | 38.260714 | 121 | 0.592431 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/scene/legacy.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ['LegacyGridScene', 'LegacyLightScene', 'LegacyAudioScene']
import carb
import omni.usd
from pxr import UsdGeom
class LegacyGridScene:
AUTO_TRACK_PATH = '/app/viewport/grid/trackCamera'
def __init__(self, desc: dict, *args, **kwargs):
self.__vc_change = None
self.__viewport_grid_vis_sub = None
self.__auto_track_sub = None
self.__usd_context_name = desc['usd_context_name']
self.__viewport_api = desc.get('viewport_api')
settings = carb.settings.get_settings()
self.__viewport_grid_vis_sub = settings.subscribe_to_node_change_events(
f"/persistent/app/viewport/{self.__viewport_api.id}/guide/grid/visible",
self.__viewport_grid_display_changed
)
self.__auto_track_sub = settings.subscribe_to_node_change_events(
"/app/viewport/grid/trackCamera",
self.__auto_track_changed
)
self.__viewport_grid_display_changed(None, carb.settings.ChangeEventType.CHANGED)
self.__auto_track_changed()
def __setup_view_tracking(self):
if self.__vc_change:
return
self.__persp_grid = 'XZ'
self.__last_grid = None
self.__on_stage_opened(self.stage)
self.__stage_sub = self.usd_context.get_stage_event_stream().create_subscription_to_pop(
self.__on_usd_context_event, name='LegacyGridScene StageUp watcher'
)
self.__vc_change = self.__viewport_api.subscribe_to_view_change(self.__view_changed)
def __destroy_view_tracking(self, settings):
self.__stage_sub = None
if self.__vc_change:
self.__vc_change.destroy()
self.__vc_change = None
@property
def usd_context(self):
return omni.usd.get_context(self.__usd_context_name)
@property
def stage(self):
return self.usd_context.get_stage()
def __auto_track_changed(self, *args, **kwargs):
settings = carb.settings.get_settings()
if settings.get(self.AUTO_TRACK_PATH):
self.__destroy_view_tracking(settings)
else:
self.__setup_view_tracking()
def __on_usd_context_event(self, event: carb.events.IEvent):
if event.type == int(omni.usd.StageEventType.OPENED):
self.__on_stage_opened(self.stage)
def __set_grid(self, grid: str):
if self.__last_grid != grid:
self.__last_grid = grid
carb.settings.get_settings().set('/app/viewport/grid/plane', grid)
def __on_stage_opened(self, stage):
up = UsdGeom.GetStageUpAxis(stage) if stage else None
if up == UsdGeom.Tokens.x:
self.__persp_grid = 'YZ'
elif up == UsdGeom.Tokens.z:
self.__persp_grid = 'XY'
else:
self.__persp_grid = 'XZ'
def __view_changed(self, viewport_api):
is_ortho = viewport_api.projection[3][3] == 1
if is_ortho:
ortho_dir = viewport_api.transform.TransformDir((0, 0, 1))
ortho_dir = [abs(v) for v in ortho_dir]
if ortho_dir[1] > ortho_dir[0] and ortho_dir[1] > ortho_dir[2]:
self.__set_grid('XZ')
elif ortho_dir[2] > ortho_dir[0] and ortho_dir[2] > ortho_dir[1]:
self.__set_grid('XY')
else:
self.__set_grid('YZ')
else:
self.__on_stage_opened(viewport_api.stage)
self.__set_grid(self.__persp_grid)
def __viewport_grid_display_changed(self, item: carb.dictionary.Item, event_type: carb.settings.ChangeEventType):
if event_type == carb.settings.ChangeEventType.CHANGED:
key = f"/persistent/app/viewport/{self.__viewport_api.id}/guide/grid/visible"
self.visible = bool(carb.settings.get_settings().get(key))
@property
def name(self):
return 'Grid (legacy)'
@property
def categories(self):
return ['guide']
@property
def visible(self):
return carb.settings.get_settings().get('/app/viewport/grid/enabled')
@visible.setter
def visible(self, value):
carb.settings.get_settings().set('/app/viewport/grid/enabled', bool(value))
return self.visible
def destroy(self):
settings = carb.settings.get_settings()
self.__destroy_view_tracking(settings)
if self.__viewport_grid_vis_sub is not None:
settings.unsubscribe_to_change_events(self.__viewport_grid_vis_sub)
self.__viewport_grid_vis_sub = None
if self.__auto_track_sub is not None:
settings.unsubscribe_to_change_events(self.__auto_track_sub)
self.__auto_track_sub = None
class LegacyLightScene:
def __init__(self, *args, **kwargs):
carb.settings.get_settings().set_default('/app/viewport/show/lights', True)
@property
def name(self):
return 'Lights (legacy)'
@property
def categories(self):
return ['scene']
@property
def visible(self):
return carb.settings.get_settings().get('/app/viewport/show/lights')
@visible.setter
def visible(self, value):
carb.settings.get_settings().set('/app/viewport/show/lights', bool(value))
return self.visible
def destroy(self):
pass
class LegacyAudioScene:
def __init__(self, *args, **kwargs):
carb.settings.get_settings().set_default('/app/viewport/show/audio', True)
@property
def name(self):
return 'Audio (legacy)'
@property
def categories(self):
return ['scene']
@property
def visible(self):
return carb.settings.get_settings().get('/app/viewport/show/audio')
@visible.setter
def visible(self, value):
carb.settings.get_settings().set('/app/viewport/show/audio', bool(value))
return self.visible
def destroy(self):
pass
| 6,306 | Python | 32.547872 | 117 | 0.615604 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/manipulator/camera.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ['ViewportCameraManiulatorFactory']
from omni.kit.manipulator.camera import ViewportCameraManipulator
import omni.kit.app
import carb
class ViewportCameraManiulatorFactory:
VP1_CAM_VELOCITY = '/persistent/app/viewport/camMoveVelocity'
VP1_CAM_INERTIA_ENABLED = '/persistent/app/viewport/camInertiaEnabled'
VP1_CAM_INERTIA_SEC = '/persistent/app/viewport/camInertiaAmount'
VP1_CAM_ROTATIONAL_STEP = '/persistent/app/viewport/camFreeRotationStep'
VP1_CAM_LOOK_SPEED = '/persistent/app/viewport/camYawPitchSpeed'
VP2_FLY_ACCELERATION = '/persistent/app/viewport/manipulator/camera/flyAcceleration'
VP2_FLY_DAMPENING = '/persistent/app/viewport/manipulator/camera/flyDampening'
VP2_LOOK_ACCELERATION = '/persistent/app/viewport/manipulator/camera/lookAcceleration'
VP2_LOOK_DAMPENING = '/persistent/app/viewport/manipulator/camera/lookDampening'
def __init__(self, desc: dict, *args, **kwargs):
self.__manipulator = ViewportCameraManipulator(desc.get('viewport_api'))
def setting_changed(value, event_type, set_fn):
if event_type != carb.settings.ChangeEventType.CHANGED:
return
set_fn(value.get('', None))
self.__setting_subs = (
omni.kit.app.SettingChangeSubscription(ViewportCameraManiulatorFactory.VP1_CAM_VELOCITY, lambda *args: setting_changed(*args, self.__set_flight_velocity)),
omni.kit.app.SettingChangeSubscription(ViewportCameraManiulatorFactory.VP1_CAM_INERTIA_ENABLED, lambda *args: setting_changed(*args, self.__set_inertia_enabled)),
omni.kit.app.SettingChangeSubscription(ViewportCameraManiulatorFactory.VP1_CAM_INERTIA_SEC, lambda *args: setting_changed(*args, self.__set_inertia_seconds)),
omni.kit.app.SettingChangeSubscription(ViewportCameraManiulatorFactory.VP2_FLY_ACCELERATION, lambda *args: setting_changed(*args, self.__set_flight_acceleration)),
omni.kit.app.SettingChangeSubscription(ViewportCameraManiulatorFactory.VP2_FLY_DAMPENING, lambda *args: setting_changed(*args, self.__set_flight_dampening)),
omni.kit.app.SettingChangeSubscription(ViewportCameraManiulatorFactory.VP2_LOOK_ACCELERATION, lambda *args: setting_changed(*args, self.__set_look_acceleration)),
omni.kit.app.SettingChangeSubscription(ViewportCameraManiulatorFactory.VP2_LOOK_DAMPENING, lambda *args: setting_changed(*args, self.__set_look_dampening))
)
settings = carb.settings.get_settings()
settings.set_default(ViewportCameraManiulatorFactory.VP1_CAM_VELOCITY, 5.0)
settings.set_default(ViewportCameraManiulatorFactory.VP1_CAM_INERTIA_ENABLED, False)
settings.set_default(ViewportCameraManiulatorFactory.VP1_CAM_INERTIA_SEC, 0.55)
settings.set_default(ViewportCameraManiulatorFactory.VP2_FLY_ACCELERATION, 1000.0)
settings.set_default(ViewportCameraManiulatorFactory.VP2_FLY_DAMPENING, 10.0)
settings.set_default(ViewportCameraManiulatorFactory.VP2_LOOK_ACCELERATION, 2000.0)
settings.set_default(ViewportCameraManiulatorFactory.VP2_LOOK_DAMPENING, 20.0)
self.__set_flight_velocity(settings.get(ViewportCameraManiulatorFactory.VP1_CAM_VELOCITY))
self.__set_inertia_enabled(settings.get(ViewportCameraManiulatorFactory.VP1_CAM_INERTIA_ENABLED))
self.__set_inertia_seconds(settings.get(ViewportCameraManiulatorFactory.VP1_CAM_INERTIA_SEC))
self.__set_flight_acceleration(settings.get(ViewportCameraManiulatorFactory.VP2_FLY_ACCELERATION))
self.__set_flight_dampening(settings.get(ViewportCameraManiulatorFactory.VP2_FLY_DAMPENING))
self.__set_look_acceleration(settings.get(ViewportCameraManiulatorFactory.VP2_LOOK_ACCELERATION))
self.__set_look_dampening(settings.get(ViewportCameraManiulatorFactory.VP2_LOOK_DAMPENING))
def __set_inertia_enabled(self, value):
if value is not None:
self.__manipulator.model.set_ints('inertia_enabled', [1 if value else 0])
def __set_inertia_seconds(self, value):
if value is not None:
self.__manipulator.model.set_floats('inertia_seconds', [value])
def __set_flight_velocity(self, value):
if value is not None:
self.__manipulator.model.set_floats('fly_speed', [value])
def __set_flight_acceleration(self, value):
if value is not None:
self.__manipulator.model.set_floats('fly_acceleration', [value, value, value])
def __set_flight_dampening(self, value):
if value is not None:
self.__manipulator.model.set_floats('fly_dampening', [10, 10, 10])
def __set_look_acceleration(self, value):
if value is not None:
self.__manipulator.model.set_floats('look_acceleration', [value, value, value])
def __set_look_dampening(self, value):
if value is not None:
self.__manipulator.model.set_floats('look_dampening', [value, value, value])
def __vel_changed(self, value, event_type):
if event_type != carb.settings.ChangeEventType.CHANGED:
return
self.__set_flight_velocity(value.get('', None))
def destroy(self):
self.__setting_subs = None
if self.__manipulator:
self.__manipulator.destroy()
self.__manipulator = None
@property
def categories(self):
return ['manipulator']
@property
def name(self):
return 'Camera'
@property
def visible(self):
return self.__manipulator.visible
@visible.setter
def visible(self, value):
self.__manipulator.visible = bool(value)
@property
def manipulator(self):
return self.__manipulator
| 6,147 | Python | 48.580645 | 175 | 0.715634 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/manipulator/object_click.py | ## Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
##
## NVIDIA CORPORATION and its licensors retain all intellectual property
## and proprietary rights in and to this software, related documentation
## and any modifications thereto. Any use, reproduction, disclosure or
## distribution of this software and related documentation without an express
## license agreement from NVIDIA CORPORATION is strictly prohibited.
##
__all__ = ["ObjectClickFactory"]
from omni.ui import scene as sc
from pxr import Gf, Sdf
import carb
import omni.kit.commands
from ..raycast import perform_raycast_query
KIT_COI_ATTRIBUTE = 'omni:kit:centerOfInterest'
class ObjectClickGesture(sc.DoubleClickGesture):
def __init__(self, viewport_api, mouse_button: int):
super().__init__(mouse_button=mouse_button)
self.__viewport_api = viewport_api
def __query_completed(self, prim_path: str, world_space_pos, *args):
if prim_path:
viewport_api = self.__viewport_api
stage = viewport_api.stage
cam_path = viewport_api.camera_path
cam_prim = stage.GetPrimAtPath(cam_path)
if not cam_prim:
carb.log_error(f'Could not find prim for camera path "{cam_path}"')
return
if True:
# Get position directly from USD
from pxr import Usd, UsdGeom
hit_prim = stage.GetPrimAtPath(prim_path)
if not hit_prim:
carb.log_error(f'Could not find prim for hit path "{prim_path}"')
return
box_cache = UsdGeom.BBoxCache(Usd.TimeCode.Default(), includedPurposes=[UsdGeom.Tokens.default_])
prim_center = box_cache.ComputeWorldBound(hit_prim).ComputeCentroid()
else:
# Get the word-transform of the hit prim
prim_matrix = Gf.Matrix4d(*viewport_api.usd_context.compute_path_world_transform(prim_path))
# Get the position of the center of the object (based on transform)
prim_center = prim_matrix.Transform(Gf.Vec3d(0,0,0))
# Move the prim center into local space of the camera
prim_center = viewport_api.view.Transform(prim_center)
# Set the camera's center-of-interest attribute (in an undo-able way)
coi_attr = cam_prim.GetAttribute(KIT_COI_ATTRIBUTE)
omni.kit.commands.execute('ChangePropertyCommand', prop_path=coi_attr.GetPath(), value=prim_center,
prev=coi_attr.Get() if coi_attr else None, type_to_create_if_not_exist=Sdf.ValueTypeNames.Vector3d)
def on_ended(self, *args):
if self.state == sc.GestureState.CANCELED:
return
self.__ndc_mouse = self.sender.gesture_payload.mouse
mouse, viewport_api = self.__viewport_api.map_ndc_to_texture_pixel(self.__ndc_mouse)
if mouse and viewport_api:
perform_raycast_query(
viewport_api=viewport_api,
mouse_ndc=self.__ndc_mouse,
mouse_pixel=mouse,
on_complete_fn=self.__query_completed
)
class ObjectClickManipulator(sc.Manipulator):
VP_COI_SETTING = "/exts/omni.kit.viewport.window/coiDoubleClick"
def __init__(self, viewport_api, mouse_button: int = 0, *args, **kwargs):
super().__init__(*args, **kwargs)
self.__gesture = ObjectClickGesture(viewport_api, mouse_button)
self.__transform = None
self.__screen = None
settings = carb.settings.get_settings()
self.__setting_sub = settings.subscribe_to_node_change_events(self.VP_COI_SETTING, self.__coi_enabled_changed)
def __coi_enabled_changed(self, item: carb.dictionary.Item, event_type: carb.settings.ChangeEventType):
if self.__screen and event_type == carb.settings.ChangeEventType.CHANGED:
self.__screen.visible = carb.settings.get_settings().get(self.VP_COI_SETTING)
def on_build(self):
# Need to hold a reference to this or the sc.Screen would be destroyed when out of scope
self.__transform = sc.Transform()
with self.__transform:
self.__screen = sc.Screen(gesture=self.__gesture)
# Enable / Disable functionality based on current setting value
self.__coi_enabled_changed(None, carb.settings.ChangeEventType.CHANGED)
def destroy(self):
setting_sub, self.__setting_sub = self.__setting_sub, None
if setting_sub is not None:
carb.settings.get_settings().unsubscribe_to_change_events(setting_sub)
if self.__transform:
self.__transform.clear()
self.__transform = None
self.__screen = None
def ObjectClickFactory(desc: dict):
manip = ObjectClickManipulator(desc.get('viewport_api'))
manip.categories = ('manipulator',)
manip.name = 'ObjectClick'
return manip
| 4,921 | Python | 43.745454 | 118 | 0.641739 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/manipulator/context_menu.py | ## Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
##
## NVIDIA CORPORATION and its licensors retain all intellectual property
## and proprietary rights in and to this software, related documentation
## and any modifications thereto. Any use, reproduction, disclosure or
## distribution of this software and related documentation without an express
## license agreement from NVIDIA CORPORATION is strictly prohibited.
##
__all__ = ["ViewportClickFactory"]
from omni.ui import scene as sc
from pxr import Gf
from typing import Sequence
import carb
import importlib.util
from ..raycast import perform_raycast_query
class WorldSpacePositionCache:
def __init__(self):
self.__ndc_z = None
def __cache_screen_ndc(self, viewport_api, world_space_pos: Gf.Vec3d):
screen_space_pos = viewport_api.world_to_ndc.Transform(world_space_pos)
self.__ndc_z = screen_space_pos[2]
def get_world_position(self, viewport_api, prim_path: str, world_space_pos: Sequence[float], mouse_ndc: Sequence[float]):
# Simple case, prim hit and world_space_pos is valid, cache NDC-z
if prim_path:
world_space_pos = Gf.Vec3d(*world_space_pos)
self.__cache_screen_ndc(viewport_api, world_space_pos)
return world_space_pos
# No prim-path, deliver a best guess at world-position
# If never over an object, cacluate NDC-z from camera's center-of-interest
if self.__ndc_z is None:
# Otherwise use the camera's center-of-interest as the depth
camera = viewport_api.stage.GetPrimAtPath(viewport_api.camera_path)
coi_attr = camera.GetAttribute('omni:kit:centerOfInterest')
if coi_attr:
world_space_pos = viewport_api.transform.Transform(coi_attr.Get(viewport_api.time))
self.__cache_screen_ndc(viewport_api, world_space_pos)
# If we have depth (in NDC), move (x_ndc, y_ndz, z_ndc) to a world-space position
if mouse_ndc and self.__ndc_z is not None:
return viewport_api.ndc_to_world.Transform(Gf.Vec3d(mouse_ndc[0], mouse_ndc[1], self.__ndc_z))
# Nothing, return whatever it was
return Gf.Vec3d(*world_space_pos)
class ClickGesture(sc.ClickGesture):
def __init__(self, viewport_api, mouse_button: int = 1):
super().__init__(mouse_button=mouse_button)
self.__viewport_api = viewport_api
def __query_completed(self, prim_path: str, world_space_pos, *args):
viewport_api = self.__viewport_api
world_space_pos = WorldSpacePositionCache().get_world_position(viewport_api, prim_path, world_space_pos, self.__ndc_mouse)
if not prim_path:
selected_prims = viewport_api.usd_context.get_selection().get_selected_prim_paths()
if len(selected_prims) == 1:
prim_path = selected_prims[0]
else:
prim_path = None
self.on_clicked(viewport_api.usd_context_name, prim_path, world_space_pos, viewport_api.stage)
def on_ended(self, *args):
self.__ndc_mouse = self.sender.gesture_payload.mouse
mouse, viewport_api = self.__viewport_api.map_ndc_to_texture_pixel(self.__ndc_mouse)
if mouse and viewport_api:
perform_raycast_query(
viewport_api=viewport_api,
mouse_ndc=self.__ndc_mouse,
mouse_pixel=mouse,
on_complete_fn=self.__query_completed
)
# User callback when click and Viewport query have completed
def on_clicked(self, usd_context_name: str, prim_path: str, world_space_pos: Gf.Vec3d, stage):
# Honor legacy setting /exts/omni.kit.window.viewport/showContextMenu, but ony when it is actually set
legacy_show_context_menu = carb.settings.get_settings().get("/exts/omni.kit.window.viewport/showContextMenu")
if (legacy_show_context_menu is not None) and (bool(legacy_show_context_menu) is False):
return
try:
from omni.kit.context_menu import ViewportMenu
ViewportMenu.show_menu(
usd_context_name, prim_path, world_space_pos, stage
)
except (AttributeError, ImportError):
if importlib.util.find_spec('omni.kit.context_menu') is None:
carb.log_error('omni.kit.context_menu must be loaded to use the context menu')
else:
carb.log_error('omni.kit.context_menu 1.3.7+ must be loaded to use the context menu')
class ViewportClickManipulator(sc.Manipulator):
def __init__(self, viewport_api, mouse_button: int = 1, *args, **kwargs):
super().__init__(*args, **kwargs)
self.__gesture = ClickGesture(viewport_api, mouse_button)
self.__transform = None
def on_build(self):
# Need to hold a reference to this or the sc.Screen would be destroyed when out of scope
self.__transform = sc.Transform()
with self.__transform:
self.__screen = sc.Screen(gesture=self.__gesture)
def destroy(self):
if self.__transform:
self.__transform.clear()
self.__transform = None
self.__screen = None
def ViewportClickFactory(desc: dict):
manip = ViewportClickManipulator(desc.get('viewport_api'))
manip.categories = ('manipulator',)
manip.name = 'ContextMenu'
return manip
| 5,396 | Python | 42.524193 | 130 | 0.647331 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/manipulator/selection.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ['SelectionManipulatorItem']
from omni.kit.manipulator.selection import SelectionManipulator, SelectionMode
import omni.usd
class SelectionManipulatorItem:
def __init__(self, desc: dict, *args, **kwargs):
self.__viewport_api = desc.get('viewport_api')
self.__manipulator = SelectionManipulator()
model = self.__manipulator.model
self.__model_changed_sub = model.subscribe_item_changed_fn(self.__model_changed)
self.__initial_selection = None
self.__selection_args = None
def __reset_state(self):
self.__initial_selection = None
self.__selection_args = None
def __handle_selection(self, model, ndc_rect, mode, viewport_api):
# Attempt to support live-selection for add and invert modes
# usd_context = viewport_api.usd_context
# if not self.__initial_selection:
# # Save the initial selection
# self.__initial_selection = usd_context.get_selection().get_selected_prim_paths()
# elif mode != omni.usd.PickingMode.RESET_AND_SELECT:
# # Restore the initial selection so that add & invert do the right thing
# usd_context.get_selection().set_selected_prim_paths(self.__initial_selection, True)
# Map the NDC screen coordinates into texture space
box_start, start_in = viewport_api.map_ndc_to_texture_pixel((ndc_rect[0], ndc_rect[1]))
box_end, end_in = viewport_api.map_ndc_to_texture_pixel((ndc_rect[2], ndc_rect[3]))
# Clamp selection box to texture in pixel-space
resolution = viewport_api.resolution
box_start = (max(0, min(resolution[0], box_start[0])), max(0, min(resolution[1], box_start[1])))
box_end = (max(0, min(resolution[0], box_end[0])), max(0, min(resolution[1], box_end[1])))
# If the selection box overlaps the Viewport, save the state; otherwise clear it
if (box_start[0] < resolution[0]) and (box_end[0] > 0) and (box_start[1] > 0) and (box_end[1] < resolution[1]):
self.__selection_args = box_start, box_end, mode
else:
self.__selection_args = None
def __request_pick(self):
# If not selection state (pick is 100% outside of the viewport); clear the UsdContext's selection
if self.__selection_args is None:
usd_context = self.__viewport_api.usd_context
if usd_context:
usd_context.get_selection().set_selected_prim_paths([], False)
return
args = self.__selection_args
if hasattr(self.__viewport_api, 'request_pick'):
self.__viewport_api.request_pick(*args)
return
self.__viewport_api.pick(args[0][0], args[0][1], args[1][0], args[1][1], args[2])
def __model_changed(self, model, item):
# https://gitlab-master.nvidia.com/omniverse/kit/-/merge_requests/13725
if not hasattr(omni.usd, 'PickingMode'):
import carb
carb.log_error('No picking support in omni.hydratexture')
return
# We only care about rect and mode changes
if item != model.get_item('ndc_rect') and item != model.get_item('mode'):
return
live_select = False
ndc_rect = model.get_as_floats('ndc_rect')
if not ndc_rect:
if not live_select:
self.__request_pick()
return self.__reset_state()
# Convert the mode into an omni.usd.PickingMode
mode = model.get_as_ints('mode')
if not mode:
return self.__reset_state()
mode = {
SelectionMode.REPLACE: omni.usd.PickingMode.RESET_AND_SELECT,
SelectionMode.APPEND: omni.usd.PickingMode.MERGE_SELECTION,
SelectionMode.REMOVE: omni.usd.PickingMode.INVERT_SELECTION
}.get(mode[0], None)
if mode is None:
return self.__reset_state()
self.__handle_selection(model, ndc_rect, mode, self.__viewport_api)
# For reset selection, we can live-select as the drag occurs
# live_select = mode == omni.usd.PickingMode.RESET_AND_SELECT
if live_select:
self.__request_pick()
def destroy(self):
self.__model_changed_sub = None
self.__manipulator = None
self.__viewport_api = None
@property
def categories(self):
return ['manipulator']
@property
def name(self):
return 'Selection'
@property
def visible(self):
return self.__manipulator.visible
@visible.setter
def visible(self, value):
self.__manipulator.visible = bool(value)
| 5,058 | Python | 40.130081 | 120 | 0.627916 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/tests/test_drag_drop.py | ## Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
##
## NVIDIA CORPORATION and its licensors retain all intellectual property
## and proprietary rights in and to this software, related documentation
## and any modifications thereto. Any use, reproduction, disclosure or
## distribution of this software and related documentation without an express
## license agreement from NVIDIA CORPORATION is strictly prohibited.
##
__all__ = ["TestDragDrop"]
import omni.kit.test
from omni.kit.test import AsyncTestCase
import omni.usd
from pxr import Sdf, UsdGeom
from ..dragdrop.usd_file_drop_delegate import UsdFileDropDelegate
from ..dragdrop.material_file_drop_delegate import MaterialFileDropDelegate
from ..dragdrop.audio_file_drop_delegate import AudioFileDropDelegate
class TestDragDrop(AsyncTestCase):
async def setUp(self):
self.usd_context_name = ''
self.usd_context = omni.usd.get_context(self.usd_context_name)
await self.usd_context.new_stage_async()
self.stage = self.usd_context.get_stage()
async def tearDown(self):
self.usd_context = None
self.stage = None
async def createNewStage(self, default_prim: str = None):
self.usd_context_name = ''
self.usd_context = omni.usd.get_context(self.usd_context_name)
await self.usd_context.new_stage_async()
self.stage = self.usd_context.get_stage()
if default_prim is not None:
self.stage.SetDefaultPrim(UsdGeom.Xform.Define(self.stage, f'/{default_prim}').GetPrim())
def validate_sdf_path(self, file_drop: UsdFileDropDelegate, url: str):
prim_path = file_drop.make_prim_path(self.stage, url)
# Make sure the return value is a completely valid SdfPath
self.assertIsNotNone(prim_path)
self.assertTrue(Sdf.Path.IsValidPathString(prim_path.pathString))
# If it was dropped onto a stage wit a defaultPrim, make sure it was dropped into that Prim
default_prim = self.stage.GetDefaultPrim()
if default_prim:
default_prim_path = default_prim.GetPath()
self.assertEqual(prim_path.GetCommonPrefix(default_prim_path), default_prim_path)
async def test_prim_name_generation_in_world(self):
'''Test new prim is generated with a valid path under defaultPrim=World'''
await self.createNewStage('World')
usd_file_drop = UsdFileDropDelegate()
# Test against a file path
self.validate_sdf_path(usd_file_drop, '/fake/path.usda')
self.validate_sdf_path(usd_file_drop, '/fake/path with spaces.usda')
self.validate_sdf_path(usd_file_drop, '/fake/a_weird_name-off__-_that-is_ still odd.usda')
# Test against an omni protocol
self.validate_sdf_path(usd_file_drop, 'omni://fake/omnipath.usda')
self.validate_sdf_path(usd_file_drop, 'omni://fake/1 omni path path with spaces.usda')
self.validate_sdf_path(usd_file_drop, 'omni:///fake/a_weird_name-off__-_that-is_ still odd.usda')
# Test a protocol other than omni, just use https
self.validate_sdf_path(usd_file_drop, 'https://fake/protocolpath.usda')
self.validate_sdf_path(usd_file_drop, 'https://fake/2 prot')
self.validate_sdf_path(usd_file_drop, 'https:///fake/a_weird_name-off__-_that-is_ still odd.usda')
async def test_prim_name_generation_in_another_world(self):
'''Test new prim is generated with a valid path under defaultPrim=AnotherNonStandardWorld'''
await self.createNewStage('AnotherNonStandardWorld')
usd_file_drop = UsdFileDropDelegate()
# Test against a file path
self.validate_sdf_path(usd_file_drop, '/fake/path.usda')
self.validate_sdf_path(usd_file_drop, '/fake/path with spaces.usda')
self.validate_sdf_path(usd_file_drop, '/fake/a_weird_name-off__-_that-is_ still odd.usda')
# Test against an omni protocol
self.validate_sdf_path(usd_file_drop, 'omni://fake/omnipath.usda')
self.validate_sdf_path(usd_file_drop, 'omni://fake/1 omni path path with spaces.usda')
self.validate_sdf_path(usd_file_drop, 'omni:///fake/a_weird_name-off__-_that-is_ still odd.usda')
# Test a protocol other than omni, just use https
self.validate_sdf_path(usd_file_drop, 'https://fake/protocolpath.usda')
self.validate_sdf_path(usd_file_drop, 'https://fake/2 prot')
self.validate_sdf_path(usd_file_drop, 'https:///fake/a_weird_name-off__-_that-is_ still odd.usda')
async def test_prim_name_root_generation(self):
'''Test new prim is generated with a valid path'''
await self.createNewStage()
usd_file_drop = UsdFileDropDelegate()
# Test against a file path
self.validate_sdf_path(usd_file_drop, '/fake/path.usda')
self.validate_sdf_path(usd_file_drop, '/fake/path with spaces.usda')
self.validate_sdf_path(usd_file_drop, '/fake/a_weird_name-off__-_that-is_ still odd.usda')
# Test against an omni protocol
self.validate_sdf_path(usd_file_drop, 'omni://fake/omnipath.usda')
self.validate_sdf_path(usd_file_drop, 'omni://fake/1 omni path path with spaces.usda')
self.validate_sdf_path(usd_file_drop, 'omni:///fake/a_weird_name-off__-_that-is_ still odd.usda')
# Test a protocol other than omni, just use https
self.validate_sdf_path(usd_file_drop, 'https://fake/protocolpath.usda')
self.validate_sdf_path(usd_file_drop, 'https://fake/2 prot')
self.validate_sdf_path(usd_file_drop, 'https:///fake/a_weird_name-off__-_that-is_ still odd.usda')
async def test_mdl_drop(self):
'''Test Material will be accepted by MDL handler and denied by USD handler'''
await self.createNewStage('World')
usd_file_drop = UsdFileDropDelegate()
mtl_file_drop = MaterialFileDropDelegate()
def make_drop_object(url: str):
return {'mime_data': url, 'usd_context_name': self.usd_context_name}
self.assertFalse(usd_file_drop.accepted(make_drop_object('/fake/mdlfile.mdl')))
self.assertFalse(usd_file_drop.accepted(make_drop_object('https://fake/mdlfile.mdl')))
self.assertFalse(usd_file_drop.accepted(make_drop_object('material::https://fake/mdlfile.mdl')))
self.assertTrue(mtl_file_drop.accepted(make_drop_object('/fake/mdlfile.mdl')))
self.assertTrue(mtl_file_drop.accepted(make_drop_object('https://fake/mdlfile.mdl')))
self.assertFalse(mtl_file_drop.accepted(make_drop_object('material::https://fake/mdlfile.mdl')))
self.assertEqual(mtl_file_drop.accept_url('/fake/mdlfile.mdl'), '/fake/mdlfile.mdl')
self.assertEqual(mtl_file_drop.accept_url('https://fake/mdlfile.mdl'), 'https://fake/mdlfile.mdl')
self.assertFalse(mtl_file_drop.accept_url('material::https://fake/mdlfile.mdl'))
async def test_mdl_drop_material_location(self):
'''Test Material will be created in proper Scope location'''
mtl_file_drop = MaterialFileDropDelegate()
await self.createNewStage('World')
self.assertEqual(mtl_file_drop.get_material_prim_location(self.stage), Sdf.Path('/World/Looks'))
await self.createNewStage()
self.assertEqual(mtl_file_drop.get_material_prim_location(self.stage), Sdf.Path('/Looks'))
async def test_audio_drop_delegate(self):
'''Test Audio will be created in proper location'''
audio_drop = AudioFileDropDelegate()
await self.createNewStage('World')
def make_drop_object(url: str):
return {'mime_data': url, 'usd_context_name': self.usd_context_name}
self.validate_sdf_path(audio_drop, '/fake/path.wav')
self.validate_sdf_path(audio_drop, '/fake/path.wave')
self.validate_sdf_path(audio_drop, '/fake/path.ogg')
self.validate_sdf_path(audio_drop, '/fake/path.mp3')
self.assertFalse(audio_drop.accepted(make_drop_object('/fake/path.txt')))
self.assertFalse(audio_drop.accepted(make_drop_object('/fake/path.usda')))
self.assertFalse(audio_drop.accepted(make_drop_object('material::https://fake/mdlfile.mdl')))
async def test_ignored_dragdrop_protocols(self):
'''Test DragDropDelegates to ensure registered protocols are ignored'''
delegates = [UsdFileDropDelegate,
MaterialFileDropDelegate,
AudioFileDropDelegate]
protocol = "test://"
for delegate in delegates:
self.assertFalse(delegate.is_ignored_protocol(protocol))
delegate.add_ignored_protocol(protocol)
self.assertTrue(delegate.is_ignored_protocol(protocol+"test.ext"))
delegate.remove_ignored_protocol(protocol)
self.assertFalse(delegate.is_ignored_protocol(protocol))
async def test_ignored_dragdrop_extensions(self):
'''Test DragDropDelegates to ensure registered extensions are ignored'''
delegates = [UsdFileDropDelegate,
MaterialFileDropDelegate,
AudioFileDropDelegate]
extension = ".test"
for delegate in delegates:
self.assertFalse(delegate.is_ignored_extension(extension))
delegate.add_ignored_extension(extension)
self.assertTrue(delegate.is_ignored_extension("test"+extension))
delegate.remove_ignored_extension(extension)
self.assertFalse(delegate.is_ignored_extension(extension))
| 9,484 | Python | 47.392857 | 106 | 0.67577 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/tests/test_window_viewport.py | ## Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
##
## NVIDIA CORPORATION and its licensors retain all intellectual property
## and proprietary rights in and to this software, related documentation
## and any modifications thereto. Any use, reproduction, disclosure or
## distribution of this software and related documentation without an express
## license agreement from NVIDIA CORPORATION is strictly prohibited.
##
__all__ = ["TestWindowViewport"]
import omni.kit.test
from omni.ui.tests.test_base import OmniUiTest
from omni.kit.viewport.window import ViewportWindow
from pathlib import Path
import carb
import omni.usd
import omni.timeline
from pxr import Gf
DATA_PATH = Path(carb.tokens.get_tokens_interface().resolve("${omni.kit.viewport.window}/data")).absolute().resolve()
TEST_FILES = DATA_PATH.joinpath("tests")
USD_FILES = TEST_FILES.joinpath("usd")
TEST_WIDTH, TEST_HEIGHT = 360, 240
class TestWindowViewport(OmniUiTest):
# Before running each test
async def setUp(self):
await super().setUp()
# After running each test
async def tearDown(self):
await super().tearDown()
async def test_timeline_time_projection(self):
"""Test that changing attribute that affect projection work when time-sampled."""
await self.create_test_area(width=TEST_WIDTH, height=TEST_HEIGHT)
vp_window = ViewportWindow('TestWindow', width=TEST_WIDTH, height=TEST_HEIGHT)
usd_context = vp_window.viewport_api.usd_context
# L1 test without a render, so cannot lock to reults as there are none
vp_window.viewport_api.lock_to_render_result = False
await usd_context.open_stage_async(str(USD_FILES.joinpath("timesampled_camera.usda")))
timeline = omni.timeline.get_timeline_interface()
timeline.set_current_time(2)
timeline.commit()
expected_proj = Gf.Matrix4d(2.542591218004352, 0, 0, 0, 0, 4.261867184464438, 0, 0, 0, 0, -1.000002000002, -1, 0, 0, -2.000002000002, 0)
self.assertTrue(Gf.IsClose(expected_proj, vp_window.viewport_api.projection, 1e-07))
# Test no Window are reachable after destruction
vp_window.destroy()
del vp_window
# Unblocks devices again
await self.finalize_test_no_image()
async def test_viewport_instance_resolution_serialization(self):
"""Test that restoring a Viewport instance resolution works from persistent data."""
await self.create_test_area(width=TEST_WIDTH, height=TEST_HEIGHT)
vp_window = None
settings = carb.settings.get_settings()
try:
vp_window = ViewportWindow('TestWindow', width=TEST_WIDTH, height=TEST_HEIGHT)
self.assertEqual(vp_window.viewport_api.resolution, (1280, 720))
self.assertEqual(vp_window.viewport_api.resolution_scale, 1.0)
finally:
if vp_window:
vp_window.destroy()
del vp_window
try:
settings.set('/persistent/app/viewport/TestWindow/Viewport0/resolution', [512, 512])
settings.set('/persistent/app/viewport/TestWindow/Viewport0/resolutionScale', 0.25)
vp_window = ViewportWindow('TestWindow', width=TEST_WIDTH, height=TEST_HEIGHT)
self.assertEqual(vp_window.viewport_api.full_resolution, (512, 512))
self.assertEqual(vp_window.viewport_api.resolution, (128, 128))
self.assertEqual(vp_window.viewport_api.resolution_scale, 0.25)
finally:
settings.destroy_item('/persistent/app/viewport/TestWindow/Viewport0/resolution')
settings.destroy_item('/persistent/app/viewport/TestWindow/Viewport0/resolutionScale')
if vp_window:
vp_window.destroy()
del vp_window
# Unblocks devices again
await self.finalize_test_no_image()
async def test_viewport_startup_resolution_serialization(self):
"""Test that restoring a Viewport instance resolution works from startup data."""
await self.create_test_area(width=TEST_WIDTH, height=TEST_HEIGHT)
vp_window = None
settings = carb.settings.get_settings()
try:
vp_window = ViewportWindow('TestWindow', width=TEST_WIDTH, height=TEST_HEIGHT)
self.assertEqual(vp_window.viewport_api.resolution, (1280, 720))
self.assertEqual(vp_window.viewport_api.resolution_scale, 1.0)
finally:
if vp_window:
vp_window.destroy()
del vp_window
try:
settings.set('/app/viewport/TestWindow/Viewport0/resolution', [1024, 1024])
settings.set('/app/viewport/TestWindow/Viewport0/resolutionScale', 0.125)
vp_window = ViewportWindow('TestWindow', width=TEST_WIDTH, height=TEST_HEIGHT)
self.assertEqual(vp_window.viewport_api.full_resolution, (1024, 1024))
self.assertEqual(vp_window.viewport_api.resolution, (128, 128))
self.assertEqual(vp_window.viewport_api.resolution_scale, 0.125)
finally:
settings.destroy_item('/app/viewport/TestWindow/Viewport0/resolution')
settings.destroy_item('/app/viewport/TestWindow/Viewport0/resolutionScale')
if vp_window:
vp_window.destroy()
del vp_window
# Unblocks devices again
await self.finalize_test_no_image()
async def test_viewport_globals_resolution_serialization(self):
"""Test that restoring a Viewport instance resolution works from startup global data."""
await self.create_test_area(width=TEST_WIDTH, height=TEST_HEIGHT)
vp_window = None
settings = carb.settings.get_settings()
try:
vp_window = ViewportWindow('TestWindow', width=TEST_WIDTH, height=TEST_HEIGHT)
self.assertEqual(vp_window.viewport_api.resolution, (1280, 720))
self.assertEqual(vp_window.viewport_api.resolution_scale, 1.0)
finally:
if vp_window:
vp_window.destroy()
del vp_window
try:
settings.set('/app/viewport/defaults/resolution', [512, 512])
settings.set('/app/viewport/defaults/resolutionScale', 0.5)
vp_window = ViewportWindow('TestWindow', width=TEST_WIDTH, height=TEST_HEIGHT)
self.assertEqual(vp_window.viewport_api.full_resolution, (512, 512))
self.assertEqual(vp_window.viewport_api.resolution, (256, 256))
self.assertEqual(vp_window.viewport_api.resolution_scale, 0.5)
finally:
settings.destroy_item('/app/viewport/defaults/resolution')
settings.destroy_item('/app/viewport/defaults/resolutionScale')
if vp_window:
vp_window.destroy()
del vp_window
# Unblocks devices again
await self.finalize_test_no_image()
async def __test_viewport_hud_visibility(self, golden_img_name: str, visible: bool, bg_alpha: float = None):
"""Test that toggling Viewport HUD visibility."""
vp_window = None
settings = carb.settings.get_settings()
hud_setting_prefix = "/persistent/app/viewport/TestWindow/Viewport0/hud"
hud_setting_keys = ("visible", "renderResolution/visible")
golden_img_names = [f"{golden_img_name}_off.png", f"{golden_img_name}_on.png"]
try:
settings.destroy_item("/persistent/app/viewport/TestWindow/Viewport0")
settings.destroy_item("/app/viewport/forceHideFps")
settings.destroy_item("/app/viewport/showLayerMenu")
for hk in hud_setting_keys:
settings.set(f"{hud_setting_prefix}/{hk}", True)
if bg_alpha is not None:
settings.set("/persistent/app/viewport/ui/background/opacity", bg_alpha)
settings.set(f"{hud_setting_prefix}/renderFPS/visible", False)
settings.set(f"{hud_setting_prefix}/hostMemory/visible", False)
await self.wait_n_updates()
await self.create_test_area(width=320, height=240)
vp_window = ViewportWindow('TestWindow', width=320, height=240)
settings.set(f"{hud_setting_prefix}/visible", visible)
await self.wait_n_updates()
await self.capture_and_compare(golden_img_name=golden_img_names[visible], golden_img_dir=TEST_FILES)
await self.wait_n_updates()
settings.set(f"{hud_setting_prefix}/visible", not visible)
await self.wait_n_updates()
await self.finalize_test(golden_img_name=golden_img_names[not visible], golden_img_dir=TEST_FILES)
finally:
settings.destroy_item("/persistent/app/viewport/ui/background/opacity")
if vp_window:
vp_window.destroy()
del vp_window
async def test_viewport_hud_visibility(self):
"""Test that toggling Viewport HUD visibility works forward."""
await self.__test_viewport_hud_visibility("test_viewport_hud_visibility", True)
async def test_viewport_hud_visibility_with_bg(self):
"""Test that toggling Viewport HUD visibility works and is affected by UI background color."""
await self.__test_viewport_hud_visibility("test_viewport_hud_visibility_no_bg", False, 0.0)
async def test_camera_axis_resize(self):
"""Test that camera axis overlay properly sizes as requested."""
from omni.kit.viewport.window.scene.scenes import CameraAxisLayer
async def test_size(camera_axis_layer, size, golden_img_name):
"""test custom sizes"""
# one way to set the size
settings.set(CameraAxisLayer.CAMERA_AXIS_SIZE_SETTING, size)
# another way to set the size
settings.set(f"{CameraAxisLayer.CAMERA_AXIS_SIZE_SETTING}/0", size[0])
settings.set(f"{CameraAxisLayer.CAMERA_AXIS_SIZE_SETTING}/1", size[1])
# wait for UI refresh
await self.wait_n_updates()
# read back the actual layer extents and check if the values are as expected
self.assertEqual(camera_axis_layer._CameraAxisLayer__scene_view.width.value, float(size[0]))
self.assertEqual(camera_axis_layer._CameraAxisLayer__scene_view.height.value, float(size[1]))
# finally, the image test
await self.capture_and_compare(golden_img_name=golden_img_name, golden_img_dir=TEST_FILES)
await self.create_test_area(width=TEST_WIDTH, height=TEST_HEIGHT)
settings = carb.settings.get_settings()
vp_window = ViewportWindow('TestWindow', width=TEST_WIDTH, height=TEST_HEIGHT)
viewport_api = vp_window.viewport_api
# Test requires a USD context so that the implicit cameras are actually created
await viewport_api.usd_context.new_stage_async()
# turn the CameraAxisLayer on
axis_visibility_key = f"/persistent/app/viewport/{viewport_api.id}/guide/axis/visible"
axis_vis_restore = settings.get(axis_visibility_key)
try:
settings.set(axis_visibility_key, True)
# get CameraAxis layer
cam_axis_layer = vp_window._find_viewport_layer(layer_id="Axis", category="guide")
self.assertTrue(cam_axis_layer is not None, "Axis widget is not available!")
def_size = CameraAxisLayer.CAMERA_AXIS_DEFAULT_SIZE
await test_size(cam_axis_layer, (def_size[0] + 20, def_size[1] + 30), "test_camera_axis_resize_enlarge.png")
await test_size(cam_axis_layer, (def_size[0] - 20, def_size[1] - 30), "test_camera_axis_resize_shrink.png")
finally:
settings.set(axis_visibility_key, axis_vis_restore)
if vp_window:
vp_window.destroy()
del vp_window
await self.finalize_test_no_image()
async def __test_engine_creation_arguments(self, hydra_engine_options, verify_engine):
vp_window = None
try:
await self.create_test_area(width=TEST_WIDTH, height=TEST_HEIGHT)
vp_window = ViewportWindow('TestWindow', width=TEST_WIDTH, height=TEST_HEIGHT,
hydra_engine_options=hydra_engine_options)
await self.wait_n_updates()
self.assertIsNotNone(vp_window)
await verify_engine(vp_window.viewport_widget.viewport_api._hydra_texture)
finally:
if vp_window:
vp_window.destroy()
del vp_window
await self.finalize_test_no_image()
async def test_engine_creation_default_arguments(self):
'''Test default engine creation arguments'''
hydra_engine_options = {}
async def verify_engine(hydra_texture):
settings = carb.settings.get_settings()
tick_rate = settings.get(f"{hydra_texture.get_settings_path()}hydraTickRate")
is_async = settings.get(f"{hydra_texture.get_settings_path()}async")
is_async_ll = settings.get(f"{hydra_texture.get_settings_path()}asyncLowLatency")
self.assertEqual(is_async, bool(settings.get("/app/asyncRendering")))
self.assertEqual(is_async_ll, bool(settings.get("/app/asyncRenderingLowLatency")))
self.assertEqual(tick_rate, int(settings.get("/persistent/app/viewport/defaults/tickRate")))
await self.__test_engine_creation_arguments(hydra_engine_options, verify_engine)
async def test_engine_creation_forward_arguments(self):
'''Test forwarding of engine creation arguments'''
settings = carb.settings.get_settings()
# Make sure the defaults are in a state that overrides from hydra_engine_options can be tested
self.assertFalse(bool(settings.get("/app/asyncRendering")))
self.assertFalse(bool(settings.get("/app/asyncRenderingLowLatency")))
self.assertNotEqual(30, int(settings.get("/persistent/app/viewport/defaults/tickRate")))
try:
hydra_engine_options = {
"is_async": True,
"is_async_low_latency": True,
"hydra_tick_rate": 30
}
async def verify_engine(hydra_texture):
tick_rate = settings.get(f"{hydra_texture.get_settings_path()}hydraTickRate")
is_async = settings.get(f"{hydra_texture.get_settings_path()}async")
is_async_ll = settings.get(f"{hydra_texture.get_settings_path()}asyncLowLatency")
self.assertEqual(is_async, hydra_engine_options.get("is_async"))
self.assertEqual(is_async_ll, hydra_engine_options.get("is_async_low_latency"))
self.assertEqual(tick_rate, hydra_engine_options.get("hydra_tick_rate"))
await self.__test_engine_creation_arguments(hydra_engine_options, verify_engine)
finally:
settings.set("/app/asyncRendering", False)
settings.destroy_item("/app/asyncRenderingLowLatency")
| 15,016 | Python | 44.923547 | 144 | 0.647376 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/tests/__init__.py | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
from .test_window_api import *
from .test_drag_drop import *
from .test_window_viewport import *
from .test_events import *
| 553 | Python | 38.571426 | 76 | 0.793852 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/tests/test_events.py | ## Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
##
## NVIDIA CORPORATION and its licensors retain all intellectual property
## and proprietary rights in and to this software, related documentation
## and any modifications thereto. Any use, reproduction, disclosure or
## distribution of this software and related documentation without an express
## license agreement from NVIDIA CORPORATION is strictly prohibited.
##
__all__ = ["Test01_ViewportEvents"]
import omni.kit.test
from omni.ui.tests.test_base import OmniUiTest
from omni.kit.viewport.window import ViewportWindow
from pathlib import Path
import carb
from carb.input import MouseEventType
import omni.kit.app
from omni.kit.ui_test import emulate_mouse_move_and_click, emulate_mouse_scroll, Vec2
from omni.kit.ui_test.input import emulate_mouse
import math
DATA_PATH = Path(carb.tokens.get_tokens_interface().resolve("${omni.kit.viewport.window}/data"))
TESTS_PATH = DATA_PATH.joinpath("tests").absolute().resolve()
USD_FILES = TESTS_PATH.joinpath("usd")
TEST_WIDTH, TEST_HEIGHT = 360, 240
#
# XXX: This test must run first!!! This is likely due to block_devices=False argument below, which conflicts with
# the default block_devices=True argument that is used if other tests are run first?
#
class Test01_ViewportEvents(OmniUiTest):
# Before running each test
async def setUp(self):
await super().setUp()
# After running each test
async def tearDown(self):
await super().tearDown()
@staticmethod
async def wait_frames(app, n_frame: int = 3):
for _ in range(n_frame):
await app.next_update_async()
async def __test_camera_scroll_wheel(self, initial_speed: float, scroll_y: float, vel_scale: float, test_op):
await self.create_test_area(width=TEST_WIDTH, height=TEST_HEIGHT, block_devices=False)
app = omni.kit.app.get_app()
settings = carb.settings.get_settings()
settings.set('/persistent/app/viewport/camMoveVelocity', initial_speed)
settings.set('/persistent/app/viewport/camVelocityScalerMultAmount', vel_scale)
settings.set('/persistent/app/viewport/show/flySpeed', True)
await self.wait_frames(app)
vp_window = ViewportWindow('TestWindow', width=TEST_WIDTH, height=TEST_HEIGHT)
# Odd, but need to scale scroll by window height ?
y_scroll_scale = scroll_y * TEST_HEIGHT
try:
await emulate_mouse_move_and_click(Vec2(TEST_WIDTH-40, TEST_HEIGHT-40))
settings.set('/exts/omni.kit.manipulator.camera/viewportMode', [vp_window.viewport_api.id, 'fly'])
await self.wait_frames(app)
await emulate_mouse(MouseEventType.RIGHT_BUTTON_DOWN)
await app.next_update_async()
for _ in range(15):
await emulate_mouse_scroll(Vec2(0, y_scroll_scale))
await app.next_update_async()
test_op(settings.get('/persistent/app/viewport/camMoveVelocity'))
finally:
await emulate_mouse(MouseEventType.RIGHT_BUTTON_UP)
await app.next_update_async()
settings.set('/persistent/app/viewport/camMoveVelocity', 5)
settings.set('/persistent/app/viewport/camVelocityScalerMultAmount', 1)
settings.set('/persistent/app/viewport/show/flySpeed', False)
settings.set('/exts/omni.kit.manipulator.camera/viewportMode', None)
# Test no Window are reachable after destruction
vp_window.destroy()
del vp_window
# Restore devices and window sizes again
await self.finalize_test_no_image()
async def test_camera_speed_scroll_wheel_down(self):
"""Test that the camera-speed scroll adjusts speed within proper ranges when adjusting speed down."""
initial_speed = 0.001
def test_range(value):
self.assertTrue(value > 0, msg="Camera speed has become or fallen below zero")
self.assertTrue(value < initial_speed, msg="Camera speed has wrapped around")
await self.__test_camera_scroll_wheel(initial_speed, -1, 1.1, test_range)
async def test_camera_speed_scroll_up(self):
"""Test that the camera-speed scroll adjusts speed within proper ranges when adjusting speed up."""
initial_speed = 1.7976931348623157e+307
def test_range(value):
self.assertTrue(math.isfinite(value), msg="Camera speed has become infinite")
self.assertTrue(value > initial_speed, msg="Camera speed has wrapped around")
await self.__test_camera_scroll_wheel(initial_speed, 1, 1.4, test_range)
async def test_camera_speed_buttons(self):
""""""
import carb
settings = carb.settings.get_settings()
await self.create_test_area(width=TEST_WIDTH, height=TEST_HEIGHT, block_devices=False)
settings.set("/persistent/app/viewport/TestWindow/Viewport0/hud/visible", True)
settings.set("/persistent/app/viewport/TestWindow/Viewport0/hud/cameraSpeed/visible", True)
settings.set("/persistent/app/viewport/TestWindow/Viewport0/hud/renderResolution/visible", False)
settings.set("/persistent/exts/omni.kit.viewport.window/cameraSpeedMessage/showFlyViewLock", True)
settings.set("/persistent/exts/omni.kit.viewport.window/cameraSpeedMessage/collapsed", False)
settings.set("/persistent/exts/omni.kit.manipulator.camera/flyViewLock", False)
settings.set("/app/viewport/forceHideFps", False)
fade_in = settings.get("/exts/omni.kit.viewport.window/cameraSpeedMessage/fadeIn")
settings.set("/exts/omni.kit.viewport.window/cameraSpeedMessage/fadeIn", 0)
vp_window = None
click_received = False
app = omni.kit.app.get_app()
await self.wait_frames(app)
import omni.ui.scene as sc
from omni.kit.viewport.registry import RegisterScene
class ObjectClickGesture(sc.ClickGesture):
def on_ended(self, *args):
nonlocal click_received
click_received = True
class ViewportClickManipulator(sc.Manipulator):
def __init__(self, viewport_desc):
super().__init__()
def on_build(self):
# Need to hold a reference to this or the sc.Screen would be destroyed when out of scope
self.__transform = sc.Transform()
with self.__transform:
self.__screen = sc.Screen(gesture=ObjectClickGesture(mouse_button=0))
scoped_factory = RegisterScene(ViewportClickManipulator, 'omni.kit.viewport.window.tests.test_camera_speed_buttons')
try:
vp_window = ViewportWindow('TestWindow', width=TEST_WIDTH, height=TEST_HEIGHT)
settings.set("/exts/omni.kit.manipulator.camera/viewportMode", [vp_window.viewport_api.id, "fly"])
await self.wait_frames(app)
await self.capture_and_compare(golden_img_dir=TESTS_PATH, golden_img_name="test_camera_speed_buttons_start.png")
await self.wait_frames(app)
await emulate_mouse_move_and_click(Vec2(30, 85))
await self.capture_and_compare(golden_img_dir=TESTS_PATH, golden_img_name="test_camera_speed_buttons_down.png")
await self.wait_frames(app)
await emulate_mouse_move_and_click(Vec2(30, 85))
await self.capture_and_compare(golden_img_dir=TESTS_PATH, golden_img_name="test_camera_speed_buttons_up.png")
await self.wait_frames(app)
await emulate_mouse_move_and_click(Vec2(275, 105))
await self.wait_frames(app, 100)
await self.capture_and_compare(golden_img_dir=TESTS_PATH, golden_img_name="test_camera_speed_lock_down.png")
self.assertFalse(click_received)
finally:
if vp_window:
vp_window.destroy()
del vp_window
settings.set("/exts/omni.kit.viewport.window/cameraSpeedMessage/fadeIn", fade_in)
settings.destroy_item("/persistent/app/viewport/TestWindow/Viewport0/hud/visible")
settings.destroy_item("/persistent/app/viewport/TestWindow/Viewport0/hud/cameraSpeed/visible")
settings.destroy_item("/persistent/exts/omni.kit.viewport.window/cameraSpeedMessage/showFlyViewLock")
settings.destroy_item("/persistent/exts/omni.kit.viewport.window/cameraSpeedMessage/collapsed")
settings.destroy_item("/persistent/app/viewport/TestWindow/Viewport0/hud/renderResolution/visible")
settings.destroy_item("/persistent/exts/omni.kit.manipulator.camera/flyViewLock")
settings.destroy_item("/app/viewport/forceHideFps")
await self.finalize_test_no_image()
| 8,766 | Python | 44.900523 | 124 | 0.675337 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/tests/test_window_api.py | ## Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
##
## NVIDIA CORPORATION and its licensors retain all intellectual property
## and proprietary rights in and to this software, related documentation
## and any modifications thereto. Any use, reproduction, disclosure or
## distribution of this software and related documentation without an express
## license agreement from NVIDIA CORPORATION is strictly prohibited.
##
__all__ = ["TestWindowAPI"]
import omni.kit.test
from omni.ui.tests.test_base import OmniUiTest
from pathlib import Path
import carb
import omni.usd
import omni.ui as ui
from omni.kit.viewport.window import ViewportWindow, get_viewport_window_instances
CURRENT_PATH = Path(carb.tokens.get_tokens_interface().resolve("${omni.kit.viewport.window}/data"))
TEST_WIDTH, TEST_HEIGHT = 360, 240
NUM_DEFAULT_WINDOWS = 0
class TestWindowAPI(OmniUiTest):
# Before running each test
async def setUp(self):
await super().setUp()
self._golden_img_dir = CURRENT_PATH.absolute().resolve().joinpath("tests")
self.assertNoViewportWindows()
# After running each test
async def tearDown(self):
self._golden_img_dir = None
await super().tearDown()
@staticmethod
async def wait_frames(n_frames: int = 3):
app = omni.kit.app.get_app()
for _ in range(n_frames):
await app.next_update_async()
def assertNoViewportWindows(self):
self.assertEqual(NUM_DEFAULT_WINDOWS, sum(1 for x in get_viewport_window_instances()))
async def test_new_window(self):
"""Test basic creartion of a ViewportWindow"""
await self.create_test_area(width=TEST_WIDTH, height=TEST_HEIGHT)
vp_window = ViewportWindow('TestWindow', width=TEST_WIDTH, height=TEST_HEIGHT)
self.assertIsNotNone(vp_window)
self.assertEqual('', vp_window.viewport_api.usd_context_name)
self.assertEqual(1 + NUM_DEFAULT_WINDOWS, sum(1 for x in get_viewport_window_instances()))
await self.wait_frames()
await self.finalize_test(golden_img_dir=self._golden_img_dir)
# Test no Window are reachable after destruction
vp_window.destroy()
del vp_window
self.assertNoViewportWindows()
async def _test_post_message(self, vp_callback, golden_img_name: str):
await self.create_test_area(width=TEST_WIDTH, height=TEST_HEIGHT)
settings = carb.settings.get_settings()
try:
# These 0 avoid a fade-in fade-out animation, but also test that zero is valid (no divide by zero)
settings.set('/app/viewport/toastMessage/fadeIn', 0)
settings.set('/app/viewport/toastMessage/fadeOut', 0)
# Keep the message for a short amount of time
settings.set('/app/viewport/toastMessage/seconds', 0.5)
# Need to show the Viewport Hud globally, it contains the scroll speed
settings.set('/app/viewport/forceHideFps', False)
settings.destroy_item("/persistent/app/viewport/TestWindow/Viewport0")
vp_window = ViewportWindow('TestWindow', width=TEST_WIDTH, height=TEST_HEIGHT)
vp_callback(vp_window)
await self.wait_frames()
await self.finalize_test(golden_img_dir=self._golden_img_dir, golden_img_name=golden_img_name)
finally:
# Restore to default state
settings.set('/app/viewport/toastMessage/seconds', 3)
settings.set('/app/viewport/toastMessage/fadeIn', 0.5)
settings.set('/app/viewport/toastMessage/fadeOut', 0.5)
settings.set("/app/viewport/forceHideFps", True)
# Test no Window are reachable after destruction
vp_window.destroy()
del vp_window
self.assertNoViewportWindows()
async def test_post_message(self):
"""Test the legacy post-message API works for a single line"""
def vp_callback(vp_window):
vp_window._post_toast_message("My First Message", "message_id.0")
await self._test_post_message(vp_callback, golden_img_name="single_messages.png")
async def test_post_multiple_messages(self):
"""Test the legacy post-message API works for multiple lines"""
def vp_callback(vp_window):
vp_window._post_toast_message("My First Message", "message_id.0")
vp_window._post_toast_message("My Second Message", "message_id.1")
vp_window._post_toast_message("My Third Message", "message_id.2")
vp_window._post_toast_message("My First Message Changed", "message_id.0")
await self._test_post_message(vp_callback, golden_img_name="multiple_messages.png")
async def test_post_message_no_background(self):
"""Test the legacy post-message API works without a background"""
def vp_callback(vp_window):
vp_window._post_toast_message("Message with no BG", "message_id.0")
settings = carb.settings.get_settings()
try:
settings.set("/persistent/app/viewport/ui/background/opacity", 0.0)
await self._test_post_message(vp_callback, golden_img_name="single_messages_no_bg.png")
finally:
settings.destroy_item("/persistent/app/viewport/ui/background/opacity")
async def test_new_window_custom_context(self):
"""Test instantiating a ViewportWindow to non-default omni.UsdContext"""
await self.create_test_area(width=TEST_WIDTH, height=TEST_HEIGHT)
usd_context_name = 'TestContext'
usd_context = omni.usd.create_context(usd_context_name)
vp_window = ViewportWindow(f'Custom UsdContext {usd_context_name}', usd_context_name=usd_context_name, width=TEST_WIDTH, height=TEST_HEIGHT)
self.assertIsNotNone(vp_window)
self.assertEqual(usd_context, vp_window.viewport_api.usd_context)
self.assertEqual(usd_context_name, vp_window.viewport_api.usd_context_name)
# This should equal 0, as it retrieves only ViewportWindow on UsdContext ''
self.assertEqual(0 + NUM_DEFAULT_WINDOWS, sum(1 for x in get_viewport_window_instances()))
# This should equal 1, as it retrieves only ViewportWindow on UsdContext 'TestContext'
self.assertEqual(1 + NUM_DEFAULT_WINDOWS, sum(1 for x in get_viewport_window_instances(usd_context_name)))
# This should also equal 1, as it retrieves -all- ViewportWindow on any UsdContext
self.assertEqual(1 + NUM_DEFAULT_WINDOWS, sum(1 for x in get_viewport_window_instances(None)))
await self.wait_frames()
await self.finalize_test(golden_img_dir=self._golden_img_dir)
# Test no Window are reachable after destruction
vp_window.destroy()
del vp_window
self.assertNoViewportWindows()
async def test_new_window_add_frame(self):
"""Test add_frame API for a ViewportWindow instance"""
await self.create_test_area(width=TEST_WIDTH, height=TEST_HEIGHT)
vp_window = None
settings = carb.settings.get_settings()
settings.set("/rtx/post/backgroundZeroAlpha/enabled", True)
try:
vp_window = ViewportWindow('TestWindowWithFrame', width=TEST_WIDTH, height=TEST_HEIGHT)
custom_frame = vp_window.get_frame('custom_frame')
# Test the frame is returned from a second call with the same name
self.assertEqual(custom_frame, vp_window.get_frame('custom_frame'))
with custom_frame:
ui.Rectangle(width=TEST_WIDTH, height=TEST_HEIGHT / 2, style_type_name_override='CustomFrame')
vp_window.set_style({
'ViewportBackgroundColor': {'background_color': 0xffff0000},
'CustomFrame': {'background_color': 0xff0000ff},
})
await self.wait_frames()
await self.finalize_test(golden_img_dir=self._golden_img_dir)
finally:
settings.destroy_item("/rtx/post/backgroundZeroAlpha/enabled")
# Test no Window are reachable after destruction
if vp_window:
vp_window.destroy()
del vp_window
self.assertNoViewportWindows()
async def test_viewport_widget_api(self):
"""Test ViewportWidget and ViewportAPI accessors on a ViewportWindow instance"""
await self.create_test_area(width=TEST_WIDTH, height=TEST_HEIGHT)
vp_window = ViewportWindow('TestWindowWithFrame', width=TEST_WIDTH, height=TEST_HEIGHT)
self.assertIsNotNone(vp_window.viewport_widget)
self.assertIsNotNone(vp_window.viewport_widget.display_delegate)
# Test no Window are reachable after destruction
vp_window.destroy()
del vp_window
self.assertNoViewportWindows()
# Unblocks devices again
await self.finalize_test_no_image()
async def __test_hud_memory_info(self, settings, name: str):
if name != "Host":
# Chaneg from defaults to values
settings.set("/exts/omni.kit.viewport.window/hud/hostMemory/label", name)
settings.set("/exts/omni.kit.viewport.window/hud/hostMemory/perProcess", True)
else:
# Need to test lack of any values still instantiates a usable ViewportWindow
self.assertEqual(settings.get("/exts/omni.kit.viewport.window/hud/hostMemory/label"), None)
self.assertEqual(settings.get("/exts/omni.kit.viewport.window/hud/hostMemory/perProcess"), None)
await self.create_test_area(width=TEST_WIDTH, height=TEST_HEIGHT)
vp_window = ViewportWindow('TestWindowHudMemory', width=TEST_WIDTH, height=TEST_HEIGHT)
found_layer = vp_window._find_viewport_layer(f"{name} Memory") is not None
vp_window.destroy()
del vp_window
self.assertTrue(found_layer)
self.assertNoViewportWindows()
async def test_hud_memory_info(self):
"""Test ability to change label of Viewport HUD memory"""
settings = carb.settings.get_settings()
try:
settings.set("/app/viewport/forceHideFps", False)
await self.__test_hud_memory_info(settings, "Host")
await self.__test_hud_memory_info(settings, "Process")
finally:
# Reset to known prior defaults by delting these items
settings.destroy_item("/app/viewport/forceHideFps")
settings.destroy_item("/exts/omni.kit.viewport.window/hud/hostMemory/label")
settings.destroy_item("/exts/omni.kit.viewport.window/hud/hostMemory/perProcess")
await self.finalize_test_no_image()
| 10,595 | Python | 43.708861 | 148 | 0.665219 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/events/delegate.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ['ViewportEventDelegate']
from ..dragdrop.handler import DragDropHandler
import carb
import math
import traceback
def _limit_camera_velocity(value: float, settings: carb.settings.ISettings, context_name: str):
cam_limit = settings.get('/exts/omni.kit.viewport.window/cameraSpeedLimit')
if context_name in cam_limit:
vel_min = settings.get('/persistent/app/viewport/camVelocityMin')
if vel_min is not None:
value = max(vel_min, value)
vel_max = settings.get('/persistent/app/viewport/camVelocityMax')
if vel_max is not None:
value = min(vel_max, value)
return value
class ViewportEventDelegate:
def __init__(self, scene_view, viewport_api):
self.__scene_view = scene_view
self.__viewport_api = viewport_api
scene_view.set_mouse_wheel_fn(self.mouse_wheel)
scene_view.set_key_pressed_fn(self.key_pressed)
scene_view.set_accept_drop_fn(self.drop_accept)
scene_view.set_drop_fn(self.drop)
scene_view.scroll_only_window_hovered = True
self.__dd_handler = None
self.__key_down = set()
def destroy(self):
scene_view = self.scene_view
if scene_view:
scene_view.set_mouse_wheel_fn(None)
scene_view.set_key_pressed_fn(None)
scene_view.set_accept_drop_fn(None)
scene_view.set_drop_fn(None)
self.__scene_view = None
@property
def scene_view(self):
try:
if self.__scene_view:
return self.__scene_view
except ReferenceError:
pass
return None
@property
def viewport_api(self):
try:
if self.__viewport_api:
return self.__viewport_api
except ReferenceError:
pass
return None
@property
def drag_drop_handler(self):
return self.__dd_handler
def adjust_flight_speed(self, x: float, y: float):
try:
import omni.appwindow
iinput = carb.input.acquire_input_interface()
app_window = omni.appwindow.get_default_app_window()
mouse = app_window.get_mouse()
mouse_value = iinput.get_mouse_value(mouse, carb.input.MouseInput.RIGHT_BUTTON)
if mouse_value > 0:
settings = carb.settings.get_settings()
value = settings.get('/persistent/app/viewport/camMoveVelocity') or 1
scaler = settings.get('/persistent/app/viewport/camVelocityScalerMultAmount') or 1.1
scaler = 1.0 + (max(scaler, 1.0 + 1e-8) - 1.0) * abs(y)
if y < 0:
value = value / scaler
elif y > 0:
value = value * scaler
if math.isfinite(value) and (value > 1e-8):
value = _limit_camera_velocity(value, settings, 'scroll')
settings.set('/persistent/app/viewport/camMoveVelocity', value)
return True
# OM-58310: orbit + scroll does not behave well together, but when scroll is moved to omni.ui.scene
# they cannot both exists anyway, so disable this possibility for now by returning True if any button down
return (iinput.get_mouse_value(mouse, carb.input.MouseInput.LEFT_BUTTON)
or iinput.get_mouse_value(mouse, carb.input.MouseInput.MIDDLE_BUTTON))
except Exception:
carb.log_error(f"Traceback:\n{traceback.format_exc()}")
return False
def mouse_wheel(self, x: float, y: float, modifiers: int):
# Do not use horizontal scroll at all (do we want to hide this behind a setting, or allow it for speed bu not zoom)
x = 0
# Try to apply flight speed first (should be applied when flight-mode key is active)
if self.adjust_flight_speed(x, y):
return
# If a key is down, ignore the wheel-event (i.e. don't zoom on paint b+scroll event)
if self.__key_down:
import omni.appwindow
app_window = omni.appwindow.get_default_app_window()
key_input = carb.input.acquire_input_interface()
keyboard = app_window.get_keyboard()
app_window.get_keyboard()
for key in self.__key_down:
if key_input.get_keyboard_value(keyboard, key):
return
self.__key_down = set()
try:
from omni.kit.manipulator.camera.viewport_camera_manipulator import _zoom_operation
_zoom_operation(x, y, self.viewport_api)
except Exception:
carb.log_error(f"Traceback:\n{traceback.format_exc()}")
def key_pressed(self, key_index: int, modifiers: int, is_down: bool):
# Ignore all key-modifier up/down events, only care about escape or blocking scroll with real-key
if key_index >= int(carb.input.KeyboardInput.LEFT_SHIFT):
return
if key_index == int(carb.input.KeyboardInput.ESCAPE):
self.stop_drag_drop()
return
if is_down:
self.__key_down.add(carb.input.KeyboardInput(key_index))
else:
self.__key_down.discard(carb.input.KeyboardInput(key_index))
def mouse_moved(self, x: float, y: float, modifiers: int, is_pressed: bool, *args):
if self.__dd_handler:
self.__dd_handler._perform_query(self.__scene_view, (x, y))
def drop_accept(self, url: str):
dd_handler = DragDropHandler({
'viewport_api': self.__viewport_api,
'scene_view': self.__scene_view
})
if not dd_handler.accepted(self.__scene_view, url):
return False
self.__dd_handler = dd_handler
self.__scene_view.set_mouse_moved_fn(self.mouse_moved)
self.__scene_view.set_mouse_hovered_fn(self.mouse_hovered)
return True
def drop(self, data):
dd_handler = self.stop_drag_drop(False)
if dd_handler:
dd_handler.dropped(self.__scene_view, data)
def mouse_hovered(self, value: bool, *args):
if not value and self.__dd_handler:
self.stop_drag_drop()
def stop_drag_drop(self, cancel: bool = True):
dd_handler, self.__dd_handler = self.__dd_handler, None
self.__scene_view.set_mouse_moved_fn(None)
self.__scene_view.set_mouse_hovered_fn(None)
if dd_handler and cancel:
dd_handler.cancel(self)
return dd_handler
| 6,931 | Python | 39.302325 | 123 | 0.608859 |
omniverse-code/kit/exts/omni.kit.viewport.window/omni/kit/viewport/window/events/__init__.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ['ViewportEventDelegate', 'add_event_delegation', 'remove_event_delegation', 'set_ui_delegate']
from .delegate import ViewportEventDelegate
_ui_delegate_setup = ViewportEventDelegate
_ui_delegate_list = []
def add_event_delegation(scene_view, viewport_api):
global _ui_delegate_setup
if _ui_delegate_setup:
delegate = _ui_delegate_setup(scene_view, viewport_api)
if delegate:
_ui_delegate_list.append(delegate)
def remove_event_delegation(in_scene_view):
global _ui_delegate_list
new_delegate_list = []
for delegate in _ui_delegate_list:
scene_view = delegate.scene_view
if delegate and scene_view != in_scene_view:
new_delegate_list.append(delegate)
elif delegate:
delegate.destroy()
_ui_delegate_list = new_delegate_list
def set_ui_delegate(ui_delegate_setup):
global _ui_delegate_setup, _ui_delegate_list
_ui_delegate_setup = ui_delegate_setup
new_delegate_list = []
if ui_delegate_setup:
# Transfer all valid event handling to the new delegate
for delegate in _ui_delegate_list:
scene_view = delegate.scene_view
viewport_api = delegate.viewport_api
if scene_view and viewport_api:
delegate = ui_delegate_setup(scene_view, viewport_api)
if delegate:
new_delegate_list.append(delegate)
# Destroy all of the old event delegates
for delegate in _ui_delegate_list:
try:
delegate.destroy()
except Exception:
carb.log_error(f"Traceback:\n{traceback.format_exc()}")
_ui_delegate_list = new_delegate_list
| 2,127 | Python | 33.885245 | 105 | 0.67748 |
omniverse-code/kit/exts/omni.kit.viewport.window/docs/index.rst | omni.kit.viewport.window
################################
.. mdinclude:: README.md
.. toctree::
:maxdepth: 1
README
API (python) <API.rst>
CHANGELOG
| 168 | reStructuredText | 13.083332 | 32 | 0.5 |
omniverse-code/kit/exts/omni.kit.viewport.window/docs/API.rst | API
#########
.. automodule:: omni.kit.viewport.window
:platform: Windows-x86_64, Linux-x86_64
:members:
:undoc-members:
:show-inheritance:
:imported-members:
| 180 | reStructuredText | 17.099998 | 43 | 0.627778 |
omniverse-code/kit/exts/omni.kit.telemetry/omni.telemetry.transmitter/omni.telemetry.transmitter.config.toml | pluginsLoaded = [
"carb.dictionary.plugin",
"carb.settings.plugin",
"carb.dictionary.serializer-json.plugin"
]
[log]
level = "warn"
flushStandardStreamOutput = true
includeSource = true
setElapsedTimeUnits = "us"
includeThreadId = true
includeProcessId = true
includeTimeStamp = true
outputStream = "stderr"
[plugins]
[plugins."carb.scripting-python.plugin"]
"pythonHome" = "../../target-deps/python"
| 461 | TOML | 20.999999 | 50 | 0.663774 |
omniverse-code/kit/exts/omni.kit.telemetry/PACKAGE-LICENSES/omni.kit.telemetry-LICENSE.md | Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
NVIDIA CORPORATION and its licensors retain all intellectual property
and proprietary rights in and to this software, related documentation
and any modifications thereto. Any use, reproduction, disclosure or
distribution of this software and related documentation without an express
license agreement from NVIDIA CORPORATION is strictly prohibited. | 412 | Markdown | 57.999992 | 74 | 0.839806 |
omniverse-code/kit/exts/omni.kit.telemetry/config/extension.toml | [package]
title = "Kit Telemetry"
category = "Telemetry"
version = "0.1.0"
description = "Telemetry for Omniverse Kit."
authors = ["NVIDIA"]
keywords = ["telemetry", "structured logging"]
[core]
order = -1000
[[python.module]]
name = "omni.kit.telemetry"
[[native.plugin]]
path = "bin/*.plugin"
[dependencies]
"omni.kit.pip_archive" = {}
[settings]
telemetry.logging.warnFilter = [ "*" ]
telemetry.enableNVDF = true
# enable this following option to send to the 'test' NVDF endpoint instead.
# telemetry.nvdfTestEndpoint = true
# Enable sending stack traces to Sentry
telemetry.enableSentry = false
[[test]]
# in the tests we'll be intentionally emitting error and fatal messages that will need to be
# ignored. List their patterns here.
stdoutFailPatterns.exclude = [
"*error log message*",
"*error apple muffin*",
"*fatal log message*",
"*fatal apple muffin*"
]
# the privacy settings for internal builds needs to be overridden so we can more reliably
# retrieve the session ID for some of the tests.
args = [
"--/privacy/externalBuild=false",
"--/exts/omni.kit.telemetry/skipDeferredStartup=true",
]
pyCoverageEnabled = false
pythonTests.unreliable = [
"*test_sysinfo_messages" # OM-52280
]
| 1,233 | TOML | 22.730769 | 92 | 0.712895 |
omniverse-code/kit/exts/omni.kit.telemetry/omni/kit/telemetry/__init__.py | """
Provides a helper interface to abstract and simplify some common telemetry related
tasks.
"""
import omni.core
from ._telemetry import *
from .impl import *
| 170 | Python | 17.999998 | 86 | 0.723529 |
omniverse-code/kit/exts/omni.kit.telemetry/omni/kit/telemetry/_telemetry.pyi | from __future__ import annotations
import omni.kit.telemetry._telemetry
import typing
import omni.core._core
__all__ = [
"ITelemetry",
"ITelemetry2",
"RunEnvironment"
]
class ITelemetry(_ITelemetry, omni.core._core.IObject):
"""
Interface to handle performing telemetry related tasks.
This provides an abstraction over the lower level telemetry and structured logging systems
and allows control over some common features of it.
"""
@typing.overload
def __init__(self, arg0: omni.core._core.IObject) -> None: ...
@typing.overload
def __init__(self) -> None: ...
def send_custom_event(self, eventType: str, duration: float = 0.0, data1: str = None, data2: str = None, value1: float = 0.0, value2: float = 0.0) -> None: ...
def send_generic_event(self, event_type: str, duration: float, data1: str, data2: str, value1: float, value2: float) -> None:
"""
Sends a generic structured log event with caller specified data.
@param[in] eventType A string describing the event that occurred. There is no
restriction on the content or formatting of this value.
This should neither be `nullptr` nor an empty string.
@param[in] duration A generic duration value that can be optionally included
with the event. It is the caller's respsonsibility to
decide on the usage and semantics of this value depending
on the @p eventType value. This may be 0.0 if no duration
value is needed for the event.
@param[in] data1 A string data value to be sent with the event. The contents
and interpretation of this string depend on the @p eventTyoe
value.
@param[in] data2 A string data value to be sent with the event. The contents
and interpretation of this string depend on the @p eventTyoe
value.
@param[in] value1 A floating point value to be sent with the event. This value
will be interpreted according to the @p eventType value.
@param[in] value2 A floating point value to be sent with the event. This value
will be interpreted according to the @p eventType value.
@returns No return value.
@remarks This sends a generic event to the structured logging log file. The contents,
semantics, and interpretation of this event are left entirely up to the caller.
This will be a no-op if telemetry is disabled (ie: the telemetry module either
intentionally was not loaded or failed to load).
"""
pass
class ITelemetry2(_ITelemetry2, omni.core._core.IObject):
"""
Interface to handle performing telemetry related tasks.
This provides an abstraction over the lower level telemetry and structured logging systems
and allows control over some common features of it.
"""
@typing.overload
def __init__(self, arg0: omni.core._core.IObject) -> None: ...
@typing.overload
def __init__(self) -> None: ...
def send_custom_event(self, eventType: str, duration: float = 0.0, data1: str = None, data2: str = None, value1: float = 0.0, value2: float = 0.0) -> None: ...
@property
def cloud_session(self) -> bool:
"""
:type: bool
"""
@property
def cloud_session_id(self) -> str:
"""
:type: str
"""
@property
def customer_id(self) -> str:
"""
:type: str
"""
@property
def run_environment(self) -> omni::telemetry::RunEnvironment:
"""
:type: omni::telemetry::RunEnvironment
"""
pass
class RunEnvironment():
"""
Names for the current Run environment used for telemetry.
Identifiers used to outline what kind of environment this process is currently running
in. This may be individual (OVI), cloud (OVC), or enterprise (OVE).
Members:
UNDETERMINED : The run environment has not been determined yet.
This indicates that the required startup events have not occurred yet or the run
environment could not be determined yet. An attempt to retrieve the run environment
should be made again at a later time.
INDIVIDUAL : Omniverse individual (OVI) desktop session.
This is typically installed and run through the Omniverse desktop launcher app.
Telemetry is enabled through this environment using the public Kratos authenticated
endpoint.
CLOUD : Omniverse Cloud (OVC) session.
This type of session is launched through the OVC services portal and the visual output
streamed over the network. Telemetry is enabled through this environment using a Kratos
authenticated endpoint specific to cloud deployments.
ENTERPRISE : Omniverse Enterprise (OVE) session.
This type of session is typically installed and run through the Omniverse enterprise
launcher app. Telemetry is enabled through this environment using the Kratos open
endpoint for enterprise.
"""
def __eq__(self, other: object) -> bool: ...
def __getstate__(self) -> int: ...
def __hash__(self) -> int: ...
def __index__(self) -> int: ...
def __init__(self, value: int) -> None: ...
def __int__(self) -> int: ...
def __ne__(self, other: object) -> bool: ...
def __repr__(self) -> str: ...
def __setstate__(self, state: int) -> None: ...
@property
def name(self) -> str:
"""
:type: str
"""
@property
def value(self) -> int:
"""
:type: int
"""
CLOUD: omni.kit.telemetry._telemetry.RunEnvironment # value = <RunEnvironment.CLOUD: 2>
ENTERPRISE: omni.kit.telemetry._telemetry.RunEnvironment # value = <RunEnvironment.ENTERPRISE: 3>
INDIVIDUAL: omni.kit.telemetry._telemetry.RunEnvironment # value = <RunEnvironment.INDIVIDUAL: 1>
UNDETERMINED: omni.kit.telemetry._telemetry.RunEnvironment # value = <RunEnvironment.UNDETERMINED: 0>
__members__: dict # value = {'UNDETERMINED': <RunEnvironment.UNDETERMINED: 0>, 'INDIVIDUAL': <RunEnvironment.INDIVIDUAL: 1>, 'CLOUD': <RunEnvironment.CLOUD: 2>, 'ENTERPRISE': <RunEnvironment.ENTERPRISE: 3>}
pass
class _ITelemetry(omni.core._core.IObject):
pass
class _ITelemetry2(omni.core._core.IObject):
pass
| 6,629 | unknown | 42.907284 | 210 | 0.62483 |
omniverse-code/kit/exts/omni.kit.telemetry/omni/kit/telemetry/tests/test_telemetry.py | # Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
import omni.kit.test
import omni.kit.test.teamcity
import omni.kit.telemetry
import omni.structuredlog
import omni.kit.app
import carb.settings
import tempfile
import pathlib
import time
import io
import os
import sys
import json
import datetime
import psutil
import carb
import carb.tokens
class TestITelemetry(omni.kit.test.AsyncTestCase): # pragma: no cover
def setUp(self):
self._structured_log_settings = omni.structuredlog.IStructuredLogSettings()
self._control = omni.structuredlog.IStructuredLogControl()
self._settings = carb.settings.get_settings_interface()
self.assertIsNotNone(self._control)
self.assertIsNotNone(self._settings)
self.assertIsNotNone(self._structured_log_settings)
# failed to retrieve the IStructuredLogSettings object => fail
if self._structured_log_settings == None or self._control == None:
return
# print out the current timestamps and session ID to help with debugging test failures
# post mortem.
print("local time at test start is " + str(datetime.datetime.now()) + ", UTC time is " + str(datetime.datetime.now(datetime.timezone.utc)) + ".")
print("current session ID is " + str(self._structured_log_settings.session_id) + ".")
# make sure to flush the structured log queue now since we're going to be changing the
# log output path and default log name for this test. This will ensure that any pending
# events are flushed to their appropriate log files first.
self._control.stop()
# set the log directory and name.
self._temp_dir = tempfile.TemporaryDirectory()
self._log_file_name = "omni.kit.telemetry.test.log"
self._old_log_name = self._structured_log_settings.log_default_name
self._old_log_path = self._structured_log_settings.log_output_path
self._structured_log_settings.log_default_name = self._log_file_name
self._structured_log_settings.log_output_path = self._temp_dir.name
# piece together the expected name of the log and privacy files we'll be watching.
self._log_path = pathlib.Path(self._temp_dir.name).joinpath(self._log_file_name)
self._privacy_path = pathlib.Path(self._temp_dir.name).joinpath("privacy.toml")
# put together the expected location for the system info logs. Unfortunately these
# logs are created and events added to them before this script gets a chance to modify
# the log directory and log name. We'll have to look at the original log location to
# make sure that it output the system info events as expected. Also, if the system
# info logs are accumulating on the system, they may be rotated out over time. If this
# happens during the launch of the app on this run, it could split the messages belonging
# to this session over two log files (presumably we won't be outputting more than 50MiB
# of system info logs in a single run). We'll make sure to run over each of the default
# rotated log names to pull in as much information as possible.
self._sysinfo_log_paths = [pathlib.Path(self._old_log_path).joinpath("omni.kit.sysinfo.2.log"),
pathlib.Path(self._old_log_path).joinpath("omni.kit.sysinfo.1.log"),
pathlib.Path(self._old_log_path).joinpath("omni.kit.sysinfo.log")]
self._write_privacy_settings(self._privacy_path)
self._settings.set_string("/structuredLog/privacySettingsFile", str(self._privacy_path))
self._structured_log_settings.load_privacy_settings()
self.assertEqual(pathlib.Path(self._structured_log_settings.log_default_name), self._log_path)
self.assertEqual(pathlib.Path(self._structured_log_settings.log_output_path), pathlib.Path(self._temp_dir.name))
def tearDown(self):
# nothing to clean up => fail.
if self._structured_log_settings == None:
return;
self._structured_log_settings.log_output_path = self._old_log_path
self._structured_log_settings.log_default_name = self._old_log_name
# restore the original privacy settings.
self._settings.set_string("/structuredLog/privacySettingsFile", "")
self._structured_log_settings.load_privacy_settings()
# explicitly clean up the temporary dir. Note that we need to explicitly clean it up
# since it can throw an exception on Windows if a file or folder is still locked. The
# support for internally ignoring these exceptions isn't added until `tempfile` v3.10
# and we're using an older version of the package here.
try:
self._temp_dir.cleanup()
except:
pass
# explicitly clean up all of our objects so we're not relying on the python GC.
self._structured_log_settings = None
self._control = None
self._settings = None
self._temp_dir = None
self._log_file_name = None
self._old_log_name = None
self._old_log_path = None
self._log_path = None
self._privacy_path = None
self._sysinfo_log_paths = None
print("local time at test end is " + str(datetime.datetime.now()) + ", UTC time is " + str(datetime.datetime.now(datetime.timezone.utc)) + ".")
def _write_privacy_settings(self, filename):
with io.open(filename, "w") as fp:
fp.write("[privacy]\n")
fp.write("performance = true\n")
fp.write("personalization = true\n")
fp.write("usage = true\n")
fp.write("userId = \"[email protected]\"\n")
fp.write("extraDiagnosticDataOptIn = \"externalBuilds\"\n")
def _read_log_lines(self, filename, expected_types, session = None, time_delta = -1, log_time_range = 900):
"""
Reads the events from the expected log file location. Each log message line is parsed as
a JSON blob. The 'data' property of each message is parsed into a dictionary and a list
of these parsed dictionaries are returned. The log's header JSON object will also be
parsed and verified. The verification includes checking that the log's creation timestamp
is recent.
Parameters:
filename: The name of the log file to process for events. This may not be
`None`.
expected_types: A list of event type names that are to be expected in the log file.
If an event is found that does not match one of the events in this
list, a test will fail.
session: An optional session ID string to match to each event. An event will
only be included in the output if its session ID matches this one.
This may be `None` or "0" to ignore the session ID matching. If this
is set to "0", the session ID from each event will be added to each
event in the output list so that further filtering can occur.
time_delta: An optional time delta in seconds used to further filter events from
the log file. Only events that were logged after a point that is
this many seconds earlier than the call time will be included in the
output. This may be negative to disable filtering out older events.
log_time_range: The maximum number of seconds old that the log's creation timestamp
in its header may be. This test may be disabled by settings this
value to 0. If non-zero, this should be set to an absurd range
versus the ideal case so that running on slow machines doesn't cause
this test to unexpectedly fail. This defaults to 900s (15m).
Returns:
A list of parsed events. Each event in the list will be a dictionary of the
properties parsed from that event's 'data' property. Note that each returned
event in this list will have had its 'type' and 'session' properties copied
into it under the property names 'cloudEventsEventType' and 'cloudEventsSessionId'.
These can be used by the caller to further filter and categorize the events.
"""
if not os.path.isfile(filename):
print("failed to find the log file '" + str(filename) + "'.")
return []
events = []
lines = []
header = {}
with open(filename, "r") as f:
lines = f.readlines()
if time_delta >= 0:
timestamp = datetime.datetime.now(datetime.timezone.utc) - datetime.timedelta(seconds = time_delta)
# walk through all the lines in the file except the first one (the log header).
for i in range(1, len(lines)):
line = lines[i]
try:
event = json.loads(line)
self.assertTrue(event["type"] in expected_types)
msg_time = datetime.datetime.strptime(event["time"], "%Y-%m-%dT%H:%M:%S.%f%z")
# always add the 'type' and 'session' properties to the output event. Since the
# "type" and "session" property names are rather generic and could legitimately
# be part of the "data" property, we'll rename them to something less generic
# that the caller can consume.
event["data"]["cloudEventsEventType"] = event["type"]
event["data"]["cloudEventsSessionId"] = event["session"]
if (session == None or session == "0" or event["session"] == session) and (time_delta < 0 or msg_time >= timestamp):
events.append(event["data"])
except json.decoder.JSONDecodeError as e:
print("failed to parse the line '" + line + "' as JSON {reason = '" + str(e) + "'}")
pass
except Exception as e:
print("error processing the line '" + line + "' as JSON {error = '" + str(e) + "'}")
raise
# ****** parse and verify the header line ******
try:
header = json.loads(lines[0])
except json.decoder.JSONDecodeError as e:
print("failed to parse the header '" + lines[0] + "' as JSON {reason = '" + str(e) + "'}")
self.assertFalse(True)
except Exception as e:
print("error processing the header '" + lines[0] + "' as JSON {error = '" + str(e) + "'}")
self.assertFalse(True)
self.assertEqual(header["source"], "omni.structuredlog")
self.assertIsNotNone(header["version"])
# make sure the log was created recently.
if log_time_range > 0:
timestamp = datetime.datetime.strptime(header["time"], "%Y-%m-%dT%H:%M:%S.%f%z")
time_diff = datetime.datetime.now(datetime.timezone.utc) - timestamp
self.assertLess(time_diff.total_seconds(), log_time_range)
return events
def _is_event_present(self, events, properties):
"""
Verifies that all keys in `properties` both exist and have the same values in a
single event in `events`.
Parameters:
events: The set of events that were read from the log file. These are
expected to have been parsed into dictionary objects from the
original JSON 'data' property of each event.
properties: The set of properties to verify are present and match at least
one of the events in the log. All properties must match to a single
event in order for this to succeed.
Returns:
`True` if all the requested keys match in a single event.
`False` if no event containing all properties is found.
"""
# go through each event in the log file and check if it has all the required properties.
for i in range(len(events)):
event = events[i]
matches = True
# go through each of the required properties and verify they are all present and
# have the expected value.
for key, value in properties.items():
if not key in event:
continue
if event[key] != value:
matches = False
break
if matches:
return True
return False
def test_itelemetry_generic_events(self):
"""
Tests sending telemetry events with ITelemetry.send_generic_event(). This version of the
helper function does not provide default values for the parameters.
"""
# retrieve the ITelemetry object.
self._telemetry = omni.kit.telemetry.ITelemetry()
self.assertIsNotNone(self._telemetry)
# send some test events with default ordered parameters.
self._telemetry.send_generic_event("itelemetry_event3_1", 1.025, "apple", None, -1.1275, 5.5)
self._telemetry.send_generic_event("itelemetry_event3_2", 4.25, None, "boo", 8.75, 14.12875)
self._telemetry.send_generic_event("itelemetry_event3_3", 17.625, None, None, 1.25, 2.25)
self._telemetry.send_generic_event("itelemetry_event3_4", 6.75, "orange", "muffin", 76.25, -83.25)
# send some test events with default named parameters.
# FIXME!! once python bindings from 'omni.bind' generate parameter names, these tests
# should be enabled to get some extra test coverage. Currently python is
# expecting the parameters to be named "arg0", "arg1", etc.
#self._telemetry.send_generic_event(eventType = "itelemetry_event4_1", duration = 11.025, data1 = "pear", data2 = None, value1 = -3.1275, value2 = 50.5)
#self._telemetry.send_generic_event(value2 = 23.12875, data2 = "peach", data1 = None, value1 = 10.75, eventType = "itelemetry_event4_2", duration = 14.25)
# make sure all the messages are flushed to disk.
self._control.stop()
# read the log and verify that all the expected messages are present.
events = self._read_log_lines(self._log_path,
[
"com.nvidia.omni.kit.internal.generic",
"com.nvidia.omni.kit.telemetry.startup",
"com.nvidia.omni.kit.extension.startup"
])
# verify the ordered parameters events.
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry_event3_1", "duration" : 1.025, "data1" : "apple", "data2" : "", "value1" : -1.1275, "value2" : 5.5}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry_event3_2", "duration" : 4.25, "data1" : "", "data2" : "boo", "value1" : 8.75, "value2" : 14.12875}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry_event3_3", "duration" : 17.625, "data1" : "", "data2" : "", "value1" : 1.25, "value2" : 2.25}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry_event3_4", "duration" : 6.75, "data1" : "orange", "data2" : "muffin", "value1" : 76.25, "value2" : -83.25}))
# verify the named parameters events.
# FIXME!! once python bindings from 'omni.bind' generate parameter names, these tests
# should be enabled to get some extra test coverage.
#self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry_event4_1", "duration" : 11.025, "data1" : "pear", "data2" : "", "value1" : -3.1275, "value2" : 50.5}))
#self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry_event4_2", "duration" : 14.25, "data1" : "", "data2" : "peach", "value1" : 10.75, "value2" : 23.12875}))
# clean up.
self._telemetry = None
def test_itelemetry_custom_events(self):
"""
Tests sending telemetry events with ITelemetry.send_custom_event(). This version of the
helper function provides default values for all parameters except the first 'eventType'.
"""
# retrieve the ITelemetry object.
self._telemetry = omni.kit.telemetry.ITelemetry()
self.assertIsNotNone(self._telemetry)
# send some test events with default ordered parameters.
self._telemetry.send_custom_event("itelemetry_event")
self._telemetry.send_custom_event("itelemetry_event_duration", 1.25)
self._telemetry.send_custom_event("itelemetry_event_data1", 0, "some data1")
self._telemetry.send_custom_event("itelemetry_event_data2", 0, None, "some data2")
self._telemetry.send_custom_event("itelemetry_event_value1", 0, None, None, 3.14159)
self._telemetry.send_custom_event("itelemetry_event_value2", 0, None, None, 0, 2.71828)
# send some test events with default named parameters.
self._telemetry.send_custom_event("itelemetry_event2")
self._telemetry.send_custom_event("itelemetry_event2_duration", duration = 5.05)
self._telemetry.send_custom_event("itelemetry_event2_data1", data1 = "some data1_2")
self._telemetry.send_custom_event("itelemetry_event2_data2", data2 = "some data2_2")
self._telemetry.send_custom_event("itelemetry_event2_value1", value1 = 1.75)
self._telemetry.send_custom_event("itelemetry_event2_value2", value2 = -14.28)
# make sure all the messages are flushed to disk.
self._control.stop()
# read the log and verify that all the expected messages are present.
events = self._read_log_lines(self._log_path,
[
"com.nvidia.omni.kit.internal.generic",
"com.nvidia.omni.kit.telemetry.startup",
"com.nvidia.omni.kit.extension.startup"
])
# verify the ordered parameters events.
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry_event", "duration" : 0, "data1" : "", "data2" : "", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry_event_duration", "duration" : 1.25, "data1" : "", "data2" : "", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry_event_data1", "duration" : 0, "data1" : "some data1", "data2" : "", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry_event_data2", "duration" : 0, "data1" : "", "data2" : "some data2", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry_event_value1", "duration" : 0, "data1" : "", "data2" : "", "value1" : 3.14159, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry_event_value2", "duration" : 0, "data1" : "", "data2" : "", "value1" : 0, "value2" : 2.71828}))
# verify the named parameters events.
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry_event2", "duration" : 0, "data1" : "", "data2" : "", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry_event2_duration", "duration" : 5.05, "data1" : "", "data2" : "", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry_event2_data1", "duration" : 0, "data1" : "some data1_2", "data2" : "", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry_event2_data2", "duration" : 0, "data1" : "", "data2" : "some data2_2", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry_event2_value1", "duration" : 0, "data1" : "", "data2" : "", "value1" : 1.75, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry_event2_value2", "duration" : 0, "data1" : "", "data2" : "", "value1" : 0, "value2" : -14.28}))
# clean up.
self._telemetry = None
def test_iapp_events(self):
"""
Tests sending telemetry events with omni.kit.app.send_telemetry_event(). This version
provides access to generic telemetry events to all systems through IApp. These events
will be a no-op if the `omni.kit.telemetry` extension is not loaded.
"""
# send some test events with default ordered parameters.
omni.kit.app.send_telemetry_event("iapp_event")
omni.kit.app.send_telemetry_event("iapp_event_duration", -2.25)
omni.kit.app.send_telemetry_event("iapp_event_data1", 0, "some app_data1")
omni.kit.app.send_telemetry_event("iapp_event_data2", 0, None, "some app_data2")
omni.kit.app.send_telemetry_event("iapp_event_value1", 0, None, None, 1.5)
omni.kit.app.send_telemetry_event("iapp_event_value2", 0, None, None, 0, 75.5)
# send some test events with default named parameters.
omni.kit.app.send_telemetry_event("iapp_event2")
omni.kit.app.send_telemetry_event("iapp_event2_duration", duration = 81.75)
omni.kit.app.send_telemetry_event("iapp_event2_data1", data1 = "some app_data1_2")
omni.kit.app.send_telemetry_event("iapp_event2_data2", data2 = "some app_data2_2")
omni.kit.app.send_telemetry_event("iapp_event2_value1", value1 = -4.75)
omni.kit.app.send_telemetry_event("iapp_event2_value2", value2 = 214.5)
# make sure all the messages are flushed to disk.
self._control.stop()
# read the log and verify that all the expected messages are present.
events = self._read_log_lines(self._log_path,
[
"com.nvidia.omni.kit.internal.generic",
"com.nvidia.omni.kit.telemetry.startup",
"com.nvidia.omni.kit.extension.startup"
])
# verify the ordered parameters events.
self.assertTrue(self._is_event_present(events, {"eventType" : "iapp_event", "duration" : 0, "data1" : "", "data2" : "", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "iapp_event_duration", "duration" : -2.25, "data1" : "", "data2" : "", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "iapp_event_data1", "duration" : 0, "data1" : "some app_data1", "data2" : "", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "iapp_event_data2", "duration" : 0, "data1" : "", "data2" : "some app_data2", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "iapp_event_value1", "duration" : 0, "data1" : "", "data2" : "", "value1" : 1.5, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "iapp_event_value2", "duration" : 0, "data1" : "", "data2" : "", "value1" : 0, "value2" : 75.5}))
# verify the named parameters events.
self.assertTrue(self._is_event_present(events, {"eventType" : "iapp_event2", "duration" : 0, "data1" : "", "data2" : "", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "iapp_event2_duration", "duration" : 81.75, "data1" : "", "data2" : "", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "iapp_event2_data1", "duration" : 0, "data1" : "some app_data1_2", "data2" : "", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "iapp_event2_data2", "duration" : 0, "data1" : "", "data2" : "some app_data2_2", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "iapp_event2_value1", "duration" : 0, "data1" : "", "data2" : "", "value1" : -4.75, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "iapp_event2_value2", "duration" : 0, "data1" : "", "data2" : "", "value1" : 0, "value2" : 214.5}))
def test_transmitter_launch(self):
"""
Tests that the telemetry transmitter app was successfully launched and is still running.
This should always be the case in the default configuration.
"""
transmitter_log = carb.tokens.get_tokens_interface().resolve("${omni_logs}/omni.telemetry.transmitter.log")
transmitter_exited = False
transmitter_old_log = False
# wait for a little bit to allow the transmitter process to fully start up. This usually
# takes up to 1s. We'll wait longer to account for slow machines. Without waiting, this
# test will only catch the first few lines of the transmitter's log and it may not have
# exited yet. Without checking for the log's early exit message first, this test could
# get into a race condition with checking for the process still running versus the
# transmitter process exiting.
time.sleep(5)
self.assertIsNotNone(transmitter_log)
# wait for the log to appear for up to a minute. This will also account for cases where
# the transmitter takes a long time to download the schemas package or time out while
# attempting to download the authentication token from the OV launcher (this failure is
# expected but normally takes ~1s).
for i in range(60):
if os.path.isfile(transmitter_log):
break
time.sleep(1)
# check the transmitter's test log first to see if it ran. If it did run, it is possible
# that it shutdown early if the local user hasn't given data consent or the 'privacy.toml'
# file doesn't exist. In this case we can check for the shutdown message and avoid
# testing for the existence of the process later on. For this test, all we're really
# interested in is whether we can verify that this process at least attempted to launch
# the transmitter process.
self.assertTrue(os.path.isfile(transmitter_log))
# get the log's modification time and make sure it's very recent. If it's not recent,
# that means the transmitter didn't run or wasn't launched by this process. We'll
# consider a modification time in the last 60s as being recent.
log_mtime = datetime.datetime.fromtimestamp(os.path.getmtime(transmitter_log))
self.assertGreaterEqual(log_mtime, datetime.datetime.now() - datetime.timedelta(seconds = 60))
lines = []
with io.open(transmitter_log, "r") as f:
lines = f.readlines()
for line in lines:
# check if the disabled consent message was printed to the log. This means that the
# transmitter exited early because either the user did not give consent to any of
# the data categories or the 'privacy.toml' file is missing. However, in this case
# we did verify that the transmitter process did actually run.
if "consent was disabled for all categories - exiting" in line:
transmitter_exited = True
# check if the transmitter exited naturally on its own. This means that this log
# belonged to an older instance of the transmitter that was launched by another
# process. This message should not be present in the log belonging to the transmitter
# process that was launched by this process since the existence of this process itself
# will keep the transmitter alive.
if "all clients have exited - shutting down" in line:
transmitter_old_log = True
# make sure there wasn't a natural shutdown present in the log. If this is found, that
# means that log was created by a previous instances of the transmitter, not the one
# that was launched by this process (since this process would hold the transmitter
# open).
self.assertFalse(transmitter_old_log)
# the transmitter process has not exited yet according to its log => scan the running
# processes to make sure it's actually running. Note that this is safe to do since
# this process itself will be keeping the transmitter from exiting now that we know
# it didn't exit early during its startup.
if not transmitter_exited:
transmitter_count = 0
# walk the process list in the table and count how many transmitter processes are running.
for proc in psutil.process_iter():
try:
if "omni.telemetry.transmitter" in proc.name().lower():
print("found the running process '" + proc.name() + "' (" + str(proc.pid) + ").")
transmitter_count = transmitter_count + 1
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess) as e:
print("invalid process found {e = '" + str(e) + "'}")
pass
# make sure only a single telemetry transmitter is running.
self.assertEqual(transmitter_count, 1)
def test_log_redirection(self):
"""
Tests that the log message redirection works as expected.
"""
# save the original settings for all the log channels locally so we can restore
# them later.
logging_settings = self._settings.create_dictionary_from_settings("/telemetry/logging")
def log_fatal(msg):
"""
Helper function to provide functionality to the 'CARB_LOG_FATAL()' operation from
python. This isn't provided in the carb logging bindings because in theory we
should never get into a situation where a fatal operation can be performed from
the python side. However, for the purposes of this test, we need to be able to
produce fatal log messages.
"""
file, lno, func, mod = carb._get_caller_info()
carb.log(mod, carb.logging.LEVEL_FATAL, file, func, lno, msg)
def get_function_name():
"""
Retrieves the name of the calling function.
"""
f = sys._getframe(1)
if f is None or not hasattr(f, "f_code"):
return "(unknown function)"
return f.f_code.co_name
# write some test log messages.
carb.log_verbose("verbose log message 1") # should be missing in the log.
carb.log_info("info log message 2") # should be missing in the log.
carb.log_warn("warn log message 3") # should be missing in the log.
carb.log_error("error log message 4") # should be found in the log.
log_fatal("fatal log message 5") # should be found in the log.
# adjust the settings and write more log messages.
self._settings.destroy_item("/telemetry/logging/warnFilter")
self._settings.destroy_item("/telemetry/logging/errorFilter")
self._settings.destroy_item("/telemetry/logging/fatalFilter")
carb.log_verbose("verbose log message 6") # should be missing in the log.
carb.log_info("info log message 7") # should be missing in the log.
carb.log_warn("warn log message 8") # should be found in the log.
carb.log_error("error log message 9") # should be found in the log.
log_fatal("fatal log message 10") # should be found in the log.
# adjust the settings again and write more log messages.
self._settings.set_string_array("/telemetry/logging/warnFilter", [".* message .*"])
self._settings.set_string_array("/telemetry/logging/errorFilter", [".* log .*"])
self._settings.set_string_array("/telemetry/logging/fatalFilter", [".*"])
carb.log_verbose("verbose log message 11") # should be missing in the log.
carb.log_verbose("verbose apple muffin 11b") # should be missing in the log.
carb.log_info("info log message 12") # should be missing in the log.
carb.log_info("info apple muffin 12b") # should be missing in the log.
carb.log_warn("warn log message 13") # should be missing in the log.
carb.log_warn("warn apple muffin 13b") # should be found in the log.
carb.log_error("error log message 14") # should be missing in the log.
carb.log_error("error apple muffin 14b") # should be found in the log.
log_fatal("fatal log message 15") # should be missing in the log.
log_fatal("fatal apple muffin 15b") # should be missing in the log.
# flush the log queue and read the log file.
self._control.stop()
events = self._read_log_lines(self._log_path,
[
"omni.kit.logging.message",
"com.nvidia.omni.kit.telemetry.startup",
"com.nvidia.omni.kit.extension.startup"
])
func_name = get_function_name()
# verify that the expected log messages show up in the log.
self.assertFalse(self._is_event_present(events, {"functionName" : func_name, "level" : "verbose", "message" : "verbose log message 1"}))
self.assertFalse(self._is_event_present(events, {"functionName" : func_name, "level" : "info", "message" : "info log message 2"}))
self.assertFalse(self._is_event_present(events, {"functionName" : func_name, "level" : "warn", "message" : "warn log message 3"}))
self.assertTrue(self._is_event_present(events, {"functionName" : func_name, "level" : "error", "message" : "error log message 4"}))
self.assertTrue(self._is_event_present(events, {"functionName" : func_name, "level" : "fatal", "message" : "fatal log message 5"}))
self.assertFalse(self._is_event_present(events, {"functionName" : func_name, "level" : "verbose", "message" : "verbose log message 6"}))
self.assertFalse(self._is_event_present(events, {"functionName" : func_name, "level" : "info", "message" : "info log message 7"}))
self.assertTrue(self._is_event_present(events, {"functionName" : func_name, "level" : "warn", "message" : "warn log message 8"}))
self.assertTrue(self._is_event_present(events, {"functionName" : func_name, "level" : "error", "message" : "error log message 9"}))
self.assertTrue(self._is_event_present(events, {"functionName" : func_name, "level" : "fatal", "message" : "fatal log message 10"}))
self.assertFalse(self._is_event_present(events, {"functionName" : func_name, "level" : "verbose", "message" : "verbose log message 11"}))
self.assertFalse(self._is_event_present(events, {"functionName" : func_name, "level" : "verbose", "message" : "verbose apple muffin 11b"}))
self.assertFalse(self._is_event_present(events, {"functionName" : func_name, "level" : "info", "message" : "info log message 12"}))
self.assertFalse(self._is_event_present(events, {"functionName" : func_name, "level" : "info", "message" : "info apple muffin 12b"}))
self.assertFalse(self._is_event_present(events, {"functionName" : func_name, "level" : "warn", "message" : "warn log message 13"}))
self.assertTrue(self._is_event_present(events, {"functionName" : func_name, "level" : "warn", "message" : "warn apple muffin 13b"}))
self.assertFalse(self._is_event_present(events, {"functionName" : func_name, "level" : "error", "message" : "error log message 14"}))
self.assertTrue(self._is_event_present(events, {"functionName" : func_name, "level" : "error", "message" : "error apple muffin 14b"}))
self.assertFalse(self._is_event_present(events, {"functionName" : func_name, "level" : "fatal", "message" : "fatal log message 15"}))
self.assertFalse(self._is_event_present(events, {"functionName" : func_name, "level" : "fatal", "message" : "fatal apple muffin 15b"}))
# restore the original logging redirection settings. Note that calling update() with
# OVERWRITE doesn't actually overwrite array values. It instead only replaces the items
# in the array that are also present in the new array. If the old array was longer, the
# additional array items from the old value still exist after the update. To work around
# this and have 'replace' behaviour instead of just 'overwrite', we need to delete the
# old array first.
self._settings.destroy_item("/telemetry/logging/warnFilter")
self._settings.destroy_item("/telemetry/logging/errorFilter")
self._settings.destroy_item("/telemetry/logging/fatalFilter")
self._settings.update("/telemetry/logging", logging_settings, "", carb.dictionary.UpdateAction.OVERWRITE)
def test_sysinfo_messages(self):
"""
Test whether the system info messages were written out when the 'omni.kit.telemetry'
extension was loaded. Note that this happens when the `omni.kit.telemetry` extension
loads and would have happened long before this script started running so we unfortunately
can't redirect its output to a new log or log directory. However, we can find the log
it did go to (in its original location) and verify that some new system info events
were written into it in the last few seconds or minutes.
"""
# on a system with attached (active) displays, we should expect 4 events - 'cpu', 'os',
# 'display', and 'displayOverview'. However, on headless systems (like some TC agents)
# there may not be displays to speak of so we'll just ignore them.
expected_count = 2
# stop the queue to ensure all events are flushed to disk.
self._control.stop()
# make sure that at least one log message from a recent session was written to the
# system info log. Note that if the local user doesn't have its 'privacy.toml' file
# present on disk or the user hasn't given consent for 'usage' data, the retrieved
# session ID will be 0 and we won't be able to filter based on session ID. This will
# be the case on most or all test agent machines. To work around this, we'll also
# make sure to only grab the events from a recent period (several minutes in this case).
for sysinfo_log_path in self._sysinfo_log_paths:
# numbered log file doesn't exist => skip it.
if not os.path.isfile(sysinfo_log_path):
print("the log file '" + str(sysinfo_log_path) + "' doesn't exist. Skipping it.")
continue
# publish the full log file to the TC artifacts.
omni.kit.test.teamcity.teamcity_publish_image_artifact(sysinfo_log_path, "logs")
events = self._read_log_lines(sysinfo_log_path,
[
"com.nvidia.omni.kit.sysinfo.cpu",
"com.nvidia.omni.kit.sysinfo.os",
"com.nvidia.omni.kit.sysinfo.display",
"com.nvidia.omni.kit.sysinfo.displayOverview",
"com.nvidia.omni.kit.sysinfo.gpu",
"com.nvidia.omni.kit.sysinfo.gpuOverview"
],
str(self._structured_log_settings.session_id),
30 * 60, 0)
# make sure at least one event was found.
self.assertGreater(len(events), 0)
# this local user is either missing their 'privacy.toml' file or did not give consent
# for 'usage' data => count how many events appeared for each session ID in the list
# of recent events. There should be at least four events for each run - 'cpu', 'os',
# 'display', and 'displayOverview'. Note that in render-less cases like these tests
# the GPU info will never be collected because the `gpu.foundation` plugin is never
# loaded.
if "cloudEventsSessionId" in events[0]:
session_counts = {}
for event in events:
if not event["cloudEventsSessionId"] in session_counts:
session_counts[event["cloudEventsSessionId"]] = 1
else:
session_counts[event["cloudEventsSessionId"]] = session_counts[event["cloudEventsSessionId"]] + 1
# make sure at least one group of events from sessions have matching messages for the
# main events that always print (cpu, os, display, displayOverview).
found = False
for key, value in session_counts.items():
if value >= expected_count:
found = True
break
else:
print(f"only found {value} events from session {key}.")
self.assertTrue(found)
# make sure at least one matching message was found for the main events that always print
# (cpu, os, display, displayOverview).
else:
self.assertGreaterEqual(len(events), expected_count)
# verify that at least the 'cpu' and 'os' events are present for each session ID returned
# in the event list.
cpu_counts = {}
os_counts = {}
sessions = []
for event in events:
# the event name wasn't present (?!) => fail.
self.assertTrue("cloudEventsEventType" in event)
self.assertTrue("cloudEventsSessionId" in event)
# add the session ID to a list so we can ensure each one had a CPU and OS entry. Note
# that if multiple sessions are found in the list, we'll reject the counts for the
# first session since one or more of its events could have been filtered out by the
# time delta check in _read_log_lines().
if not event["cloudEventsSessionId"] in sessions:
sessions.append(event["cloudEventsSessionId"])
session_id = event["cloudEventsSessionId"]
if event["cloudEventsEventType"] == "com.nvidia.omni.kit.sysinfo.cpu":
if not session_id in cpu_counts:
cpu_counts[session_id] = 1
else:
cpu_counts[session_id] = cpu_counts[session_id] + 1
elif event["cloudEventsEventType"] == "com.nvidia.omni.kit.sysinfo.os":
if not session_id in os_counts:
os_counts[session_id] = 1
else:
os_counts[session_id] = os_counts[session_id] + 1
# make sure at least one session ID was found.
self.assertGreater(len(sessions), 0)
# events from multiple sessions were found => reject the counts from the first session
# since some of its events may have been filtered by the time delta check.
if len(sessions) > 1:
print("trimming partial sessions.")
for id in sessions:
print(" {session = '" + str(id) +
"', cpu_counts = " + str(cpu_counts[id]) +
", os_counts = " + str(os_counts[id]) + "}")
session_id = sessions[0]
self.assertTrue(session_id in cpu_counts)
self.assertTrue(session_id in os_counts)
sessions.pop(0)
cpu_counts.pop(session_id)
os_counts.pop(session_id)
self.assertGreater(len(cpu_counts), 0)
self.assertGreater(len(os_counts), 0)
# make sure no mysterious extra sessions got into the counts somehow.
self.assertEqual(len(sessions), len(cpu_counts))
self.assertEqual(len(sessions), len(os_counts))
# check that each known session has at least one 'cpu' and one 'os' event found for it.
for session in sessions:
self.assertTrue(session in cpu_counts)
self.assertTrue(session in os_counts)
self.assertGreater(cpu_counts[session], 0)
self.assertGreater(os_counts[session], 0)
def test_itelemetry2(self):
"""
Tests the methods of the with ITelemetry2 interface. This version of the
helper function provides default values for all parameters except the first 'eventType'.
"""
# retrieve the ITelemetry object.
self._telemetry2 = omni.kit.telemetry.ITelemetry2()
self.assertIsNotNone(self._telemetry2)
# send some test events with default ordered parameters.
self._telemetry2.send_custom_event("itelemetry2_event")
self._telemetry2.send_custom_event("itelemetry2_event_duration", 1.25)
self._telemetry2.send_custom_event("itelemetry2_event_data1", 0, "some data1")
self._telemetry2.send_custom_event("itelemetry2_event_data2", 0, None, "some data2")
self._telemetry2.send_custom_event("itelemetry2_event_value1", 0, None, None, 3.14159)
self._telemetry2.send_custom_event("itelemetry2_event_value2", 0, None, None, 0, 2.71828)
# send some test events with default named parameters.
self._telemetry2.send_custom_event("itelemetry2_event2")
self._telemetry2.send_custom_event("itelemetry2_event2_duration", duration = 5.05)
self._telemetry2.send_custom_event("itelemetry2_event2_data1", data1 = "some data1_2")
self._telemetry2.send_custom_event("itelemetry2_event2_data2", data2 = "some data2_2")
self._telemetry2.send_custom_event("itelemetry2_event2_value1", value1 = 1.75)
self._telemetry2.send_custom_event("itelemetry2_event2_value2", value2 = -14.28)
# make sure all the messages are flushed to disk.
self._control.stop()
# read the log and verify that all the expected messages are present.
events = self._read_log_lines(self._log_path,
[
"com.nvidia.omni.kit.internal.generic",
"com.nvidia.omni.kit.telemetry.startup",
"com.nvidia.omni.kit.extension.startup"
])
# verify the ordered parameters events.
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry2_event", "duration" : 0, "data1" : "", "data2" : "", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry2_event_duration", "duration" : 1.25, "data1" : "", "data2" : "", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry2_event_data1", "duration" : 0, "data1" : "some data1", "data2" : "", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry2_event_data2", "duration" : 0, "data1" : "", "data2" : "some data2", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry2_event_value1", "duration" : 0, "data1" : "", "data2" : "", "value1" : 3.14159, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry2_event_value2", "duration" : 0, "data1" : "", "data2" : "", "value1" : 0, "value2" : 2.71828}))
# verify the named parameters events.
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry2_event2", "duration" : 0, "data1" : "", "data2" : "", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry2_event2_duration", "duration" : 5.05, "data1" : "", "data2" : "", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry2_event2_data1", "duration" : 0, "data1" : "some data1_2", "data2" : "", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry2_event2_data2", "duration" : 0, "data1" : "", "data2" : "some data2_2", "value1" : 0, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry2_event2_value1", "duration" : 0, "data1" : "", "data2" : "", "value1" : 1.75, "value2" : 0}))
self.assertTrue(self._is_event_present(events, {"eventType" : "itelemetry2_event2_value2", "duration" : 0, "data1" : "", "data2" : "", "value1" : 0, "value2" : -14.28}))
# make sure the other methods and accessors can be called.
if self._telemetry2.cloud_session:
self.assertNotNone(self._telemetry2.cloud_session_id)
self.assertEqual(self._telemetry2.run_environment, omni.kit.telemetry.RunEnvironment.CLOUD)
# make sure the 'cloud_session_id' property is read-only.
try:
self._telemetry2.cloud_session_id = "This donut is purple. Purple is a fruit!"
self.assertFalse(True, "unexpectedly able to write to the `omni.kit.telemetry.ITelemetry2().cloud_session_id` property.")
except:
pass
# make sure the 'run_environment' property is read-only.
try:
self._telemetry2.run_environment = "The camembert is a little runny today"
self.assertFalse(True, "unexpectedly able to write to the `omni.kit.telemetry.ITelemetry2().run_environment` property.")
except:
pass
run_environment = self._telemetry2.run_environment;
self.assertTrue(run_environment == omni.kit.telemetry.RunEnvironment.CLOUD or
run_environment == omni.kit.telemetry.RunEnvironment.INDIVIDUAL or
run_environment == omni.kit.telemetry.RunEnvironment.ENTERPRISE)
try:
self._telemetry2.customer_id = "Bachelor Chow Incorporated"
self.assertFalse(True, "unexpectedly able to write to the `omni.kit.telemetry.ITelemetry2().customer_id` property.")
except:
pass
# clean up.
self._telemetry2 = None
| 51,322 | Python | 59.809242 | 190 | 0.612057 |
omniverse-code/kit/exts/omni.kit.telemetry/omni/kit/telemetry/tests/__init__.py | # Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
from .test_telemetry import * # pragma: no cover
from .test_sentry import *
| 502 | Python | 49.299995 | 76 | 0.800797 |
omniverse-code/kit/exts/omni.kit.telemetry/omni/kit/telemetry/tests/test_sentry.py | from unittest.mock import patch
import omni.kit.test
from omni.kit.telemetry import should_enable_sentry, start_sentry, remove_sentry_pii_data
class MockApp():
def __init__(self, is_external=False):
self.is_external = is_external
def is_app_external(self):
return self.is_external
def get_app_name(self):
return "test-app"
def get_app_version(self):
return "0.1.1"
def get_app_environment(self):
return "test"
def get_kit_version(self):
return "105.1"
class TestSentryExt(omni.kit.test.AsyncTestCase):
def test_remove_pii_data(self):
mock_event = {
"breadcrumbs": {
"values": [
{
"timestamp": 1693940484.77857,
"type": "subprocess",
"category": "subprocess",
"level": "info",
"message": "'mklink /J \"S:\\\\Remix\\\\rtx-remix\\\\mods\\\\portal_rtx\\\\deps\" \"S:\\\\Remix\\\\rtx-remix\"'"
}
]
},
'contexts': {'runtime': {'build': '3.10.13 (main, Sep 6 2023, 19:28:27) [GCC '
'7.3.1 20180303 (Red Hat 7.3.1-5)]',
'name': 'CPython',
'version': '3.10.13'}},
'environment': 'production',
'event_id': 'd4097ca1c6fa4d33ab95ce56cd48e890',
'level': 'error',
'logentry': {'message': "[Watcher] Failed to resolve USD Asset Identifier '../../../../../../capture/materials/AperturePBR_Opacity.mdl' from prim '/RootNode/meshes/mesh_4019D65FB9B7DF03/Looks/M_Fixture_Glados_Screen_A1_Screen/Shader'",
"formatted": "[Watcher] Failed to resolve USD Asset Identifier '../../../../../../capture/materials/AperturePBR_Opacity.mdl' from prim '/RootNode/meshes/mesh_4019D65FB9B7DF03/Looks/M_Fixture_Glados_Screen_A1_Screen/Shader'",
'params': []},
'logger': 'omni.ext._impl._internal',
'modules': {'pip': '21.2.1+nv1', 'setuptools': '65.5.1'},
'platform': 'python',
'release': 'omni.app.mini-0.1.1',
'tags': {'app.environment': 'default',
'app.kit_version': '105.2+.0.00Dev000.local',
'app.name': 'omni.app.mini',
'app.version': '0.1.1',
'session_id': '771899758188315817'},
'user': {'id': '[email protected]'},
"extra": {
"filename": "C:\\buildAgent\\work\\kit\\kit\\source\\extensions\\omni.usd.core\\sharedlibs\\omni.usd\\UsdMaterialWatcher.cpp",
"functionName": "load",
"lineNumber": 332,
"sys.argv": [
"D:\\Repositories\\lightspeedrtx\\lightspeed-kit\\_build\\windows-x86_64\\release\\kit\\kit.exe",
"D:\\Repositories\\lightspeedrtx\\lightspeed-kit\\_build\\windows-x86_64\\release\\apps/lightspeed.app.trex_dev.kit",
"--/rtx/verifyDriverVersion/enabled=false",
"--/app/extensions/registryEnabled=1",
"--enable",
"omni.kit.debug.pycharm",
"--/exts/omni.kit.debug.pycharm/pycharm_location=C:\\Program Files\\JetBrains\\PyCharm 2023.2"
]
},
}
scubbed_event = remove_sentry_pii_data(mock_event, None)
assert int(scubbed_event["user"]["id"]), "User Id should be replaced by a session id"
self.assertEquals(scubbed_event["logentry"]["message"], "[Watcher] Failed to resolve USD Asset Identifier /AperturePBR_Opacity.mdl' from prim /Shader'", "Message shouldn't have paths")
self.assertEquals(scubbed_event["breadcrumbs"]["values"][0]["message"], '\'mklink /J /deps" /rtx-remix"\'', "Message shouldn't have paths")
self.assertEquals(scubbed_event["extra"]["filename"], "/UsdMaterialWatcher.cpp", "Filename should only have last part")
self.assertEquals(scubbed_event["extra"]["sys.argv"][0], "/kit.exe", "Sys argv0 should only have kit")
self.assertEquals(scubbed_event["extra"]["sys.argv"][1], "/lightspeed.app.trex_dev.kit", "Sys argv1 should only have app")
self.assertEquals(scubbed_event["extra"]["sys.argv"][6], "--/exts/omni.kit.debug.pycharm/pycharm_location=/PyCharm 2023.2", "Sys argv6 should not have path to pycharm")
def test_should_enable_sentry(self):
app = MockApp(is_external=False)
settings = {}
assert should_enable_sentry(app, settings) == False, "Shouldn't be enabled in external builds"
app = MockApp(is_external=True)
settings = {"/telemetry/enableSentry": True}
assert should_enable_sentry(app, settings) == False, "Shouldn't be enabled in external builds if setting set"
app = MockApp(is_external=False)
settings = {"/telemetry/enableSentry": True}
assert should_enable_sentry(app, settings) == True, "Should be enabled in internal builds if setting set"
app = MockApp(is_external=False)
settings = {"/telemetry/enableSentry": False}
assert should_enable_sentry(app, settings) == False, "Shouldn't be enabled in internal builds if setting set"
@patch('omni.kit.telemetry.sentry_extension._get_sentry_sdk')
@patch('omni.kit.telemetry.sentry_extension._get_sentry_logging_integration')
def test_start_sentry(self, mocked_sentry_sdk, mock_logging_integration):
app = MockApp(is_external=False)
settings = {"/telemetry/enableSentry": True}
has_started = start_sentry(app, settings)
assert has_started == True, "Sentry should have started"
| 5,513 | Python | 46.947826 | 237 | 0.604027 |
omniverse-code/kit/exts/omni.kit.telemetry/omni/kit/telemetry/impl/sentry_extension.py | import time
import logging
import carb.settings
import carb
import omni.ext
import omni.kit.app
import omni.structuredlog
import sentry_sdk
from sentry_sdk.integrations.logging import LoggingIntegration
logger = logging.getLogger(__name__)
# Link was generated by perflab Sentry instance:
DSN = "https://[email protected]/834"
CARB_LOG_LEVEL_TO_EVENT_LEVEL = {
carb.logging.LEVEL_VERBOSE: "debug",
carb.logging.LEVEL_INFO: "info",
carb.logging.LEVEL_WARN: "warning",
carb.logging.LEVEL_ERROR: "error",
carb.logging.LEVEL_FATAL: "fatal"
}
class Extension(omni.ext.IExt):
def on_startup(self):
s = carb.settings.get_settings()
if s.get("/privacy/externalBuild"):
logger.info("sentry is disabled for external build")
return
if not s.get("/telemetry/enableSentry"):
return
app = omni.kit.app.get_app()
# Setup user using already formed crashreporter data
data = s.get("/crashreporter/data")
if not data:
data = {}
user_id = data.get("userId", None)
if user_id:
sentry_sdk.set_user({"id": user_id})
sentry_sdk.set_tag("app.name", app.get_app_name())
sentry_sdk.set_tag("app.version", app.get_app_version())
sentry_sdk.set_tag("app.environment", app.get_app_environment())
# Pass telemetry session to sentry
structlog_settings = omni.structuredlog.IStructuredLogSettings()
if structlog_settings:
sentry_sdk.set_tag("session_id", str(structlog_settings.session_id))
time_start = time.time()
sentry_sdk.init(
dsn=DSN,
traces_sample_rate=1.0,
auto_enabling_integrations=False,
integrations=[LoggingIntegration(event_level=None, level=None)], # Disable builtin logging integration
release=app.get_kit_version()
)
logger.info("enabled Sentry...(time took: {:.2f}s)".format(time.time()-time_start))
# Subscribe to IApp log listener which outputs carbonite log errors each frame on the main thread
# We could have created custom python logger here, but it is known to create deadlocks with GIL because of being
# called from many threads.
def on_log_event(e):
level = e.payload["level"]
if level >= carb.logging.LEVEL_ERROR:
event = {}
event["level"] = CARB_LOG_LEVEL_TO_EVENT_LEVEL.get(level, "notset")
event["logger"] = e.payload["source"]
event["logentry"] = {
"message": e.payload["message"],
"params": (),
}
event["extra"] = {
"filename": e.payload["filename"],
"functionName": e.payload["functionName"],
"lineNumber": e.payload["lineNumber"]
}
sentry_sdk.capture_event(event)
log_stream = omni.kit.app.get_app().get_log_event_stream()
self._log_sub = log_stream.create_subscription_to_pop(on_log_event, name="omni.kit.telemetry.sentry_extension")
| 3,210 | Python | 33.159574 | 120 | 0.603738 |
omniverse-code/kit/exts/omni.kit.telemetry/omni/kit/telemetry/impl/__init__.py | from .sentry_extension import Extension
| 40 | Python | 19.49999 | 39 | 0.85 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnPrimDeformer2.rst | .. _omni_graph_examples_cpp_PrimDeformer2_1:
.. _omni_graph_examples_cpp_PrimDeformer2:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Z Threshold Prim Deformer
:keywords: lang-en omnigraph node examples WriteOnly cpp prim-deformer2
Example Node: Z Threshold Prim Deformer
=======================================
.. <description>
Example deformer node that limits the Z point positions to a threshold, input via a Prim
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.PrimDeformer2"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "tests"
"uiName", "Example Node: Z Threshold Prim Deformer"
"Categories", "examples"
"Generated Class Name", "OgnPrimDeformer2Database"
"Python Module", "omni.graph.examples.cpp"
| 1,337 | reStructuredText | 25.759999 | 109 | 0.578908 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnCompound.rst | .. _omni_graph_examples_cpp_Compound_1:
.. _omni_graph_examples_cpp_Compound:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Compound
:keywords: lang-en omnigraph node examples threadsafe cpp compound
Example Node: Compound
======================
.. <description>
Encapsulation of one more other nodes into a single node entity. The compound node doesn't have any functionality of its own, it is merely a wrapper for a set of nodes that perform a complex task. It presents a more limited set of input and output attributes than the union of the contained nodes to make it seem as though a single node is performing a higher level function. For example a compound node could present inputs a, b, and c, and outputs root1 and root2 at the compound boundary, wiring up simple math nodes square, squareRoot, add, subtract, times, and divided_by in a simple way that calculates quadratic roots. (root1 = divide(add(b, square_root(subtract(square(b), times(4, times(a, c))))))) (root2 = divide(subtract(b, square_root(subtract(square(b), times(4, times(a, c)))))))
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.Compound"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Example Node: Compound"
"Categories", "examples"
"Generated Class Name", "OgnCompoundDatabase"
"Python Module", "omni.graph.examples.cpp"
| 1,949 | reStructuredText | 37.999999 | 794 | 0.639302 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnExampleSmooth.rst | .. _omni_graph_examples_cpp_Smooth_1:
.. _omni_graph_examples_cpp_Smooth:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Smooth Points
:keywords: lang-en omnigraph node cpp smooth
Example Node: Smooth Points
===========================
.. <description>
Smooths data in a very simple way by averaging values with neighbors.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:iterations", "``int``", "Number of times to average neighboring values", "5"
"inputs:mesh", "``bundle``", "Bundle containing data to be smoothed and neighbor arrays.", "None"
"inputs:nameOfAttributeToSmooth", "``token``", "Name of the attribute in 'mesh' containing the data to be smoothed", "points"
"inputs:nameOfNeighborStartsInputAttribute", "``token``", "Name of the 'int[]' attribute in 'mesh' containing the beginning index of neighbors of each point in the array attribute specified by 'nameOfNeighborsInputAttribute'", "neighborStarts"
"inputs:nameOfNeighborsInputAttribute", "``token``", "Name of the 'int[]' attribute in 'mesh' containing the neighbors of all points. The beginnings of each point's neighbors within this array are provided in the attribute specified by 'nameOfNeighborStartsInputAttribute'.", "neighbors"
"inputs:useGPU", "``bool``", "When this option is on, the node will use the GPU to perform the smoothing computation.", "True"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:mesh", "``bundle``", "A copy of 'mesh' with the specified attribute smoothed.", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.Smooth"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Example Node: Smooth Points"
"Generated Class Name", "OgnExampleSmoothDatabase"
"Python Module", "omni.graph.examples.cpp"
| 2,513 | reStructuredText | 33.916666 | 292 | 0.629526 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnExampleAdjacency.rst | .. _omni_graph_examples_cpp_Adjacency_1:
.. _omni_graph_examples_cpp_Adjacency:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Adjacency
:keywords: lang-en omnigraph node cpp adjacency
Example Node: Adjacency
=======================
.. <description>
Computes chosen adjacency information from specified input mesh topology data.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:computeDistances", "``bool``", "When enabled, the distances from each point to its neighbors is computed and stored in a 'float[]' attribute in 'output' as specified by 'nameOfDistancesOutputAttribute'.", "False"
"inputs:computeNeighborCounts", "``bool``", "When enabled, the number of neighbors of each point is computed and all are stored in an 'int[]' attribute in 'output' as specified by 'nameOfNeighborCountsOutputAttribute'.", "False"
"inputs:computeNeighborStarts", "``bool``", "When enabled, the beginning index of neighbors of each point within the arrays computed by either 'computeNeighbors' or 'computeDistances' is computed and all, plus an additional integer to indicate the end of the array, are stored in an 'int[]' attribute in 'output' as specified by 'nameOfNeighborStartsOutputAttribute'. The extra integer at the end allows for easy computing of the number of neighbors of any single point, by subtracting the value in the array corresponding with the point, from the following value in the array.", "True"
"inputs:computeNeighbors", "``bool``", "When enabled, the neighbors of each point are computed and stored contiguously in an 'int[]' attribute in 'output' as specified by 'nameOfNeighborsOutputAttribute'.", "True"
"inputs:mesh", "``bundle``", "Bundle containing topology data to be analysed", "None"
"inputs:nameOfDistancesOutputAttribute", "``token``", "Name of the 'float[]' attribute to be created in 'output' to contain the computed distances to each neighbor. This is only used if 'computeDistances' is true.", "distances"
"inputs:nameOfNeighborCountsOutputAttribute", "``token``", "Name of the 'int[]' attribute to be created in 'output' to contain the number of neighbors of each point. This is only used if 'computeNeighborCounts' is true. A running sum of this array can be computed using 'computeNeighborStarts'. The neighbors themselves can be computed using 'computeNeighbors'.", "neighborCounts"
"inputs:nameOfNeighborStartsOutputAttribute", "``token``", "Name of the 'int[]' attribute to be created in 'output' to contain the beginning index of neighbors of each point in the arrays computed by either 'computeNeighbors' or 'computeDistances'. This is only used if 'computeNeighborStarts' is true.", "neighborStarts"
"inputs:nameOfNeighborsOutputAttribute", "``token``", "Name of the 'int[]' attribute to be created in 'output' to contain the neighbors of all points. This is only used if 'computeNeighbors' is true. The beginnings of each point's neighbors within this array can be computed using 'computeNeighborStarts'. The number of neighbors of each point can be computed using 'computeNeighborCounts'.", "neighbors"
"inputs:nameOfPositionsInputAttribute", "``token``", "Name of the 'point3f[]' attribute in 'mesh' containing the positions of each point. This is only used if 'computeDistances' is true. The element count of this array overrides 'pointCount', when used.", "points"
"inputs:nameOfVertexCountsInputAttribute", "``token``", "Name of the 'int[]' attribute in 'mesh' containing the vertex counts of each face", "faceVertexCounts"
"inputs:nameOfVertexIndicesInputAttribute", "``token``", "Name of the 'int[]' attribute in 'mesh' containing the vertex indices of each face", "faceVertexIndices"
"inputs:pointCount", "``int``", "Number of points being referred to in the vertex indices attribute. This is only used if 'computeDistances' is false, otherwise this is overridden by the element count of the attribute specified by 'nameOfPositionsInputAttribute'.", "0"
"inputs:removeDuplicates", "``bool``", "When enabled, each neighbor of a point will be counted only once, instead of once per edge that connects the point to the neighbor.", "True"
"inputs:treatEdgesAsOneWay", "``bool``", "When enabled, if a face has an edge from A to B, B will be considered a neighbor of A, but A will not be considered a neighbor of B. This can be useful as part of identifying unshared edges or inconsistent face winding order.", "False"
"inputs:treatFacesAsCurves", "``bool``", "When enabled, the input faces will be treated as curves, instead of closed polygons, i.e. no edge from the last vertex of each face to the first vertex of that face will be counted.", "False"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:mesh", "``bundle``", "A copy of the input 'mesh' with the computed attributes added, as specified above.", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.Adjacency"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Example Node: Adjacency"
"Generated Class Name", "OgnExampleAdjacencyDatabase"
"Python Module", "omni.graph.examples.cpp"
| 5,856 | reStructuredText | 70.426828 | 591 | 0.706626 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnUniversalAdd.rst | .. _omni_graph_examples_cpp_UniversalAdd_1:
.. _omni_graph_examples_cpp_UniversalAdd:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Universal Add Node
:keywords: lang-en omnigraph node examples threadsafe cpp universal-add
Example Node: Universal Add Node
================================
.. <description>
Universal add node for all types. This file was originally generated using UniversalAddGenerator.py. Edits have been made since the initial generation as the API evolved. This example uses outputs and pairs of inputs of every type to be 'universal'. See the 'Add' node for a Python implementation that uses only one output and one pair of inputs using the 'any' type.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:bool_0", "``bool``", "Input of type bool", "False"
"inputs:bool_1", "``bool``", "Input of type bool", "False"
"inputs:bool_arr_0", "``bool[]``", "Input of type bool[]", "[]"
"inputs:bool_arr_1", "``bool[]``", "Input of type bool[]", "[]"
"inputs:colord3_0", "``colord[3]``", "Input of type colord[3]", "[0.0, 0.0, 0.0]"
"inputs:colord3_1", "``colord[3]``", "Input of type colord[3]", "[0.0, 0.0, 0.0]"
"inputs:colord3_arr_0", "``colord[3][]``", "Input of type colord[3][]", "[]"
"inputs:colord3_arr_1", "``colord[3][]``", "Input of type colord[3][]", "[]"
"inputs:colord4_0", "``colord[4]``", "Input of type colord[4]", "[0.0, 0.0, 0.0, 0.0]"
"inputs:colord4_1", "``colord[4]``", "Input of type colord[4]", "[0.0, 0.0, 0.0, 0.0]"
"inputs:colord4_arr_0", "``colord[4][]``", "Input of type colord[4][]", "[]"
"inputs:colord4_arr_1", "``colord[4][]``", "Input of type colord[4][]", "[]"
"inputs:colorf3_0", "``colorf[3]``", "Input of type colorf[3]", "[0.0, 0.0, 0.0]"
"inputs:colorf3_1", "``colorf[3]``", "Input of type colorf[3]", "[0.0, 0.0, 0.0]"
"inputs:colorf3_arr_0", "``colorf[3][]``", "Input of type colorf[3][]", "[]"
"inputs:colorf3_arr_1", "``colorf[3][]``", "Input of type colorf[3][]", "[]"
"inputs:colorf4_0", "``colorf[4]``", "Input of type colorf[4]", "[0.0, 0.0, 0.0, 0.0]"
"inputs:colorf4_1", "``colorf[4]``", "Input of type colorf[4]", "[0.0, 0.0, 0.0, 0.0]"
"inputs:colorf4_arr_0", "``colorf[4][]``", "Input of type colorf[4][]", "[]"
"inputs:colorf4_arr_1", "``colorf[4][]``", "Input of type colorf[4][]", "[]"
"inputs:colorh3_0", "``colorh[3]``", "Input of type colorh[3]", "[0.0, 0.0, 0.0]"
"inputs:colorh3_1", "``colorh[3]``", "Input of type colorh[3]", "[0.0, 0.0, 0.0]"
"inputs:colorh3_arr_0", "``colorh[3][]``", "Input of type colorh[3][]", "[]"
"inputs:colorh3_arr_1", "``colorh[3][]``", "Input of type colorh[3][]", "[]"
"inputs:colorh4_0", "``colorh[4]``", "Input of type colorh[4]", "[0.0, 0.0, 0.0, 0.0]"
"inputs:colorh4_1", "``colorh[4]``", "Input of type colorh[4]", "[0.0, 0.0, 0.0, 0.0]"
"inputs:colorh4_arr_0", "``colorh[4][]``", "Input of type colorh[4][]", "[]"
"inputs:colorh4_arr_1", "``colorh[4][]``", "Input of type colorh[4][]", "[]"
"inputs:double2_0", "``double[2]``", "Input of type double[2]", "[0.0, 0.0]"
"inputs:double2_1", "``double[2]``", "Input of type double[2]", "[0.0, 0.0]"
"inputs:double2_arr_0", "``double[2][]``", "Input of type double[2][]", "[]"
"inputs:double2_arr_1", "``double[2][]``", "Input of type double[2][]", "[]"
"inputs:double3_0", "``double[3]``", "Input of type double[3]", "[0.0, 0.0, 0.0]"
"inputs:double3_1", "``double[3]``", "Input of type double[3]", "[0.0, 0.0, 0.0]"
"inputs:double3_arr_0", "``double[3][]``", "Input of type double[3][]", "[]"
"inputs:double3_arr_1", "``double[3][]``", "Input of type double[3][]", "[]"
"inputs:double4_0", "``double[4]``", "Input of type double[4]", "[0.0, 0.0, 0.0, 0.0]"
"inputs:double4_1", "``double[4]``", "Input of type double[4]", "[0.0, 0.0, 0.0, 0.0]"
"inputs:double4_arr_0", "``double[4][]``", "Input of type double[4][]", "[]"
"inputs:double4_arr_1", "``double[4][]``", "Input of type double[4][]", "[]"
"inputs:double_0", "``double``", "Input of type double", "0.0"
"inputs:double_1", "``double``", "Input of type double", "0.0"
"inputs:double_arr_0", "``double[]``", "Input of type double[]", "[]"
"inputs:double_arr_1", "``double[]``", "Input of type double[]", "[]"
"inputs:float2_0", "``float[2]``", "Input of type float[2]", "[0.0, 0.0]"
"inputs:float2_1", "``float[2]``", "Input of type float[2]", "[0.0, 0.0]"
"inputs:float2_arr_0", "``float[2][]``", "Input of type float[2][]", "[]"
"inputs:float2_arr_1", "``float[2][]``", "Input of type float[2][]", "[]"
"inputs:float3_0", "``float[3]``", "Input of type float[3]", "[0.0, 0.0, 0.0]"
"inputs:float3_1", "``float[3]``", "Input of type float[3]", "[0.0, 0.0, 0.0]"
"inputs:float3_arr_0", "``float[3][]``", "Input of type float[3][]", "[]"
"inputs:float3_arr_1", "``float[3][]``", "Input of type float[3][]", "[]"
"inputs:float4_0", "``float[4]``", "Input of type float[4]", "[0.0, 0.0, 0.0, 0.0]"
"inputs:float4_1", "``float[4]``", "Input of type float[4]", "[0.0, 0.0, 0.0, 0.0]"
"inputs:float4_arr_0", "``float[4][]``", "Input of type float[4][]", "[]"
"inputs:float4_arr_1", "``float[4][]``", "Input of type float[4][]", "[]"
"inputs:float_0", "``float``", "Input of type float", "0.0"
"inputs:float_1", "``float``", "Input of type float", "0.0"
"inputs:float_arr_0", "``float[]``", "Input of type float[]", "[]"
"inputs:float_arr_1", "``float[]``", "Input of type float[]", "[]"
"inputs:frame4_0", "``frame[4]``", "Input of type frame[4]", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]"
"inputs:frame4_1", "``frame[4]``", "Input of type frame[4]", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]"
"inputs:frame4_arr_0", "``frame[4][]``", "Input of type frame[4][]", "[]"
"inputs:frame4_arr_1", "``frame[4][]``", "Input of type frame[4][]", "[]"
"inputs:half2_0", "``half[2]``", "Input of type half[2]", "[0.0, 0.0]"
"inputs:half2_1", "``half[2]``", "Input of type half[2]", "[0.0, 0.0]"
"inputs:half2_arr_0", "``half[2][]``", "Input of type half[2][]", "[]"
"inputs:half2_arr_1", "``half[2][]``", "Input of type half[2][]", "[]"
"inputs:half3_0", "``half[3]``", "Input of type half[3]", "[0.0, 0.0, 0.0]"
"inputs:half3_1", "``half[3]``", "Input of type half[3]", "[0.0, 0.0, 0.0]"
"inputs:half3_arr_0", "``half[3][]``", "Input of type half[3][]", "[]"
"inputs:half3_arr_1", "``half[3][]``", "Input of type half[3][]", "[]"
"inputs:half4_0", "``half[4]``", "Input of type half[4]", "[0.0, 0.0, 0.0, 0.0]"
"inputs:half4_1", "``half[4]``", "Input of type half[4]", "[0.0, 0.0, 0.0, 0.0]"
"inputs:half4_arr_0", "``half[4][]``", "Input of type half[4][]", "[]"
"inputs:half4_arr_1", "``half[4][]``", "Input of type half[4][]", "[]"
"inputs:half_0", "``half``", "Input of type half", "0.0"
"inputs:half_1", "``half``", "Input of type half", "0.0"
"inputs:half_arr_0", "``half[]``", "Input of type half[]", "[]"
"inputs:half_arr_1", "``half[]``", "Input of type half[]", "[]"
"inputs:int2_0", "``int[2]``", "Input of type int[2]", "[0, 0]"
"inputs:int2_1", "``int[2]``", "Input of type int[2]", "[0, 0]"
"inputs:int2_arr_0", "``int[2][]``", "Input of type int[2][]", "[]"
"inputs:int2_arr_1", "``int[2][]``", "Input of type int[2][]", "[]"
"inputs:int3_0", "``int[3]``", "Input of type int[3]", "[0, 0, 0]"
"inputs:int3_1", "``int[3]``", "Input of type int[3]", "[0, 0, 0]"
"inputs:int3_arr_0", "``int[3][]``", "Input of type int[3][]", "[]"
"inputs:int3_arr_1", "``int[3][]``", "Input of type int[3][]", "[]"
"inputs:int4_0", "``int[4]``", "Input of type int[4]", "[0, 0, 0, 0]"
"inputs:int4_1", "``int[4]``", "Input of type int[4]", "[0, 0, 0, 0]"
"inputs:int4_arr_0", "``int[4][]``", "Input of type int[4][]", "[]"
"inputs:int4_arr_1", "``int[4][]``", "Input of type int[4][]", "[]"
"inputs:int64_0", "``int64``", "Input of type int64", "0"
"inputs:int64_1", "``int64``", "Input of type int64", "0"
"inputs:int64_arr_0", "``int64[]``", "Input of type int64[]", "[]"
"inputs:int64_arr_1", "``int64[]``", "Input of type int64[]", "[]"
"inputs:int_0", "``int``", "Input of type int", "0"
"inputs:int_1", "``int``", "Input of type int", "0"
"inputs:int_arr_0", "``int[]``", "Input of type int[]", "[]"
"inputs:int_arr_1", "``int[]``", "Input of type int[]", "[]"
"inputs:matrixd2_0", "``matrixd[2]``", "Input of type matrixd[2]", "[0.0, 0.0, 0.0, 0.0]"
"inputs:matrixd2_1", "``matrixd[2]``", "Input of type matrixd[2]", "[0.0, 0.0, 0.0, 0.0]"
"inputs:matrixd2_arr_0", "``matrixd[2][]``", "Input of type matrixd[2][]", "[]"
"inputs:matrixd2_arr_1", "``matrixd[2][]``", "Input of type matrixd[2][]", "[]"
"inputs:matrixd3_0", "``matrixd[3]``", "Input of type matrixd[3]", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]"
"inputs:matrixd3_1", "``matrixd[3]``", "Input of type matrixd[3]", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]"
"inputs:matrixd3_arr_0", "``matrixd[3][]``", "Input of type matrixd[3][]", "[]"
"inputs:matrixd3_arr_1", "``matrixd[3][]``", "Input of type matrixd[3][]", "[]"
"inputs:matrixd4_0", "``matrixd[4]``", "Input of type matrixd[4]", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]"
"inputs:matrixd4_1", "``matrixd[4]``", "Input of type matrixd[4]", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]"
"inputs:matrixd4_arr_0", "``matrixd[4][]``", "Input of type matrixd[4][]", "[]"
"inputs:matrixd4_arr_1", "``matrixd[4][]``", "Input of type matrixd[4][]", "[]"
"inputs:normald3_0", "``normald[3]``", "Input of type normald[3]", "[0.0, 0.0, 0.0]"
"inputs:normald3_1", "``normald[3]``", "Input of type normald[3]", "[0.0, 0.0, 0.0]"
"inputs:normald3_arr_0", "``normald[3][]``", "Input of type normald[3][]", "[]"
"inputs:normald3_arr_1", "``normald[3][]``", "Input of type normald[3][]", "[]"
"inputs:normalf3_0", "``normalf[3]``", "Input of type normalf[3]", "[0.0, 0.0, 0.0]"
"inputs:normalf3_1", "``normalf[3]``", "Input of type normalf[3]", "[0.0, 0.0, 0.0]"
"inputs:normalf3_arr_0", "``normalf[3][]``", "Input of type normalf[3][]", "[]"
"inputs:normalf3_arr_1", "``normalf[3][]``", "Input of type normalf[3][]", "[]"
"inputs:normalh3_0", "``normalh[3]``", "Input of type normalh[3]", "[0.0, 0.0, 0.0]"
"inputs:normalh3_1", "``normalh[3]``", "Input of type normalh[3]", "[0.0, 0.0, 0.0]"
"inputs:normalh3_arr_0", "``normalh[3][]``", "Input of type normalh[3][]", "[]"
"inputs:normalh3_arr_1", "``normalh[3][]``", "Input of type normalh[3][]", "[]"
"inputs:pointd3_0", "``pointd[3]``", "Input of type pointd[3]", "[0.0, 0.0, 0.0]"
"inputs:pointd3_1", "``pointd[3]``", "Input of type pointd[3]", "[0.0, 0.0, 0.0]"
"inputs:pointd3_arr_0", "``pointd[3][]``", "Input of type pointd[3][]", "[]"
"inputs:pointd3_arr_1", "``pointd[3][]``", "Input of type pointd[3][]", "[]"
"inputs:pointf3_0", "``pointf[3]``", "Input of type pointf[3]", "[0.0, 0.0, 0.0]"
"inputs:pointf3_1", "``pointf[3]``", "Input of type pointf[3]", "[0.0, 0.0, 0.0]"
"inputs:pointf3_arr_0", "``pointf[3][]``", "Input of type pointf[3][]", "[]"
"inputs:pointf3_arr_1", "``pointf[3][]``", "Input of type pointf[3][]", "[]"
"inputs:pointh3_0", "``pointh[3]``", "Input of type pointh[3]", "[0.0, 0.0, 0.0]"
"inputs:pointh3_1", "``pointh[3]``", "Input of type pointh[3]", "[0.0, 0.0, 0.0]"
"inputs:pointh3_arr_0", "``pointh[3][]``", "Input of type pointh[3][]", "[]"
"inputs:pointh3_arr_1", "``pointh[3][]``", "Input of type pointh[3][]", "[]"
"inputs:quatd4_0", "``quatd[4]``", "Input of type quatd[4]", "[0.0, 0.0, 0.0, 0.0]"
"inputs:quatd4_1", "``quatd[4]``", "Input of type quatd[4]", "[0.0, 0.0, 0.0, 0.0]"
"inputs:quatd4_arr_0", "``quatd[4][]``", "Input of type quatd[4][]", "[]"
"inputs:quatd4_arr_1", "``quatd[4][]``", "Input of type quatd[4][]", "[]"
"inputs:quatf4_0", "``quatf[4]``", "Input of type quatf[4]", "[0.0, 0.0, 0.0, 0.0]"
"inputs:quatf4_1", "``quatf[4]``", "Input of type quatf[4]", "[0.0, 0.0, 0.0, 0.0]"
"inputs:quatf4_arr_0", "``quatf[4][]``", "Input of type quatf[4][]", "[]"
"inputs:quatf4_arr_1", "``quatf[4][]``", "Input of type quatf[4][]", "[]"
"inputs:quath4_0", "``quath[4]``", "Input of type quath[4]", "[0.0, 0.0, 0.0, 0.0]"
"inputs:quath4_1", "``quath[4]``", "Input of type quath[4]", "[0.0, 0.0, 0.0, 0.0]"
"inputs:quath4_arr_0", "``quath[4][]``", "Input of type quath[4][]", "[]"
"inputs:quath4_arr_1", "``quath[4][]``", "Input of type quath[4][]", "[]"
"inputs:texcoordd2_0", "``texcoordd[2]``", "Input of type texcoordd[2]", "[0.0, 0.0]"
"inputs:texcoordd2_1", "``texcoordd[2]``", "Input of type texcoordd[2]", "[0.0, 0.0]"
"inputs:texcoordd2_arr_0", "``texcoordd[2][]``", "Input of type texcoordd[2][]", "[]"
"inputs:texcoordd2_arr_1", "``texcoordd[2][]``", "Input of type texcoordd[2][]", "[]"
"inputs:texcoordd3_0", "``texcoordd[3]``", "Input of type texcoordd[3]", "[0.0, 0.0, 0.0]"
"inputs:texcoordd3_1", "``texcoordd[3]``", "Input of type texcoordd[3]", "[0.0, 0.0, 0.0]"
"inputs:texcoordd3_arr_0", "``texcoordd[3][]``", "Input of type texcoordd[3][]", "[]"
"inputs:texcoordd3_arr_1", "``texcoordd[3][]``", "Input of type texcoordd[3][]", "[]"
"inputs:texcoordf2_0", "``texcoordf[2]``", "Input of type texcoordf[2]", "[0.0, 0.0]"
"inputs:texcoordf2_1", "``texcoordf[2]``", "Input of type texcoordf[2]", "[0.0, 0.0]"
"inputs:texcoordf2_arr_0", "``texcoordf[2][]``", "Input of type texcoordf[2][]", "[]"
"inputs:texcoordf2_arr_1", "``texcoordf[2][]``", "Input of type texcoordf[2][]", "[]"
"inputs:texcoordf3_0", "``texcoordf[3]``", "Input of type texcoordf[3]", "[0.0, 0.0, 0.0]"
"inputs:texcoordf3_1", "``texcoordf[3]``", "Input of type texcoordf[3]", "[0.0, 0.0, 0.0]"
"inputs:texcoordf3_arr_0", "``texcoordf[3][]``", "Input of type texcoordf[3][]", "[]"
"inputs:texcoordf3_arr_1", "``texcoordf[3][]``", "Input of type texcoordf[3][]", "[]"
"inputs:texcoordh2_0", "``texcoordh[2]``", "Input of type texcoordh[2]", "[0.0, 0.0]"
"inputs:texcoordh2_1", "``texcoordh[2]``", "Input of type texcoordh[2]", "[0.0, 0.0]"
"inputs:texcoordh2_arr_0", "``texcoordh[2][]``", "Input of type texcoordh[2][]", "[]"
"inputs:texcoordh2_arr_1", "``texcoordh[2][]``", "Input of type texcoordh[2][]", "[]"
"inputs:texcoordh3_0", "``texcoordh[3]``", "Input of type texcoordh[3]", "[0.0, 0.0, 0.0]"
"inputs:texcoordh3_1", "``texcoordh[3]``", "Input of type texcoordh[3]", "[0.0, 0.0, 0.0]"
"inputs:texcoordh3_arr_0", "``texcoordh[3][]``", "Input of type texcoordh[3][]", "[]"
"inputs:texcoordh3_arr_1", "``texcoordh[3][]``", "Input of type texcoordh[3][]", "[]"
"inputs:timecode_0", "``timecode``", "Input of type timecode", "0.0"
"inputs:timecode_1", "``timecode``", "Input of type timecode", "0.0"
"inputs:timecode_arr_0", "``timecode[]``", "Input of type timecode[]", "[]"
"inputs:timecode_arr_1", "``timecode[]``", "Input of type timecode[]", "[]"
"inputs:token_0", "``token``", "Input of type token", "default_token"
"inputs:token_1", "``token``", "Input of type token", "default_token"
"inputs:token_arr_0", "``token[]``", "Input of type token[]", "[]"
"inputs:token_arr_1", "``token[]``", "Input of type token[]", "[]"
"inputs:transform4_0", "``transform[4]``", "Input of type transform[4]", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]"
"inputs:transform4_1", "``transform[4]``", "Input of type transform[4]", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]"
"inputs:transform4_arr_0", "``transform[4][]``", "Input of type transform[4][]", "[]"
"inputs:transform4_arr_1", "``transform[4][]``", "Input of type transform[4][]", "[]"
"inputs:uchar_0", "``uchar``", "Input of type uchar", "0"
"inputs:uchar_1", "``uchar``", "Input of type uchar", "0"
"inputs:uchar_arr_0", "``uchar[]``", "Input of type uchar[]", "[]"
"inputs:uchar_arr_1", "``uchar[]``", "Input of type uchar[]", "[]"
"inputs:uint64_0", "``uint64``", "Input of type uint64", "0"
"inputs:uint64_1", "``uint64``", "Input of type uint64", "0"
"inputs:uint64_arr_0", "``uint64[]``", "Input of type uint64[]", "[]"
"inputs:uint64_arr_1", "``uint64[]``", "Input of type uint64[]", "[]"
"inputs:uint_0", "``uint``", "Input of type uint", "0"
"inputs:uint_1", "``uint``", "Input of type uint", "0"
"inputs:uint_arr_0", "``uint[]``", "Input of type uint[]", "[]"
"inputs:uint_arr_1", "``uint[]``", "Input of type uint[]", "[]"
"inputs:vectord3_0", "``vectord[3]``", "Input of type vectord[3]", "[0.0, 0.0, 0.0]"
"inputs:vectord3_1", "``vectord[3]``", "Input of type vectord[3]", "[0.0, 0.0, 0.0]"
"inputs:vectord3_arr_0", "``vectord[3][]``", "Input of type vectord[3][]", "[]"
"inputs:vectord3_arr_1", "``vectord[3][]``", "Input of type vectord[3][]", "[]"
"inputs:vectorf3_0", "``vectorf[3]``", "Input of type vectorf[3]", "[0.0, 0.0, 0.0]"
"inputs:vectorf3_1", "``vectorf[3]``", "Input of type vectorf[3]", "[0.0, 0.0, 0.0]"
"inputs:vectorf3_arr_0", "``vectorf[3][]``", "Input of type vectorf[3][]", "[]"
"inputs:vectorf3_arr_1", "``vectorf[3][]``", "Input of type vectorf[3][]", "[]"
"inputs:vectorh3_0", "``vectorh[3]``", "Input of type vectorh[3]", "[0.0, 0.0, 0.0]"
"inputs:vectorh3_1", "``vectorh[3]``", "Input of type vectorh[3]", "[0.0, 0.0, 0.0]"
"inputs:vectorh3_arr_0", "``vectorh[3][]``", "Input of type vectorh[3][]", "[]"
"inputs:vectorh3_arr_1", "``vectorh[3][]``", "Input of type vectorh[3][]", "[]"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:bool_0", "``bool``", "Output of type bool", "False"
"outputs:bool_arr_0", "``bool[]``", "Output of type bool[]", "[]"
"outputs:colord3_0", "``colord[3]``", "Output of type colord[3]", "[0.0, 0.0, 0.0]"
"outputs:colord3_arr_0", "``colord[3][]``", "Output of type colord[3][]", "[]"
"outputs:colord4_0", "``colord[4]``", "Output of type colord[4]", "[0.0, 0.0, 0.0, 0.0]"
"outputs:colord4_arr_0", "``colord[4][]``", "Output of type colord[4][]", "[]"
"outputs:colorf3_0", "``colorf[3]``", "Output of type colorf[3]", "[0.0, 0.0, 0.0]"
"outputs:colorf3_arr_0", "``colorf[3][]``", "Output of type colorf[3][]", "[]"
"outputs:colorf4_0", "``colorf[4]``", "Output of type colorf[4]", "[0.0, 0.0, 0.0, 0.0]"
"outputs:colorf4_arr_0", "``colorf[4][]``", "Output of type colorf[4][]", "[]"
"outputs:colorh3_0", "``colorh[3]``", "Output of type colorh[3]", "[0.0, 0.0, 0.0]"
"outputs:colorh3_arr_0", "``colorh[3][]``", "Output of type colorh[3][]", "[]"
"outputs:colorh4_0", "``colorh[4]``", "Output of type colorh[4]", "[0.0, 0.0, 0.0, 0.0]"
"outputs:colorh4_arr_0", "``colorh[4][]``", "Output of type colorh[4][]", "[]"
"outputs:double2_0", "``double[2]``", "Output of type double[2]", "[0.0, 0.0]"
"outputs:double2_arr_0", "``double[2][]``", "Output of type double[2][]", "[]"
"outputs:double3_0", "``double[3]``", "Output of type double[3]", "[0.0, 0.0, 0.0]"
"outputs:double3_arr_0", "``double[3][]``", "Output of type double[3][]", "[]"
"outputs:double4_0", "``double[4]``", "Output of type double[4]", "[0.0, 0.0, 0.0, 0.0]"
"outputs:double4_arr_0", "``double[4][]``", "Output of type double[4][]", "[]"
"outputs:double_0", "``double``", "Output of type double", "0.0"
"outputs:double_arr_0", "``double[]``", "Output of type double[]", "[]"
"outputs:float2_0", "``float[2]``", "Output of type float[2]", "[0.0, 0.0]"
"outputs:float2_arr_0", "``float[2][]``", "Output of type float[2][]", "[]"
"outputs:float3_0", "``float[3]``", "Output of type float[3]", "[0.0, 0.0, 0.0]"
"outputs:float3_arr_0", "``float[3][]``", "Output of type float[3][]", "[]"
"outputs:float4_0", "``float[4]``", "Output of type float[4]", "[0.0, 0.0, 0.0, 0.0]"
"outputs:float4_arr_0", "``float[4][]``", "Output of type float[4][]", "[]"
"outputs:float_0", "``float``", "Output of type float", "0.0"
"outputs:float_arr_0", "``float[]``", "Output of type float[]", "[]"
"outputs:frame4_0", "``frame[4]``", "Output of type frame[4]", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]"
"outputs:frame4_arr_0", "``frame[4][]``", "Output of type frame[4][]", "[]"
"outputs:half2_0", "``half[2]``", "Output of type half[2]", "[0.0, 0.0]"
"outputs:half2_arr_0", "``half[2][]``", "Output of type half[2][]", "[]"
"outputs:half3_0", "``half[3]``", "Output of type half[3]", "[0.0, 0.0, 0.0]"
"outputs:half3_arr_0", "``half[3][]``", "Output of type half[3][]", "[]"
"outputs:half4_0", "``half[4]``", "Output of type half[4]", "[0.0, 0.0, 0.0, 0.0]"
"outputs:half4_arr_0", "``half[4][]``", "Output of type half[4][]", "[]"
"outputs:half_0", "``half``", "Output of type half", "0.0"
"outputs:half_arr_0", "``half[]``", "Output of type half[]", "[]"
"outputs:int2_0", "``int[2]``", "Output of type int[2]", "[0, 0]"
"outputs:int2_arr_0", "``int[2][]``", "Output of type int[2][]", "[]"
"outputs:int3_0", "``int[3]``", "Output of type int[3]", "[0, 0, 0]"
"outputs:int3_arr_0", "``int[3][]``", "Output of type int[3][]", "[]"
"outputs:int4_0", "``int[4]``", "Output of type int[4]", "[0, 0, 0, 0]"
"outputs:int4_arr_0", "``int[4][]``", "Output of type int[4][]", "[]"
"outputs:int64_0", "``int64``", "Output of type int64", "0"
"outputs:int64_arr_0", "``int64[]``", "Output of type int64[]", "[]"
"outputs:int_0", "``int``", "Output of type int", "0"
"outputs:int_arr_0", "``int[]``", "Output of type int[]", "[]"
"outputs:matrixd2_0", "``matrixd[2]``", "Output of type matrixd[2]", "[0.0, 0.0, 0.0, 0.0]"
"outputs:matrixd2_arr_0", "``matrixd[2][]``", "Output of type matrixd[2][]", "[]"
"outputs:matrixd3_0", "``matrixd[3]``", "Output of type matrixd[3]", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]"
"outputs:matrixd3_arr_0", "``matrixd[3][]``", "Output of type matrixd[3][]", "[]"
"outputs:matrixd4_0", "``matrixd[4]``", "Output of type matrixd[4]", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]"
"outputs:matrixd4_arr_0", "``matrixd[4][]``", "Output of type matrixd[4][]", "[]"
"outputs:normald3_0", "``normald[3]``", "Output of type normald[3]", "[0.0, 0.0, 0.0]"
"outputs:normald3_arr_0", "``normald[3][]``", "Output of type normald[3][]", "[]"
"outputs:normalf3_0", "``normalf[3]``", "Output of type normalf[3]", "[0.0, 0.0, 0.0]"
"outputs:normalf3_arr_0", "``normalf[3][]``", "Output of type normalf[3][]", "[]"
"outputs:normalh3_0", "``normalh[3]``", "Output of type normalh[3]", "[0.0, 0.0, 0.0]"
"outputs:normalh3_arr_0", "``normalh[3][]``", "Output of type normalh[3][]", "[]"
"outputs:pointd3_0", "``pointd[3]``", "Output of type pointd[3]", "[0.0, 0.0, 0.0]"
"outputs:pointd3_arr_0", "``pointd[3][]``", "Output of type pointd[3][]", "[]"
"outputs:pointf3_0", "``pointf[3]``", "Output of type pointf[3]", "[0.0, 0.0, 0.0]"
"outputs:pointf3_arr_0", "``pointf[3][]``", "Output of type pointf[3][]", "[]"
"outputs:pointh3_0", "``pointh[3]``", "Output of type pointh[3]", "[0.0, 0.0, 0.0]"
"outputs:pointh3_arr_0", "``pointh[3][]``", "Output of type pointh[3][]", "[]"
"outputs:quatd4_0", "``quatd[4]``", "Output of type quatd[4]", "[0.0, 0.0, 0.0, 0.0]"
"outputs:quatd4_arr_0", "``quatd[4][]``", "Output of type quatd[4][]", "[]"
"outputs:quatf4_0", "``quatf[4]``", "Output of type quatf[4]", "[0.0, 0.0, 0.0, 0.0]"
"outputs:quatf4_arr_0", "``quatf[4][]``", "Output of type quatf[4][]", "[]"
"outputs:quath4_0", "``quath[4]``", "Output of type quath[4]", "[0.0, 0.0, 0.0, 0.0]"
"outputs:quath4_arr_0", "``quath[4][]``", "Output of type quath[4][]", "[]"
"outputs:texcoordd2_0", "``texcoordd[2]``", "Output of type texcoordd[2]", "[0.0, 0.0]"
"outputs:texcoordd2_arr_0", "``texcoordd[2][]``", "Output of type texcoordd[2][]", "[]"
"outputs:texcoordd3_0", "``texcoordd[3]``", "Output of type texcoordd[3]", "[0.0, 0.0, 0.0]"
"outputs:texcoordd3_arr_0", "``texcoordd[3][]``", "Output of type texcoordd[3][]", "[]"
"outputs:texcoordf2_0", "``texcoordf[2]``", "Output of type texcoordf[2]", "[0.0, 0.0]"
"outputs:texcoordf2_arr_0", "``texcoordf[2][]``", "Output of type texcoordf[2][]", "[]"
"outputs:texcoordf3_0", "``texcoordf[3]``", "Output of type texcoordf[3]", "[0.0, 0.0, 0.0]"
"outputs:texcoordf3_arr_0", "``texcoordf[3][]``", "Output of type texcoordf[3][]", "[]"
"outputs:texcoordh2_0", "``texcoordh[2]``", "Output of type texcoordh[2]", "[0.0, 0.0]"
"outputs:texcoordh2_arr_0", "``texcoordh[2][]``", "Output of type texcoordh[2][]", "[]"
"outputs:texcoordh3_0", "``texcoordh[3]``", "Output of type texcoordh[3]", "[0.0, 0.0, 0.0]"
"outputs:texcoordh3_arr_0", "``texcoordh[3][]``", "Output of type texcoordh[3][]", "[]"
"outputs:timecode_0", "``timecode``", "Output of type timecode", "0.0"
"outputs:timecode_arr_0", "``timecode[]``", "Output of type timecode[]", "[]"
"outputs:token_0", "``token``", "Output of type token", "default_token"
"outputs:token_arr_0", "``token[]``", "Output of type token[]", "[]"
"outputs:transform4_0", "``transform[4]``", "Output of type transform[4]", "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]"
"outputs:transform4_arr_0", "``transform[4][]``", "Output of type transform[4][]", "[]"
"outputs:uchar_0", "``uchar``", "Output of type uchar", "0"
"outputs:uchar_arr_0", "``uchar[]``", "Output of type uchar[]", "[]"
"outputs:uint64_0", "``uint64``", "Output of type uint64", "0"
"outputs:uint64_arr_0", "``uint64[]``", "Output of type uint64[]", "[]"
"outputs:uint_0", "``uint``", "Output of type uint", "0"
"outputs:uint_arr_0", "``uint[]``", "Output of type uint[]", "[]"
"outputs:vectord3_0", "``vectord[3]``", "Output of type vectord[3]", "[0.0, 0.0, 0.0]"
"outputs:vectord3_arr_0", "``vectord[3][]``", "Output of type vectord[3][]", "[]"
"outputs:vectorf3_0", "``vectorf[3]``", "Output of type vectorf[3]", "[0.0, 0.0, 0.0]"
"outputs:vectorf3_arr_0", "``vectorf[3][]``", "Output of type vectorf[3][]", "[]"
"outputs:vectorh3_0", "``vectorh[3]``", "Output of type vectorh[3]", "[0.0, 0.0, 0.0]"
"outputs:vectorh3_arr_0", "``vectorh[3][]``", "Output of type vectorh[3][]", "[]"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.UniversalAdd"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "usd"
"uiName", "Example Node: Universal Add Node"
"Categories", "examples"
"Generated Class Name", "OgnUniversalAddDatabase"
"Python Module", "omni.graph.examples.cpp"
| 27,845 | reStructuredText | 72.666666 | 367 | 0.53076 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnScaleCubeWithPrim.rst | .. _omni_graph_examples_cpp_ScaleCubeWithOutputPrim_1:
.. _omni_graph_examples_cpp_ScaleCubeWithOutputPrim:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Multiply From Prim
:keywords: lang-en omnigraph node examples WriteOnly cpp scale-cube-with-output-prim
Example Node: Multiply From Prim
================================
.. <description>
Example node that performs a simple multiplication on a float value extracted from a Prim
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.ScaleCubeWithOutputPrim"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "tests"
"uiName", "Example Node: Multiply From Prim"
"Categories", "examples"
"Generated Class Name", "OgnScaleCubeWithPrimDatabase"
"Python Module", "omni.graph.examples.cpp"
| 1,357 | reStructuredText | 26.159999 | 109 | 0.591746 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnVersionedDeformer.rst | .. _omni_graph_examples_cpp_VersionedDeformer_2:
.. _omni_graph_examples_cpp_VersionedDeformer:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Versioned Deformer
:keywords: lang-en omnigraph node examples threadsafe cpp versioned-deformer
Example Node: Versioned Deformer
================================
.. <description>
Test node to confirm version upgrading works. Performs a basic deformation on some points.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:points", "``pointf[3][]``", "Set of points to be deformed", "[]"
"inputs:wavelength", "``float``", "Wavelength of sinusodal deformer function", "50.0"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:points", "``pointf[3][]``", "Set of deformed points", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.VersionedDeformer"
"Version", "2"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Example Node: Versioned Deformer"
"Categories", "examples"
"Generated Class Name", "OgnVersionedDeformerDatabase"
"Python Module", "omni.graph.examples.cpp"
| 1,800 | reStructuredText | 25.101449 | 109 | 0.581667 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnDeformerTimeBased.rst | .. _omni_graph_examples_cpp_DeformerTimeBased_1:
.. _omni_graph_examples_cpp_DeformerTimeBased:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Time-based Sine Wave Deformer
:keywords: lang-en omnigraph node examples threadsafe cpp deformer-time-based
Example Node: Time-based Sine Wave Deformer
===========================================
.. <description>
This is an example of a simple deformer with time based input to control a time dependent sine wave deformation.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:multiplier", "``float``", "The multiplier for the amplitude of the sine wave", "1"
"inputs:points", "``pointf[3][]``", "The input points to be deformed", "[]"
"inputs:time", "``double``", "Time value to modulate the offset in sine curve evaluation", "0.0"
"inputs:wavelength", "``float``", "The wavelength of the sine wave", "1"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:points", "``pointf[3][]``", "The deformed output points", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.DeformerTimeBased"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Example Node: Time-based Sine Wave Deformer"
"Categories", "examples"
"Generated Class Name", "OgnDeformerTimeBasedDatabase"
"Python Module", "omni.graph.examples.cpp"
| 2,058 | reStructuredText | 28 | 113 | 0.588921 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnScaleCube.rst | .. _omni_graph_examples_cpp_ScaleCube_1:
.. _omni_graph_examples_cpp_ScaleCube:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Multiply Float
:keywords: lang-en omnigraph node examples threadsafe cpp scale-cube
Example Node: Multiply Float
============================
.. <description>
Example node that performs a simple multiplication
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:multiplier", "``float``", "2nd multiplicand", "0.0"
"inputs:value", "``float``", "1st multiplicand", "0.0"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:value", "``double``", "Product of value and multiplier", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.ScaleCube"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Example Node: Multiply Float"
"Categories", "examples"
"Generated Class Name", "OgnScaleCubeDatabase"
"Python Module", "omni.graph.examples.cpp"
| 1,663 | reStructuredText | 23.115942 | 109 | 0.564041 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnGpuInteropCpuToDisk.rst | .. _omni_graph_examples_cpp_GpuInteropCpuToDisk_1:
.. _omni_graph_examples_cpp_GpuInteropCpuToDisk:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Cpu To Disk
:keywords: lang-en omnigraph node examples cpp gpu-interop-cpu-to-disk
Example Node: Cpu To Disk
=========================
.. <description>
Saves specified CPU buffer to disk
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"activeReset (*inputs:active*)", "``bool``", "Alternative to frameCount/startFrame, does a single frame then autoResets to false", "False"
"aovCpu (*inputs:aovCpu*)", "``string``", "Name of AOV representing CPU buffer of GPU resource", ""
"aovGpu (*inputs:aovGpu*)", "``string``", "Name of AOV representing GPU resource, used for querying format + properties", ""
"autoFileNumber (*inputs:autoFileNumber*)", "``int``", "If non zero, this number will be the starting number for export. Each invocation of this node increases the number by 1.", "-1"
"fileName (*inputs:fileName*)", "``string``", "Optional, if specified the output filename will be fileName_{aovGpu}.{fileType}", ""
"fileNumber (*inputs:fileNumber*)", "``int``", "Number that will be appended to the exported filename. If -1 then the render product's frame number will be used.", "-1"
"fileType (*inputs:fileType*)", "``string``", "bmp,png,exr", "png"
"frameCount (*inputs:frameCount*)", "``int64``", "Number of frames to capture (-1 means never stop)", "-1"
"gpuFoundations (*inputs:gpu*)", "``uint64``", "Pointer to shared context containing gpu foundations", "0"
"maxInflightWrites (*inputs:maxInflightWrites*)", "``int``", "Maximum number of in-flight file write operations before blocking on file i/o", "2"
"renderProduct (*inputs:rp*)", "``uint64``", "Pointer to render product for this view", "0"
"saveFlags (*inputs:saveFlags*)", "``uint64``", "Flags that will be passed to carb::imaging::IImaging for file saving.", "0"
"saveLocation (*inputs:saveLocation*)", "``string``", "Folder to save AOVs as AOV_FrameNumber.{exr,png}", ""
"startFrame (*inputs:startFrame*)", "``uint64``", "Frame to begin saving to disk", "0"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"gpuFoundations (*outputs:gpu*)", "``uint64``", "Pointer to shared context containing gpu foundations", "None"
"renderProduct (*outputs:rp*)", "``uint64``", "Pointer to render product for this view", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.GpuInteropCpuToDisk"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Example Node: Cpu To Disk"
"Categories", "examples"
"Generated Class Name", "OgnGpuInteropCpuToDiskDatabase"
"Python Module", "omni.graph.examples.cpp"
| 3,437 | reStructuredText | 40.926829 | 187 | 0.625546 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnPrimDeformer1.rst | .. _omni_graph_examples_cpp_PrimDeformer1_1:
.. _omni_graph_examples_cpp_PrimDeformer1:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Sine Wave Prim Deformer
:keywords: lang-en omnigraph node examples WriteOnly cpp prim-deformer1
Example Node: Sine Wave Prim Deformer
=====================================
.. <description>
Example deformer node that applies a sine wave to a mesh, input via a Prim
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.PrimDeformer1"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "tests"
"uiName", "Example Node: Sine Wave Prim Deformer"
"Categories", "examples"
"Generated Class Name", "OgnPrimDeformer1Database"
"Python Module", "omni.graph.examples.cpp"
| 1,315 | reStructuredText | 25.319999 | 109 | 0.574144 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnSimple.rst | .. _omni_graph_examples_cpp_Simple_1:
.. _omni_graph_examples_cpp_Simple:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Simple Multiply
:keywords: lang-en omnigraph node examples threadsafe cpp simple
Example Node: Simple Multiply
=============================
.. <description>
Minimal compute node example that reads two floats and outputs their product
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:multiplier", "``float``", "Multiplier of value", "0.0"
"inputs:value", "``float``", "Value to be multiplied", "0.0"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:value", "``double``", "Result of the multiplication", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.Simple"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Example Node: Simple Multiply"
"Categories", "examples"
"Generated Class Name", "OgnSimpleDatabase"
"Python Module", "omni.graph.examples.cpp"
| 1,683 | reStructuredText | 23.405797 | 109 | 0.565062 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnDeformer1_GPU.rst | .. _omni_graph_examples_cpp_Deformer1Gpu_1:
.. _omni_graph_examples_cpp_Deformer1Gpu:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Sine Wave GPU Deformer
:keywords: lang-en omnigraph node examples threadsafe cpp deformer1-gpu
Example Node: Sine Wave GPU Deformer
====================================
.. <description>
Example deformer node that applies a sine wave to a mesh using CUDA code
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:multiplier", "``float``", "Amplitude of sinusoidal deformer function", "0.7"
"inputs:points", "``pointf[3][]``", "Set of points to be deformed", "[]"
"inputs:wavelength", "``float``", "Wavelength of sinusodal deformer function", "50.0"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:points", "``pointf[3][]``", "Set of deformed points", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.Deformer1Gpu"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cuda"
"Generated Code Exclusions", "tests"
"__memoryType", "cuda"
"uiName", "Example Node: Sine Wave GPU Deformer"
"Categories", "examples"
"Generated Class Name", "OgnDeformer1_GPUDatabase"
"Python Module", "omni.graph.examples.cpp"
| 1,892 | reStructuredText | 25.661971 | 109 | 0.575053 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnGpuInteropGpuToCpuCopy.rst | .. _omni_graph_examples_cpp_GpuInteropGpuToCpuCopy_1:
.. _omni_graph_examples_cpp_GpuInteropGpuToCpuCopy:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Gpu To Cpu Copy
:keywords: lang-en omnigraph node examples cpp gpu-interop-gpu-to-cpu-copy
Example Node: Gpu To Cpu Copy
=============================
.. <description>
Generates a new AOV representing a CPU copy of a GPU buffer
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"aovGpu (*inputs:aovGpu*)", "``string``", "Name of AOV to copy from GPU to CPU", ""
"gpuFoundations (*inputs:gpu*)", "``uint64``", "Pointer to shared context containing gpu foundations", "0"
"renderProduct (*inputs:rp*)", "``uint64``", "Pointer to render product for this view", "0"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"aovCpu (*outputs:aovCpu*)", "``string``", "Name of AOV representing CPU buffer of GPU resource", ""
"gpuFoundations (*outputs:gpu*)", "``uint64``", "Pointer to shared context containing gpu foundations", "None"
"renderProduct (*outputs:rp*)", "``uint64``", "Pointer to render product for this view", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.GpuInteropGpuToCpuCopy"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Example Node: Gpu To Cpu Copy"
"Categories", "examples"
"Generated Class Name", "OgnGpuInteropGpuToCpuCopyDatabase"
"Python Module", "omni.graph.examples.cpp"
| 2,149 | reStructuredText | 28.861111 | 114 | 0.593299 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnGpuInteropAdjustExposure.rst | .. _omni_graph_examples_cpp_GpuInteropAdjustExposure_1:
.. _omni_graph_examples_cpp_GpuInteropAdjustExposure:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Render Postprocess
:keywords: lang-en omnigraph node examples cpp gpu-interop-adjust-exposure
Example Node: Render Postprocess
================================
.. <description>
RTX Renderer Postprocess Example (Exposure Adjustment)
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"cudaMipmappedArray (*inputs:cudaMipmappedArray*)", "``uint64``", "Pointer to the CUDA Mipmapped Array", "0"
"exposure (*inputs:exposure*)", "``float``", "Exposure value (in stops)", "0.0"
"format (*inputs:format*)", "``uint64``", "Format", "0"
"height (*inputs:height*)", "``uint``", "Height", "0"
"hydraTime (*inputs:hydraTime*)", "``double``", "Hydra time in stage", "0.0"
"mipCount (*inputs:mipCount*)", "``uint``", "Mip Count", "0"
"simTime (*inputs:simTime*)", "``double``", "Simulation time", "0.0"
"stream (*inputs:stream*)", "``uint64``", "Pointer to the CUDA Stream", "0"
"width (*inputs:width*)", "``uint``", "Width", "0"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.GpuInteropAdjustExposure"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Example Node: Render Postprocess"
"Categories", "examples"
"Generated Class Name", "OgnGpuInteropAdjustExposureDatabase"
"Python Module", "omni.graph.examples.cpp"
| 2,103 | reStructuredText | 30.402985 | 112 | 0.582026 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnDeformer1_CPU.rst | .. _omni_graph_examples_cpp_Deformer1_1:
.. _omni_graph_examples_cpp_Deformer1:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Sine Wave Deformer
:keywords: lang-en omnigraph node examples threadsafe cpp deformer1
Example Node: Sine Wave Deformer
================================
.. <description>
Example deformer node that applies a sine wave to a mesh
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:multiplier", "``float``", "Amplitude of sinusoidal deformer function", "0.7"
"inputs:points", "``pointf[3][]``", "Set of points to be deformed", "[]"
"inputs:wavelength", "``float``", "Wavelength of sinusodal deformer function", "50.0"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:points", "``pointf[3][]``", "Set of deformed points", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.Deformer1"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Example Node: Sine Wave Deformer"
"Categories", "examples"
"Generated Class Name", "OgnDeformer1_CPUDatabase"
"Python Module", "omni.graph.examples.cpp"
| 1,818 | reStructuredText | 24.985714 | 109 | 0.570957 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnPrimDeformer1_GPU.rst | .. _omni_graph_examples_cpp_PrimDeformer1Gpu_1:
.. _omni_graph_examples_cpp_PrimDeformer1Gpu:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Sine Wave Prim GPU Deformer
:keywords: lang-en omnigraph node examples WriteOnly cpp prim-deformer1-gpu
Example Node: Sine Wave Prim GPU Deformer
=========================================
.. <description>
Example deformer node that applies a sine wave to a mesh on the GPU, input via a Prim
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.PrimDeformer1Gpu"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "tests"
"uiName", "Example Node: Sine Wave Prim GPU Deformer"
"Categories", "examples"
"Generated Class Name", "OgnPrimDeformer1_GPUDatabase"
"Python Module", "omni.graph.examples.cpp"
| 1,359 | reStructuredText | 26.199999 | 109 | 0.579102 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnExampleExtractFloat3Array.rst | .. _omni_graph_examples_cpp_ExtractFloat3Array_1:
.. _omni_graph_examples_cpp_ExtractFloat3Array:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Extract Float3 Array
:keywords: lang-en omnigraph node examples threadsafe cpp extract-float3-array
Example Node: Extract Float3 Array
==================================
.. <description>
Outputs a float[3][] attribute extracted from a bundle.
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:input", "``bundle``", "Bundle containing a float[3][] attribute to be extracted to 'output'", "None"
"inputs:nameOfAttribute", "``token``", "Name of the attribute in 'input' that is to be extracted to 'output'", ""
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:output", "``float[3][]``", "The float[3][] attribute extracted from 'input'", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.ExtractFloat3Array"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Example Node: Extract Float3 Array"
"Categories", "examples"
"Generated Class Name", "OgnExampleExtractFloat3ArrayDatabase"
"Python Module", "omni.graph.examples.cpp"
| 1,874 | reStructuredText | 26.173913 | 117 | 0.584312 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnExampleSimpleDeformer.rst | .. _omni_graph_examples_cpp_SimpleDeformer_1:
.. _omni_graph_examples_cpp_SimpleDeformer:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Simple Sine Wave Deformer
:keywords: lang-en omnigraph node examples threadsafe cpp simple-deformer
Example Node: Simple Sine Wave Deformer
=======================================
.. <description>
This is an example of a simple deformer. It calculates a sine wave and deforms the input geometry with it
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:multiplier", "``float``", "The multiplier for the amplitude of the sine wave", "1"
"inputs:points", "``pointf[3][]``", "The input points to be deformed", "[]"
"inputs:wavelength", "``float``", "The wavelength of the sine wave", "1"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:points", "``pointf[3][]``", "The deformed output points", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.SimpleDeformer"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Example Node: Simple Sine Wave Deformer"
"Categories", "examples"
"Generated Class Name", "OgnExampleSimpleDeformerDatabase"
"Python Module", "omni.graph.examples.cpp"
| 1,926 | reStructuredText | 26.528571 | 109 | 0.582035 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnIK.rst | .. _omni_graph_examples_cpp_SimpleIk_1:
.. _omni_graph_examples_cpp_SimpleIk:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Simple IK
:keywords: lang-en omnigraph node examples threadsafe cpp simple-ik
Example Node: Simple IK
=======================
.. <description>
Example node that employs a simple IK algorithm to match a three-joint limb to a goal
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"Goal Transform (*inputs:goal*)", "``matrixd[4]``", "Transform of the IK goal", "[[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]]"
State
-----
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"Ankle Transform (*state:ankle*)", "``matrixd[4]``", "Computed transform of the ankle joint", "None"
"Hip Transform (*state:hip*)", "``matrixd[4]``", "Computed transform of the hip joint", "None"
"Knee Transform (*state:knee*)", "``matrixd[4]``", "Computed transform of the knee joint", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.SimpleIk"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "True"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Example Node: Simple IK"
"Categories", "examples"
"Generated Class Name", "OgnIKDatabase"
"Python Module", "omni.graph.examples.cpp"
| 1,943 | reStructuredText | 26.771428 | 174 | 0.562017 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnDeformer2_GPU.rst | .. _omni_graph_examples_cpp_Deformer2Gpu_1:
.. _omni_graph_examples_cpp_Deformer2Gpu:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Z Threshold GPU Deformer
:keywords: lang-en omnigraph node examples threadsafe cpp deformer2-gpu
Example Node: Z Threshold GPU Deformer
======================================
.. <description>
Example deformer that limits the Z point positions to a threshold running on the GPU
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:points", "``pointf[3][]``", "Set of points to be deformed", "[]"
"inputs:threshold", "``float``", "Z value to limit points", "0.0"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:points", "``pointf[3][]``", "Set of deformed points", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.Deformer2Gpu"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cuda"
"Generated Code Exclusions", "tests"
"__memoryType", "cuda"
"uiName", "Example Node: Z Threshold GPU Deformer"
"Categories", "examples"
"Generated Class Name", "OgnDeformer2_GPUDatabase"
"Python Module", "omni.graph.examples.cpp"
| 1,803 | reStructuredText | 24.771428 | 109 | 0.568497 |
omniverse-code/kit/exts/omni.graph.examples.cpp/ogn/docs/OgnDeformer2_CPU.rst | .. _omni_graph_examples_cpp_Deformer2_1:
.. _omni_graph_examples_cpp_Deformer2:
.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================
:orphan:
.. meta::
:title: Example Node: Z Threshold Deformer
:keywords: lang-en omnigraph node examples threadsafe cpp deformer2
Example Node: Z Threshold Deformer
==================================
.. <description>
Example deformer that limits the Z point positions to a threshold
.. </description>
Installation
------------
To use this node enable :ref:`omni.graph.examples.cpp<ext_omni_graph_examples_cpp>` in the Extension Manager.
Inputs
------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"inputs:points", "``pointf[3][]``", "Set of points to be deformed", "[]"
"inputs:threshold", "``float``", "Z value to limit points", "0.0"
Outputs
-------
.. csv-table::
:header: "Name", "Type", "Descripton", "Default"
:widths: 20, 20, 50, 10
"outputs:points", "``pointf[3][]``", "Set of deformed points", "None"
Metadata
--------
.. csv-table::
:header: "Name", "Value"
:widths: 30,70
"Unique ID", "omni.graph.examples.cpp.Deformer2"
"Version", "1"
"Extension", "omni.graph.examples.cpp"
"Has State?", "False"
"Implementation Language", "C++"
"Default Memory Type", "cpu"
"Generated Code Exclusions", "None"
"uiName", "Example Node: Z Threshold Deformer"
"Categories", "examples"
"Generated Class Name", "OgnDeformer2_CPUDatabase"
"Python Module", "omni.graph.examples.cpp"
| 1,726 | reStructuredText | 24.028985 | 109 | 0.563731 |
omniverse-code/kit/exts/omni.graph.examples.cpp/PACKAGE-LICENSES/omni.graph.examples.cpp-LICENSE.md | Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
NVIDIA CORPORATION and its licensors retain all intellectual property
and proprietary rights in and to this software, related documentation
and any modifications thereto. Any use, reproduction, disclosure or
distribution of this software and related documentation without an express
license agreement from NVIDIA CORPORATION is strictly prohibited. | 412 | Markdown | 57.999992 | 74 | 0.839806 |
omniverse-code/kit/exts/omni.graph.examples.cpp/config/extension.toml | [package]
title = "OmniGraph C++ Examples"
version = "1.4.2"
category = "Graph"
readme = "docs/README.md"
changelog = "docs/CHANGELOG.md"
description = "Contains a set of sample OmniGraph nodes implemented in C++."
repository = ""
keywords = ["kit", "omnigraph", "nodes"]
# Main module for the Python interface
[[python.module]]
name = "omni.graph.examples.cpp"
# Watch the .ogn files for hot reloading (only works for Python files)
[fswatcher.patterns]
include = ["*.ogn", "*.py"]
exclude = ["Ogn*Database.py"]
# Other extensions that need to load in order for this one to work
[dependencies]
"omni.graph" = {}
"omni.graph.tools" = {}
"omni.kit.pip_archive" = {}
# Python test scripts rely on numpy
[python.pipapi]
requirements = ["numpy"] # SWIPAT filed under: http://nvbugs/3193231
[[native.plugin]]
path = "bin/*.plugin"
recursive = false
[[test]]
timeout = 600 # OM-51983
[documentation]
deps = [
["kit-sdk", "_build/docs/kit-sdk/latest"], # WAR to include omni.graph refs until that workflow is moved
]
pages = [
"docs/Overview.md",
"docs/CHANGELOG.md",
]
| 1,081 | TOML | 23.044444 | 108 | 0.684551 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/__init__.py | """Module containing example nodes written in C++.
There is no public API to this module.
"""
__all__ = []
from ._impl.extension import _PublicExtension as _OmniGraphExamplesCppExtension # noqa: F401
| 203 | Python | 24.499997 | 93 | 0.729064 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnBounceNoGatherDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.BounceWithoutGather
Example node that bounces an object up and down
"""
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnBounceNoGatherDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.BounceWithoutGather
Class Members:
node: Node being evaluated
"""
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
])
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedWriteValues = { }
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnBounceNoGatherDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnBounceNoGatherDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnBounceNoGatherDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 3,801 | Python | 57.492307 | 116 | 0.700079 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnSimpleDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.Simple
Minimal compute node example that reads two floats and outputs their product
"""
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnSimpleDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.Simple
Class Members:
node: Node being evaluated
Attribute Value Properties:
Inputs:
inputs.multiplier
inputs.value
Outputs:
outputs.value
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
('inputs:multiplier', 'float', 0, None, 'Multiplier of value', {}, True, 0.0, False, ''),
('inputs:value', 'float', 0, None, 'Value to be multiplied', {}, True, 0.0, False, ''),
('outputs:value', 'double', 0, None, 'Result of the multiplication', {}, True, None, False, ''),
])
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
@property
def multiplier(self):
data_view = og.AttributeValueHelper(self._attributes.multiplier)
return data_view.get()
@multiplier.setter
def multiplier(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.multiplier)
data_view = og.AttributeValueHelper(self._attributes.multiplier)
data_view.set(value)
@property
def value(self):
data_view = og.AttributeValueHelper(self._attributes.value)
return data_view.get()
@value.setter
def value(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.value)
data_view = og.AttributeValueHelper(self._attributes.value)
data_view.set(value)
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedWriteValues = { }
@property
def value(self):
data_view = og.AttributeValueHelper(self._attributes.value)
return data_view.get()
@value.setter
def value(self, value):
data_view = og.AttributeValueHelper(self._attributes.value)
data_view.set(value)
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnSimpleDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnSimpleDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnSimpleDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 5,544 | Python | 44.0813 | 111 | 0.659632 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnPrimDeformer1_GPUDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.PrimDeformer1Gpu
Example deformer node that applies a sine wave to a mesh on the GPU, input via a Prim
"""
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnPrimDeformer1_GPUDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.PrimDeformer1Gpu
Class Members:
node: Node being evaluated
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
])
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedWriteValues = { }
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnPrimDeformer1_GPUDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnPrimDeformer1_GPUDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnPrimDeformer1_GPUDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 4,008 | Python | 49.746835 | 119 | 0.697106 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnDeformer1_GPUDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.Deformer1Gpu
Example deformer node that applies a sine wave to a mesh using CUDA code
"""
import numpy
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnDeformer1_GPUDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.Deformer1Gpu
Class Members:
node: Node being evaluated
Attribute Value Properties:
Inputs:
inputs.multiplier
inputs.points
inputs.wavelength
Outputs:
outputs.points
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
('inputs:multiplier', 'float', 0, None, 'Amplitude of sinusoidal deformer function', {ogn.MetadataKeys.DEFAULT: '0.7'}, True, 0.7, False, ''),
('inputs:points', 'point3f[]', 0, None, 'Set of points to be deformed', {}, True, [], False, ''),
('inputs:wavelength', 'float', 0, None, 'Wavelength of sinusodal deformer function', {ogn.MetadataKeys.DEFAULT: '50.0'}, True, 50.0, False, ''),
('outputs:points', 'point3f[]', 0, None, 'Set of deformed points', {}, True, None, False, ''),
])
@classmethod
def _populate_role_data(cls):
"""Populate a role structure with the non-default roles on this node type"""
role_data = super()._populate_role_data()
role_data.inputs.points = og.AttributeRole.POSITION
role_data.outputs.points = og.AttributeRole.POSITION
return role_data
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
@property
def multiplier(self):
data_view = og.AttributeValueHelper(self._attributes.multiplier)
return data_view.get(on_gpu=True)
@multiplier.setter
def multiplier(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.multiplier)
data_view = og.AttributeValueHelper(self._attributes.multiplier)
data_view.set(value, on_gpu=True)
@property
def points(self):
data_view = og.AttributeValueHelper(self._attributes.points)
return data_view.get(on_gpu=True)
@points.setter
def points(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.points)
data_view = og.AttributeValueHelper(self._attributes.points)
data_view.set(value, on_gpu=True)
self.points_size = data_view.get_array_size()
@property
def wavelength(self):
data_view = og.AttributeValueHelper(self._attributes.wavelength)
return data_view.get(on_gpu=True)
@wavelength.setter
def wavelength(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.wavelength)
data_view = og.AttributeValueHelper(self._attributes.wavelength)
data_view.set(value, on_gpu=True)
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self.points_size = None
self._batchedWriteValues = { }
@property
def points(self):
data_view = og.AttributeValueHelper(self._attributes.points)
return data_view.get(reserved_element_count=self.points_size, on_gpu=True)
@points.setter
def points(self, value):
data_view = og.AttributeValueHelper(self._attributes.points)
data_view.set(value, on_gpu=True)
self.points_size = data_view.get_array_size()
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnDeformer1_GPUDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnDeformer1_GPUDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnDeformer1_GPUDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 6,913 | Python | 45.402684 | 152 | 0.65847 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnExampleAdjacencyDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.Adjacency
Computes chosen adjacency information from specified input mesh topology data.
"""
import carb
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnExampleAdjacencyDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.Adjacency
Class Members:
node: Node being evaluated
Attribute Value Properties:
Inputs:
inputs.computeDistances
inputs.computeNeighborCounts
inputs.computeNeighborStarts
inputs.computeNeighbors
inputs.mesh
inputs.nameOfDistancesOutputAttribute
inputs.nameOfNeighborCountsOutputAttribute
inputs.nameOfNeighborStartsOutputAttribute
inputs.nameOfNeighborsOutputAttribute
inputs.nameOfPositionsInputAttribute
inputs.nameOfVertexCountsInputAttribute
inputs.nameOfVertexIndicesInputAttribute
inputs.pointCount
inputs.removeDuplicates
inputs.treatEdgesAsOneWay
inputs.treatFacesAsCurves
Outputs:
outputs.mesh
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
('inputs:computeDistances', 'bool', 0, None, "When enabled, the distances from each point to its neighbors is computed and stored in a 'float[]' attribute in 'output' as specified by 'nameOfDistancesOutputAttribute'.", {ogn.MetadataKeys.DEFAULT: 'false'}, True, False, False, ''),
('inputs:computeNeighborCounts', 'bool', 0, None, "When enabled, the number of neighbors of each point is computed and all are stored in an 'int[]' attribute in 'output' as specified by 'nameOfNeighborCountsOutputAttribute'.", {ogn.MetadataKeys.DEFAULT: 'false'}, True, False, False, ''),
('inputs:computeNeighborStarts', 'bool', 0, None, "When enabled, the beginning index of neighbors of each point within the arrays computed by either 'computeNeighbors' or 'computeDistances' is computed and all, plus an additional integer to indicate the end of the array, are stored in an 'int[]' attribute in 'output' as specified by 'nameOfNeighborStartsOutputAttribute'. The extra integer at the end allows for easy computing of the number of neighbors of any single point, by subtracting the value in the array corresponding with the point, from the following value in the array.", {ogn.MetadataKeys.DEFAULT: 'true'}, True, True, False, ''),
('inputs:computeNeighbors', 'bool', 0, None, "When enabled, the neighbors of each point are computed and stored contiguously in an 'int[]' attribute in 'output' as specified by 'nameOfNeighborsOutputAttribute'.", {ogn.MetadataKeys.DEFAULT: 'true'}, True, True, False, ''),
('inputs:mesh', 'bundle', 0, None, 'Bundle containing topology data to be analysed', {}, True, None, False, ''),
('inputs:nameOfDistancesOutputAttribute', 'token', 0, None, "Name of the 'float[]' attribute to be created in 'output' to contain the computed distances to each neighbor. This is only used if 'computeDistances' is true.", {ogn.MetadataKeys.DEFAULT: '"distances"'}, True, "distances", False, ''),
('inputs:nameOfNeighborCountsOutputAttribute', 'token', 0, None, "Name of the 'int[]' attribute to be created in 'output' to contain the number of neighbors of each point. This is only used if 'computeNeighborCounts' is true. A running sum of this array can be computed using 'computeNeighborStarts'. The neighbors themselves can be computed using 'computeNeighbors'.", {ogn.MetadataKeys.DEFAULT: '"neighborCounts"'}, True, "neighborCounts", False, ''),
('inputs:nameOfNeighborStartsOutputAttribute', 'token', 0, None, "Name of the 'int[]' attribute to be created in 'output' to contain the beginning index of neighbors of each point in the arrays computed by either 'computeNeighbors' or 'computeDistances'. This is only used if 'computeNeighborStarts' is true.", {ogn.MetadataKeys.DEFAULT: '"neighborStarts"'}, True, "neighborStarts", False, ''),
('inputs:nameOfNeighborsOutputAttribute', 'token', 0, None, "Name of the 'int[]' attribute to be created in 'output' to contain the neighbors of all points. This is only used if 'computeNeighbors' is true. The beginnings of each point's neighbors within this array can be computed using 'computeNeighborStarts'. The number of neighbors of each point can be computed using 'computeNeighborCounts'.", {ogn.MetadataKeys.DEFAULT: '"neighbors"'}, True, "neighbors", False, ''),
('inputs:nameOfPositionsInputAttribute', 'token', 0, None, "Name of the 'point3f[]' attribute in 'mesh' containing the positions of each point. This is only used if 'computeDistances' is true. The element count of this array overrides 'pointCount', when used.", {ogn.MetadataKeys.DEFAULT: '"points"'}, True, "points", False, ''),
('inputs:nameOfVertexCountsInputAttribute', 'token', 0, None, "Name of the 'int[]' attribute in 'mesh' containing the vertex counts of each face", {ogn.MetadataKeys.DEFAULT: '"faceVertexCounts"'}, True, "faceVertexCounts", False, ''),
('inputs:nameOfVertexIndicesInputAttribute', 'token', 0, None, "Name of the 'int[]' attribute in 'mesh' containing the vertex indices of each face", {ogn.MetadataKeys.DEFAULT: '"faceVertexIndices"'}, True, "faceVertexIndices", False, ''),
('inputs:pointCount', 'int', 0, None, "Number of points being referred to in the vertex indices attribute. This is only used if 'computeDistances' is false, otherwise this is overridden by the element count of the attribute specified by 'nameOfPositionsInputAttribute'.", {}, True, 0, False, ''),
('inputs:removeDuplicates', 'bool', 0, None, 'When enabled, each neighbor of a point will be counted only once, instead of once per edge that connects the point to the neighbor.', {ogn.MetadataKeys.DEFAULT: 'true'}, True, True, False, ''),
('inputs:treatEdgesAsOneWay', 'bool', 0, None, 'When enabled, if a face has an edge from A to B, B will be considered a neighbor of A, but A will not be considered a neighbor of B. This can be useful as part of identifying unshared edges or inconsistent face winding order.', {ogn.MetadataKeys.DEFAULT: 'false'}, True, False, False, ''),
('inputs:treatFacesAsCurves', 'bool', 0, None, 'When enabled, the input faces will be treated as curves, instead of closed polygons, i.e. no edge from the last vertex of each face to the first vertex of that face will be counted.', {ogn.MetadataKeys.DEFAULT: 'false'}, True, False, False, ''),
('outputs:mesh', 'bundle', 0, None, "A copy of the input 'mesh' with the computed attributes added, as specified above.", {}, True, None, False, ''),
])
@classmethod
def _populate_role_data(cls):
"""Populate a role structure with the non-default roles on this node type"""
role_data = super()._populate_role_data()
role_data.inputs.mesh = og.AttributeRole.BUNDLE
role_data.outputs.mesh = og.AttributeRole.BUNDLE
return role_data
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self.__bundles = og.BundleContainer(context, node, attributes, [], read_only=True, gpu_ptr_kinds={})
self._batchedReadAttributes = []
self._batchedReadValues = []
@property
def computeDistances(self):
data_view = og.AttributeValueHelper(self._attributes.computeDistances)
return data_view.get()
@computeDistances.setter
def computeDistances(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.computeDistances)
data_view = og.AttributeValueHelper(self._attributes.computeDistances)
data_view.set(value)
@property
def computeNeighborCounts(self):
data_view = og.AttributeValueHelper(self._attributes.computeNeighborCounts)
return data_view.get()
@computeNeighborCounts.setter
def computeNeighborCounts(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.computeNeighborCounts)
data_view = og.AttributeValueHelper(self._attributes.computeNeighborCounts)
data_view.set(value)
@property
def computeNeighborStarts(self):
data_view = og.AttributeValueHelper(self._attributes.computeNeighborStarts)
return data_view.get()
@computeNeighborStarts.setter
def computeNeighborStarts(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.computeNeighborStarts)
data_view = og.AttributeValueHelper(self._attributes.computeNeighborStarts)
data_view.set(value)
@property
def computeNeighbors(self):
data_view = og.AttributeValueHelper(self._attributes.computeNeighbors)
return data_view.get()
@computeNeighbors.setter
def computeNeighbors(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.computeNeighbors)
data_view = og.AttributeValueHelper(self._attributes.computeNeighbors)
data_view.set(value)
@property
def mesh(self) -> og.BundleContents:
"""Get the bundle wrapper class for the attribute inputs.mesh"""
return self.__bundles.mesh
@property
def nameOfDistancesOutputAttribute(self):
data_view = og.AttributeValueHelper(self._attributes.nameOfDistancesOutputAttribute)
return data_view.get()
@nameOfDistancesOutputAttribute.setter
def nameOfDistancesOutputAttribute(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.nameOfDistancesOutputAttribute)
data_view = og.AttributeValueHelper(self._attributes.nameOfDistancesOutputAttribute)
data_view.set(value)
@property
def nameOfNeighborCountsOutputAttribute(self):
data_view = og.AttributeValueHelper(self._attributes.nameOfNeighborCountsOutputAttribute)
return data_view.get()
@nameOfNeighborCountsOutputAttribute.setter
def nameOfNeighborCountsOutputAttribute(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.nameOfNeighborCountsOutputAttribute)
data_view = og.AttributeValueHelper(self._attributes.nameOfNeighborCountsOutputAttribute)
data_view.set(value)
@property
def nameOfNeighborStartsOutputAttribute(self):
data_view = og.AttributeValueHelper(self._attributes.nameOfNeighborStartsOutputAttribute)
return data_view.get()
@nameOfNeighborStartsOutputAttribute.setter
def nameOfNeighborStartsOutputAttribute(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.nameOfNeighborStartsOutputAttribute)
data_view = og.AttributeValueHelper(self._attributes.nameOfNeighborStartsOutputAttribute)
data_view.set(value)
@property
def nameOfNeighborsOutputAttribute(self):
data_view = og.AttributeValueHelper(self._attributes.nameOfNeighborsOutputAttribute)
return data_view.get()
@nameOfNeighborsOutputAttribute.setter
def nameOfNeighborsOutputAttribute(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.nameOfNeighborsOutputAttribute)
data_view = og.AttributeValueHelper(self._attributes.nameOfNeighborsOutputAttribute)
data_view.set(value)
@property
def nameOfPositionsInputAttribute(self):
data_view = og.AttributeValueHelper(self._attributes.nameOfPositionsInputAttribute)
return data_view.get()
@nameOfPositionsInputAttribute.setter
def nameOfPositionsInputAttribute(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.nameOfPositionsInputAttribute)
data_view = og.AttributeValueHelper(self._attributes.nameOfPositionsInputAttribute)
data_view.set(value)
@property
def nameOfVertexCountsInputAttribute(self):
data_view = og.AttributeValueHelper(self._attributes.nameOfVertexCountsInputAttribute)
return data_view.get()
@nameOfVertexCountsInputAttribute.setter
def nameOfVertexCountsInputAttribute(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.nameOfVertexCountsInputAttribute)
data_view = og.AttributeValueHelper(self._attributes.nameOfVertexCountsInputAttribute)
data_view.set(value)
@property
def nameOfVertexIndicesInputAttribute(self):
data_view = og.AttributeValueHelper(self._attributes.nameOfVertexIndicesInputAttribute)
return data_view.get()
@nameOfVertexIndicesInputAttribute.setter
def nameOfVertexIndicesInputAttribute(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.nameOfVertexIndicesInputAttribute)
data_view = og.AttributeValueHelper(self._attributes.nameOfVertexIndicesInputAttribute)
data_view.set(value)
@property
def pointCount(self):
data_view = og.AttributeValueHelper(self._attributes.pointCount)
return data_view.get()
@pointCount.setter
def pointCount(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.pointCount)
data_view = og.AttributeValueHelper(self._attributes.pointCount)
data_view.set(value)
@property
def removeDuplicates(self):
data_view = og.AttributeValueHelper(self._attributes.removeDuplicates)
return data_view.get()
@removeDuplicates.setter
def removeDuplicates(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.removeDuplicates)
data_view = og.AttributeValueHelper(self._attributes.removeDuplicates)
data_view.set(value)
@property
def treatEdgesAsOneWay(self):
data_view = og.AttributeValueHelper(self._attributes.treatEdgesAsOneWay)
return data_view.get()
@treatEdgesAsOneWay.setter
def treatEdgesAsOneWay(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.treatEdgesAsOneWay)
data_view = og.AttributeValueHelper(self._attributes.treatEdgesAsOneWay)
data_view.set(value)
@property
def treatFacesAsCurves(self):
data_view = og.AttributeValueHelper(self._attributes.treatFacesAsCurves)
return data_view.get()
@treatFacesAsCurves.setter
def treatFacesAsCurves(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.treatFacesAsCurves)
data_view = og.AttributeValueHelper(self._attributes.treatFacesAsCurves)
data_view.set(value)
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self.__bundles = og.BundleContainer(context, node, attributes, [], read_only=False, gpu_ptr_kinds={})
self._batchedWriteValues = { }
@property
def mesh(self) -> og.BundleContents:
"""Get the bundle wrapper class for the attribute outputs.mesh"""
return self.__bundles.mesh
@mesh.setter
def mesh(self, bundle: og.BundleContents):
"""Overwrite the bundle attribute outputs.mesh with a new bundle"""
if not isinstance(bundle, og.BundleContents):
carb.log_error("Only bundle attributes can be assigned to another bundle attribute")
self.__bundles.mesh.bundle = bundle
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnExampleAdjacencyDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnExampleAdjacencyDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnExampleAdjacencyDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 19,410 | Python | 58.726154 | 654 | 0.688357 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnPrimDeformer2Database.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.PrimDeformer2
Example deformer node that limits the Z point positions to a threshold, input via a Prim
"""
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnPrimDeformer2Database(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.PrimDeformer2
Class Members:
node: Node being evaluated
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
])
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedWriteValues = { }
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnPrimDeformer2Database.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnPrimDeformer2Database.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnPrimDeformer2Database.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 3,989 | Python | 49.506328 | 115 | 0.697167 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnDeformer2_CPUDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.Deformer2
Example deformer that limits the Z point positions to a threshold
"""
import numpy
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnDeformer2_CPUDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.Deformer2
Class Members:
node: Node being evaluated
Attribute Value Properties:
Inputs:
inputs.points
inputs.threshold
Outputs:
outputs.points
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
('inputs:points', 'point3f[]', 0, None, 'Set of points to be deformed', {}, True, [], False, ''),
('inputs:threshold', 'float', 0, None, 'Z value to limit points', {}, True, 0.0, False, ''),
('outputs:points', 'point3f[]', 0, None, 'Set of deformed points', {}, True, None, False, ''),
])
@classmethod
def _populate_role_data(cls):
"""Populate a role structure with the non-default roles on this node type"""
role_data = super()._populate_role_data()
role_data.inputs.points = og.AttributeRole.POSITION
role_data.outputs.points = og.AttributeRole.POSITION
return role_data
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
@property
def points(self):
data_view = og.AttributeValueHelper(self._attributes.points)
return data_view.get()
@points.setter
def points(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.points)
data_view = og.AttributeValueHelper(self._attributes.points)
data_view.set(value)
self.points_size = data_view.get_array_size()
@property
def threshold(self):
data_view = og.AttributeValueHelper(self._attributes.threshold)
return data_view.get()
@threshold.setter
def threshold(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.threshold)
data_view = og.AttributeValueHelper(self._attributes.threshold)
data_view.set(value)
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self.points_size = None
self._batchedWriteValues = { }
@property
def points(self):
data_view = og.AttributeValueHelper(self._attributes.points)
return data_view.get(reserved_element_count=self.points_size)
@points.setter
def points(self, value):
data_view = og.AttributeValueHelper(self._attributes.points)
data_view.set(value)
self.points_size = data_view.get_array_size()
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnDeformer2_CPUDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnDeformer2_CPUDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnDeformer2_CPUDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 6,121 | Python | 44.348148 | 115 | 0.659533 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnBounce_CPUDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.BounceCpu
A sample node that gathers (vectorizes) a bunch of translation attributes and bounces the objects up and down
"""
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
import carb
class OgnBounce_CPUDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.BounceCpu
Class Members:
node: Node being evaluated
Attribute Value Properties:
Inputs:
inputs.gatheredData
Outputs:
outputs.gatheredData
"""
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
('inputs:gatheredData', 'bundle', 0, None, 'Bundle containing gathered translation attributes', {}, True, None, False, ''),
('outputs:gatheredData', 'bundle', 0, None, 'Bundle containing gathered translation attributes, now mutated', {}, True, None, False, ''),
])
@classmethod
def _populate_role_data(cls):
"""Populate a role structure with the non-default roles on this node type"""
role_data = super()._populate_role_data()
role_data.inputs.gatheredData = og.Database.ROLE_BUNDLE
role_data.outputs.gatheredData = og.Database.ROLE_BUNDLE
return role_data
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self.__bundles = og.BundleContainer(context, node, attributes, [], read_only=True, gpu_ptr_kinds={})
self._batchedReadAttributes = []
self._batchedReadValues = []
@property
def gatheredData(self) -> og.BundleContents:
"""Get the bundle wrapper class for the attribute inputs.gatheredData"""
return self.__bundles.gatheredData
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self.__bundles = og.BundleContainer(context, node, attributes, [], read_only=False, gpu_ptr_kinds={})
self._batchedWriteValues = { }
@property
def gatheredData(self) -> og.BundleContents:
"""Get the bundle wrapper class for the attribute outputs.gatheredData"""
return self.__bundles.gatheredData
@gatheredData.setter
def gatheredData(self, bundle: og.BundleContents):
"""Overwrite the bundle attribute outputs.gatheredData with a new bundle"""
if not isinstance(bundle, og.BundleContents):
carb.log_error("Only bundle attributes can be assigned to another bundle attribute")
self.__bundles.gatheredData.bundle = bundle
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnBounce_CPUDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnBounce_CPUDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnBounce_CPUDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 5,616 | Python | 55.169999 | 145 | 0.682336 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnBounceNoBundle_CPUDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.BounceNoBundleCpu
A sample node that gathers (vectorizes) a bunch of translation attributes and bounces the objects up and down
"""
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnBounceNoBundle_CPUDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.BounceNoBundleCpu
Class Members:
node: Node being evaluated
Attribute Value Properties:
Inputs:
inputs.gatherId
"""
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
('inputs:gatherId', 'uint64', 0, None, 'GatherId of the Gather', {}, True, 0, False, ''),
])
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = {"gatherId", "_setting_locked", "_batchedReadAttributes", "_batchedReadValues"}
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = [self._attributes.gatherId]
self._batchedReadValues = [0]
@property
def gatherId(self):
return self._batchedReadValues[0]
@gatherId.setter
def gatherId(self, value):
self._batchedReadValues[0] = value
def __getattr__(self, item: str):
if item in self.LOCAL_PROPERTY_NAMES:
return object.__getattribute__(self, item)
else:
return super().__getattr__(item)
def __setattr__(self, item: str, new_value):
if item in self.LOCAL_PROPERTY_NAMES:
object.__setattr__(self, item, new_value)
else:
super().__setattr__(item, new_value)
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedWriteValues = { }
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnBounceNoBundle_CPUDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnBounceNoBundle_CPUDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnBounceNoBundle_CPUDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 4,805 | Python | 52.399999 | 120 | 0.673673 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnDeformer1Gather_GPUDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.DeformerWithGatherGpu
Example deformer node that applies a sine wave to a mesh using gathered inputs
"""
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnDeformer1Gather_GPUDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.DeformerWithGatherGpu
Class Members:
node: Node being evaluated
"""
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
])
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedWriteValues = { }
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnDeformer1Gather_GPUDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnDeformer1Gather_GPUDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnDeformer1Gather_GPUDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 3,856 | Python | 58.338461 | 121 | 0.702023 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnScaleCubeDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.ScaleCube
Example node that performs a simple multiplication
"""
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnScaleCubeDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.ScaleCube
Class Members:
node: Node being evaluated
Attribute Value Properties:
Inputs:
inputs.multiplier
inputs.value
Outputs:
outputs.value
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
('inputs:multiplier', 'float', 0, None, '2nd multiplicand', {}, True, 0.0, False, ''),
('inputs:value', 'float', 0, None, '1st multiplicand', {}, True, 0.0, False, ''),
('outputs:value', 'double', 0, None, 'Product of value and multiplier', {}, True, None, False, ''),
])
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
@property
def multiplier(self):
data_view = og.AttributeValueHelper(self._attributes.multiplier)
return data_view.get()
@multiplier.setter
def multiplier(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.multiplier)
data_view = og.AttributeValueHelper(self._attributes.multiplier)
data_view.set(value)
@property
def value(self):
data_view = og.AttributeValueHelper(self._attributes.value)
return data_view.get()
@value.setter
def value(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.value)
data_view = og.AttributeValueHelper(self._attributes.value)
data_view.set(value)
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedWriteValues = { }
@property
def value(self):
data_view = og.AttributeValueHelper(self._attributes.value)
return data_view.get()
@value.setter
def value(self, value):
data_view = og.AttributeValueHelper(self._attributes.value)
data_view.set(value)
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnScaleCubeDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnScaleCubeDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnScaleCubeDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 5,530 | Python | 43.967479 | 111 | 0.660036 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnDeformer1_CPUDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.Deformer1
Example deformer node that applies a sine wave to a mesh
"""
import numpy
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnDeformer1_CPUDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.Deformer1
Class Members:
node: Node being evaluated
Attribute Value Properties:
Inputs:
inputs.multiplier
inputs.points
inputs.wavelength
Outputs:
outputs.points
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
('inputs:multiplier', 'float', 0, None, 'Amplitude of sinusoidal deformer function', {ogn.MetadataKeys.DEFAULT: '0.7'}, True, 0.7, False, ''),
('inputs:points', 'point3f[]', 0, None, 'Set of points to be deformed', {}, True, [], False, ''),
('inputs:wavelength', 'float', 0, None, 'Wavelength of sinusodal deformer function', {ogn.MetadataKeys.DEFAULT: '50.0'}, True, 50.0, False, ''),
('outputs:points', 'point3f[]', 0, None, 'Set of deformed points', {}, True, None, False, ''),
])
@classmethod
def _populate_role_data(cls):
"""Populate a role structure with the non-default roles on this node type"""
role_data = super()._populate_role_data()
role_data.inputs.points = og.AttributeRole.POSITION
role_data.outputs.points = og.AttributeRole.POSITION
return role_data
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
@property
def multiplier(self):
data_view = og.AttributeValueHelper(self._attributes.multiplier)
return data_view.get()
@multiplier.setter
def multiplier(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.multiplier)
data_view = og.AttributeValueHelper(self._attributes.multiplier)
data_view.set(value)
@property
def points(self):
data_view = og.AttributeValueHelper(self._attributes.points)
return data_view.get()
@points.setter
def points(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.points)
data_view = og.AttributeValueHelper(self._attributes.points)
data_view.set(value)
self.points_size = data_view.get_array_size()
@property
def wavelength(self):
data_view = og.AttributeValueHelper(self._attributes.wavelength)
return data_view.get()
@wavelength.setter
def wavelength(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.wavelength)
data_view = og.AttributeValueHelper(self._attributes.wavelength)
data_view.set(value)
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self.points_size = None
self._batchedWriteValues = { }
@property
def points(self):
data_view = og.AttributeValueHelper(self._attributes.points)
return data_view.get(reserved_element_count=self.points_size)
@points.setter
def points(self, value):
data_view = og.AttributeValueHelper(self._attributes.points)
data_view.set(value)
self.points_size = data_view.get_array_size()
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnDeformer1_CPUDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnDeformer1_CPUDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnDeformer1_CPUDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 6,793 | Python | 44.597315 | 152 | 0.656705 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnExampleSmoothDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.Smooth
Smooths data in a very simple way by averaging values with neighbors.
"""
import carb
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnExampleSmoothDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.Smooth
Class Members:
node: Node being evaluated
Attribute Value Properties:
Inputs:
inputs.iterations
inputs.mesh
inputs.nameOfAttributeToSmooth
inputs.nameOfNeighborStartsInputAttribute
inputs.nameOfNeighborsInputAttribute
inputs.useGPU
Outputs:
outputs.mesh
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
('inputs:iterations', 'int', 0, None, 'Number of times to average neighboring values', {ogn.MetadataKeys.DEFAULT: '5'}, True, 5, False, ''),
('inputs:mesh', 'bundle', 0, None, 'Bundle containing data to be smoothed and neighbor arrays.', {}, True, None, False, ''),
('inputs:nameOfAttributeToSmooth', 'token', 0, None, "Name of the attribute in 'mesh' containing the data to be smoothed", {ogn.MetadataKeys.DEFAULT: '"points"'}, True, "points", False, ''),
('inputs:nameOfNeighborStartsInputAttribute', 'token', 0, None, "Name of the 'int[]' attribute in 'mesh' containing the beginning index of neighbors of each point in the array attribute specified by 'nameOfNeighborsInputAttribute'", {ogn.MetadataKeys.DEFAULT: '"neighborStarts"'}, True, "neighborStarts", False, ''),
('inputs:nameOfNeighborsInputAttribute', 'token', 0, None, "Name of the 'int[]' attribute in 'mesh' containing the neighbors of all points. The beginnings of each point's neighbors within this array are provided in the attribute specified by 'nameOfNeighborStartsInputAttribute'.", {ogn.MetadataKeys.DEFAULT: '"neighbors"'}, True, "neighbors", False, ''),
('inputs:useGPU', 'bool', 0, None, 'When this option is on, the node will use the GPU to perform the smoothing computation.', {ogn.MetadataKeys.DEFAULT: 'true'}, True, True, False, ''),
('outputs:mesh', 'bundle', 0, None, "A copy of 'mesh' with the specified attribute smoothed.", {}, True, None, False, ''),
])
@classmethod
def _populate_role_data(cls):
"""Populate a role structure with the non-default roles on this node type"""
role_data = super()._populate_role_data()
role_data.inputs.mesh = og.AttributeRole.BUNDLE
role_data.outputs.mesh = og.AttributeRole.BUNDLE
return role_data
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self.__bundles = og.BundleContainer(context, node, attributes, [], read_only=True, gpu_ptr_kinds={})
self._batchedReadAttributes = []
self._batchedReadValues = []
@property
def iterations(self):
data_view = og.AttributeValueHelper(self._attributes.iterations)
return data_view.get()
@iterations.setter
def iterations(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.iterations)
data_view = og.AttributeValueHelper(self._attributes.iterations)
data_view.set(value)
@property
def mesh(self) -> og.BundleContents:
"""Get the bundle wrapper class for the attribute inputs.mesh"""
return self.__bundles.mesh
@property
def nameOfAttributeToSmooth(self):
data_view = og.AttributeValueHelper(self._attributes.nameOfAttributeToSmooth)
return data_view.get()
@nameOfAttributeToSmooth.setter
def nameOfAttributeToSmooth(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.nameOfAttributeToSmooth)
data_view = og.AttributeValueHelper(self._attributes.nameOfAttributeToSmooth)
data_view.set(value)
@property
def nameOfNeighborStartsInputAttribute(self):
data_view = og.AttributeValueHelper(self._attributes.nameOfNeighborStartsInputAttribute)
return data_view.get()
@nameOfNeighborStartsInputAttribute.setter
def nameOfNeighborStartsInputAttribute(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.nameOfNeighborStartsInputAttribute)
data_view = og.AttributeValueHelper(self._attributes.nameOfNeighborStartsInputAttribute)
data_view.set(value)
@property
def nameOfNeighborsInputAttribute(self):
data_view = og.AttributeValueHelper(self._attributes.nameOfNeighborsInputAttribute)
return data_view.get()
@nameOfNeighborsInputAttribute.setter
def nameOfNeighborsInputAttribute(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.nameOfNeighborsInputAttribute)
data_view = og.AttributeValueHelper(self._attributes.nameOfNeighborsInputAttribute)
data_view.set(value)
@property
def useGPU(self):
data_view = og.AttributeValueHelper(self._attributes.useGPU)
return data_view.get()
@useGPU.setter
def useGPU(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.useGPU)
data_view = og.AttributeValueHelper(self._attributes.useGPU)
data_view.set(value)
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self.__bundles = og.BundleContainer(context, node, attributes, [], read_only=False, gpu_ptr_kinds={})
self._batchedWriteValues = { }
@property
def mesh(self) -> og.BundleContents:
"""Get the bundle wrapper class for the attribute outputs.mesh"""
return self.__bundles.mesh
@mesh.setter
def mesh(self, bundle: og.BundleContents):
"""Overwrite the bundle attribute outputs.mesh with a new bundle"""
if not isinstance(bundle, og.BundleContents):
carb.log_error("Only bundle attributes can be assigned to another bundle attribute")
self.__bundles.mesh.bundle = bundle
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnExampleSmoothDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnExampleSmoothDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnExampleSmoothDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 9,571 | Python | 50.74054 | 364 | 0.672448 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnCompoundDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.Compound
Encapsulation of one more other nodes into a single node entity. The compound node doesn't have any functionality of its
own, it is merely a wrapper for a set of nodes that perform a complex task. It presents a more limited set of input and output
attributes than the union of the contained nodes to make it seem as though a single node is performing a higher level function.
For example a compound node could present inputs a, b, and c, and outputs root1 and root2 at the compound boundary, wiring
up simple math nodes square, squareRoot, add, subtract, times, and divided_by in a simple way that calculates quadratic roots.
(root1 = divide(add(b, square_root(subtract(square(b), times(4, times(a, c))))))) (root2 = divide(subtract(b, square_root(subtract(square(b),
times(4, times(a, c)))))))
"""
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnCompoundDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.Compound
Class Members:
node: Node being evaluated
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
])
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedWriteValues = { }
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnCompoundDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnCompoundDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnCompoundDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 4,665 | Python | 53.894117 | 141 | 0.705252 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnScaleCubeWithPrimDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.ScaleCubeWithOutputPrim
Example node that performs a simple multiplication on a float value extracted from a Prim
"""
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnScaleCubeWithPrimDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.ScaleCubeWithOutputPrim
Class Members:
node: Node being evaluated
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
])
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedWriteValues = { }
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnScaleCubeWithPrimDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnScaleCubeWithPrimDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnScaleCubeWithPrimDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 4,026 | Python | 49.974683 | 120 | 0.700447 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnVersionedDeformerDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.VersionedDeformer
Test node to confirm version upgrading works. Performs a basic deformation on some points.
"""
import numpy
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnVersionedDeformerDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.VersionedDeformer
Class Members:
node: Node being evaluated
Attribute Value Properties:
Inputs:
inputs.points
inputs.wavelength
Outputs:
outputs.points
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
('inputs:points', 'point3f[]', 0, None, 'Set of points to be deformed', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:wavelength', 'float', 0, None, 'Wavelength of sinusodal deformer function', {ogn.MetadataKeys.DEFAULT: '50.0'}, True, 50.0, False, ''),
('outputs:points', 'point3f[]', 0, None, 'Set of deformed points', {}, True, None, False, ''),
])
@classmethod
def _populate_role_data(cls):
"""Populate a role structure with the non-default roles on this node type"""
role_data = super()._populate_role_data()
role_data.inputs.points = og.AttributeRole.POSITION
role_data.outputs.points = og.AttributeRole.POSITION
return role_data
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
@property
def points(self):
data_view = og.AttributeValueHelper(self._attributes.points)
return data_view.get()
@points.setter
def points(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.points)
data_view = og.AttributeValueHelper(self._attributes.points)
data_view.set(value)
self.points_size = data_view.get_array_size()
@property
def wavelength(self):
data_view = og.AttributeValueHelper(self._attributes.wavelength)
return data_view.get()
@wavelength.setter
def wavelength(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.wavelength)
data_view = og.AttributeValueHelper(self._attributes.wavelength)
data_view.set(value)
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self.points_size = None
self._batchedWriteValues = { }
@property
def points(self):
data_view = og.AttributeValueHelper(self._attributes.points)
return data_view.get(reserved_element_count=self.points_size)
@points.setter
def points(self, value):
data_view = og.AttributeValueHelper(self._attributes.points)
data_view.set(value)
self.points_size = data_view.get_array_size()
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnVersionedDeformerDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnVersionedDeformerDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnVersionedDeformerDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 6,267 | Python | 45.429629 | 152 | 0.664911 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnBounce_GPUDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.BounceGpu
Example node that gathers (vectorizes) a bunch of translation attributes and bounces the objects up and down on the GPU
"""
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnBounce_GPUDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.BounceGpu
Class Members:
node: Node being evaluated
"""
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
])
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedWriteValues = { }
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnBounce_GPUDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnBounce_GPUDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnBounce_GPUDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 3,837 | Python | 58.046153 | 119 | 0.698462 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnUniversalAddDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.UniversalAdd
Universal add node for all types. This file was originally generated using UniversalAddGenerator.py. Edits have been made
since the initial generation as the API evolved. This example uses outputs and pairs of inputs of every type to be 'universal'.
See the 'Add' node for a Python implementation that uses only one output and one pair of inputs using the 'any' type.
"""
import numpy
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnUniversalAddDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.UniversalAdd
Class Members:
node: Node being evaluated
Attribute Value Properties:
Inputs:
inputs.bool_0
inputs.bool_1
inputs.bool_arr_0
inputs.bool_arr_1
inputs.colord3_0
inputs.colord3_1
inputs.colord3_arr_0
inputs.colord3_arr_1
inputs.colord4_0
inputs.colord4_1
inputs.colord4_arr_0
inputs.colord4_arr_1
inputs.colorf3_0
inputs.colorf3_1
inputs.colorf3_arr_0
inputs.colorf3_arr_1
inputs.colorf4_0
inputs.colorf4_1
inputs.colorf4_arr_0
inputs.colorf4_arr_1
inputs.colorh3_0
inputs.colorh3_1
inputs.colorh3_arr_0
inputs.colorh3_arr_1
inputs.colorh4_0
inputs.colorh4_1
inputs.colorh4_arr_0
inputs.colorh4_arr_1
inputs.double2_0
inputs.double2_1
inputs.double2_arr_0
inputs.double2_arr_1
inputs.double3_0
inputs.double3_1
inputs.double3_arr_0
inputs.double3_arr_1
inputs.double4_0
inputs.double4_1
inputs.double4_arr_0
inputs.double4_arr_1
inputs.double_0
inputs.double_1
inputs.double_arr_0
inputs.double_arr_1
inputs.float2_0
inputs.float2_1
inputs.float2_arr_0
inputs.float2_arr_1
inputs.float3_0
inputs.float3_1
inputs.float3_arr_0
inputs.float3_arr_1
inputs.float4_0
inputs.float4_1
inputs.float4_arr_0
inputs.float4_arr_1
inputs.float_0
inputs.float_1
inputs.float_arr_0
inputs.float_arr_1
inputs.frame4_0
inputs.frame4_1
inputs.frame4_arr_0
inputs.frame4_arr_1
inputs.half2_0
inputs.half2_1
inputs.half2_arr_0
inputs.half2_arr_1
inputs.half3_0
inputs.half3_1
inputs.half3_arr_0
inputs.half3_arr_1
inputs.half4_0
inputs.half4_1
inputs.half4_arr_0
inputs.half4_arr_1
inputs.half_0
inputs.half_1
inputs.half_arr_0
inputs.half_arr_1
inputs.int2_0
inputs.int2_1
inputs.int2_arr_0
inputs.int2_arr_1
inputs.int3_0
inputs.int3_1
inputs.int3_arr_0
inputs.int3_arr_1
inputs.int4_0
inputs.int4_1
inputs.int4_arr_0
inputs.int4_arr_1
inputs.int64_0
inputs.int64_1
inputs.int64_arr_0
inputs.int64_arr_1
inputs.int_0
inputs.int_1
inputs.int_arr_0
inputs.int_arr_1
inputs.matrixd2_0
inputs.matrixd2_1
inputs.matrixd2_arr_0
inputs.matrixd2_arr_1
inputs.matrixd3_0
inputs.matrixd3_1
inputs.matrixd3_arr_0
inputs.matrixd3_arr_1
inputs.matrixd4_0
inputs.matrixd4_1
inputs.matrixd4_arr_0
inputs.matrixd4_arr_1
inputs.normald3_0
inputs.normald3_1
inputs.normald3_arr_0
inputs.normald3_arr_1
inputs.normalf3_0
inputs.normalf3_1
inputs.normalf3_arr_0
inputs.normalf3_arr_1
inputs.normalh3_0
inputs.normalh3_1
inputs.normalh3_arr_0
inputs.normalh3_arr_1
inputs.pointd3_0
inputs.pointd3_1
inputs.pointd3_arr_0
inputs.pointd3_arr_1
inputs.pointf3_0
inputs.pointf3_1
inputs.pointf3_arr_0
inputs.pointf3_arr_1
inputs.pointh3_0
inputs.pointh3_1
inputs.pointh3_arr_0
inputs.pointh3_arr_1
inputs.quatd4_0
inputs.quatd4_1
inputs.quatd4_arr_0
inputs.quatd4_arr_1
inputs.quatf4_0
inputs.quatf4_1
inputs.quatf4_arr_0
inputs.quatf4_arr_1
inputs.quath4_0
inputs.quath4_1
inputs.quath4_arr_0
inputs.quath4_arr_1
inputs.texcoordd2_0
inputs.texcoordd2_1
inputs.texcoordd2_arr_0
inputs.texcoordd2_arr_1
inputs.texcoordd3_0
inputs.texcoordd3_1
inputs.texcoordd3_arr_0
inputs.texcoordd3_arr_1
inputs.texcoordf2_0
inputs.texcoordf2_1
inputs.texcoordf2_arr_0
inputs.texcoordf2_arr_1
inputs.texcoordf3_0
inputs.texcoordf3_1
inputs.texcoordf3_arr_0
inputs.texcoordf3_arr_1
inputs.texcoordh2_0
inputs.texcoordh2_1
inputs.texcoordh2_arr_0
inputs.texcoordh2_arr_1
inputs.texcoordh3_0
inputs.texcoordh3_1
inputs.texcoordh3_arr_0
inputs.texcoordh3_arr_1
inputs.timecode_0
inputs.timecode_1
inputs.timecode_arr_0
inputs.timecode_arr_1
inputs.token_0
inputs.token_1
inputs.token_arr_0
inputs.token_arr_1
inputs.transform4_0
inputs.transform4_1
inputs.transform4_arr_0
inputs.transform4_arr_1
inputs.uchar_0
inputs.uchar_1
inputs.uchar_arr_0
inputs.uchar_arr_1
inputs.uint64_0
inputs.uint64_1
inputs.uint64_arr_0
inputs.uint64_arr_1
inputs.uint_0
inputs.uint_1
inputs.uint_arr_0
inputs.uint_arr_1
inputs.vectord3_0
inputs.vectord3_1
inputs.vectord3_arr_0
inputs.vectord3_arr_1
inputs.vectorf3_0
inputs.vectorf3_1
inputs.vectorf3_arr_0
inputs.vectorf3_arr_1
inputs.vectorh3_0
inputs.vectorh3_1
inputs.vectorh3_arr_0
inputs.vectorh3_arr_1
Outputs:
outputs.bool_0
outputs.bool_arr_0
outputs.colord3_0
outputs.colord3_arr_0
outputs.colord4_0
outputs.colord4_arr_0
outputs.colorf3_0
outputs.colorf3_arr_0
outputs.colorf4_0
outputs.colorf4_arr_0
outputs.colorh3_0
outputs.colorh3_arr_0
outputs.colorh4_0
outputs.colorh4_arr_0
outputs.double2_0
outputs.double2_arr_0
outputs.double3_0
outputs.double3_arr_0
outputs.double4_0
outputs.double4_arr_0
outputs.double_0
outputs.double_arr_0
outputs.float2_0
outputs.float2_arr_0
outputs.float3_0
outputs.float3_arr_0
outputs.float4_0
outputs.float4_arr_0
outputs.float_0
outputs.float_arr_0
outputs.frame4_0
outputs.frame4_arr_0
outputs.half2_0
outputs.half2_arr_0
outputs.half3_0
outputs.half3_arr_0
outputs.half4_0
outputs.half4_arr_0
outputs.half_0
outputs.half_arr_0
outputs.int2_0
outputs.int2_arr_0
outputs.int3_0
outputs.int3_arr_0
outputs.int4_0
outputs.int4_arr_0
outputs.int64_0
outputs.int64_arr_0
outputs.int_0
outputs.int_arr_0
outputs.matrixd2_0
outputs.matrixd2_arr_0
outputs.matrixd3_0
outputs.matrixd3_arr_0
outputs.matrixd4_0
outputs.matrixd4_arr_0
outputs.normald3_0
outputs.normald3_arr_0
outputs.normalf3_0
outputs.normalf3_arr_0
outputs.normalh3_0
outputs.normalh3_arr_0
outputs.pointd3_0
outputs.pointd3_arr_0
outputs.pointf3_0
outputs.pointf3_arr_0
outputs.pointh3_0
outputs.pointh3_arr_0
outputs.quatd4_0
outputs.quatd4_arr_0
outputs.quatf4_0
outputs.quatf4_arr_0
outputs.quath4_0
outputs.quath4_arr_0
outputs.texcoordd2_0
outputs.texcoordd2_arr_0
outputs.texcoordd3_0
outputs.texcoordd3_arr_0
outputs.texcoordf2_0
outputs.texcoordf2_arr_0
outputs.texcoordf3_0
outputs.texcoordf3_arr_0
outputs.texcoordh2_0
outputs.texcoordh2_arr_0
outputs.texcoordh3_0
outputs.texcoordh3_arr_0
outputs.timecode_0
outputs.timecode_arr_0
outputs.token_0
outputs.token_arr_0
outputs.transform4_0
outputs.transform4_arr_0
outputs.uchar_0
outputs.uchar_arr_0
outputs.uint64_0
outputs.uint64_arr_0
outputs.uint_0
outputs.uint_arr_0
outputs.vectord3_0
outputs.vectord3_arr_0
outputs.vectorf3_0
outputs.vectorf3_arr_0
outputs.vectorh3_0
outputs.vectorh3_arr_0
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
('inputs:bool_0', 'bool', 0, None, 'Input of type bool', {ogn.MetadataKeys.DEFAULT: 'false'}, True, False, False, ''),
('inputs:bool_1', 'bool', 0, None, 'Input of type bool', {ogn.MetadataKeys.DEFAULT: 'false'}, True, False, False, ''),
('inputs:bool_arr_0', 'bool[]', 0, None, 'Input of type bool[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:bool_arr_1', 'bool[]', 0, None, 'Input of type bool[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:colord3_0', 'color3d', 0, None, 'Input of type colord[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:colord3_1', 'color3d', 0, None, 'Input of type colord[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:colord3_arr_0', 'color3d[]', 0, None, 'Input of type colord[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:colord3_arr_1', 'color3d[]', 0, None, 'Input of type colord[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:colord4_0', 'color4d', 0, None, 'Input of type colord[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:colord4_1', 'color4d', 0, None, 'Input of type colord[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:colord4_arr_0', 'color4d[]', 0, None, 'Input of type colord[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:colord4_arr_1', 'color4d[]', 0, None, 'Input of type colord[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:colorf3_0', 'color3f', 0, None, 'Input of type colorf[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:colorf3_1', 'color3f', 0, None, 'Input of type colorf[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:colorf3_arr_0', 'color3f[]', 0, None, 'Input of type colorf[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:colorf3_arr_1', 'color3f[]', 0, None, 'Input of type colorf[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:colorf4_0', 'color4f', 0, None, 'Input of type colorf[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:colorf4_1', 'color4f', 0, None, 'Input of type colorf[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:colorf4_arr_0', 'color4f[]', 0, None, 'Input of type colorf[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:colorf4_arr_1', 'color4f[]', 0, None, 'Input of type colorf[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:colorh3_0', 'color3h', 0, None, 'Input of type colorh[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:colorh3_1', 'color3h', 0, None, 'Input of type colorh[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:colorh3_arr_0', 'color3h[]', 0, None, 'Input of type colorh[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:colorh3_arr_1', 'color3h[]', 0, None, 'Input of type colorh[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:colorh4_0', 'color4h', 0, None, 'Input of type colorh[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:colorh4_1', 'color4h', 0, None, 'Input of type colorh[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:colorh4_arr_0', 'color4h[]', 0, None, 'Input of type colorh[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:colorh4_arr_1', 'color4h[]', 0, None, 'Input of type colorh[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:double2_0', 'double2', 0, None, 'Input of type double[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0]'}, True, [0.0, 0.0], False, ''),
('inputs:double2_1', 'double2', 0, None, 'Input of type double[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0]'}, True, [0.0, 0.0], False, ''),
('inputs:double2_arr_0', 'double2[]', 0, None, 'Input of type double[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:double2_arr_1', 'double2[]', 0, None, 'Input of type double[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:double3_0', 'double3', 0, None, 'Input of type double[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:double3_1', 'double3', 0, None, 'Input of type double[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:double3_arr_0', 'double3[]', 0, None, 'Input of type double[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:double3_arr_1', 'double3[]', 0, None, 'Input of type double[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:double4_0', 'double4', 0, None, 'Input of type double[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:double4_1', 'double4', 0, None, 'Input of type double[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:double4_arr_0', 'double4[]', 0, None, 'Input of type double[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:double4_arr_1', 'double4[]', 0, None, 'Input of type double[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:double_0', 'double', 0, None, 'Input of type double', {ogn.MetadataKeys.DEFAULT: '0.0'}, True, 0.0, False, ''),
('inputs:double_1', 'double', 0, None, 'Input of type double', {ogn.MetadataKeys.DEFAULT: '0.0'}, True, 0.0, False, ''),
('inputs:double_arr_0', 'double[]', 0, None, 'Input of type double[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:double_arr_1', 'double[]', 0, None, 'Input of type double[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:float2_0', 'float2', 0, None, 'Input of type float[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0]'}, True, [0.0, 0.0], False, ''),
('inputs:float2_1', 'float2', 0, None, 'Input of type float[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0]'}, True, [0.0, 0.0], False, ''),
('inputs:float2_arr_0', 'float2[]', 0, None, 'Input of type float[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:float2_arr_1', 'float2[]', 0, None, 'Input of type float[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:float3_0', 'float3', 0, None, 'Input of type float[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:float3_1', 'float3', 0, None, 'Input of type float[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:float3_arr_0', 'float3[]', 0, None, 'Input of type float[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:float3_arr_1', 'float3[]', 0, None, 'Input of type float[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:float4_0', 'float4', 0, None, 'Input of type float[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:float4_1', 'float4', 0, None, 'Input of type float[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:float4_arr_0', 'float4[]', 0, None, 'Input of type float[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:float4_arr_1', 'float4[]', 0, None, 'Input of type float[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:float_0', 'float', 0, None, 'Input of type float', {ogn.MetadataKeys.DEFAULT: '0.0'}, True, 0.0, False, ''),
('inputs:float_1', 'float', 0, None, 'Input of type float', {ogn.MetadataKeys.DEFAULT: '0.0'}, True, 0.0, False, ''),
('inputs:float_arr_0', 'float[]', 0, None, 'Input of type float[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:float_arr_1', 'float[]', 0, None, 'Input of type float[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:frame4_0', 'frame4d', 0, None, 'Input of type frame[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:frame4_1', 'frame4d', 0, None, 'Input of type frame[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:frame4_arr_0', 'frame4d[]', 0, None, 'Input of type frame[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:frame4_arr_1', 'frame4d[]', 0, None, 'Input of type frame[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:half2_0', 'half2', 0, None, 'Input of type half[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0]'}, True, [0.0, 0.0], False, ''),
('inputs:half2_1', 'half2', 0, None, 'Input of type half[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0]'}, True, [0.0, 0.0], False, ''),
('inputs:half2_arr_0', 'half2[]', 0, None, 'Input of type half[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:half2_arr_1', 'half2[]', 0, None, 'Input of type half[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:half3_0', 'half3', 0, None, 'Input of type half[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:half3_1', 'half3', 0, None, 'Input of type half[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:half3_arr_0', 'half3[]', 0, None, 'Input of type half[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:half3_arr_1', 'half3[]', 0, None, 'Input of type half[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:half4_0', 'half4', 0, None, 'Input of type half[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:half4_1', 'half4', 0, None, 'Input of type half[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:half4_arr_0', 'half4[]', 0, None, 'Input of type half[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:half4_arr_1', 'half4[]', 0, None, 'Input of type half[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:half_0', 'half', 0, None, 'Input of type half', {ogn.MetadataKeys.DEFAULT: '0.0'}, True, 0.0, False, ''),
('inputs:half_1', 'half', 0, None, 'Input of type half', {ogn.MetadataKeys.DEFAULT: '0.0'}, True, 0.0, False, ''),
('inputs:half_arr_0', 'half[]', 0, None, 'Input of type half[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:half_arr_1', 'half[]', 0, None, 'Input of type half[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:int2_0', 'int2', 0, None, 'Input of type int[2]', {ogn.MetadataKeys.DEFAULT: '[0, 0]'}, True, [0, 0], False, ''),
('inputs:int2_1', 'int2', 0, None, 'Input of type int[2]', {ogn.MetadataKeys.DEFAULT: '[0, 0]'}, True, [0, 0], False, ''),
('inputs:int2_arr_0', 'int2[]', 0, None, 'Input of type int[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:int2_arr_1', 'int2[]', 0, None, 'Input of type int[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:int3_0', 'int3', 0, None, 'Input of type int[3]', {ogn.MetadataKeys.DEFAULT: '[0, 0, 0]'}, True, [0, 0, 0], False, ''),
('inputs:int3_1', 'int3', 0, None, 'Input of type int[3]', {ogn.MetadataKeys.DEFAULT: '[0, 0, 0]'}, True, [0, 0, 0], False, ''),
('inputs:int3_arr_0', 'int3[]', 0, None, 'Input of type int[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:int3_arr_1', 'int3[]', 0, None, 'Input of type int[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:int4_0', 'int4', 0, None, 'Input of type int[4]', {ogn.MetadataKeys.DEFAULT: '[0, 0, 0, 0]'}, True, [0, 0, 0, 0], False, ''),
('inputs:int4_1', 'int4', 0, None, 'Input of type int[4]', {ogn.MetadataKeys.DEFAULT: '[0, 0, 0, 0]'}, True, [0, 0, 0, 0], False, ''),
('inputs:int4_arr_0', 'int4[]', 0, None, 'Input of type int[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:int4_arr_1', 'int4[]', 0, None, 'Input of type int[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:int64_0', 'int64', 0, None, 'Input of type int64', {ogn.MetadataKeys.DEFAULT: '0'}, True, 0, False, ''),
('inputs:int64_1', 'int64', 0, None, 'Input of type int64', {ogn.MetadataKeys.DEFAULT: '0'}, True, 0, False, ''),
('inputs:int64_arr_0', 'int64[]', 0, None, 'Input of type int64[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:int64_arr_1', 'int64[]', 0, None, 'Input of type int64[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:int_0', 'int', 0, None, 'Input of type int', {ogn.MetadataKeys.DEFAULT: '0'}, True, 0, False, ''),
('inputs:int_1', 'int', 0, None, 'Input of type int', {ogn.MetadataKeys.DEFAULT: '0'}, True, 0, False, ''),
('inputs:int_arr_0', 'int[]', 0, None, 'Input of type int[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:int_arr_1', 'int[]', 0, None, 'Input of type int[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:matrixd2_0', 'matrix2d', 0, None, 'Input of type matrixd[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:matrixd2_1', 'matrix2d', 0, None, 'Input of type matrixd[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:matrixd2_arr_0', 'matrix2d[]', 0, None, 'Input of type matrixd[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:matrixd2_arr_1', 'matrix2d[]', 0, None, 'Input of type matrixd[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:matrixd3_0', 'matrix3d', 0, None, 'Input of type matrixd[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:matrixd3_1', 'matrix3d', 0, None, 'Input of type matrixd[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:matrixd3_arr_0', 'matrix3d[]', 0, None, 'Input of type matrixd[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:matrixd3_arr_1', 'matrix3d[]', 0, None, 'Input of type matrixd[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:matrixd4_0', 'matrix4d', 0, None, 'Input of type matrixd[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:matrixd4_1', 'matrix4d', 0, None, 'Input of type matrixd[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:matrixd4_arr_0', 'matrix4d[]', 0, None, 'Input of type matrixd[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:matrixd4_arr_1', 'matrix4d[]', 0, None, 'Input of type matrixd[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:normald3_0', 'normal3d', 0, None, 'Input of type normald[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:normald3_1', 'normal3d', 0, None, 'Input of type normald[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:normald3_arr_0', 'normal3d[]', 0, None, 'Input of type normald[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:normald3_arr_1', 'normal3d[]', 0, None, 'Input of type normald[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:normalf3_0', 'normal3f', 0, None, 'Input of type normalf[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:normalf3_1', 'normal3f', 0, None, 'Input of type normalf[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:normalf3_arr_0', 'normal3f[]', 0, None, 'Input of type normalf[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:normalf3_arr_1', 'normal3f[]', 0, None, 'Input of type normalf[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:normalh3_0', 'normal3h', 0, None, 'Input of type normalh[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:normalh3_1', 'normal3h', 0, None, 'Input of type normalh[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:normalh3_arr_0', 'normal3h[]', 0, None, 'Input of type normalh[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:normalh3_arr_1', 'normal3h[]', 0, None, 'Input of type normalh[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:pointd3_0', 'point3d', 0, None, 'Input of type pointd[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:pointd3_1', 'point3d', 0, None, 'Input of type pointd[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:pointd3_arr_0', 'point3d[]', 0, None, 'Input of type pointd[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:pointd3_arr_1', 'point3d[]', 0, None, 'Input of type pointd[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:pointf3_0', 'point3f', 0, None, 'Input of type pointf[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:pointf3_1', 'point3f', 0, None, 'Input of type pointf[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:pointf3_arr_0', 'point3f[]', 0, None, 'Input of type pointf[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:pointf3_arr_1', 'point3f[]', 0, None, 'Input of type pointf[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:pointh3_0', 'point3h', 0, None, 'Input of type pointh[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:pointh3_1', 'point3h', 0, None, 'Input of type pointh[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:pointh3_arr_0', 'point3h[]', 0, None, 'Input of type pointh[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:pointh3_arr_1', 'point3h[]', 0, None, 'Input of type pointh[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:quatd4_0', 'quatd', 0, None, 'Input of type quatd[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:quatd4_1', 'quatd', 0, None, 'Input of type quatd[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:quatd4_arr_0', 'quatd[]', 0, None, 'Input of type quatd[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:quatd4_arr_1', 'quatd[]', 0, None, 'Input of type quatd[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:quatf4_0', 'quatf', 0, None, 'Input of type quatf[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:quatf4_1', 'quatf', 0, None, 'Input of type quatf[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:quatf4_arr_0', 'quatf[]', 0, None, 'Input of type quatf[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:quatf4_arr_1', 'quatf[]', 0, None, 'Input of type quatf[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:quath4_0', 'quath', 0, None, 'Input of type quath[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:quath4_1', 'quath', 0, None, 'Input of type quath[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:quath4_arr_0', 'quath[]', 0, None, 'Input of type quath[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:quath4_arr_1', 'quath[]', 0, None, 'Input of type quath[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:texcoordd2_0', 'texCoord2d', 0, None, 'Input of type texcoordd[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0]'}, True, [0.0, 0.0], False, ''),
('inputs:texcoordd2_1', 'texCoord2d', 0, None, 'Input of type texcoordd[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0]'}, True, [0.0, 0.0], False, ''),
('inputs:texcoordd2_arr_0', 'texCoord2d[]', 0, None, 'Input of type texcoordd[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:texcoordd2_arr_1', 'texCoord2d[]', 0, None, 'Input of type texcoordd[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:texcoordd3_0', 'texCoord3d', 0, None, 'Input of type texcoordd[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:texcoordd3_1', 'texCoord3d', 0, None, 'Input of type texcoordd[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:texcoordd3_arr_0', 'texCoord3d[]', 0, None, 'Input of type texcoordd[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:texcoordd3_arr_1', 'texCoord3d[]', 0, None, 'Input of type texcoordd[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:texcoordf2_0', 'texCoord2f', 0, None, 'Input of type texcoordf[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0]'}, True, [0.0, 0.0], False, ''),
('inputs:texcoordf2_1', 'texCoord2f', 0, None, 'Input of type texcoordf[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0]'}, True, [0.0, 0.0], False, ''),
('inputs:texcoordf2_arr_0', 'texCoord2f[]', 0, None, 'Input of type texcoordf[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:texcoordf2_arr_1', 'texCoord2f[]', 0, None, 'Input of type texcoordf[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:texcoordf3_0', 'texCoord3f', 0, None, 'Input of type texcoordf[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:texcoordf3_1', 'texCoord3f', 0, None, 'Input of type texcoordf[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:texcoordf3_arr_0', 'texCoord3f[]', 0, None, 'Input of type texcoordf[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:texcoordf3_arr_1', 'texCoord3f[]', 0, None, 'Input of type texcoordf[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:texcoordh2_0', 'texCoord2h', 0, None, 'Input of type texcoordh[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0]'}, True, [0.0, 0.0], False, ''),
('inputs:texcoordh2_1', 'texCoord2h', 0, None, 'Input of type texcoordh[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0]'}, True, [0.0, 0.0], False, ''),
('inputs:texcoordh2_arr_0', 'texCoord2h[]', 0, None, 'Input of type texcoordh[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:texcoordh2_arr_1', 'texCoord2h[]', 0, None, 'Input of type texcoordh[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:texcoordh3_0', 'texCoord3h', 0, None, 'Input of type texcoordh[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:texcoordh3_1', 'texCoord3h', 0, None, 'Input of type texcoordh[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:texcoordh3_arr_0', 'texCoord3h[]', 0, None, 'Input of type texcoordh[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:texcoordh3_arr_1', 'texCoord3h[]', 0, None, 'Input of type texcoordh[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:timecode_0', 'timecode', 0, None, 'Input of type timecode', {ogn.MetadataKeys.DEFAULT: '0.0'}, True, 0.0, False, ''),
('inputs:timecode_1', 'timecode', 0, None, 'Input of type timecode', {ogn.MetadataKeys.DEFAULT: '0.0'}, True, 0.0, False, ''),
('inputs:timecode_arr_0', 'timecode[]', 0, None, 'Input of type timecode[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:timecode_arr_1', 'timecode[]', 0, None, 'Input of type timecode[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:token_0', 'token', 0, None, 'Input of type token', {ogn.MetadataKeys.DEFAULT: '"default_token"'}, True, "default_token", False, ''),
('inputs:token_1', 'token', 0, None, 'Input of type token', {ogn.MetadataKeys.DEFAULT: '"default_token"'}, True, "default_token", False, ''),
('inputs:token_arr_0', 'token[]', 0, None, 'Input of type token[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:token_arr_1', 'token[]', 0, None, 'Input of type token[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:transform4_0', 'frame4d', 0, None, 'Input of type transform[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:transform4_1', 'frame4d', 0, None, 'Input of type transform[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], False, ''),
('inputs:transform4_arr_0', 'frame4d[]', 0, None, 'Input of type transform[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:transform4_arr_1', 'frame4d[]', 0, None, 'Input of type transform[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:uchar_0', 'uchar', 0, None, 'Input of type uchar', {ogn.MetadataKeys.DEFAULT: '0'}, True, 0, False, ''),
('inputs:uchar_1', 'uchar', 0, None, 'Input of type uchar', {ogn.MetadataKeys.DEFAULT: '0'}, True, 0, False, ''),
('inputs:uchar_arr_0', 'uchar[]', 0, None, 'Input of type uchar[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:uchar_arr_1', 'uchar[]', 0, None, 'Input of type uchar[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:uint64_0', 'uint64', 0, None, 'Input of type uint64', {ogn.MetadataKeys.DEFAULT: '0'}, True, 0, False, ''),
('inputs:uint64_1', 'uint64', 0, None, 'Input of type uint64', {ogn.MetadataKeys.DEFAULT: '0'}, True, 0, False, ''),
('inputs:uint64_arr_0', 'uint64[]', 0, None, 'Input of type uint64[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:uint64_arr_1', 'uint64[]', 0, None, 'Input of type uint64[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:uint_0', 'uint', 0, None, 'Input of type uint', {ogn.MetadataKeys.DEFAULT: '0'}, True, 0, False, ''),
('inputs:uint_1', 'uint', 0, None, 'Input of type uint', {ogn.MetadataKeys.DEFAULT: '0'}, True, 0, False, ''),
('inputs:uint_arr_0', 'uint[]', 0, None, 'Input of type uint[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:uint_arr_1', 'uint[]', 0, None, 'Input of type uint[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:vectord3_0', 'vector3d', 0, None, 'Input of type vectord[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:vectord3_1', 'vector3d', 0, None, 'Input of type vectord[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:vectord3_arr_0', 'vector3d[]', 0, None, 'Input of type vectord[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:vectord3_arr_1', 'vector3d[]', 0, None, 'Input of type vectord[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:vectorf3_0', 'vector3f', 0, None, 'Input of type vectorf[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:vectorf3_1', 'vector3f', 0, None, 'Input of type vectorf[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:vectorf3_arr_0', 'vector3f[]', 0, None, 'Input of type vectorf[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:vectorf3_arr_1', 'vector3f[]', 0, None, 'Input of type vectorf[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:vectorh3_0', 'vector3h', 0, None, 'Input of type vectorh[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:vectorh3_1', 'vector3h', 0, None, 'Input of type vectorh[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('inputs:vectorh3_arr_0', 'vector3h[]', 0, None, 'Input of type vectorh[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:vectorh3_arr_1', 'vector3h[]', 0, None, 'Input of type vectorh[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:bool_0', 'bool', 0, None, 'Output of type bool', {ogn.MetadataKeys.DEFAULT: 'false'}, True, False, False, ''),
('outputs:bool_arr_0', 'bool[]', 0, None, 'Output of type bool[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:colord3_0', 'color3d', 0, None, 'Output of type colord[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('outputs:colord3_arr_0', 'color3d[]', 0, None, 'Output of type colord[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:colord4_0', 'color4d', 0, None, 'Output of type colord[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('outputs:colord4_arr_0', 'color4d[]', 0, None, 'Output of type colord[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:colorf3_0', 'color3f', 0, None, 'Output of type colorf[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('outputs:colorf3_arr_0', 'color3f[]', 0, None, 'Output of type colorf[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:colorf4_0', 'color4f', 0, None, 'Output of type colorf[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('outputs:colorf4_arr_0', 'color4f[]', 0, None, 'Output of type colorf[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:colorh3_0', 'color3h', 0, None, 'Output of type colorh[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('outputs:colorh3_arr_0', 'color3h[]', 0, None, 'Output of type colorh[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:colorh4_0', 'color4h', 0, None, 'Output of type colorh[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('outputs:colorh4_arr_0', 'color4h[]', 0, None, 'Output of type colorh[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:double2_0', 'double2', 0, None, 'Output of type double[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0]'}, True, [0.0, 0.0], False, ''),
('outputs:double2_arr_0', 'double2[]', 0, None, 'Output of type double[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:double3_0', 'double3', 0, None, 'Output of type double[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('outputs:double3_arr_0', 'double3[]', 0, None, 'Output of type double[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:double4_0', 'double4', 0, None, 'Output of type double[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('outputs:double4_arr_0', 'double4[]', 0, None, 'Output of type double[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:double_0', 'double', 0, None, 'Output of type double', {ogn.MetadataKeys.DEFAULT: '0.0'}, True, 0.0, False, ''),
('outputs:double_arr_0', 'double[]', 0, None, 'Output of type double[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:float2_0', 'float2', 0, None, 'Output of type float[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0]'}, True, [0.0, 0.0], False, ''),
('outputs:float2_arr_0', 'float2[]', 0, None, 'Output of type float[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:float3_0', 'float3', 0, None, 'Output of type float[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('outputs:float3_arr_0', 'float3[]', 0, None, 'Output of type float[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:float4_0', 'float4', 0, None, 'Output of type float[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('outputs:float4_arr_0', 'float4[]', 0, None, 'Output of type float[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:float_0', 'float', 0, None, 'Output of type float', {ogn.MetadataKeys.DEFAULT: '0.0'}, True, 0.0, False, ''),
('outputs:float_arr_0', 'float[]', 0, None, 'Output of type float[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:frame4_0', 'frame4d', 0, None, 'Output of type frame[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], False, ''),
('outputs:frame4_arr_0', 'frame4d[]', 0, None, 'Output of type frame[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:half2_0', 'half2', 0, None, 'Output of type half[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0]'}, True, [0.0, 0.0], False, ''),
('outputs:half2_arr_0', 'half2[]', 0, None, 'Output of type half[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:half3_0', 'half3', 0, None, 'Output of type half[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('outputs:half3_arr_0', 'half3[]', 0, None, 'Output of type half[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:half4_0', 'half4', 0, None, 'Output of type half[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('outputs:half4_arr_0', 'half4[]', 0, None, 'Output of type half[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:half_0', 'half', 0, None, 'Output of type half', {ogn.MetadataKeys.DEFAULT: '0.0'}, True, 0.0, False, ''),
('outputs:half_arr_0', 'half[]', 0, None, 'Output of type half[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:int2_0', 'int2', 0, None, 'Output of type int[2]', {ogn.MetadataKeys.DEFAULT: '[0, 0]'}, True, [0, 0], False, ''),
('outputs:int2_arr_0', 'int2[]', 0, None, 'Output of type int[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:int3_0', 'int3', 0, None, 'Output of type int[3]', {ogn.MetadataKeys.DEFAULT: '[0, 0, 0]'}, True, [0, 0, 0], False, ''),
('outputs:int3_arr_0', 'int3[]', 0, None, 'Output of type int[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:int4_0', 'int4', 0, None, 'Output of type int[4]', {ogn.MetadataKeys.DEFAULT: '[0, 0, 0, 0]'}, True, [0, 0, 0, 0], False, ''),
('outputs:int4_arr_0', 'int4[]', 0, None, 'Output of type int[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:int64_0', 'int64', 0, None, 'Output of type int64', {ogn.MetadataKeys.DEFAULT: '0'}, True, 0, False, ''),
('outputs:int64_arr_0', 'int64[]', 0, None, 'Output of type int64[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:int_0', 'int', 0, None, 'Output of type int', {ogn.MetadataKeys.DEFAULT: '0'}, True, 0, False, ''),
('outputs:int_arr_0', 'int[]', 0, None, 'Output of type int[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:matrixd2_0', 'matrix2d', 0, None, 'Output of type matrixd[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('outputs:matrixd2_arr_0', 'matrix2d[]', 0, None, 'Output of type matrixd[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:matrixd3_0', 'matrix3d', 0, None, 'Output of type matrixd[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], False, ''),
('outputs:matrixd3_arr_0', 'matrix3d[]', 0, None, 'Output of type matrixd[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:matrixd4_0', 'matrix4d', 0, None, 'Output of type matrixd[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], False, ''),
('outputs:matrixd4_arr_0', 'matrix4d[]', 0, None, 'Output of type matrixd[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:normald3_0', 'normal3d', 0, None, 'Output of type normald[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('outputs:normald3_arr_0', 'normal3d[]', 0, None, 'Output of type normald[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:normalf3_0', 'normal3f', 0, None, 'Output of type normalf[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('outputs:normalf3_arr_0', 'normal3f[]', 0, None, 'Output of type normalf[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:normalh3_0', 'normal3h', 0, None, 'Output of type normalh[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('outputs:normalh3_arr_0', 'normal3h[]', 0, None, 'Output of type normalh[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:pointd3_0', 'point3d', 0, None, 'Output of type pointd[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('outputs:pointd3_arr_0', 'point3d[]', 0, None, 'Output of type pointd[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:pointf3_0', 'point3f', 0, None, 'Output of type pointf[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('outputs:pointf3_arr_0', 'point3f[]', 0, None, 'Output of type pointf[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:pointh3_0', 'point3h', 0, None, 'Output of type pointh[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('outputs:pointh3_arr_0', 'point3h[]', 0, None, 'Output of type pointh[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:quatd4_0', 'quatd', 0, None, 'Output of type quatd[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('outputs:quatd4_arr_0', 'quatd[]', 0, None, 'Output of type quatd[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:quatf4_0', 'quatf', 0, None, 'Output of type quatf[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('outputs:quatf4_arr_0', 'quatf[]', 0, None, 'Output of type quatf[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:quath4_0', 'quath', 0, None, 'Output of type quath[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0], False, ''),
('outputs:quath4_arr_0', 'quath[]', 0, None, 'Output of type quath[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:texcoordd2_0', 'texCoord2d', 0, None, 'Output of type texcoordd[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0]'}, True, [0.0, 0.0], False, ''),
('outputs:texcoordd2_arr_0', 'texCoord2d[]', 0, None, 'Output of type texcoordd[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:texcoordd3_0', 'texCoord3d', 0, None, 'Output of type texcoordd[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('outputs:texcoordd3_arr_0', 'texCoord3d[]', 0, None, 'Output of type texcoordd[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:texcoordf2_0', 'texCoord2f', 0, None, 'Output of type texcoordf[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0]'}, True, [0.0, 0.0], False, ''),
('outputs:texcoordf2_arr_0', 'texCoord2f[]', 0, None, 'Output of type texcoordf[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:texcoordf3_0', 'texCoord3f', 0, None, 'Output of type texcoordf[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('outputs:texcoordf3_arr_0', 'texCoord3f[]', 0, None, 'Output of type texcoordf[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:texcoordh2_0', 'texCoord2h', 0, None, 'Output of type texcoordh[2]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0]'}, True, [0.0, 0.0], False, ''),
('outputs:texcoordh2_arr_0', 'texCoord2h[]', 0, None, 'Output of type texcoordh[2][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:texcoordh3_0', 'texCoord3h', 0, None, 'Output of type texcoordh[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('outputs:texcoordh3_arr_0', 'texCoord3h[]', 0, None, 'Output of type texcoordh[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:timecode_0', 'timecode', 0, None, 'Output of type timecode', {ogn.MetadataKeys.DEFAULT: '0.0'}, True, 0.0, False, ''),
('outputs:timecode_arr_0', 'timecode[]', 0, None, 'Output of type timecode[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:token_0', 'token', 0, None, 'Output of type token', {ogn.MetadataKeys.DEFAULT: '"default_token"'}, True, "default_token", False, ''),
('outputs:token_arr_0', 'token[]', 0, None, 'Output of type token[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:transform4_0', 'frame4d', 0, None, 'Output of type transform[4]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], False, ''),
('outputs:transform4_arr_0', 'frame4d[]', 0, None, 'Output of type transform[4][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:uchar_0', 'uchar', 0, None, 'Output of type uchar', {ogn.MetadataKeys.DEFAULT: '0'}, True, 0, False, ''),
('outputs:uchar_arr_0', 'uchar[]', 0, None, 'Output of type uchar[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:uint64_0', 'uint64', 0, None, 'Output of type uint64', {ogn.MetadataKeys.DEFAULT: '0'}, True, 0, False, ''),
('outputs:uint64_arr_0', 'uint64[]', 0, None, 'Output of type uint64[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:uint_0', 'uint', 0, None, 'Output of type uint', {ogn.MetadataKeys.DEFAULT: '0'}, True, 0, False, ''),
('outputs:uint_arr_0', 'uint[]', 0, None, 'Output of type uint[]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:vectord3_0', 'vector3d', 0, None, 'Output of type vectord[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('outputs:vectord3_arr_0', 'vector3d[]', 0, None, 'Output of type vectord[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:vectorf3_0', 'vector3f', 0, None, 'Output of type vectorf[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('outputs:vectorf3_arr_0', 'vector3f[]', 0, None, 'Output of type vectorf[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('outputs:vectorh3_0', 'vector3h', 0, None, 'Output of type vectorh[3]', {ogn.MetadataKeys.DEFAULT: '[0.0, 0.0, 0.0]'}, True, [0.0, 0.0, 0.0], False, ''),
('outputs:vectorh3_arr_0', 'vector3h[]', 0, None, 'Output of type vectorh[3][]', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
])
@classmethod
def _populate_role_data(cls):
"""Populate a role structure with the non-default roles on this node type"""
role_data = super()._populate_role_data()
role_data.inputs.colord3_0 = og.AttributeRole.COLOR
role_data.inputs.colord3_1 = og.AttributeRole.COLOR
role_data.inputs.colord3_arr_0 = og.AttributeRole.COLOR
role_data.inputs.colord3_arr_1 = og.AttributeRole.COLOR
role_data.inputs.colord4_0 = og.AttributeRole.COLOR
role_data.inputs.colord4_1 = og.AttributeRole.COLOR
role_data.inputs.colord4_arr_0 = og.AttributeRole.COLOR
role_data.inputs.colord4_arr_1 = og.AttributeRole.COLOR
role_data.inputs.colorf3_0 = og.AttributeRole.COLOR
role_data.inputs.colorf3_1 = og.AttributeRole.COLOR
role_data.inputs.colorf3_arr_0 = og.AttributeRole.COLOR
role_data.inputs.colorf3_arr_1 = og.AttributeRole.COLOR
role_data.inputs.colorf4_0 = og.AttributeRole.COLOR
role_data.inputs.colorf4_1 = og.AttributeRole.COLOR
role_data.inputs.colorf4_arr_0 = og.AttributeRole.COLOR
role_data.inputs.colorf4_arr_1 = og.AttributeRole.COLOR
role_data.inputs.colorh3_0 = og.AttributeRole.COLOR
role_data.inputs.colorh3_1 = og.AttributeRole.COLOR
role_data.inputs.colorh3_arr_0 = og.AttributeRole.COLOR
role_data.inputs.colorh3_arr_1 = og.AttributeRole.COLOR
role_data.inputs.colorh4_0 = og.AttributeRole.COLOR
role_data.inputs.colorh4_1 = og.AttributeRole.COLOR
role_data.inputs.colorh4_arr_0 = og.AttributeRole.COLOR
role_data.inputs.colorh4_arr_1 = og.AttributeRole.COLOR
role_data.inputs.frame4_0 = og.AttributeRole.FRAME
role_data.inputs.frame4_1 = og.AttributeRole.FRAME
role_data.inputs.frame4_arr_0 = og.AttributeRole.FRAME
role_data.inputs.frame4_arr_1 = og.AttributeRole.FRAME
role_data.inputs.matrixd2_0 = og.AttributeRole.MATRIX
role_data.inputs.matrixd2_1 = og.AttributeRole.MATRIX
role_data.inputs.matrixd2_arr_0 = og.AttributeRole.MATRIX
role_data.inputs.matrixd2_arr_1 = og.AttributeRole.MATRIX
role_data.inputs.matrixd3_0 = og.AttributeRole.MATRIX
role_data.inputs.matrixd3_1 = og.AttributeRole.MATRIX
role_data.inputs.matrixd3_arr_0 = og.AttributeRole.MATRIX
role_data.inputs.matrixd3_arr_1 = og.AttributeRole.MATRIX
role_data.inputs.matrixd4_0 = og.AttributeRole.MATRIX
role_data.inputs.matrixd4_1 = og.AttributeRole.MATRIX
role_data.inputs.matrixd4_arr_0 = og.AttributeRole.MATRIX
role_data.inputs.matrixd4_arr_1 = og.AttributeRole.MATRIX
role_data.inputs.normald3_0 = og.AttributeRole.NORMAL
role_data.inputs.normald3_1 = og.AttributeRole.NORMAL
role_data.inputs.normald3_arr_0 = og.AttributeRole.NORMAL
role_data.inputs.normald3_arr_1 = og.AttributeRole.NORMAL
role_data.inputs.normalf3_0 = og.AttributeRole.NORMAL
role_data.inputs.normalf3_1 = og.AttributeRole.NORMAL
role_data.inputs.normalf3_arr_0 = og.AttributeRole.NORMAL
role_data.inputs.normalf3_arr_1 = og.AttributeRole.NORMAL
role_data.inputs.normalh3_0 = og.AttributeRole.NORMAL
role_data.inputs.normalh3_1 = og.AttributeRole.NORMAL
role_data.inputs.normalh3_arr_0 = og.AttributeRole.NORMAL
role_data.inputs.normalh3_arr_1 = og.AttributeRole.NORMAL
role_data.inputs.pointd3_0 = og.AttributeRole.POSITION
role_data.inputs.pointd3_1 = og.AttributeRole.POSITION
role_data.inputs.pointd3_arr_0 = og.AttributeRole.POSITION
role_data.inputs.pointd3_arr_1 = og.AttributeRole.POSITION
role_data.inputs.pointf3_0 = og.AttributeRole.POSITION
role_data.inputs.pointf3_1 = og.AttributeRole.POSITION
role_data.inputs.pointf3_arr_0 = og.AttributeRole.POSITION
role_data.inputs.pointf3_arr_1 = og.AttributeRole.POSITION
role_data.inputs.pointh3_0 = og.AttributeRole.POSITION
role_data.inputs.pointh3_1 = og.AttributeRole.POSITION
role_data.inputs.pointh3_arr_0 = og.AttributeRole.POSITION
role_data.inputs.pointh3_arr_1 = og.AttributeRole.POSITION
role_data.inputs.quatd4_0 = og.AttributeRole.QUATERNION
role_data.inputs.quatd4_1 = og.AttributeRole.QUATERNION
role_data.inputs.quatd4_arr_0 = og.AttributeRole.QUATERNION
role_data.inputs.quatd4_arr_1 = og.AttributeRole.QUATERNION
role_data.inputs.quatf4_0 = og.AttributeRole.QUATERNION
role_data.inputs.quatf4_1 = og.AttributeRole.QUATERNION
role_data.inputs.quatf4_arr_0 = og.AttributeRole.QUATERNION
role_data.inputs.quatf4_arr_1 = og.AttributeRole.QUATERNION
role_data.inputs.quath4_0 = og.AttributeRole.QUATERNION
role_data.inputs.quath4_1 = og.AttributeRole.QUATERNION
role_data.inputs.quath4_arr_0 = og.AttributeRole.QUATERNION
role_data.inputs.quath4_arr_1 = og.AttributeRole.QUATERNION
role_data.inputs.texcoordd2_0 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordd2_1 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordd2_arr_0 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordd2_arr_1 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordd3_0 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordd3_1 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordd3_arr_0 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordd3_arr_1 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordf2_0 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordf2_1 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordf2_arr_0 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordf2_arr_1 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordf3_0 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordf3_1 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordf3_arr_0 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordf3_arr_1 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordh2_0 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordh2_1 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordh2_arr_0 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordh2_arr_1 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordh3_0 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordh3_1 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordh3_arr_0 = og.AttributeRole.TEXCOORD
role_data.inputs.texcoordh3_arr_1 = og.AttributeRole.TEXCOORD
role_data.inputs.timecode_0 = og.AttributeRole.TIMECODE
role_data.inputs.timecode_1 = og.AttributeRole.TIMECODE
role_data.inputs.timecode_arr_0 = og.AttributeRole.TIMECODE
role_data.inputs.timecode_arr_1 = og.AttributeRole.TIMECODE
role_data.inputs.transform4_0 = og.AttributeRole.TRANSFORM
role_data.inputs.transform4_1 = og.AttributeRole.TRANSFORM
role_data.inputs.transform4_arr_0 = og.AttributeRole.TRANSFORM
role_data.inputs.transform4_arr_1 = og.AttributeRole.TRANSFORM
role_data.inputs.vectord3_0 = og.AttributeRole.VECTOR
role_data.inputs.vectord3_1 = og.AttributeRole.VECTOR
role_data.inputs.vectord3_arr_0 = og.AttributeRole.VECTOR
role_data.inputs.vectord3_arr_1 = og.AttributeRole.VECTOR
role_data.inputs.vectorf3_0 = og.AttributeRole.VECTOR
role_data.inputs.vectorf3_1 = og.AttributeRole.VECTOR
role_data.inputs.vectorf3_arr_0 = og.AttributeRole.VECTOR
role_data.inputs.vectorf3_arr_1 = og.AttributeRole.VECTOR
role_data.inputs.vectorh3_0 = og.AttributeRole.VECTOR
role_data.inputs.vectorh3_1 = og.AttributeRole.VECTOR
role_data.inputs.vectorh3_arr_0 = og.AttributeRole.VECTOR
role_data.inputs.vectorh3_arr_1 = og.AttributeRole.VECTOR
role_data.outputs.colord3_0 = og.AttributeRole.COLOR
role_data.outputs.colord3_arr_0 = og.AttributeRole.COLOR
role_data.outputs.colord4_0 = og.AttributeRole.COLOR
role_data.outputs.colord4_arr_0 = og.AttributeRole.COLOR
role_data.outputs.colorf3_0 = og.AttributeRole.COLOR
role_data.outputs.colorf3_arr_0 = og.AttributeRole.COLOR
role_data.outputs.colorf4_0 = og.AttributeRole.COLOR
role_data.outputs.colorf4_arr_0 = og.AttributeRole.COLOR
role_data.outputs.colorh3_0 = og.AttributeRole.COLOR
role_data.outputs.colorh3_arr_0 = og.AttributeRole.COLOR
role_data.outputs.colorh4_0 = og.AttributeRole.COLOR
role_data.outputs.colorh4_arr_0 = og.AttributeRole.COLOR
role_data.outputs.frame4_0 = og.AttributeRole.FRAME
role_data.outputs.frame4_arr_0 = og.AttributeRole.FRAME
role_data.outputs.matrixd2_0 = og.AttributeRole.MATRIX
role_data.outputs.matrixd2_arr_0 = og.AttributeRole.MATRIX
role_data.outputs.matrixd3_0 = og.AttributeRole.MATRIX
role_data.outputs.matrixd3_arr_0 = og.AttributeRole.MATRIX
role_data.outputs.matrixd4_0 = og.AttributeRole.MATRIX
role_data.outputs.matrixd4_arr_0 = og.AttributeRole.MATRIX
role_data.outputs.normald3_0 = og.AttributeRole.NORMAL
role_data.outputs.normald3_arr_0 = og.AttributeRole.NORMAL
role_data.outputs.normalf3_0 = og.AttributeRole.NORMAL
role_data.outputs.normalf3_arr_0 = og.AttributeRole.NORMAL
role_data.outputs.normalh3_0 = og.AttributeRole.NORMAL
role_data.outputs.normalh3_arr_0 = og.AttributeRole.NORMAL
role_data.outputs.pointd3_0 = og.AttributeRole.POSITION
role_data.outputs.pointd3_arr_0 = og.AttributeRole.POSITION
role_data.outputs.pointf3_0 = og.AttributeRole.POSITION
role_data.outputs.pointf3_arr_0 = og.AttributeRole.POSITION
role_data.outputs.pointh3_0 = og.AttributeRole.POSITION
role_data.outputs.pointh3_arr_0 = og.AttributeRole.POSITION
role_data.outputs.quatd4_0 = og.AttributeRole.QUATERNION
role_data.outputs.quatd4_arr_0 = og.AttributeRole.QUATERNION
role_data.outputs.quatf4_0 = og.AttributeRole.QUATERNION
role_data.outputs.quatf4_arr_0 = og.AttributeRole.QUATERNION
role_data.outputs.quath4_0 = og.AttributeRole.QUATERNION
role_data.outputs.quath4_arr_0 = og.AttributeRole.QUATERNION
role_data.outputs.texcoordd2_0 = og.AttributeRole.TEXCOORD
role_data.outputs.texcoordd2_arr_0 = og.AttributeRole.TEXCOORD
role_data.outputs.texcoordd3_0 = og.AttributeRole.TEXCOORD
role_data.outputs.texcoordd3_arr_0 = og.AttributeRole.TEXCOORD
role_data.outputs.texcoordf2_0 = og.AttributeRole.TEXCOORD
role_data.outputs.texcoordf2_arr_0 = og.AttributeRole.TEXCOORD
role_data.outputs.texcoordf3_0 = og.AttributeRole.TEXCOORD
role_data.outputs.texcoordf3_arr_0 = og.AttributeRole.TEXCOORD
role_data.outputs.texcoordh2_0 = og.AttributeRole.TEXCOORD
role_data.outputs.texcoordh2_arr_0 = og.AttributeRole.TEXCOORD
role_data.outputs.texcoordh3_0 = og.AttributeRole.TEXCOORD
role_data.outputs.texcoordh3_arr_0 = og.AttributeRole.TEXCOORD
role_data.outputs.timecode_0 = og.AttributeRole.TIMECODE
role_data.outputs.timecode_arr_0 = og.AttributeRole.TIMECODE
role_data.outputs.transform4_0 = og.AttributeRole.TRANSFORM
role_data.outputs.transform4_arr_0 = og.AttributeRole.TRANSFORM
role_data.outputs.vectord3_0 = og.AttributeRole.VECTOR
role_data.outputs.vectord3_arr_0 = og.AttributeRole.VECTOR
role_data.outputs.vectorf3_0 = og.AttributeRole.VECTOR
role_data.outputs.vectorf3_arr_0 = og.AttributeRole.VECTOR
role_data.outputs.vectorh3_0 = og.AttributeRole.VECTOR
role_data.outputs.vectorh3_arr_0 = og.AttributeRole.VECTOR
return role_data
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
@property
def bool_0(self):
data_view = og.AttributeValueHelper(self._attributes.bool_0)
return data_view.get()
@bool_0.setter
def bool_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.bool_0)
data_view = og.AttributeValueHelper(self._attributes.bool_0)
data_view.set(value)
@property
def bool_1(self):
data_view = og.AttributeValueHelper(self._attributes.bool_1)
return data_view.get()
@bool_1.setter
def bool_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.bool_1)
data_view = og.AttributeValueHelper(self._attributes.bool_1)
data_view.set(value)
@property
def bool_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.bool_arr_0)
return data_view.get()
@bool_arr_0.setter
def bool_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.bool_arr_0)
data_view = og.AttributeValueHelper(self._attributes.bool_arr_0)
data_view.set(value)
self.bool_arr_0_size = data_view.get_array_size()
@property
def bool_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.bool_arr_1)
return data_view.get()
@bool_arr_1.setter
def bool_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.bool_arr_1)
data_view = og.AttributeValueHelper(self._attributes.bool_arr_1)
data_view.set(value)
self.bool_arr_1_size = data_view.get_array_size()
@property
def colord3_0(self):
data_view = og.AttributeValueHelper(self._attributes.colord3_0)
return data_view.get()
@colord3_0.setter
def colord3_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colord3_0)
data_view = og.AttributeValueHelper(self._attributes.colord3_0)
data_view.set(value)
@property
def colord3_1(self):
data_view = og.AttributeValueHelper(self._attributes.colord3_1)
return data_view.get()
@colord3_1.setter
def colord3_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colord3_1)
data_view = og.AttributeValueHelper(self._attributes.colord3_1)
data_view.set(value)
@property
def colord3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.colord3_arr_0)
return data_view.get()
@colord3_arr_0.setter
def colord3_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colord3_arr_0)
data_view = og.AttributeValueHelper(self._attributes.colord3_arr_0)
data_view.set(value)
self.colord3_arr_0_size = data_view.get_array_size()
@property
def colord3_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.colord3_arr_1)
return data_view.get()
@colord3_arr_1.setter
def colord3_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colord3_arr_1)
data_view = og.AttributeValueHelper(self._attributes.colord3_arr_1)
data_view.set(value)
self.colord3_arr_1_size = data_view.get_array_size()
@property
def colord4_0(self):
data_view = og.AttributeValueHelper(self._attributes.colord4_0)
return data_view.get()
@colord4_0.setter
def colord4_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colord4_0)
data_view = og.AttributeValueHelper(self._attributes.colord4_0)
data_view.set(value)
@property
def colord4_1(self):
data_view = og.AttributeValueHelper(self._attributes.colord4_1)
return data_view.get()
@colord4_1.setter
def colord4_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colord4_1)
data_view = og.AttributeValueHelper(self._attributes.colord4_1)
data_view.set(value)
@property
def colord4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.colord4_arr_0)
return data_view.get()
@colord4_arr_0.setter
def colord4_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colord4_arr_0)
data_view = og.AttributeValueHelper(self._attributes.colord4_arr_0)
data_view.set(value)
self.colord4_arr_0_size = data_view.get_array_size()
@property
def colord4_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.colord4_arr_1)
return data_view.get()
@colord4_arr_1.setter
def colord4_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colord4_arr_1)
data_view = og.AttributeValueHelper(self._attributes.colord4_arr_1)
data_view.set(value)
self.colord4_arr_1_size = data_view.get_array_size()
@property
def colorf3_0(self):
data_view = og.AttributeValueHelper(self._attributes.colorf3_0)
return data_view.get()
@colorf3_0.setter
def colorf3_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colorf3_0)
data_view = og.AttributeValueHelper(self._attributes.colorf3_0)
data_view.set(value)
@property
def colorf3_1(self):
data_view = og.AttributeValueHelper(self._attributes.colorf3_1)
return data_view.get()
@colorf3_1.setter
def colorf3_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colorf3_1)
data_view = og.AttributeValueHelper(self._attributes.colorf3_1)
data_view.set(value)
@property
def colorf3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.colorf3_arr_0)
return data_view.get()
@colorf3_arr_0.setter
def colorf3_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colorf3_arr_0)
data_view = og.AttributeValueHelper(self._attributes.colorf3_arr_0)
data_view.set(value)
self.colorf3_arr_0_size = data_view.get_array_size()
@property
def colorf3_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.colorf3_arr_1)
return data_view.get()
@colorf3_arr_1.setter
def colorf3_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colorf3_arr_1)
data_view = og.AttributeValueHelper(self._attributes.colorf3_arr_1)
data_view.set(value)
self.colorf3_arr_1_size = data_view.get_array_size()
@property
def colorf4_0(self):
data_view = og.AttributeValueHelper(self._attributes.colorf4_0)
return data_view.get()
@colorf4_0.setter
def colorf4_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colorf4_0)
data_view = og.AttributeValueHelper(self._attributes.colorf4_0)
data_view.set(value)
@property
def colorf4_1(self):
data_view = og.AttributeValueHelper(self._attributes.colorf4_1)
return data_view.get()
@colorf4_1.setter
def colorf4_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colorf4_1)
data_view = og.AttributeValueHelper(self._attributes.colorf4_1)
data_view.set(value)
@property
def colorf4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.colorf4_arr_0)
return data_view.get()
@colorf4_arr_0.setter
def colorf4_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colorf4_arr_0)
data_view = og.AttributeValueHelper(self._attributes.colorf4_arr_0)
data_view.set(value)
self.colorf4_arr_0_size = data_view.get_array_size()
@property
def colorf4_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.colorf4_arr_1)
return data_view.get()
@colorf4_arr_1.setter
def colorf4_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colorf4_arr_1)
data_view = og.AttributeValueHelper(self._attributes.colorf4_arr_1)
data_view.set(value)
self.colorf4_arr_1_size = data_view.get_array_size()
@property
def colorh3_0(self):
data_view = og.AttributeValueHelper(self._attributes.colorh3_0)
return data_view.get()
@colorh3_0.setter
def colorh3_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colorh3_0)
data_view = og.AttributeValueHelper(self._attributes.colorh3_0)
data_view.set(value)
@property
def colorh3_1(self):
data_view = og.AttributeValueHelper(self._attributes.colorh3_1)
return data_view.get()
@colorh3_1.setter
def colorh3_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colorh3_1)
data_view = og.AttributeValueHelper(self._attributes.colorh3_1)
data_view.set(value)
@property
def colorh3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.colorh3_arr_0)
return data_view.get()
@colorh3_arr_0.setter
def colorh3_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colorh3_arr_0)
data_view = og.AttributeValueHelper(self._attributes.colorh3_arr_0)
data_view.set(value)
self.colorh3_arr_0_size = data_view.get_array_size()
@property
def colorh3_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.colorh3_arr_1)
return data_view.get()
@colorh3_arr_1.setter
def colorh3_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colorh3_arr_1)
data_view = og.AttributeValueHelper(self._attributes.colorh3_arr_1)
data_view.set(value)
self.colorh3_arr_1_size = data_view.get_array_size()
@property
def colorh4_0(self):
data_view = og.AttributeValueHelper(self._attributes.colorh4_0)
return data_view.get()
@colorh4_0.setter
def colorh4_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colorh4_0)
data_view = og.AttributeValueHelper(self._attributes.colorh4_0)
data_view.set(value)
@property
def colorh4_1(self):
data_view = og.AttributeValueHelper(self._attributes.colorh4_1)
return data_view.get()
@colorh4_1.setter
def colorh4_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colorh4_1)
data_view = og.AttributeValueHelper(self._attributes.colorh4_1)
data_view.set(value)
@property
def colorh4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.colorh4_arr_0)
return data_view.get()
@colorh4_arr_0.setter
def colorh4_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colorh4_arr_0)
data_view = og.AttributeValueHelper(self._attributes.colorh4_arr_0)
data_view.set(value)
self.colorh4_arr_0_size = data_view.get_array_size()
@property
def colorh4_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.colorh4_arr_1)
return data_view.get()
@colorh4_arr_1.setter
def colorh4_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.colorh4_arr_1)
data_view = og.AttributeValueHelper(self._attributes.colorh4_arr_1)
data_view.set(value)
self.colorh4_arr_1_size = data_view.get_array_size()
@property
def double2_0(self):
data_view = og.AttributeValueHelper(self._attributes.double2_0)
return data_view.get()
@double2_0.setter
def double2_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.double2_0)
data_view = og.AttributeValueHelper(self._attributes.double2_0)
data_view.set(value)
@property
def double2_1(self):
data_view = og.AttributeValueHelper(self._attributes.double2_1)
return data_view.get()
@double2_1.setter
def double2_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.double2_1)
data_view = og.AttributeValueHelper(self._attributes.double2_1)
data_view.set(value)
@property
def double2_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.double2_arr_0)
return data_view.get()
@double2_arr_0.setter
def double2_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.double2_arr_0)
data_view = og.AttributeValueHelper(self._attributes.double2_arr_0)
data_view.set(value)
self.double2_arr_0_size = data_view.get_array_size()
@property
def double2_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.double2_arr_1)
return data_view.get()
@double2_arr_1.setter
def double2_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.double2_arr_1)
data_view = og.AttributeValueHelper(self._attributes.double2_arr_1)
data_view.set(value)
self.double2_arr_1_size = data_view.get_array_size()
@property
def double3_0(self):
data_view = og.AttributeValueHelper(self._attributes.double3_0)
return data_view.get()
@double3_0.setter
def double3_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.double3_0)
data_view = og.AttributeValueHelper(self._attributes.double3_0)
data_view.set(value)
@property
def double3_1(self):
data_view = og.AttributeValueHelper(self._attributes.double3_1)
return data_view.get()
@double3_1.setter
def double3_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.double3_1)
data_view = og.AttributeValueHelper(self._attributes.double3_1)
data_view.set(value)
@property
def double3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.double3_arr_0)
return data_view.get()
@double3_arr_0.setter
def double3_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.double3_arr_0)
data_view = og.AttributeValueHelper(self._attributes.double3_arr_0)
data_view.set(value)
self.double3_arr_0_size = data_view.get_array_size()
@property
def double3_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.double3_arr_1)
return data_view.get()
@double3_arr_1.setter
def double3_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.double3_arr_1)
data_view = og.AttributeValueHelper(self._attributes.double3_arr_1)
data_view.set(value)
self.double3_arr_1_size = data_view.get_array_size()
@property
def double4_0(self):
data_view = og.AttributeValueHelper(self._attributes.double4_0)
return data_view.get()
@double4_0.setter
def double4_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.double4_0)
data_view = og.AttributeValueHelper(self._attributes.double4_0)
data_view.set(value)
@property
def double4_1(self):
data_view = og.AttributeValueHelper(self._attributes.double4_1)
return data_view.get()
@double4_1.setter
def double4_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.double4_1)
data_view = og.AttributeValueHelper(self._attributes.double4_1)
data_view.set(value)
@property
def double4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.double4_arr_0)
return data_view.get()
@double4_arr_0.setter
def double4_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.double4_arr_0)
data_view = og.AttributeValueHelper(self._attributes.double4_arr_0)
data_view.set(value)
self.double4_arr_0_size = data_view.get_array_size()
@property
def double4_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.double4_arr_1)
return data_view.get()
@double4_arr_1.setter
def double4_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.double4_arr_1)
data_view = og.AttributeValueHelper(self._attributes.double4_arr_1)
data_view.set(value)
self.double4_arr_1_size = data_view.get_array_size()
@property
def double_0(self):
data_view = og.AttributeValueHelper(self._attributes.double_0)
return data_view.get()
@double_0.setter
def double_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.double_0)
data_view = og.AttributeValueHelper(self._attributes.double_0)
data_view.set(value)
@property
def double_1(self):
data_view = og.AttributeValueHelper(self._attributes.double_1)
return data_view.get()
@double_1.setter
def double_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.double_1)
data_view = og.AttributeValueHelper(self._attributes.double_1)
data_view.set(value)
@property
def double_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.double_arr_0)
return data_view.get()
@double_arr_0.setter
def double_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.double_arr_0)
data_view = og.AttributeValueHelper(self._attributes.double_arr_0)
data_view.set(value)
self.double_arr_0_size = data_view.get_array_size()
@property
def double_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.double_arr_1)
return data_view.get()
@double_arr_1.setter
def double_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.double_arr_1)
data_view = og.AttributeValueHelper(self._attributes.double_arr_1)
data_view.set(value)
self.double_arr_1_size = data_view.get_array_size()
@property
def float2_0(self):
data_view = og.AttributeValueHelper(self._attributes.float2_0)
return data_view.get()
@float2_0.setter
def float2_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.float2_0)
data_view = og.AttributeValueHelper(self._attributes.float2_0)
data_view.set(value)
@property
def float2_1(self):
data_view = og.AttributeValueHelper(self._attributes.float2_1)
return data_view.get()
@float2_1.setter
def float2_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.float2_1)
data_view = og.AttributeValueHelper(self._attributes.float2_1)
data_view.set(value)
@property
def float2_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.float2_arr_0)
return data_view.get()
@float2_arr_0.setter
def float2_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.float2_arr_0)
data_view = og.AttributeValueHelper(self._attributes.float2_arr_0)
data_view.set(value)
self.float2_arr_0_size = data_view.get_array_size()
@property
def float2_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.float2_arr_1)
return data_view.get()
@float2_arr_1.setter
def float2_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.float2_arr_1)
data_view = og.AttributeValueHelper(self._attributes.float2_arr_1)
data_view.set(value)
self.float2_arr_1_size = data_view.get_array_size()
@property
def float3_0(self):
data_view = og.AttributeValueHelper(self._attributes.float3_0)
return data_view.get()
@float3_0.setter
def float3_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.float3_0)
data_view = og.AttributeValueHelper(self._attributes.float3_0)
data_view.set(value)
@property
def float3_1(self):
data_view = og.AttributeValueHelper(self._attributes.float3_1)
return data_view.get()
@float3_1.setter
def float3_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.float3_1)
data_view = og.AttributeValueHelper(self._attributes.float3_1)
data_view.set(value)
@property
def float3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.float3_arr_0)
return data_view.get()
@float3_arr_0.setter
def float3_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.float3_arr_0)
data_view = og.AttributeValueHelper(self._attributes.float3_arr_0)
data_view.set(value)
self.float3_arr_0_size = data_view.get_array_size()
@property
def float3_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.float3_arr_1)
return data_view.get()
@float3_arr_1.setter
def float3_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.float3_arr_1)
data_view = og.AttributeValueHelper(self._attributes.float3_arr_1)
data_view.set(value)
self.float3_arr_1_size = data_view.get_array_size()
@property
def float4_0(self):
data_view = og.AttributeValueHelper(self._attributes.float4_0)
return data_view.get()
@float4_0.setter
def float4_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.float4_0)
data_view = og.AttributeValueHelper(self._attributes.float4_0)
data_view.set(value)
@property
def float4_1(self):
data_view = og.AttributeValueHelper(self._attributes.float4_1)
return data_view.get()
@float4_1.setter
def float4_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.float4_1)
data_view = og.AttributeValueHelper(self._attributes.float4_1)
data_view.set(value)
@property
def float4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.float4_arr_0)
return data_view.get()
@float4_arr_0.setter
def float4_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.float4_arr_0)
data_view = og.AttributeValueHelper(self._attributes.float4_arr_0)
data_view.set(value)
self.float4_arr_0_size = data_view.get_array_size()
@property
def float4_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.float4_arr_1)
return data_view.get()
@float4_arr_1.setter
def float4_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.float4_arr_1)
data_view = og.AttributeValueHelper(self._attributes.float4_arr_1)
data_view.set(value)
self.float4_arr_1_size = data_view.get_array_size()
@property
def float_0(self):
data_view = og.AttributeValueHelper(self._attributes.float_0)
return data_view.get()
@float_0.setter
def float_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.float_0)
data_view = og.AttributeValueHelper(self._attributes.float_0)
data_view.set(value)
@property
def float_1(self):
data_view = og.AttributeValueHelper(self._attributes.float_1)
return data_view.get()
@float_1.setter
def float_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.float_1)
data_view = og.AttributeValueHelper(self._attributes.float_1)
data_view.set(value)
@property
def float_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.float_arr_0)
return data_view.get()
@float_arr_0.setter
def float_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.float_arr_0)
data_view = og.AttributeValueHelper(self._attributes.float_arr_0)
data_view.set(value)
self.float_arr_0_size = data_view.get_array_size()
@property
def float_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.float_arr_1)
return data_view.get()
@float_arr_1.setter
def float_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.float_arr_1)
data_view = og.AttributeValueHelper(self._attributes.float_arr_1)
data_view.set(value)
self.float_arr_1_size = data_view.get_array_size()
@property
def frame4_0(self):
data_view = og.AttributeValueHelper(self._attributes.frame4_0)
return data_view.get()
@frame4_0.setter
def frame4_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.frame4_0)
data_view = og.AttributeValueHelper(self._attributes.frame4_0)
data_view.set(value)
@property
def frame4_1(self):
data_view = og.AttributeValueHelper(self._attributes.frame4_1)
return data_view.get()
@frame4_1.setter
def frame4_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.frame4_1)
data_view = og.AttributeValueHelper(self._attributes.frame4_1)
data_view.set(value)
@property
def frame4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.frame4_arr_0)
return data_view.get()
@frame4_arr_0.setter
def frame4_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.frame4_arr_0)
data_view = og.AttributeValueHelper(self._attributes.frame4_arr_0)
data_view.set(value)
self.frame4_arr_0_size = data_view.get_array_size()
@property
def frame4_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.frame4_arr_1)
return data_view.get()
@frame4_arr_1.setter
def frame4_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.frame4_arr_1)
data_view = og.AttributeValueHelper(self._attributes.frame4_arr_1)
data_view.set(value)
self.frame4_arr_1_size = data_view.get_array_size()
@property
def half2_0(self):
data_view = og.AttributeValueHelper(self._attributes.half2_0)
return data_view.get()
@half2_0.setter
def half2_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.half2_0)
data_view = og.AttributeValueHelper(self._attributes.half2_0)
data_view.set(value)
@property
def half2_1(self):
data_view = og.AttributeValueHelper(self._attributes.half2_1)
return data_view.get()
@half2_1.setter
def half2_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.half2_1)
data_view = og.AttributeValueHelper(self._attributes.half2_1)
data_view.set(value)
@property
def half2_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.half2_arr_0)
return data_view.get()
@half2_arr_0.setter
def half2_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.half2_arr_0)
data_view = og.AttributeValueHelper(self._attributes.half2_arr_0)
data_view.set(value)
self.half2_arr_0_size = data_view.get_array_size()
@property
def half2_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.half2_arr_1)
return data_view.get()
@half2_arr_1.setter
def half2_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.half2_arr_1)
data_view = og.AttributeValueHelper(self._attributes.half2_arr_1)
data_view.set(value)
self.half2_arr_1_size = data_view.get_array_size()
@property
def half3_0(self):
data_view = og.AttributeValueHelper(self._attributes.half3_0)
return data_view.get()
@half3_0.setter
def half3_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.half3_0)
data_view = og.AttributeValueHelper(self._attributes.half3_0)
data_view.set(value)
@property
def half3_1(self):
data_view = og.AttributeValueHelper(self._attributes.half3_1)
return data_view.get()
@half3_1.setter
def half3_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.half3_1)
data_view = og.AttributeValueHelper(self._attributes.half3_1)
data_view.set(value)
@property
def half3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.half3_arr_0)
return data_view.get()
@half3_arr_0.setter
def half3_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.half3_arr_0)
data_view = og.AttributeValueHelper(self._attributes.half3_arr_0)
data_view.set(value)
self.half3_arr_0_size = data_view.get_array_size()
@property
def half3_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.half3_arr_1)
return data_view.get()
@half3_arr_1.setter
def half3_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.half3_arr_1)
data_view = og.AttributeValueHelper(self._attributes.half3_arr_1)
data_view.set(value)
self.half3_arr_1_size = data_view.get_array_size()
@property
def half4_0(self):
data_view = og.AttributeValueHelper(self._attributes.half4_0)
return data_view.get()
@half4_0.setter
def half4_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.half4_0)
data_view = og.AttributeValueHelper(self._attributes.half4_0)
data_view.set(value)
@property
def half4_1(self):
data_view = og.AttributeValueHelper(self._attributes.half4_1)
return data_view.get()
@half4_1.setter
def half4_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.half4_1)
data_view = og.AttributeValueHelper(self._attributes.half4_1)
data_view.set(value)
@property
def half4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.half4_arr_0)
return data_view.get()
@half4_arr_0.setter
def half4_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.half4_arr_0)
data_view = og.AttributeValueHelper(self._attributes.half4_arr_0)
data_view.set(value)
self.half4_arr_0_size = data_view.get_array_size()
@property
def half4_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.half4_arr_1)
return data_view.get()
@half4_arr_1.setter
def half4_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.half4_arr_1)
data_view = og.AttributeValueHelper(self._attributes.half4_arr_1)
data_view.set(value)
self.half4_arr_1_size = data_view.get_array_size()
@property
def half_0(self):
data_view = og.AttributeValueHelper(self._attributes.half_0)
return data_view.get()
@half_0.setter
def half_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.half_0)
data_view = og.AttributeValueHelper(self._attributes.half_0)
data_view.set(value)
@property
def half_1(self):
data_view = og.AttributeValueHelper(self._attributes.half_1)
return data_view.get()
@half_1.setter
def half_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.half_1)
data_view = og.AttributeValueHelper(self._attributes.half_1)
data_view.set(value)
@property
def half_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.half_arr_0)
return data_view.get()
@half_arr_0.setter
def half_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.half_arr_0)
data_view = og.AttributeValueHelper(self._attributes.half_arr_0)
data_view.set(value)
self.half_arr_0_size = data_view.get_array_size()
@property
def half_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.half_arr_1)
return data_view.get()
@half_arr_1.setter
def half_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.half_arr_1)
data_view = og.AttributeValueHelper(self._attributes.half_arr_1)
data_view.set(value)
self.half_arr_1_size = data_view.get_array_size()
@property
def int2_0(self):
data_view = og.AttributeValueHelper(self._attributes.int2_0)
return data_view.get()
@int2_0.setter
def int2_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.int2_0)
data_view = og.AttributeValueHelper(self._attributes.int2_0)
data_view.set(value)
@property
def int2_1(self):
data_view = og.AttributeValueHelper(self._attributes.int2_1)
return data_view.get()
@int2_1.setter
def int2_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.int2_1)
data_view = og.AttributeValueHelper(self._attributes.int2_1)
data_view.set(value)
@property
def int2_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.int2_arr_0)
return data_view.get()
@int2_arr_0.setter
def int2_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.int2_arr_0)
data_view = og.AttributeValueHelper(self._attributes.int2_arr_0)
data_view.set(value)
self.int2_arr_0_size = data_view.get_array_size()
@property
def int2_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.int2_arr_1)
return data_view.get()
@int2_arr_1.setter
def int2_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.int2_arr_1)
data_view = og.AttributeValueHelper(self._attributes.int2_arr_1)
data_view.set(value)
self.int2_arr_1_size = data_view.get_array_size()
@property
def int3_0(self):
data_view = og.AttributeValueHelper(self._attributes.int3_0)
return data_view.get()
@int3_0.setter
def int3_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.int3_0)
data_view = og.AttributeValueHelper(self._attributes.int3_0)
data_view.set(value)
@property
def int3_1(self):
data_view = og.AttributeValueHelper(self._attributes.int3_1)
return data_view.get()
@int3_1.setter
def int3_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.int3_1)
data_view = og.AttributeValueHelper(self._attributes.int3_1)
data_view.set(value)
@property
def int3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.int3_arr_0)
return data_view.get()
@int3_arr_0.setter
def int3_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.int3_arr_0)
data_view = og.AttributeValueHelper(self._attributes.int3_arr_0)
data_view.set(value)
self.int3_arr_0_size = data_view.get_array_size()
@property
def int3_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.int3_arr_1)
return data_view.get()
@int3_arr_1.setter
def int3_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.int3_arr_1)
data_view = og.AttributeValueHelper(self._attributes.int3_arr_1)
data_view.set(value)
self.int3_arr_1_size = data_view.get_array_size()
@property
def int4_0(self):
data_view = og.AttributeValueHelper(self._attributes.int4_0)
return data_view.get()
@int4_0.setter
def int4_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.int4_0)
data_view = og.AttributeValueHelper(self._attributes.int4_0)
data_view.set(value)
@property
def int4_1(self):
data_view = og.AttributeValueHelper(self._attributes.int4_1)
return data_view.get()
@int4_1.setter
def int4_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.int4_1)
data_view = og.AttributeValueHelper(self._attributes.int4_1)
data_view.set(value)
@property
def int4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.int4_arr_0)
return data_view.get()
@int4_arr_0.setter
def int4_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.int4_arr_0)
data_view = og.AttributeValueHelper(self._attributes.int4_arr_0)
data_view.set(value)
self.int4_arr_0_size = data_view.get_array_size()
@property
def int4_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.int4_arr_1)
return data_view.get()
@int4_arr_1.setter
def int4_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.int4_arr_1)
data_view = og.AttributeValueHelper(self._attributes.int4_arr_1)
data_view.set(value)
self.int4_arr_1_size = data_view.get_array_size()
@property
def int64_0(self):
data_view = og.AttributeValueHelper(self._attributes.int64_0)
return data_view.get()
@int64_0.setter
def int64_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.int64_0)
data_view = og.AttributeValueHelper(self._attributes.int64_0)
data_view.set(value)
@property
def int64_1(self):
data_view = og.AttributeValueHelper(self._attributes.int64_1)
return data_view.get()
@int64_1.setter
def int64_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.int64_1)
data_view = og.AttributeValueHelper(self._attributes.int64_1)
data_view.set(value)
@property
def int64_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.int64_arr_0)
return data_view.get()
@int64_arr_0.setter
def int64_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.int64_arr_0)
data_view = og.AttributeValueHelper(self._attributes.int64_arr_0)
data_view.set(value)
self.int64_arr_0_size = data_view.get_array_size()
@property
def int64_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.int64_arr_1)
return data_view.get()
@int64_arr_1.setter
def int64_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.int64_arr_1)
data_view = og.AttributeValueHelper(self._attributes.int64_arr_1)
data_view.set(value)
self.int64_arr_1_size = data_view.get_array_size()
@property
def int_0(self):
data_view = og.AttributeValueHelper(self._attributes.int_0)
return data_view.get()
@int_0.setter
def int_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.int_0)
data_view = og.AttributeValueHelper(self._attributes.int_0)
data_view.set(value)
@property
def int_1(self):
data_view = og.AttributeValueHelper(self._attributes.int_1)
return data_view.get()
@int_1.setter
def int_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.int_1)
data_view = og.AttributeValueHelper(self._attributes.int_1)
data_view.set(value)
@property
def int_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.int_arr_0)
return data_view.get()
@int_arr_0.setter
def int_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.int_arr_0)
data_view = og.AttributeValueHelper(self._attributes.int_arr_0)
data_view.set(value)
self.int_arr_0_size = data_view.get_array_size()
@property
def int_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.int_arr_1)
return data_view.get()
@int_arr_1.setter
def int_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.int_arr_1)
data_view = og.AttributeValueHelper(self._attributes.int_arr_1)
data_view.set(value)
self.int_arr_1_size = data_view.get_array_size()
@property
def matrixd2_0(self):
data_view = og.AttributeValueHelper(self._attributes.matrixd2_0)
return data_view.get()
@matrixd2_0.setter
def matrixd2_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.matrixd2_0)
data_view = og.AttributeValueHelper(self._attributes.matrixd2_0)
data_view.set(value)
@property
def matrixd2_1(self):
data_view = og.AttributeValueHelper(self._attributes.matrixd2_1)
return data_view.get()
@matrixd2_1.setter
def matrixd2_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.matrixd2_1)
data_view = og.AttributeValueHelper(self._attributes.matrixd2_1)
data_view.set(value)
@property
def matrixd2_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.matrixd2_arr_0)
return data_view.get()
@matrixd2_arr_0.setter
def matrixd2_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.matrixd2_arr_0)
data_view = og.AttributeValueHelper(self._attributes.matrixd2_arr_0)
data_view.set(value)
self.matrixd2_arr_0_size = data_view.get_array_size()
@property
def matrixd2_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.matrixd2_arr_1)
return data_view.get()
@matrixd2_arr_1.setter
def matrixd2_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.matrixd2_arr_1)
data_view = og.AttributeValueHelper(self._attributes.matrixd2_arr_1)
data_view.set(value)
self.matrixd2_arr_1_size = data_view.get_array_size()
@property
def matrixd3_0(self):
data_view = og.AttributeValueHelper(self._attributes.matrixd3_0)
return data_view.get()
@matrixd3_0.setter
def matrixd3_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.matrixd3_0)
data_view = og.AttributeValueHelper(self._attributes.matrixd3_0)
data_view.set(value)
@property
def matrixd3_1(self):
data_view = og.AttributeValueHelper(self._attributes.matrixd3_1)
return data_view.get()
@matrixd3_1.setter
def matrixd3_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.matrixd3_1)
data_view = og.AttributeValueHelper(self._attributes.matrixd3_1)
data_view.set(value)
@property
def matrixd3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.matrixd3_arr_0)
return data_view.get()
@matrixd3_arr_0.setter
def matrixd3_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.matrixd3_arr_0)
data_view = og.AttributeValueHelper(self._attributes.matrixd3_arr_0)
data_view.set(value)
self.matrixd3_arr_0_size = data_view.get_array_size()
@property
def matrixd3_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.matrixd3_arr_1)
return data_view.get()
@matrixd3_arr_1.setter
def matrixd3_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.matrixd3_arr_1)
data_view = og.AttributeValueHelper(self._attributes.matrixd3_arr_1)
data_view.set(value)
self.matrixd3_arr_1_size = data_view.get_array_size()
@property
def matrixd4_0(self):
data_view = og.AttributeValueHelper(self._attributes.matrixd4_0)
return data_view.get()
@matrixd4_0.setter
def matrixd4_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.matrixd4_0)
data_view = og.AttributeValueHelper(self._attributes.matrixd4_0)
data_view.set(value)
@property
def matrixd4_1(self):
data_view = og.AttributeValueHelper(self._attributes.matrixd4_1)
return data_view.get()
@matrixd4_1.setter
def matrixd4_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.matrixd4_1)
data_view = og.AttributeValueHelper(self._attributes.matrixd4_1)
data_view.set(value)
@property
def matrixd4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.matrixd4_arr_0)
return data_view.get()
@matrixd4_arr_0.setter
def matrixd4_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.matrixd4_arr_0)
data_view = og.AttributeValueHelper(self._attributes.matrixd4_arr_0)
data_view.set(value)
self.matrixd4_arr_0_size = data_view.get_array_size()
@property
def matrixd4_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.matrixd4_arr_1)
return data_view.get()
@matrixd4_arr_1.setter
def matrixd4_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.matrixd4_arr_1)
data_view = og.AttributeValueHelper(self._attributes.matrixd4_arr_1)
data_view.set(value)
self.matrixd4_arr_1_size = data_view.get_array_size()
@property
def normald3_0(self):
data_view = og.AttributeValueHelper(self._attributes.normald3_0)
return data_view.get()
@normald3_0.setter
def normald3_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.normald3_0)
data_view = og.AttributeValueHelper(self._attributes.normald3_0)
data_view.set(value)
@property
def normald3_1(self):
data_view = og.AttributeValueHelper(self._attributes.normald3_1)
return data_view.get()
@normald3_1.setter
def normald3_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.normald3_1)
data_view = og.AttributeValueHelper(self._attributes.normald3_1)
data_view.set(value)
@property
def normald3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.normald3_arr_0)
return data_view.get()
@normald3_arr_0.setter
def normald3_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.normald3_arr_0)
data_view = og.AttributeValueHelper(self._attributes.normald3_arr_0)
data_view.set(value)
self.normald3_arr_0_size = data_view.get_array_size()
@property
def normald3_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.normald3_arr_1)
return data_view.get()
@normald3_arr_1.setter
def normald3_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.normald3_arr_1)
data_view = og.AttributeValueHelper(self._attributes.normald3_arr_1)
data_view.set(value)
self.normald3_arr_1_size = data_view.get_array_size()
@property
def normalf3_0(self):
data_view = og.AttributeValueHelper(self._attributes.normalf3_0)
return data_view.get()
@normalf3_0.setter
def normalf3_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.normalf3_0)
data_view = og.AttributeValueHelper(self._attributes.normalf3_0)
data_view.set(value)
@property
def normalf3_1(self):
data_view = og.AttributeValueHelper(self._attributes.normalf3_1)
return data_view.get()
@normalf3_1.setter
def normalf3_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.normalf3_1)
data_view = og.AttributeValueHelper(self._attributes.normalf3_1)
data_view.set(value)
@property
def normalf3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.normalf3_arr_0)
return data_view.get()
@normalf3_arr_0.setter
def normalf3_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.normalf3_arr_0)
data_view = og.AttributeValueHelper(self._attributes.normalf3_arr_0)
data_view.set(value)
self.normalf3_arr_0_size = data_view.get_array_size()
@property
def normalf3_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.normalf3_arr_1)
return data_view.get()
@normalf3_arr_1.setter
def normalf3_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.normalf3_arr_1)
data_view = og.AttributeValueHelper(self._attributes.normalf3_arr_1)
data_view.set(value)
self.normalf3_arr_1_size = data_view.get_array_size()
@property
def normalh3_0(self):
data_view = og.AttributeValueHelper(self._attributes.normalh3_0)
return data_view.get()
@normalh3_0.setter
def normalh3_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.normalh3_0)
data_view = og.AttributeValueHelper(self._attributes.normalh3_0)
data_view.set(value)
@property
def normalh3_1(self):
data_view = og.AttributeValueHelper(self._attributes.normalh3_1)
return data_view.get()
@normalh3_1.setter
def normalh3_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.normalh3_1)
data_view = og.AttributeValueHelper(self._attributes.normalh3_1)
data_view.set(value)
@property
def normalh3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.normalh3_arr_0)
return data_view.get()
@normalh3_arr_0.setter
def normalh3_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.normalh3_arr_0)
data_view = og.AttributeValueHelper(self._attributes.normalh3_arr_0)
data_view.set(value)
self.normalh3_arr_0_size = data_view.get_array_size()
@property
def normalh3_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.normalh3_arr_1)
return data_view.get()
@normalh3_arr_1.setter
def normalh3_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.normalh3_arr_1)
data_view = og.AttributeValueHelper(self._attributes.normalh3_arr_1)
data_view.set(value)
self.normalh3_arr_1_size = data_view.get_array_size()
@property
def pointd3_0(self):
data_view = og.AttributeValueHelper(self._attributes.pointd3_0)
return data_view.get()
@pointd3_0.setter
def pointd3_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.pointd3_0)
data_view = og.AttributeValueHelper(self._attributes.pointd3_0)
data_view.set(value)
@property
def pointd3_1(self):
data_view = og.AttributeValueHelper(self._attributes.pointd3_1)
return data_view.get()
@pointd3_1.setter
def pointd3_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.pointd3_1)
data_view = og.AttributeValueHelper(self._attributes.pointd3_1)
data_view.set(value)
@property
def pointd3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.pointd3_arr_0)
return data_view.get()
@pointd3_arr_0.setter
def pointd3_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.pointd3_arr_0)
data_view = og.AttributeValueHelper(self._attributes.pointd3_arr_0)
data_view.set(value)
self.pointd3_arr_0_size = data_view.get_array_size()
@property
def pointd3_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.pointd3_arr_1)
return data_view.get()
@pointd3_arr_1.setter
def pointd3_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.pointd3_arr_1)
data_view = og.AttributeValueHelper(self._attributes.pointd3_arr_1)
data_view.set(value)
self.pointd3_arr_1_size = data_view.get_array_size()
@property
def pointf3_0(self):
data_view = og.AttributeValueHelper(self._attributes.pointf3_0)
return data_view.get()
@pointf3_0.setter
def pointf3_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.pointf3_0)
data_view = og.AttributeValueHelper(self._attributes.pointf3_0)
data_view.set(value)
@property
def pointf3_1(self):
data_view = og.AttributeValueHelper(self._attributes.pointf3_1)
return data_view.get()
@pointf3_1.setter
def pointf3_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.pointf3_1)
data_view = og.AttributeValueHelper(self._attributes.pointf3_1)
data_view.set(value)
@property
def pointf3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.pointf3_arr_0)
return data_view.get()
@pointf3_arr_0.setter
def pointf3_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.pointf3_arr_0)
data_view = og.AttributeValueHelper(self._attributes.pointf3_arr_0)
data_view.set(value)
self.pointf3_arr_0_size = data_view.get_array_size()
@property
def pointf3_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.pointf3_arr_1)
return data_view.get()
@pointf3_arr_1.setter
def pointf3_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.pointf3_arr_1)
data_view = og.AttributeValueHelper(self._attributes.pointf3_arr_1)
data_view.set(value)
self.pointf3_arr_1_size = data_view.get_array_size()
@property
def pointh3_0(self):
data_view = og.AttributeValueHelper(self._attributes.pointh3_0)
return data_view.get()
@pointh3_0.setter
def pointh3_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.pointh3_0)
data_view = og.AttributeValueHelper(self._attributes.pointh3_0)
data_view.set(value)
@property
def pointh3_1(self):
data_view = og.AttributeValueHelper(self._attributes.pointh3_1)
return data_view.get()
@pointh3_1.setter
def pointh3_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.pointh3_1)
data_view = og.AttributeValueHelper(self._attributes.pointh3_1)
data_view.set(value)
@property
def pointh3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.pointh3_arr_0)
return data_view.get()
@pointh3_arr_0.setter
def pointh3_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.pointh3_arr_0)
data_view = og.AttributeValueHelper(self._attributes.pointh3_arr_0)
data_view.set(value)
self.pointh3_arr_0_size = data_view.get_array_size()
@property
def pointh3_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.pointh3_arr_1)
return data_view.get()
@pointh3_arr_1.setter
def pointh3_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.pointh3_arr_1)
data_view = og.AttributeValueHelper(self._attributes.pointh3_arr_1)
data_view.set(value)
self.pointh3_arr_1_size = data_view.get_array_size()
@property
def quatd4_0(self):
data_view = og.AttributeValueHelper(self._attributes.quatd4_0)
return data_view.get()
@quatd4_0.setter
def quatd4_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.quatd4_0)
data_view = og.AttributeValueHelper(self._attributes.quatd4_0)
data_view.set(value)
@property
def quatd4_1(self):
data_view = og.AttributeValueHelper(self._attributes.quatd4_1)
return data_view.get()
@quatd4_1.setter
def quatd4_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.quatd4_1)
data_view = og.AttributeValueHelper(self._attributes.quatd4_1)
data_view.set(value)
@property
def quatd4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.quatd4_arr_0)
return data_view.get()
@quatd4_arr_0.setter
def quatd4_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.quatd4_arr_0)
data_view = og.AttributeValueHelper(self._attributes.quatd4_arr_0)
data_view.set(value)
self.quatd4_arr_0_size = data_view.get_array_size()
@property
def quatd4_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.quatd4_arr_1)
return data_view.get()
@quatd4_arr_1.setter
def quatd4_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.quatd4_arr_1)
data_view = og.AttributeValueHelper(self._attributes.quatd4_arr_1)
data_view.set(value)
self.quatd4_arr_1_size = data_view.get_array_size()
@property
def quatf4_0(self):
data_view = og.AttributeValueHelper(self._attributes.quatf4_0)
return data_view.get()
@quatf4_0.setter
def quatf4_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.quatf4_0)
data_view = og.AttributeValueHelper(self._attributes.quatf4_0)
data_view.set(value)
@property
def quatf4_1(self):
data_view = og.AttributeValueHelper(self._attributes.quatf4_1)
return data_view.get()
@quatf4_1.setter
def quatf4_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.quatf4_1)
data_view = og.AttributeValueHelper(self._attributes.quatf4_1)
data_view.set(value)
@property
def quatf4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.quatf4_arr_0)
return data_view.get()
@quatf4_arr_0.setter
def quatf4_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.quatf4_arr_0)
data_view = og.AttributeValueHelper(self._attributes.quatf4_arr_0)
data_view.set(value)
self.quatf4_arr_0_size = data_view.get_array_size()
@property
def quatf4_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.quatf4_arr_1)
return data_view.get()
@quatf4_arr_1.setter
def quatf4_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.quatf4_arr_1)
data_view = og.AttributeValueHelper(self._attributes.quatf4_arr_1)
data_view.set(value)
self.quatf4_arr_1_size = data_view.get_array_size()
@property
def quath4_0(self):
data_view = og.AttributeValueHelper(self._attributes.quath4_0)
return data_view.get()
@quath4_0.setter
def quath4_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.quath4_0)
data_view = og.AttributeValueHelper(self._attributes.quath4_0)
data_view.set(value)
@property
def quath4_1(self):
data_view = og.AttributeValueHelper(self._attributes.quath4_1)
return data_view.get()
@quath4_1.setter
def quath4_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.quath4_1)
data_view = og.AttributeValueHelper(self._attributes.quath4_1)
data_view.set(value)
@property
def quath4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.quath4_arr_0)
return data_view.get()
@quath4_arr_0.setter
def quath4_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.quath4_arr_0)
data_view = og.AttributeValueHelper(self._attributes.quath4_arr_0)
data_view.set(value)
self.quath4_arr_0_size = data_view.get_array_size()
@property
def quath4_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.quath4_arr_1)
return data_view.get()
@quath4_arr_1.setter
def quath4_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.quath4_arr_1)
data_view = og.AttributeValueHelper(self._attributes.quath4_arr_1)
data_view.set(value)
self.quath4_arr_1_size = data_view.get_array_size()
@property
def texcoordd2_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordd2_0)
return data_view.get()
@texcoordd2_0.setter
def texcoordd2_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordd2_0)
data_view = og.AttributeValueHelper(self._attributes.texcoordd2_0)
data_view.set(value)
@property
def texcoordd2_1(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordd2_1)
return data_view.get()
@texcoordd2_1.setter
def texcoordd2_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordd2_1)
data_view = og.AttributeValueHelper(self._attributes.texcoordd2_1)
data_view.set(value)
@property
def texcoordd2_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordd2_arr_0)
return data_view.get()
@texcoordd2_arr_0.setter
def texcoordd2_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordd2_arr_0)
data_view = og.AttributeValueHelper(self._attributes.texcoordd2_arr_0)
data_view.set(value)
self.texcoordd2_arr_0_size = data_view.get_array_size()
@property
def texcoordd2_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordd2_arr_1)
return data_view.get()
@texcoordd2_arr_1.setter
def texcoordd2_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordd2_arr_1)
data_view = og.AttributeValueHelper(self._attributes.texcoordd2_arr_1)
data_view.set(value)
self.texcoordd2_arr_1_size = data_view.get_array_size()
@property
def texcoordd3_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordd3_0)
return data_view.get()
@texcoordd3_0.setter
def texcoordd3_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordd3_0)
data_view = og.AttributeValueHelper(self._attributes.texcoordd3_0)
data_view.set(value)
@property
def texcoordd3_1(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordd3_1)
return data_view.get()
@texcoordd3_1.setter
def texcoordd3_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordd3_1)
data_view = og.AttributeValueHelper(self._attributes.texcoordd3_1)
data_view.set(value)
@property
def texcoordd3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordd3_arr_0)
return data_view.get()
@texcoordd3_arr_0.setter
def texcoordd3_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordd3_arr_0)
data_view = og.AttributeValueHelper(self._attributes.texcoordd3_arr_0)
data_view.set(value)
self.texcoordd3_arr_0_size = data_view.get_array_size()
@property
def texcoordd3_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordd3_arr_1)
return data_view.get()
@texcoordd3_arr_1.setter
def texcoordd3_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordd3_arr_1)
data_view = og.AttributeValueHelper(self._attributes.texcoordd3_arr_1)
data_view.set(value)
self.texcoordd3_arr_1_size = data_view.get_array_size()
@property
def texcoordf2_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordf2_0)
return data_view.get()
@texcoordf2_0.setter
def texcoordf2_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordf2_0)
data_view = og.AttributeValueHelper(self._attributes.texcoordf2_0)
data_view.set(value)
@property
def texcoordf2_1(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordf2_1)
return data_view.get()
@texcoordf2_1.setter
def texcoordf2_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordf2_1)
data_view = og.AttributeValueHelper(self._attributes.texcoordf2_1)
data_view.set(value)
@property
def texcoordf2_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordf2_arr_0)
return data_view.get()
@texcoordf2_arr_0.setter
def texcoordf2_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordf2_arr_0)
data_view = og.AttributeValueHelper(self._attributes.texcoordf2_arr_0)
data_view.set(value)
self.texcoordf2_arr_0_size = data_view.get_array_size()
@property
def texcoordf2_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordf2_arr_1)
return data_view.get()
@texcoordf2_arr_1.setter
def texcoordf2_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordf2_arr_1)
data_view = og.AttributeValueHelper(self._attributes.texcoordf2_arr_1)
data_view.set(value)
self.texcoordf2_arr_1_size = data_view.get_array_size()
@property
def texcoordf3_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordf3_0)
return data_view.get()
@texcoordf3_0.setter
def texcoordf3_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordf3_0)
data_view = og.AttributeValueHelper(self._attributes.texcoordf3_0)
data_view.set(value)
@property
def texcoordf3_1(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordf3_1)
return data_view.get()
@texcoordf3_1.setter
def texcoordf3_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordf3_1)
data_view = og.AttributeValueHelper(self._attributes.texcoordf3_1)
data_view.set(value)
@property
def texcoordf3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordf3_arr_0)
return data_view.get()
@texcoordf3_arr_0.setter
def texcoordf3_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordf3_arr_0)
data_view = og.AttributeValueHelper(self._attributes.texcoordf3_arr_0)
data_view.set(value)
self.texcoordf3_arr_0_size = data_view.get_array_size()
@property
def texcoordf3_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordf3_arr_1)
return data_view.get()
@texcoordf3_arr_1.setter
def texcoordf3_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordf3_arr_1)
data_view = og.AttributeValueHelper(self._attributes.texcoordf3_arr_1)
data_view.set(value)
self.texcoordf3_arr_1_size = data_view.get_array_size()
@property
def texcoordh2_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordh2_0)
return data_view.get()
@texcoordh2_0.setter
def texcoordh2_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordh2_0)
data_view = og.AttributeValueHelper(self._attributes.texcoordh2_0)
data_view.set(value)
@property
def texcoordh2_1(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordh2_1)
return data_view.get()
@texcoordh2_1.setter
def texcoordh2_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordh2_1)
data_view = og.AttributeValueHelper(self._attributes.texcoordh2_1)
data_view.set(value)
@property
def texcoordh2_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordh2_arr_0)
return data_view.get()
@texcoordh2_arr_0.setter
def texcoordh2_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordh2_arr_0)
data_view = og.AttributeValueHelper(self._attributes.texcoordh2_arr_0)
data_view.set(value)
self.texcoordh2_arr_0_size = data_view.get_array_size()
@property
def texcoordh2_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordh2_arr_1)
return data_view.get()
@texcoordh2_arr_1.setter
def texcoordh2_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordh2_arr_1)
data_view = og.AttributeValueHelper(self._attributes.texcoordh2_arr_1)
data_view.set(value)
self.texcoordh2_arr_1_size = data_view.get_array_size()
@property
def texcoordh3_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordh3_0)
return data_view.get()
@texcoordh3_0.setter
def texcoordh3_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordh3_0)
data_view = og.AttributeValueHelper(self._attributes.texcoordh3_0)
data_view.set(value)
@property
def texcoordh3_1(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordh3_1)
return data_view.get()
@texcoordh3_1.setter
def texcoordh3_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordh3_1)
data_view = og.AttributeValueHelper(self._attributes.texcoordh3_1)
data_view.set(value)
@property
def texcoordh3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordh3_arr_0)
return data_view.get()
@texcoordh3_arr_0.setter
def texcoordh3_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordh3_arr_0)
data_view = og.AttributeValueHelper(self._attributes.texcoordh3_arr_0)
data_view.set(value)
self.texcoordh3_arr_0_size = data_view.get_array_size()
@property
def texcoordh3_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordh3_arr_1)
return data_view.get()
@texcoordh3_arr_1.setter
def texcoordh3_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.texcoordh3_arr_1)
data_view = og.AttributeValueHelper(self._attributes.texcoordh3_arr_1)
data_view.set(value)
self.texcoordh3_arr_1_size = data_view.get_array_size()
@property
def timecode_0(self):
data_view = og.AttributeValueHelper(self._attributes.timecode_0)
return data_view.get()
@timecode_0.setter
def timecode_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.timecode_0)
data_view = og.AttributeValueHelper(self._attributes.timecode_0)
data_view.set(value)
@property
def timecode_1(self):
data_view = og.AttributeValueHelper(self._attributes.timecode_1)
return data_view.get()
@timecode_1.setter
def timecode_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.timecode_1)
data_view = og.AttributeValueHelper(self._attributes.timecode_1)
data_view.set(value)
@property
def timecode_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.timecode_arr_0)
return data_view.get()
@timecode_arr_0.setter
def timecode_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.timecode_arr_0)
data_view = og.AttributeValueHelper(self._attributes.timecode_arr_0)
data_view.set(value)
self.timecode_arr_0_size = data_view.get_array_size()
@property
def timecode_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.timecode_arr_1)
return data_view.get()
@timecode_arr_1.setter
def timecode_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.timecode_arr_1)
data_view = og.AttributeValueHelper(self._attributes.timecode_arr_1)
data_view.set(value)
self.timecode_arr_1_size = data_view.get_array_size()
@property
def token_0(self):
data_view = og.AttributeValueHelper(self._attributes.token_0)
return data_view.get()
@token_0.setter
def token_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.token_0)
data_view = og.AttributeValueHelper(self._attributes.token_0)
data_view.set(value)
@property
def token_1(self):
data_view = og.AttributeValueHelper(self._attributes.token_1)
return data_view.get()
@token_1.setter
def token_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.token_1)
data_view = og.AttributeValueHelper(self._attributes.token_1)
data_view.set(value)
@property
def token_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.token_arr_0)
return data_view.get()
@token_arr_0.setter
def token_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.token_arr_0)
data_view = og.AttributeValueHelper(self._attributes.token_arr_0)
data_view.set(value)
self.token_arr_0_size = data_view.get_array_size()
@property
def token_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.token_arr_1)
return data_view.get()
@token_arr_1.setter
def token_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.token_arr_1)
data_view = og.AttributeValueHelper(self._attributes.token_arr_1)
data_view.set(value)
self.token_arr_1_size = data_view.get_array_size()
@property
def transform4_0(self):
data_view = og.AttributeValueHelper(self._attributes.transform4_0)
return data_view.get()
@transform4_0.setter
def transform4_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.transform4_0)
data_view = og.AttributeValueHelper(self._attributes.transform4_0)
data_view.set(value)
@property
def transform4_1(self):
data_view = og.AttributeValueHelper(self._attributes.transform4_1)
return data_view.get()
@transform4_1.setter
def transform4_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.transform4_1)
data_view = og.AttributeValueHelper(self._attributes.transform4_1)
data_view.set(value)
@property
def transform4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.transform4_arr_0)
return data_view.get()
@transform4_arr_0.setter
def transform4_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.transform4_arr_0)
data_view = og.AttributeValueHelper(self._attributes.transform4_arr_0)
data_view.set(value)
self.transform4_arr_0_size = data_view.get_array_size()
@property
def transform4_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.transform4_arr_1)
return data_view.get()
@transform4_arr_1.setter
def transform4_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.transform4_arr_1)
data_view = og.AttributeValueHelper(self._attributes.transform4_arr_1)
data_view.set(value)
self.transform4_arr_1_size = data_view.get_array_size()
@property
def uchar_0(self):
data_view = og.AttributeValueHelper(self._attributes.uchar_0)
return data_view.get()
@uchar_0.setter
def uchar_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.uchar_0)
data_view = og.AttributeValueHelper(self._attributes.uchar_0)
data_view.set(value)
@property
def uchar_1(self):
data_view = og.AttributeValueHelper(self._attributes.uchar_1)
return data_view.get()
@uchar_1.setter
def uchar_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.uchar_1)
data_view = og.AttributeValueHelper(self._attributes.uchar_1)
data_view.set(value)
@property
def uchar_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.uchar_arr_0)
return data_view.get()
@uchar_arr_0.setter
def uchar_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.uchar_arr_0)
data_view = og.AttributeValueHelper(self._attributes.uchar_arr_0)
data_view.set(value)
self.uchar_arr_0_size = data_view.get_array_size()
@property
def uchar_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.uchar_arr_1)
return data_view.get()
@uchar_arr_1.setter
def uchar_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.uchar_arr_1)
data_view = og.AttributeValueHelper(self._attributes.uchar_arr_1)
data_view.set(value)
self.uchar_arr_1_size = data_view.get_array_size()
@property
def uint64_0(self):
data_view = og.AttributeValueHelper(self._attributes.uint64_0)
return data_view.get()
@uint64_0.setter
def uint64_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.uint64_0)
data_view = og.AttributeValueHelper(self._attributes.uint64_0)
data_view.set(value)
@property
def uint64_1(self):
data_view = og.AttributeValueHelper(self._attributes.uint64_1)
return data_view.get()
@uint64_1.setter
def uint64_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.uint64_1)
data_view = og.AttributeValueHelper(self._attributes.uint64_1)
data_view.set(value)
@property
def uint64_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.uint64_arr_0)
return data_view.get()
@uint64_arr_0.setter
def uint64_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.uint64_arr_0)
data_view = og.AttributeValueHelper(self._attributes.uint64_arr_0)
data_view.set(value)
self.uint64_arr_0_size = data_view.get_array_size()
@property
def uint64_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.uint64_arr_1)
return data_view.get()
@uint64_arr_1.setter
def uint64_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.uint64_arr_1)
data_view = og.AttributeValueHelper(self._attributes.uint64_arr_1)
data_view.set(value)
self.uint64_arr_1_size = data_view.get_array_size()
@property
def uint_0(self):
data_view = og.AttributeValueHelper(self._attributes.uint_0)
return data_view.get()
@uint_0.setter
def uint_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.uint_0)
data_view = og.AttributeValueHelper(self._attributes.uint_0)
data_view.set(value)
@property
def uint_1(self):
data_view = og.AttributeValueHelper(self._attributes.uint_1)
return data_view.get()
@uint_1.setter
def uint_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.uint_1)
data_view = og.AttributeValueHelper(self._attributes.uint_1)
data_view.set(value)
@property
def uint_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.uint_arr_0)
return data_view.get()
@uint_arr_0.setter
def uint_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.uint_arr_0)
data_view = og.AttributeValueHelper(self._attributes.uint_arr_0)
data_view.set(value)
self.uint_arr_0_size = data_view.get_array_size()
@property
def uint_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.uint_arr_1)
return data_view.get()
@uint_arr_1.setter
def uint_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.uint_arr_1)
data_view = og.AttributeValueHelper(self._attributes.uint_arr_1)
data_view.set(value)
self.uint_arr_1_size = data_view.get_array_size()
@property
def vectord3_0(self):
data_view = og.AttributeValueHelper(self._attributes.vectord3_0)
return data_view.get()
@vectord3_0.setter
def vectord3_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.vectord3_0)
data_view = og.AttributeValueHelper(self._attributes.vectord3_0)
data_view.set(value)
@property
def vectord3_1(self):
data_view = og.AttributeValueHelper(self._attributes.vectord3_1)
return data_view.get()
@vectord3_1.setter
def vectord3_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.vectord3_1)
data_view = og.AttributeValueHelper(self._attributes.vectord3_1)
data_view.set(value)
@property
def vectord3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.vectord3_arr_0)
return data_view.get()
@vectord3_arr_0.setter
def vectord3_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.vectord3_arr_0)
data_view = og.AttributeValueHelper(self._attributes.vectord3_arr_0)
data_view.set(value)
self.vectord3_arr_0_size = data_view.get_array_size()
@property
def vectord3_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.vectord3_arr_1)
return data_view.get()
@vectord3_arr_1.setter
def vectord3_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.vectord3_arr_1)
data_view = og.AttributeValueHelper(self._attributes.vectord3_arr_1)
data_view.set(value)
self.vectord3_arr_1_size = data_view.get_array_size()
@property
def vectorf3_0(self):
data_view = og.AttributeValueHelper(self._attributes.vectorf3_0)
return data_view.get()
@vectorf3_0.setter
def vectorf3_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.vectorf3_0)
data_view = og.AttributeValueHelper(self._attributes.vectorf3_0)
data_view.set(value)
@property
def vectorf3_1(self):
data_view = og.AttributeValueHelper(self._attributes.vectorf3_1)
return data_view.get()
@vectorf3_1.setter
def vectorf3_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.vectorf3_1)
data_view = og.AttributeValueHelper(self._attributes.vectorf3_1)
data_view.set(value)
@property
def vectorf3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.vectorf3_arr_0)
return data_view.get()
@vectorf3_arr_0.setter
def vectorf3_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.vectorf3_arr_0)
data_view = og.AttributeValueHelper(self._attributes.vectorf3_arr_0)
data_view.set(value)
self.vectorf3_arr_0_size = data_view.get_array_size()
@property
def vectorf3_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.vectorf3_arr_1)
return data_view.get()
@vectorf3_arr_1.setter
def vectorf3_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.vectorf3_arr_1)
data_view = og.AttributeValueHelper(self._attributes.vectorf3_arr_1)
data_view.set(value)
self.vectorf3_arr_1_size = data_view.get_array_size()
@property
def vectorh3_0(self):
data_view = og.AttributeValueHelper(self._attributes.vectorh3_0)
return data_view.get()
@vectorh3_0.setter
def vectorh3_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.vectorh3_0)
data_view = og.AttributeValueHelper(self._attributes.vectorh3_0)
data_view.set(value)
@property
def vectorh3_1(self):
data_view = og.AttributeValueHelper(self._attributes.vectorh3_1)
return data_view.get()
@vectorh3_1.setter
def vectorh3_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.vectorh3_1)
data_view = og.AttributeValueHelper(self._attributes.vectorh3_1)
data_view.set(value)
@property
def vectorh3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.vectorh3_arr_0)
return data_view.get()
@vectorh3_arr_0.setter
def vectorh3_arr_0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.vectorh3_arr_0)
data_view = og.AttributeValueHelper(self._attributes.vectorh3_arr_0)
data_view.set(value)
self.vectorh3_arr_0_size = data_view.get_array_size()
@property
def vectorh3_arr_1(self):
data_view = og.AttributeValueHelper(self._attributes.vectorh3_arr_1)
return data_view.get()
@vectorh3_arr_1.setter
def vectorh3_arr_1(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.vectorh3_arr_1)
data_view = og.AttributeValueHelper(self._attributes.vectorh3_arr_1)
data_view.set(value)
self.vectorh3_arr_1_size = data_view.get_array_size()
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self.bool_arr_0_size = 0
self.colord3_arr_0_size = 0
self.colord4_arr_0_size = 0
self.colorf3_arr_0_size = 0
self.colorf4_arr_0_size = 0
self.colorh3_arr_0_size = 0
self.colorh4_arr_0_size = 0
self.double2_arr_0_size = 0
self.double3_arr_0_size = 0
self.double4_arr_0_size = 0
self.double_arr_0_size = 0
self.float2_arr_0_size = 0
self.float3_arr_0_size = 0
self.float4_arr_0_size = 0
self.float_arr_0_size = 0
self.frame4_arr_0_size = 0
self.half2_arr_0_size = 0
self.half3_arr_0_size = 0
self.half4_arr_0_size = 0
self.half_arr_0_size = 0
self.int2_arr_0_size = 0
self.int3_arr_0_size = 0
self.int4_arr_0_size = 0
self.int64_arr_0_size = 0
self.int_arr_0_size = 0
self.matrixd2_arr_0_size = 0
self.matrixd3_arr_0_size = 0
self.matrixd4_arr_0_size = 0
self.normald3_arr_0_size = 0
self.normalf3_arr_0_size = 0
self.normalh3_arr_0_size = 0
self.pointd3_arr_0_size = 0
self.pointf3_arr_0_size = 0
self.pointh3_arr_0_size = 0
self.quatd4_arr_0_size = 0
self.quatf4_arr_0_size = 0
self.quath4_arr_0_size = 0
self.texcoordd2_arr_0_size = 0
self.texcoordd3_arr_0_size = 0
self.texcoordf2_arr_0_size = 0
self.texcoordf3_arr_0_size = 0
self.texcoordh2_arr_0_size = 0
self.texcoordh3_arr_0_size = 0
self.timecode_arr_0_size = 0
self.token_arr_0_size = 0
self.transform4_arr_0_size = 0
self.uchar_arr_0_size = 0
self.uint64_arr_0_size = 0
self.uint_arr_0_size = 0
self.vectord3_arr_0_size = 0
self.vectorf3_arr_0_size = 0
self.vectorh3_arr_0_size = 0
self._batchedWriteValues = { }
@property
def bool_0(self):
data_view = og.AttributeValueHelper(self._attributes.bool_0)
return data_view.get()
@bool_0.setter
def bool_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.bool_0)
data_view.set(value)
@property
def bool_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.bool_arr_0)
return data_view.get(reserved_element_count=self.bool_arr_0_size)
@bool_arr_0.setter
def bool_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.bool_arr_0)
data_view.set(value)
self.bool_arr_0_size = data_view.get_array_size()
@property
def colord3_0(self):
data_view = og.AttributeValueHelper(self._attributes.colord3_0)
return data_view.get()
@colord3_0.setter
def colord3_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.colord3_0)
data_view.set(value)
@property
def colord3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.colord3_arr_0)
return data_view.get(reserved_element_count=self.colord3_arr_0_size)
@colord3_arr_0.setter
def colord3_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.colord3_arr_0)
data_view.set(value)
self.colord3_arr_0_size = data_view.get_array_size()
@property
def colord4_0(self):
data_view = og.AttributeValueHelper(self._attributes.colord4_0)
return data_view.get()
@colord4_0.setter
def colord4_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.colord4_0)
data_view.set(value)
@property
def colord4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.colord4_arr_0)
return data_view.get(reserved_element_count=self.colord4_arr_0_size)
@colord4_arr_0.setter
def colord4_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.colord4_arr_0)
data_view.set(value)
self.colord4_arr_0_size = data_view.get_array_size()
@property
def colorf3_0(self):
data_view = og.AttributeValueHelper(self._attributes.colorf3_0)
return data_view.get()
@colorf3_0.setter
def colorf3_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.colorf3_0)
data_view.set(value)
@property
def colorf3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.colorf3_arr_0)
return data_view.get(reserved_element_count=self.colorf3_arr_0_size)
@colorf3_arr_0.setter
def colorf3_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.colorf3_arr_0)
data_view.set(value)
self.colorf3_arr_0_size = data_view.get_array_size()
@property
def colorf4_0(self):
data_view = og.AttributeValueHelper(self._attributes.colorf4_0)
return data_view.get()
@colorf4_0.setter
def colorf4_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.colorf4_0)
data_view.set(value)
@property
def colorf4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.colorf4_arr_0)
return data_view.get(reserved_element_count=self.colorf4_arr_0_size)
@colorf4_arr_0.setter
def colorf4_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.colorf4_arr_0)
data_view.set(value)
self.colorf4_arr_0_size = data_view.get_array_size()
@property
def colorh3_0(self):
data_view = og.AttributeValueHelper(self._attributes.colorh3_0)
return data_view.get()
@colorh3_0.setter
def colorh3_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.colorh3_0)
data_view.set(value)
@property
def colorh3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.colorh3_arr_0)
return data_view.get(reserved_element_count=self.colorh3_arr_0_size)
@colorh3_arr_0.setter
def colorh3_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.colorh3_arr_0)
data_view.set(value)
self.colorh3_arr_0_size = data_view.get_array_size()
@property
def colorh4_0(self):
data_view = og.AttributeValueHelper(self._attributes.colorh4_0)
return data_view.get()
@colorh4_0.setter
def colorh4_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.colorh4_0)
data_view.set(value)
@property
def colorh4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.colorh4_arr_0)
return data_view.get(reserved_element_count=self.colorh4_arr_0_size)
@colorh4_arr_0.setter
def colorh4_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.colorh4_arr_0)
data_view.set(value)
self.colorh4_arr_0_size = data_view.get_array_size()
@property
def double2_0(self):
data_view = og.AttributeValueHelper(self._attributes.double2_0)
return data_view.get()
@double2_0.setter
def double2_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.double2_0)
data_view.set(value)
@property
def double2_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.double2_arr_0)
return data_view.get(reserved_element_count=self.double2_arr_0_size)
@double2_arr_0.setter
def double2_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.double2_arr_0)
data_view.set(value)
self.double2_arr_0_size = data_view.get_array_size()
@property
def double3_0(self):
data_view = og.AttributeValueHelper(self._attributes.double3_0)
return data_view.get()
@double3_0.setter
def double3_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.double3_0)
data_view.set(value)
@property
def double3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.double3_arr_0)
return data_view.get(reserved_element_count=self.double3_arr_0_size)
@double3_arr_0.setter
def double3_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.double3_arr_0)
data_view.set(value)
self.double3_arr_0_size = data_view.get_array_size()
@property
def double4_0(self):
data_view = og.AttributeValueHelper(self._attributes.double4_0)
return data_view.get()
@double4_0.setter
def double4_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.double4_0)
data_view.set(value)
@property
def double4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.double4_arr_0)
return data_view.get(reserved_element_count=self.double4_arr_0_size)
@double4_arr_0.setter
def double4_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.double4_arr_0)
data_view.set(value)
self.double4_arr_0_size = data_view.get_array_size()
@property
def double_0(self):
data_view = og.AttributeValueHelper(self._attributes.double_0)
return data_view.get()
@double_0.setter
def double_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.double_0)
data_view.set(value)
@property
def double_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.double_arr_0)
return data_view.get(reserved_element_count=self.double_arr_0_size)
@double_arr_0.setter
def double_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.double_arr_0)
data_view.set(value)
self.double_arr_0_size = data_view.get_array_size()
@property
def float2_0(self):
data_view = og.AttributeValueHelper(self._attributes.float2_0)
return data_view.get()
@float2_0.setter
def float2_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.float2_0)
data_view.set(value)
@property
def float2_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.float2_arr_0)
return data_view.get(reserved_element_count=self.float2_arr_0_size)
@float2_arr_0.setter
def float2_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.float2_arr_0)
data_view.set(value)
self.float2_arr_0_size = data_view.get_array_size()
@property
def float3_0(self):
data_view = og.AttributeValueHelper(self._attributes.float3_0)
return data_view.get()
@float3_0.setter
def float3_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.float3_0)
data_view.set(value)
@property
def float3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.float3_arr_0)
return data_view.get(reserved_element_count=self.float3_arr_0_size)
@float3_arr_0.setter
def float3_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.float3_arr_0)
data_view.set(value)
self.float3_arr_0_size = data_view.get_array_size()
@property
def float4_0(self):
data_view = og.AttributeValueHelper(self._attributes.float4_0)
return data_view.get()
@float4_0.setter
def float4_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.float4_0)
data_view.set(value)
@property
def float4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.float4_arr_0)
return data_view.get(reserved_element_count=self.float4_arr_0_size)
@float4_arr_0.setter
def float4_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.float4_arr_0)
data_view.set(value)
self.float4_arr_0_size = data_view.get_array_size()
@property
def float_0(self):
data_view = og.AttributeValueHelper(self._attributes.float_0)
return data_view.get()
@float_0.setter
def float_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.float_0)
data_view.set(value)
@property
def float_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.float_arr_0)
return data_view.get(reserved_element_count=self.float_arr_0_size)
@float_arr_0.setter
def float_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.float_arr_0)
data_view.set(value)
self.float_arr_0_size = data_view.get_array_size()
@property
def frame4_0(self):
data_view = og.AttributeValueHelper(self._attributes.frame4_0)
return data_view.get()
@frame4_0.setter
def frame4_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.frame4_0)
data_view.set(value)
@property
def frame4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.frame4_arr_0)
return data_view.get(reserved_element_count=self.frame4_arr_0_size)
@frame4_arr_0.setter
def frame4_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.frame4_arr_0)
data_view.set(value)
self.frame4_arr_0_size = data_view.get_array_size()
@property
def half2_0(self):
data_view = og.AttributeValueHelper(self._attributes.half2_0)
return data_view.get()
@half2_0.setter
def half2_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.half2_0)
data_view.set(value)
@property
def half2_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.half2_arr_0)
return data_view.get(reserved_element_count=self.half2_arr_0_size)
@half2_arr_0.setter
def half2_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.half2_arr_0)
data_view.set(value)
self.half2_arr_0_size = data_view.get_array_size()
@property
def half3_0(self):
data_view = og.AttributeValueHelper(self._attributes.half3_0)
return data_view.get()
@half3_0.setter
def half3_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.half3_0)
data_view.set(value)
@property
def half3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.half3_arr_0)
return data_view.get(reserved_element_count=self.half3_arr_0_size)
@half3_arr_0.setter
def half3_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.half3_arr_0)
data_view.set(value)
self.half3_arr_0_size = data_view.get_array_size()
@property
def half4_0(self):
data_view = og.AttributeValueHelper(self._attributes.half4_0)
return data_view.get()
@half4_0.setter
def half4_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.half4_0)
data_view.set(value)
@property
def half4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.half4_arr_0)
return data_view.get(reserved_element_count=self.half4_arr_0_size)
@half4_arr_0.setter
def half4_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.half4_arr_0)
data_view.set(value)
self.half4_arr_0_size = data_view.get_array_size()
@property
def half_0(self):
data_view = og.AttributeValueHelper(self._attributes.half_0)
return data_view.get()
@half_0.setter
def half_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.half_0)
data_view.set(value)
@property
def half_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.half_arr_0)
return data_view.get(reserved_element_count=self.half_arr_0_size)
@half_arr_0.setter
def half_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.half_arr_0)
data_view.set(value)
self.half_arr_0_size = data_view.get_array_size()
@property
def int2_0(self):
data_view = og.AttributeValueHelper(self._attributes.int2_0)
return data_view.get()
@int2_0.setter
def int2_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.int2_0)
data_view.set(value)
@property
def int2_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.int2_arr_0)
return data_view.get(reserved_element_count=self.int2_arr_0_size)
@int2_arr_0.setter
def int2_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.int2_arr_0)
data_view.set(value)
self.int2_arr_0_size = data_view.get_array_size()
@property
def int3_0(self):
data_view = og.AttributeValueHelper(self._attributes.int3_0)
return data_view.get()
@int3_0.setter
def int3_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.int3_0)
data_view.set(value)
@property
def int3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.int3_arr_0)
return data_view.get(reserved_element_count=self.int3_arr_0_size)
@int3_arr_0.setter
def int3_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.int3_arr_0)
data_view.set(value)
self.int3_arr_0_size = data_view.get_array_size()
@property
def int4_0(self):
data_view = og.AttributeValueHelper(self._attributes.int4_0)
return data_view.get()
@int4_0.setter
def int4_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.int4_0)
data_view.set(value)
@property
def int4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.int4_arr_0)
return data_view.get(reserved_element_count=self.int4_arr_0_size)
@int4_arr_0.setter
def int4_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.int4_arr_0)
data_view.set(value)
self.int4_arr_0_size = data_view.get_array_size()
@property
def int64_0(self):
data_view = og.AttributeValueHelper(self._attributes.int64_0)
return data_view.get()
@int64_0.setter
def int64_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.int64_0)
data_view.set(value)
@property
def int64_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.int64_arr_0)
return data_view.get(reserved_element_count=self.int64_arr_0_size)
@int64_arr_0.setter
def int64_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.int64_arr_0)
data_view.set(value)
self.int64_arr_0_size = data_view.get_array_size()
@property
def int_0(self):
data_view = og.AttributeValueHelper(self._attributes.int_0)
return data_view.get()
@int_0.setter
def int_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.int_0)
data_view.set(value)
@property
def int_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.int_arr_0)
return data_view.get(reserved_element_count=self.int_arr_0_size)
@int_arr_0.setter
def int_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.int_arr_0)
data_view.set(value)
self.int_arr_0_size = data_view.get_array_size()
@property
def matrixd2_0(self):
data_view = og.AttributeValueHelper(self._attributes.matrixd2_0)
return data_view.get()
@matrixd2_0.setter
def matrixd2_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.matrixd2_0)
data_view.set(value)
@property
def matrixd2_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.matrixd2_arr_0)
return data_view.get(reserved_element_count=self.matrixd2_arr_0_size)
@matrixd2_arr_0.setter
def matrixd2_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.matrixd2_arr_0)
data_view.set(value)
self.matrixd2_arr_0_size = data_view.get_array_size()
@property
def matrixd3_0(self):
data_view = og.AttributeValueHelper(self._attributes.matrixd3_0)
return data_view.get()
@matrixd3_0.setter
def matrixd3_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.matrixd3_0)
data_view.set(value)
@property
def matrixd3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.matrixd3_arr_0)
return data_view.get(reserved_element_count=self.matrixd3_arr_0_size)
@matrixd3_arr_0.setter
def matrixd3_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.matrixd3_arr_0)
data_view.set(value)
self.matrixd3_arr_0_size = data_view.get_array_size()
@property
def matrixd4_0(self):
data_view = og.AttributeValueHelper(self._attributes.matrixd4_0)
return data_view.get()
@matrixd4_0.setter
def matrixd4_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.matrixd4_0)
data_view.set(value)
@property
def matrixd4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.matrixd4_arr_0)
return data_view.get(reserved_element_count=self.matrixd4_arr_0_size)
@matrixd4_arr_0.setter
def matrixd4_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.matrixd4_arr_0)
data_view.set(value)
self.matrixd4_arr_0_size = data_view.get_array_size()
@property
def normald3_0(self):
data_view = og.AttributeValueHelper(self._attributes.normald3_0)
return data_view.get()
@normald3_0.setter
def normald3_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.normald3_0)
data_view.set(value)
@property
def normald3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.normald3_arr_0)
return data_view.get(reserved_element_count=self.normald3_arr_0_size)
@normald3_arr_0.setter
def normald3_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.normald3_arr_0)
data_view.set(value)
self.normald3_arr_0_size = data_view.get_array_size()
@property
def normalf3_0(self):
data_view = og.AttributeValueHelper(self._attributes.normalf3_0)
return data_view.get()
@normalf3_0.setter
def normalf3_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.normalf3_0)
data_view.set(value)
@property
def normalf3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.normalf3_arr_0)
return data_view.get(reserved_element_count=self.normalf3_arr_0_size)
@normalf3_arr_0.setter
def normalf3_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.normalf3_arr_0)
data_view.set(value)
self.normalf3_arr_0_size = data_view.get_array_size()
@property
def normalh3_0(self):
data_view = og.AttributeValueHelper(self._attributes.normalh3_0)
return data_view.get()
@normalh3_0.setter
def normalh3_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.normalh3_0)
data_view.set(value)
@property
def normalh3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.normalh3_arr_0)
return data_view.get(reserved_element_count=self.normalh3_arr_0_size)
@normalh3_arr_0.setter
def normalh3_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.normalh3_arr_0)
data_view.set(value)
self.normalh3_arr_0_size = data_view.get_array_size()
@property
def pointd3_0(self):
data_view = og.AttributeValueHelper(self._attributes.pointd3_0)
return data_view.get()
@pointd3_0.setter
def pointd3_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.pointd3_0)
data_view.set(value)
@property
def pointd3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.pointd3_arr_0)
return data_view.get(reserved_element_count=self.pointd3_arr_0_size)
@pointd3_arr_0.setter
def pointd3_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.pointd3_arr_0)
data_view.set(value)
self.pointd3_arr_0_size = data_view.get_array_size()
@property
def pointf3_0(self):
data_view = og.AttributeValueHelper(self._attributes.pointf3_0)
return data_view.get()
@pointf3_0.setter
def pointf3_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.pointf3_0)
data_view.set(value)
@property
def pointf3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.pointf3_arr_0)
return data_view.get(reserved_element_count=self.pointf3_arr_0_size)
@pointf3_arr_0.setter
def pointf3_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.pointf3_arr_0)
data_view.set(value)
self.pointf3_arr_0_size = data_view.get_array_size()
@property
def pointh3_0(self):
data_view = og.AttributeValueHelper(self._attributes.pointh3_0)
return data_view.get()
@pointh3_0.setter
def pointh3_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.pointh3_0)
data_view.set(value)
@property
def pointh3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.pointh3_arr_0)
return data_view.get(reserved_element_count=self.pointh3_arr_0_size)
@pointh3_arr_0.setter
def pointh3_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.pointh3_arr_0)
data_view.set(value)
self.pointh3_arr_0_size = data_view.get_array_size()
@property
def quatd4_0(self):
data_view = og.AttributeValueHelper(self._attributes.quatd4_0)
return data_view.get()
@quatd4_0.setter
def quatd4_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.quatd4_0)
data_view.set(value)
@property
def quatd4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.quatd4_arr_0)
return data_view.get(reserved_element_count=self.quatd4_arr_0_size)
@quatd4_arr_0.setter
def quatd4_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.quatd4_arr_0)
data_view.set(value)
self.quatd4_arr_0_size = data_view.get_array_size()
@property
def quatf4_0(self):
data_view = og.AttributeValueHelper(self._attributes.quatf4_0)
return data_view.get()
@quatf4_0.setter
def quatf4_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.quatf4_0)
data_view.set(value)
@property
def quatf4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.quatf4_arr_0)
return data_view.get(reserved_element_count=self.quatf4_arr_0_size)
@quatf4_arr_0.setter
def quatf4_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.quatf4_arr_0)
data_view.set(value)
self.quatf4_arr_0_size = data_view.get_array_size()
@property
def quath4_0(self):
data_view = og.AttributeValueHelper(self._attributes.quath4_0)
return data_view.get()
@quath4_0.setter
def quath4_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.quath4_0)
data_view.set(value)
@property
def quath4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.quath4_arr_0)
return data_view.get(reserved_element_count=self.quath4_arr_0_size)
@quath4_arr_0.setter
def quath4_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.quath4_arr_0)
data_view.set(value)
self.quath4_arr_0_size = data_view.get_array_size()
@property
def texcoordd2_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordd2_0)
return data_view.get()
@texcoordd2_0.setter
def texcoordd2_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.texcoordd2_0)
data_view.set(value)
@property
def texcoordd2_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordd2_arr_0)
return data_view.get(reserved_element_count=self.texcoordd2_arr_0_size)
@texcoordd2_arr_0.setter
def texcoordd2_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.texcoordd2_arr_0)
data_view.set(value)
self.texcoordd2_arr_0_size = data_view.get_array_size()
@property
def texcoordd3_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordd3_0)
return data_view.get()
@texcoordd3_0.setter
def texcoordd3_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.texcoordd3_0)
data_view.set(value)
@property
def texcoordd3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordd3_arr_0)
return data_view.get(reserved_element_count=self.texcoordd3_arr_0_size)
@texcoordd3_arr_0.setter
def texcoordd3_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.texcoordd3_arr_0)
data_view.set(value)
self.texcoordd3_arr_0_size = data_view.get_array_size()
@property
def texcoordf2_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordf2_0)
return data_view.get()
@texcoordf2_0.setter
def texcoordf2_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.texcoordf2_0)
data_view.set(value)
@property
def texcoordf2_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordf2_arr_0)
return data_view.get(reserved_element_count=self.texcoordf2_arr_0_size)
@texcoordf2_arr_0.setter
def texcoordf2_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.texcoordf2_arr_0)
data_view.set(value)
self.texcoordf2_arr_0_size = data_view.get_array_size()
@property
def texcoordf3_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordf3_0)
return data_view.get()
@texcoordf3_0.setter
def texcoordf3_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.texcoordf3_0)
data_view.set(value)
@property
def texcoordf3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordf3_arr_0)
return data_view.get(reserved_element_count=self.texcoordf3_arr_0_size)
@texcoordf3_arr_0.setter
def texcoordf3_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.texcoordf3_arr_0)
data_view.set(value)
self.texcoordf3_arr_0_size = data_view.get_array_size()
@property
def texcoordh2_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordh2_0)
return data_view.get()
@texcoordh2_0.setter
def texcoordh2_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.texcoordh2_0)
data_view.set(value)
@property
def texcoordh2_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordh2_arr_0)
return data_view.get(reserved_element_count=self.texcoordh2_arr_0_size)
@texcoordh2_arr_0.setter
def texcoordh2_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.texcoordh2_arr_0)
data_view.set(value)
self.texcoordh2_arr_0_size = data_view.get_array_size()
@property
def texcoordh3_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordh3_0)
return data_view.get()
@texcoordh3_0.setter
def texcoordh3_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.texcoordh3_0)
data_view.set(value)
@property
def texcoordh3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.texcoordh3_arr_0)
return data_view.get(reserved_element_count=self.texcoordh3_arr_0_size)
@texcoordh3_arr_0.setter
def texcoordh3_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.texcoordh3_arr_0)
data_view.set(value)
self.texcoordh3_arr_0_size = data_view.get_array_size()
@property
def timecode_0(self):
data_view = og.AttributeValueHelper(self._attributes.timecode_0)
return data_view.get()
@timecode_0.setter
def timecode_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.timecode_0)
data_view.set(value)
@property
def timecode_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.timecode_arr_0)
return data_view.get(reserved_element_count=self.timecode_arr_0_size)
@timecode_arr_0.setter
def timecode_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.timecode_arr_0)
data_view.set(value)
self.timecode_arr_0_size = data_view.get_array_size()
@property
def token_0(self):
data_view = og.AttributeValueHelper(self._attributes.token_0)
return data_view.get()
@token_0.setter
def token_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.token_0)
data_view.set(value)
@property
def token_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.token_arr_0)
return data_view.get(reserved_element_count=self.token_arr_0_size)
@token_arr_0.setter
def token_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.token_arr_0)
data_view.set(value)
self.token_arr_0_size = data_view.get_array_size()
@property
def transform4_0(self):
data_view = og.AttributeValueHelper(self._attributes.transform4_0)
return data_view.get()
@transform4_0.setter
def transform4_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.transform4_0)
data_view.set(value)
@property
def transform4_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.transform4_arr_0)
return data_view.get(reserved_element_count=self.transform4_arr_0_size)
@transform4_arr_0.setter
def transform4_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.transform4_arr_0)
data_view.set(value)
self.transform4_arr_0_size = data_view.get_array_size()
@property
def uchar_0(self):
data_view = og.AttributeValueHelper(self._attributes.uchar_0)
return data_view.get()
@uchar_0.setter
def uchar_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.uchar_0)
data_view.set(value)
@property
def uchar_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.uchar_arr_0)
return data_view.get(reserved_element_count=self.uchar_arr_0_size)
@uchar_arr_0.setter
def uchar_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.uchar_arr_0)
data_view.set(value)
self.uchar_arr_0_size = data_view.get_array_size()
@property
def uint64_0(self):
data_view = og.AttributeValueHelper(self._attributes.uint64_0)
return data_view.get()
@uint64_0.setter
def uint64_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.uint64_0)
data_view.set(value)
@property
def uint64_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.uint64_arr_0)
return data_view.get(reserved_element_count=self.uint64_arr_0_size)
@uint64_arr_0.setter
def uint64_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.uint64_arr_0)
data_view.set(value)
self.uint64_arr_0_size = data_view.get_array_size()
@property
def uint_0(self):
data_view = og.AttributeValueHelper(self._attributes.uint_0)
return data_view.get()
@uint_0.setter
def uint_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.uint_0)
data_view.set(value)
@property
def uint_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.uint_arr_0)
return data_view.get(reserved_element_count=self.uint_arr_0_size)
@uint_arr_0.setter
def uint_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.uint_arr_0)
data_view.set(value)
self.uint_arr_0_size = data_view.get_array_size()
@property
def vectord3_0(self):
data_view = og.AttributeValueHelper(self._attributes.vectord3_0)
return data_view.get()
@vectord3_0.setter
def vectord3_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.vectord3_0)
data_view.set(value)
@property
def vectord3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.vectord3_arr_0)
return data_view.get(reserved_element_count=self.vectord3_arr_0_size)
@vectord3_arr_0.setter
def vectord3_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.vectord3_arr_0)
data_view.set(value)
self.vectord3_arr_0_size = data_view.get_array_size()
@property
def vectorf3_0(self):
data_view = og.AttributeValueHelper(self._attributes.vectorf3_0)
return data_view.get()
@vectorf3_0.setter
def vectorf3_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.vectorf3_0)
data_view.set(value)
@property
def vectorf3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.vectorf3_arr_0)
return data_view.get(reserved_element_count=self.vectorf3_arr_0_size)
@vectorf3_arr_0.setter
def vectorf3_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.vectorf3_arr_0)
data_view.set(value)
self.vectorf3_arr_0_size = data_view.get_array_size()
@property
def vectorh3_0(self):
data_view = og.AttributeValueHelper(self._attributes.vectorh3_0)
return data_view.get()
@vectorh3_0.setter
def vectorh3_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.vectorh3_0)
data_view.set(value)
@property
def vectorh3_arr_0(self):
data_view = og.AttributeValueHelper(self._attributes.vectorh3_arr_0)
return data_view.get(reserved_element_count=self.vectorh3_arr_0_size)
@vectorh3_arr_0.setter
def vectorh3_arr_0(self, value):
data_view = og.AttributeValueHelper(self._attributes.vectorh3_arr_0)
data_view.set(value)
self.vectorh3_arr_0_size = data_view.get_array_size()
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnUniversalAddDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnUniversalAddDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnUniversalAddDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 215,357 | Python | 45.413362 | 295 | 0.589226 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnExampleSimpleDeformerDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.SimpleDeformer
This is an example of a simple deformer. It calculates a sine wave and deforms the input geometry with it
"""
import numpy
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnExampleSimpleDeformerDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.SimpleDeformer
Class Members:
node: Node being evaluated
Attribute Value Properties:
Inputs:
inputs.multiplier
inputs.points
inputs.wavelength
Outputs:
outputs.points
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
('inputs:multiplier', 'float', 0, None, 'The multiplier for the amplitude of the sine wave', {ogn.MetadataKeys.DEFAULT: '1'}, True, 1, False, ''),
('inputs:points', 'point3f[]', 0, None, 'The input points to be deformed', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:wavelength', 'float', 0, None, 'The wavelength of the sine wave', {ogn.MetadataKeys.DEFAULT: '1'}, True, 1, False, ''),
('outputs:points', 'point3f[]', 0, None, 'The deformed output points', {}, True, None, False, ''),
])
@classmethod
def _populate_role_data(cls):
"""Populate a role structure with the non-default roles on this node type"""
role_data = super()._populate_role_data()
role_data.inputs.points = og.AttributeRole.POSITION
role_data.outputs.points = og.AttributeRole.POSITION
return role_data
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
@property
def multiplier(self):
data_view = og.AttributeValueHelper(self._attributes.multiplier)
return data_view.get()
@multiplier.setter
def multiplier(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.multiplier)
data_view = og.AttributeValueHelper(self._attributes.multiplier)
data_view.set(value)
@property
def points(self):
data_view = og.AttributeValueHelper(self._attributes.points)
return data_view.get()
@points.setter
def points(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.points)
data_view = og.AttributeValueHelper(self._attributes.points)
data_view.set(value)
self.points_size = data_view.get_array_size()
@property
def wavelength(self):
data_view = og.AttributeValueHelper(self._attributes.wavelength)
return data_view.get()
@wavelength.setter
def wavelength(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.wavelength)
data_view = og.AttributeValueHelper(self._attributes.wavelength)
data_view.set(value)
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self.points_size = None
self._batchedWriteValues = { }
@property
def points(self):
data_view = og.AttributeValueHelper(self._attributes.points)
return data_view.get(reserved_element_count=self.points_size)
@points.setter
def points(self, value):
data_view = og.AttributeValueHelper(self._attributes.points)
data_view.set(value)
self.points_size = data_view.get_array_size()
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnExampleSimpleDeformerDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnExampleSimpleDeformerDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnExampleSimpleDeformerDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 6,911 | Python | 45.389261 | 154 | 0.660107 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnGpuInteropAdjustExposureDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.GpuInteropAdjustExposure
RTX Renderer Postprocess Example (Exposure Adjustment)
"""
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnGpuInteropAdjustExposureDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.GpuInteropAdjustExposure
Class Members:
node: Node being evaluated
Attribute Value Properties:
Inputs:
inputs.cudaMipmappedArray
inputs.exposure
inputs.format
inputs.height
inputs.hydraTime
inputs.mipCount
inputs.simTime
inputs.stream
inputs.width
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
('inputs:cudaMipmappedArray', 'uint64', 0, 'cudaMipmappedArray', 'Pointer to the CUDA Mipmapped Array', {}, True, 0, False, ''),
('inputs:exposure', 'float', 0, 'exposure', 'Exposure value (in stops)', {}, True, 0.0, False, ''),
('inputs:format', 'uint64', 0, 'format', 'Format', {}, True, 0, False, ''),
('inputs:height', 'uint', 0, 'height', 'Height', {}, True, 0, False, ''),
('inputs:hydraTime', 'double', 0, 'hydraTime', 'Hydra time in stage', {}, True, 0.0, False, ''),
('inputs:mipCount', 'uint', 0, 'mipCount', 'Mip Count', {}, True, 0, False, ''),
('inputs:simTime', 'double', 0, 'simTime', 'Simulation time', {}, True, 0.0, False, ''),
('inputs:stream', 'uint64', 0, 'stream', 'Pointer to the CUDA Stream', {}, True, 0, False, ''),
('inputs:width', 'uint', 0, 'width', 'Width', {}, True, 0, False, ''),
])
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
@property
def cudaMipmappedArray(self):
data_view = og.AttributeValueHelper(self._attributes.cudaMipmappedArray)
return data_view.get()
@cudaMipmappedArray.setter
def cudaMipmappedArray(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.cudaMipmappedArray)
data_view = og.AttributeValueHelper(self._attributes.cudaMipmappedArray)
data_view.set(value)
@property
def exposure(self):
data_view = og.AttributeValueHelper(self._attributes.exposure)
return data_view.get()
@exposure.setter
def exposure(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.exposure)
data_view = og.AttributeValueHelper(self._attributes.exposure)
data_view.set(value)
@property
def format(self):
data_view = og.AttributeValueHelper(self._attributes.format)
return data_view.get()
@format.setter
def format(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.format)
data_view = og.AttributeValueHelper(self._attributes.format)
data_view.set(value)
@property
def height(self):
data_view = og.AttributeValueHelper(self._attributes.height)
return data_view.get()
@height.setter
def height(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.height)
data_view = og.AttributeValueHelper(self._attributes.height)
data_view.set(value)
@property
def hydraTime(self):
data_view = og.AttributeValueHelper(self._attributes.hydraTime)
return data_view.get()
@hydraTime.setter
def hydraTime(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.hydraTime)
data_view = og.AttributeValueHelper(self._attributes.hydraTime)
data_view.set(value)
@property
def mipCount(self):
data_view = og.AttributeValueHelper(self._attributes.mipCount)
return data_view.get()
@mipCount.setter
def mipCount(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.mipCount)
data_view = og.AttributeValueHelper(self._attributes.mipCount)
data_view.set(value)
@property
def simTime(self):
data_view = og.AttributeValueHelper(self._attributes.simTime)
return data_view.get()
@simTime.setter
def simTime(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.simTime)
data_view = og.AttributeValueHelper(self._attributes.simTime)
data_view.set(value)
@property
def stream(self):
data_view = og.AttributeValueHelper(self._attributes.stream)
return data_view.get()
@stream.setter
def stream(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.stream)
data_view = og.AttributeValueHelper(self._attributes.stream)
data_view.set(value)
@property
def width(self):
data_view = og.AttributeValueHelper(self._attributes.width)
return data_view.get()
@width.setter
def width(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.width)
data_view = og.AttributeValueHelper(self._attributes.width)
data_view.set(value)
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedWriteValues = { }
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnGpuInteropAdjustExposureDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnGpuInteropAdjustExposureDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnGpuInteropAdjustExposureDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 9,075 | Python | 42.634615 | 136 | 0.63427 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnGpuInteropCpuToDiskDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.GpuInteropCpuToDisk
Saves specified CPU buffer to disk
"""
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnGpuInteropCpuToDiskDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.GpuInteropCpuToDisk
Class Members:
node: Node being evaluated
Attribute Value Properties:
Inputs:
inputs.active
inputs.aovCpu
inputs.aovGpu
inputs.autoFileNumber
inputs.fileName
inputs.fileNumber
inputs.fileType
inputs.frameCount
inputs.gpu
inputs.maxInflightWrites
inputs.rp
inputs.saveFlags
inputs.saveLocation
inputs.startFrame
Outputs:
outputs.gpu
outputs.rp
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
('inputs:active', 'bool', 0, 'activeReset', 'Alternative to frameCount/startFrame, does a single frame then autoResets to false', {ogn.MetadataKeys.DEFAULT: 'false'}, True, False, False, ''),
('inputs:aovCpu', 'string', 0, 'aovCpu', 'Name of AOV representing CPU buffer of GPU resource', {ogn.MetadataKeys.DEFAULT: '""'}, True, "", False, ''),
('inputs:aovGpu', 'string', 0, 'aovGpu', 'Name of AOV representing GPU resource, used for querying format + properties', {ogn.MetadataKeys.DEFAULT: '""'}, True, "", False, ''),
('inputs:autoFileNumber', 'int', 0, 'autoFileNumber', 'If non zero, this number will be the starting number for export. Each invocation of this node increases the number by 1.', {ogn.MetadataKeys.DEFAULT: '-1'}, True, -1, False, ''),
('inputs:fileName', 'string', 0, 'fileName', 'Optional, if specified the output filename will be fileName_{aovGpu}.{fileType}', {ogn.MetadataKeys.DEFAULT: '""'}, True, "", False, ''),
('inputs:fileNumber', 'int', 0, 'fileNumber', "Number that will be appended to the exported filename. If -1 then the render product's frame number will be used.", {ogn.MetadataKeys.DEFAULT: '-1'}, True, -1, False, ''),
('inputs:fileType', 'string', 0, 'fileType', 'bmp,png,exr', {ogn.MetadataKeys.DEFAULT: '"png"'}, True, "png", False, ''),
('inputs:frameCount', 'int64', 0, 'frameCount', 'Number of frames to capture (-1 means never stop)', {ogn.MetadataKeys.DEFAULT: '-1'}, True, -1, False, ''),
('inputs:gpu', 'uint64', 0, 'gpuFoundations', 'Pointer to shared context containing gpu foundations', {}, True, 0, False, ''),
('inputs:maxInflightWrites', 'int', 0, 'maxInflightWrites', 'Maximum number of in-flight file write operations before blocking on file i/o', {ogn.MetadataKeys.DEFAULT: '2'}, True, 2, False, ''),
('inputs:rp', 'uint64', 0, 'renderProduct', 'Pointer to render product for this view', {}, True, 0, False, ''),
('inputs:saveFlags', 'uint64', 0, 'saveFlags', 'Flags that will be passed to carb::imaging::IImaging for file saving.', {ogn.MetadataKeys.DEFAULT: '0'}, True, 0, False, ''),
('inputs:saveLocation', 'string', 0, 'saveLocation', 'Folder to save AOVs as AOV_FrameNumber.{exr,png}', {ogn.MetadataKeys.DEFAULT: '""'}, True, "", False, ''),
('inputs:startFrame', 'uint64', 0, 'startFrame', 'Frame to begin saving to disk', {ogn.MetadataKeys.DEFAULT: '0'}, True, 0, False, ''),
('outputs:gpu', 'uint64', 0, 'gpuFoundations', 'Pointer to shared context containing gpu foundations', {}, True, None, False, ''),
('outputs:rp', 'uint64', 0, 'renderProduct', 'Pointer to render product for this view', {}, True, None, False, ''),
])
@classmethod
def _populate_role_data(cls):
"""Populate a role structure with the non-default roles on this node type"""
role_data = super()._populate_role_data()
role_data.inputs.aovCpu = og.AttributeRole.TEXT
role_data.inputs.aovGpu = og.AttributeRole.TEXT
role_data.inputs.fileName = og.AttributeRole.TEXT
role_data.inputs.fileType = og.AttributeRole.TEXT
role_data.inputs.saveLocation = og.AttributeRole.TEXT
return role_data
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
@property
def active(self):
data_view = og.AttributeValueHelper(self._attributes.active)
return data_view.get()
@active.setter
def active(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.active)
data_view = og.AttributeValueHelper(self._attributes.active)
data_view.set(value)
@property
def aovCpu(self):
data_view = og.AttributeValueHelper(self._attributes.aovCpu)
return data_view.get()
@aovCpu.setter
def aovCpu(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.aovCpu)
data_view = og.AttributeValueHelper(self._attributes.aovCpu)
data_view.set(value)
self.aovCpu_size = data_view.get_array_size()
@property
def aovGpu(self):
data_view = og.AttributeValueHelper(self._attributes.aovGpu)
return data_view.get()
@aovGpu.setter
def aovGpu(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.aovGpu)
data_view = og.AttributeValueHelper(self._attributes.aovGpu)
data_view.set(value)
self.aovGpu_size = data_view.get_array_size()
@property
def autoFileNumber(self):
data_view = og.AttributeValueHelper(self._attributes.autoFileNumber)
return data_view.get()
@autoFileNumber.setter
def autoFileNumber(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.autoFileNumber)
data_view = og.AttributeValueHelper(self._attributes.autoFileNumber)
data_view.set(value)
@property
def fileName(self):
data_view = og.AttributeValueHelper(self._attributes.fileName)
return data_view.get()
@fileName.setter
def fileName(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.fileName)
data_view = og.AttributeValueHelper(self._attributes.fileName)
data_view.set(value)
self.fileName_size = data_view.get_array_size()
@property
def fileNumber(self):
data_view = og.AttributeValueHelper(self._attributes.fileNumber)
return data_view.get()
@fileNumber.setter
def fileNumber(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.fileNumber)
data_view = og.AttributeValueHelper(self._attributes.fileNumber)
data_view.set(value)
@property
def fileType(self):
data_view = og.AttributeValueHelper(self._attributes.fileType)
return data_view.get()
@fileType.setter
def fileType(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.fileType)
data_view = og.AttributeValueHelper(self._attributes.fileType)
data_view.set(value)
self.fileType_size = data_view.get_array_size()
@property
def frameCount(self):
data_view = og.AttributeValueHelper(self._attributes.frameCount)
return data_view.get()
@frameCount.setter
def frameCount(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.frameCount)
data_view = og.AttributeValueHelper(self._attributes.frameCount)
data_view.set(value)
@property
def gpu(self):
data_view = og.AttributeValueHelper(self._attributes.gpu)
return data_view.get()
@gpu.setter
def gpu(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.gpu)
data_view = og.AttributeValueHelper(self._attributes.gpu)
data_view.set(value)
@property
def maxInflightWrites(self):
data_view = og.AttributeValueHelper(self._attributes.maxInflightWrites)
return data_view.get()
@maxInflightWrites.setter
def maxInflightWrites(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.maxInflightWrites)
data_view = og.AttributeValueHelper(self._attributes.maxInflightWrites)
data_view.set(value)
@property
def rp(self):
data_view = og.AttributeValueHelper(self._attributes.rp)
return data_view.get()
@rp.setter
def rp(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.rp)
data_view = og.AttributeValueHelper(self._attributes.rp)
data_view.set(value)
@property
def saveFlags(self):
data_view = og.AttributeValueHelper(self._attributes.saveFlags)
return data_view.get()
@saveFlags.setter
def saveFlags(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.saveFlags)
data_view = og.AttributeValueHelper(self._attributes.saveFlags)
data_view.set(value)
@property
def saveLocation(self):
data_view = og.AttributeValueHelper(self._attributes.saveLocation)
return data_view.get()
@saveLocation.setter
def saveLocation(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.saveLocation)
data_view = og.AttributeValueHelper(self._attributes.saveLocation)
data_view.set(value)
self.saveLocation_size = data_view.get_array_size()
@property
def startFrame(self):
data_view = og.AttributeValueHelper(self._attributes.startFrame)
return data_view.get()
@startFrame.setter
def startFrame(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.startFrame)
data_view = og.AttributeValueHelper(self._attributes.startFrame)
data_view.set(value)
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedWriteValues = { }
@property
def gpu(self):
data_view = og.AttributeValueHelper(self._attributes.gpu)
return data_view.get()
@gpu.setter
def gpu(self, value):
data_view = og.AttributeValueHelper(self._attributes.gpu)
data_view.set(value)
@property
def rp(self):
data_view = og.AttributeValueHelper(self._attributes.rp)
return data_view.get()
@rp.setter
def rp(self, value):
data_view = og.AttributeValueHelper(self._attributes.rp)
data_view.set(value)
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnGpuInteropCpuToDiskDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnGpuInteropCpuToDiskDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnGpuInteropCpuToDiskDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 14,661 | Python | 44.962382 | 241 | 0.632153 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnSimpleGatherDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.SimpleGather
Example node to illustrate use of a gather
"""
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
import numpy
class OgnSimpleGatherDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.SimpleGather
Class Members:
node: Node being evaluated
Attribute Value Properties:
Inputs:
inputs.input0
inputs.multiplier
Outputs:
outputs.output0
"""
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
('inputs:input0', 'float[]', 0, 'Gathered Input', 'Array of floats to be gathered', {}, True, [], False, ''),
('inputs:multiplier', 'float', 0, 'Multiplier', 'Multiplication factor for all gathered values', {}, True, 0.0, False, ''),
('outputs:output0', 'double[]', 0, 'Gathered Products', 'Array of products resulting from the gathered values', {}, True, None, False, ''),
])
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = {"multiplier", "_setting_locked", "_batchedReadAttributes", "_batchedReadValues"}
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = [self._attributes.multiplier]
self._batchedReadValues = [0.0]
@property
def input0(self):
data_view = og.AttributeValueHelper(self._attributes.input0)
return data_view.get()
@input0.setter
def input0(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.input0)
data_view = og.AttributeValueHelper(self._attributes.input0)
data_view.set(value)
self.input0_size = data_view.get_array_size()
@property
def multiplier(self):
return self._batchedReadValues[0]
@multiplier.setter
def multiplier(self, value):
self._batchedReadValues[0] = value
def __getattr__(self, item: str):
if item in self.LOCAL_PROPERTY_NAMES:
return object.__getattribute__(self, item)
else:
return super().__getattr__(item)
def __setattr__(self, item: str, new_value):
if item in self.LOCAL_PROPERTY_NAMES:
object.__setattr__(self, item, new_value)
else:
super().__setattr__(item, new_value)
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self.output0_size = None
self._batchedWriteValues = { }
@property
def output0(self):
data_view = og.AttributeValueHelper(self._attributes.output0)
return data_view.get(reserved_element_count=self.output0_size)
@output0.setter
def output0(self, value):
data_view = og.AttributeValueHelper(self._attributes.output0)
data_view.set(value)
self.output0_size = data_view.get_array_size()
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnSimpleGatherDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnSimpleGatherDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnSimpleGatherDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 6,034 | Python | 48.876033 | 147 | 0.655121 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnIKDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.SimpleIk
Example node that employs a simple IK algorithm to match a three-joint limb to a goal
"""
import numpy
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnIKDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.SimpleIk
Class Members:
node: Node being evaluated
Attribute Value Properties:
Inputs:
inputs.goal
State:
state.ankle
state.hip
state.knee
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
('inputs:goal', 'matrix4d', 0, 'Goal Transform', 'Transform of the IK goal', {}, True, [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]], False, ''),
('state:ankle', 'matrix4d', 0, 'Ankle Transform', 'Computed transform of the ankle joint', {}, True, None, False, ''),
('state:hip', 'matrix4d', 0, 'Hip Transform', 'Computed transform of the hip joint', {}, True, None, False, ''),
('state:knee', 'matrix4d', 0, 'Knee Transform', 'Computed transform of the knee joint', {}, True, None, False, ''),
])
@classmethod
def _populate_role_data(cls):
"""Populate a role structure with the non-default roles on this node type"""
role_data = super()._populate_role_data()
role_data.inputs.goal = og.AttributeRole.MATRIX
role_data.state.ankle = og.AttributeRole.MATRIX
role_data.state.hip = og.AttributeRole.MATRIX
role_data.state.knee = og.AttributeRole.MATRIX
return role_data
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
@property
def goal(self):
data_view = og.AttributeValueHelper(self._attributes.goal)
return data_view.get()
@goal.setter
def goal(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.goal)
data_view = og.AttributeValueHelper(self._attributes.goal)
data_view.set(value)
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedWriteValues = { }
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
@property
def ankle(self):
data_view = og.AttributeValueHelper(self._attributes.ankle)
return data_view.get()
@ankle.setter
def ankle(self, value):
data_view = og.AttributeValueHelper(self._attributes.ankle)
data_view.set(value)
@property
def hip(self):
data_view = og.AttributeValueHelper(self._attributes.hip)
return data_view.get()
@hip.setter
def hip(self, value):
data_view = og.AttributeValueHelper(self._attributes.hip)
data_view.set(value)
@property
def knee(self):
data_view = og.AttributeValueHelper(self._attributes.knee)
return data_view.get()
@knee.setter
def knee(self, value):
data_view = og.AttributeValueHelper(self._attributes.knee)
data_view.set(value)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnIKDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnIKDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnIKDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 6,427 | Python | 43.638889 | 196 | 0.648047 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnExampleExtractFloat3ArrayDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.ExtractFloat3Array
Outputs a float[3][] attribute extracted from a bundle.
"""
import numpy
import carb
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnExampleExtractFloat3ArrayDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.ExtractFloat3Array
Class Members:
node: Node being evaluated
Attribute Value Properties:
Inputs:
inputs.input
inputs.nameOfAttribute
Outputs:
outputs.output
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
('inputs:input', 'bundle', 0, None, "Bundle containing a float[3][] attribute to be extracted to 'output'", {}, True, None, False, ''),
('inputs:nameOfAttribute', 'token', 0, None, "Name of the attribute in 'input' that is to be extracted to 'output'", {}, True, "", False, ''),
('outputs:output', 'float3[]', 0, None, "The float[3][] attribute extracted from 'input'", {}, True, None, False, ''),
])
@classmethod
def _populate_role_data(cls):
"""Populate a role structure with the non-default roles on this node type"""
role_data = super()._populate_role_data()
role_data.inputs.input = og.AttributeRole.BUNDLE
return role_data
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self.__bundles = og.BundleContainer(context, node, attributes, [], read_only=True, gpu_ptr_kinds={})
self._batchedReadAttributes = []
self._batchedReadValues = []
@property
def input(self) -> og.BundleContents:
"""Get the bundle wrapper class for the attribute inputs.input"""
return self.__bundles.input
@property
def nameOfAttribute(self):
data_view = og.AttributeValueHelper(self._attributes.nameOfAttribute)
return data_view.get()
@nameOfAttribute.setter
def nameOfAttribute(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.nameOfAttribute)
data_view = og.AttributeValueHelper(self._attributes.nameOfAttribute)
data_view.set(value)
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self.output_size = None
self._batchedWriteValues = { }
@property
def output(self):
data_view = og.AttributeValueHelper(self._attributes.output)
return data_view.get(reserved_element_count=self.output_size)
@output.setter
def output(self, value):
data_view = og.AttributeValueHelper(self._attributes.output)
data_view.set(value)
self.output_size = data_view.get_array_size()
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnExampleExtractFloat3ArrayDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnExampleExtractFloat3ArrayDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnExampleExtractFloat3ArrayDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 6,099 | Python | 46.65625 | 150 | 0.67011 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnGpuInteropGpuToCpuCopyDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.GpuInteropGpuToCpuCopy
Generates a new AOV representing a CPU copy of a GPU buffer
"""
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnGpuInteropGpuToCpuCopyDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.GpuInteropGpuToCpuCopy
Class Members:
node: Node being evaluated
Attribute Value Properties:
Inputs:
inputs.aovGpu
inputs.gpu
inputs.rp
Outputs:
outputs.aovCpu
outputs.gpu
outputs.rp
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
('inputs:aovGpu', 'string', 0, 'aovGpu', 'Name of AOV to copy from GPU to CPU', {ogn.MetadataKeys.DEFAULT: '""'}, True, "", False, ''),
('inputs:gpu', 'uint64', 0, 'gpuFoundations', 'Pointer to shared context containing gpu foundations', {}, True, 0, False, ''),
('inputs:rp', 'uint64', 0, 'renderProduct', 'Pointer to render product for this view', {}, True, 0, False, ''),
('outputs:aovCpu', 'string', 0, 'aovCpu', 'Name of AOV representing CPU buffer of GPU resource', {ogn.MetadataKeys.DEFAULT: '""'}, True, "", False, ''),
('outputs:gpu', 'uint64', 0, 'gpuFoundations', 'Pointer to shared context containing gpu foundations', {}, True, None, False, ''),
('outputs:rp', 'uint64', 0, 'renderProduct', 'Pointer to render product for this view', {}, True, None, False, ''),
])
@classmethod
def _populate_role_data(cls):
"""Populate a role structure with the non-default roles on this node type"""
role_data = super()._populate_role_data()
role_data.inputs.aovGpu = og.AttributeRole.TEXT
role_data.outputs.aovCpu = og.AttributeRole.TEXT
return role_data
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
@property
def aovGpu(self):
data_view = og.AttributeValueHelper(self._attributes.aovGpu)
return data_view.get()
@aovGpu.setter
def aovGpu(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.aovGpu)
data_view = og.AttributeValueHelper(self._attributes.aovGpu)
data_view.set(value)
self.aovGpu_size = data_view.get_array_size()
@property
def gpu(self):
data_view = og.AttributeValueHelper(self._attributes.gpu)
return data_view.get()
@gpu.setter
def gpu(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.gpu)
data_view = og.AttributeValueHelper(self._attributes.gpu)
data_view.set(value)
@property
def rp(self):
data_view = og.AttributeValueHelper(self._attributes.rp)
return data_view.get()
@rp.setter
def rp(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.rp)
data_view = og.AttributeValueHelper(self._attributes.rp)
data_view.set(value)
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self.aovCpu_size = 0
self._batchedWriteValues = { }
@property
def aovCpu(self):
data_view = og.AttributeValueHelper(self._attributes.aovCpu)
return data_view.get(reserved_element_count=self.aovCpu_size)
@aovCpu.setter
def aovCpu(self, value):
data_view = og.AttributeValueHelper(self._attributes.aovCpu)
data_view.set(value)
self.aovCpu_size = data_view.get_array_size()
@property
def gpu(self):
data_view = og.AttributeValueHelper(self._attributes.gpu)
return data_view.get()
@gpu.setter
def gpu(self, value):
data_view = og.AttributeValueHelper(self._attributes.gpu)
data_view.set(value)
@property
def rp(self):
data_view = og.AttributeValueHelper(self._attributes.rp)
return data_view.get()
@rp.setter
def rp(self, value):
data_view = og.AttributeValueHelper(self._attributes.rp)
data_view.set(value)
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnGpuInteropGpuToCpuCopyDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnGpuInteropGpuToCpuCopyDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnGpuInteropGpuToCpuCopyDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 7,683 | Python | 43.674418 | 160 | 0.644019 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnDeformer2_GPUDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.Deformer2Gpu
Example deformer that limits the Z point positions to a threshold running on the GPU
"""
import numpy
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnDeformer2_GPUDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.Deformer2Gpu
Class Members:
node: Node being evaluated
Attribute Value Properties:
Inputs:
inputs.points
inputs.threshold
Outputs:
outputs.points
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
('inputs:points', 'point3f[]', 0, None, 'Set of points to be deformed', {}, True, [], False, ''),
('inputs:threshold', 'float', 0, None, 'Z value to limit points', {}, True, 0.0, False, ''),
('outputs:points', 'point3f[]', 0, None, 'Set of deformed points', {}, True, None, False, ''),
])
@classmethod
def _populate_role_data(cls):
"""Populate a role structure with the non-default roles on this node type"""
role_data = super()._populate_role_data()
role_data.inputs.points = og.AttributeRole.POSITION
role_data.outputs.points = og.AttributeRole.POSITION
return role_data
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
@property
def points(self):
data_view = og.AttributeValueHelper(self._attributes.points)
return data_view.get(on_gpu=True)
@points.setter
def points(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.points)
data_view = og.AttributeValueHelper(self._attributes.points)
data_view.set(value, on_gpu=True)
self.points_size = data_view.get_array_size()
@property
def threshold(self):
data_view = og.AttributeValueHelper(self._attributes.threshold)
return data_view.get(on_gpu=True)
@threshold.setter
def threshold(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.threshold)
data_view = og.AttributeValueHelper(self._attributes.threshold)
data_view.set(value, on_gpu=True)
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self.points_size = None
self._batchedWriteValues = { }
@property
def points(self):
data_view = og.AttributeValueHelper(self._attributes.points)
return data_view.get(reserved_element_count=self.points_size, on_gpu=True)
@points.setter
def points(self, value):
data_view = og.AttributeValueHelper(self._attributes.points)
data_view.set(value, on_gpu=True)
self.points_size = data_view.get_array_size()
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnDeformer2_GPUDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnDeformer2_GPUDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnDeformer2_GPUDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 6,220 | Python | 45.081481 | 115 | 0.661093 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnPrimDeformer1Database.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.PrimDeformer1
Example deformer node that applies a sine wave to a mesh, input via a Prim
"""
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnPrimDeformer1Database(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.PrimDeformer1
Class Members:
node: Node being evaluated
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
])
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedWriteValues = { }
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnPrimDeformer1Database.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnPrimDeformer1Database.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnPrimDeformer1Database.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 3,975 | Python | 49.329113 | 115 | 0.696352 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/OgnDeformerTimeBasedDatabase.py | """Support for simplified access to data on nodes of type omni.graph.examples.cpp.DeformerTimeBased
This is an example of a simple deformer with time based input to control a time dependent sine wave deformation.
"""
import numpy
import omni.graph.core as og
import omni.graph.core._omni_graph_core as _og
import omni.graph.tools.ogn as ogn
class OgnDeformerTimeBasedDatabase(og.Database):
"""Helper class providing simplified access to data on nodes of type omni.graph.examples.cpp.DeformerTimeBased
Class Members:
node: Node being evaluated
Attribute Value Properties:
Inputs:
inputs.multiplier
inputs.points
inputs.time
inputs.wavelength
Outputs:
outputs.points
"""
# Imprint the generator and target ABI versions in the file for JIT generation
GENERATOR_VERSION = (1, 41, 3)
TARGET_VERSION = (2, 139, 12)
# This is an internal object that provides per-class storage of a per-node data dictionary
PER_NODE_DATA = {}
# This is an internal object that describes unchanging attributes in a generic way
# The values in this list are in no particular order, as a per-attribute tuple
# Name, Type, ExtendedTypeIndex, UiName, Description, Metadata,
# Is_Required, DefaultValue, Is_Deprecated, DeprecationMsg
# You should not need to access any of this data directly, use the defined database interfaces
INTERFACE = og.Database._get_interface([
('inputs:multiplier', 'float', 0, None, 'The multiplier for the amplitude of the sine wave', {ogn.MetadataKeys.DEFAULT: '1'}, True, 1, False, ''),
('inputs:points', 'point3f[]', 0, None, 'The input points to be deformed', {ogn.MetadataKeys.DEFAULT: '[]'}, True, [], False, ''),
('inputs:time', 'double', 0, None, 'Time value to modulate the offset in sine curve evaluation', {ogn.MetadataKeys.DEFAULT: '0.0'}, True, 0.0, False, ''),
('inputs:wavelength', 'float', 0, None, 'The wavelength of the sine wave', {ogn.MetadataKeys.DEFAULT: '1'}, True, 1, False, ''),
('outputs:points', 'point3f[]', 0, None, 'The deformed output points', {}, True, None, False, ''),
])
@classmethod
def _populate_role_data(cls):
"""Populate a role structure with the non-default roles on this node type"""
role_data = super()._populate_role_data()
role_data.inputs.points = og.AttributeRole.POSITION
role_data.outputs.points = og.AttributeRole.POSITION
return role_data
class ValuesForInputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to input attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self._batchedReadAttributes = []
self._batchedReadValues = []
@property
def multiplier(self):
data_view = og.AttributeValueHelper(self._attributes.multiplier)
return data_view.get()
@multiplier.setter
def multiplier(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.multiplier)
data_view = og.AttributeValueHelper(self._attributes.multiplier)
data_view.set(value)
@property
def points(self):
data_view = og.AttributeValueHelper(self._attributes.points)
return data_view.get()
@points.setter
def points(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.points)
data_view = og.AttributeValueHelper(self._attributes.points)
data_view.set(value)
self.points_size = data_view.get_array_size()
@property
def time(self):
data_view = og.AttributeValueHelper(self._attributes.time)
return data_view.get()
@time.setter
def time(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.time)
data_view = og.AttributeValueHelper(self._attributes.time)
data_view.set(value)
@property
def wavelength(self):
data_view = og.AttributeValueHelper(self._attributes.wavelength)
return data_view.get()
@wavelength.setter
def wavelength(self, value):
if self._setting_locked:
raise og.ReadOnlyError(self._attributes.wavelength)
data_view = og.AttributeValueHelper(self._attributes.wavelength)
data_view.set(value)
def _prefetch(self):
readAttributes = self._batchedReadAttributes
newValues = _og._prefetch_input_attributes_data(readAttributes)
if len(readAttributes) == len(newValues):
self._batchedReadValues = newValues
class ValuesForOutputs(og.DynamicAttributeAccess):
LOCAL_PROPERTY_NAMES = { }
"""Helper class that creates natural hierarchical access to output attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
self.points_size = None
self._batchedWriteValues = { }
@property
def points(self):
data_view = og.AttributeValueHelper(self._attributes.points)
return data_view.get(reserved_element_count=self.points_size)
@points.setter
def points(self, value):
data_view = og.AttributeValueHelper(self._attributes.points)
data_view.set(value)
self.points_size = data_view.get_array_size()
def _commit(self):
_og._commit_output_attributes_data(self._batchedWriteValues)
self._batchedWriteValues = { }
class ValuesForState(og.DynamicAttributeAccess):
"""Helper class that creates natural hierarchical access to state attributes"""
def __init__(self, node: og.Node, attributes, dynamic_attributes: og.DynamicAttributeInterface):
"""Initialize simplified access for the attribute data"""
context = node.get_graph().get_default_graph_context()
super().__init__(context, node, attributes, dynamic_attributes)
def __init__(self, node):
super().__init__(node)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT)
self.inputs = OgnDeformerTimeBasedDatabase.ValuesForInputs(node, self.attributes.inputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT)
self.outputs = OgnDeformerTimeBasedDatabase.ValuesForOutputs(node, self.attributes.outputs, dynamic_attributes)
dynamic_attributes = self.dynamic_attribute_data(node, og.AttributePortType.ATTRIBUTE_PORT_TYPE_STATE)
self.state = OgnDeformerTimeBasedDatabase.ValuesForState(node, self.attributes.state, dynamic_attributes)
| 7,499 | Python | 45.01227 | 162 | 0.654087 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/tests/TestOgnBounce_CPU.py | import omni.kit.test
import omni.graph.core as og
import omni.graph.core.tests as ogts
import os
class TestOgn(ogts.OmniGraphTestCase):
async def test_data_access(self):
from omni.graph.examples.cpp.ogn.OgnBounce_CPUDatabase import OgnBounce_CPUDatabase
test_file_name = "OgnBounce_CPUTemplate.usda"
usd_path = os.path.join(os.path.dirname(__file__), "usd", test_file_name)
if not os.path.exists(usd_path):
self.assertTrue(False, f"{usd_path} not found for loading test")
(result, error) = await ogts.load_test_file(usd_path)
self.assertTrue(result, f'{error} on {usd_path}')
test_node = og.Controller.node("/TestGraph/Template_omni_graph_examples_cpp_BounceCpu")
database = OgnBounce_CPUDatabase(test_node)
self.assertTrue(test_node.is_valid())
node_type_name = test_node.get_type_name()
self.assertEqual(og.GraphRegistry().get_node_type_version(node_type_name), 1)
def _attr_error(attribute: og.Attribute, usd_test: bool) -> str:
test_type = "USD Load" if usd_test else "Database Access"
return f"{node_type_name} {test_type} Test - {attribute.get_name()} value error"
self.assertTrue(test_node.get_attribute_exists("inputs:gatheredData"))
attribute = test_node.get_attribute("inputs:gatheredData")
db_value = database.inputs.gatheredData
self.assertTrue(test_node.get_attribute_exists("outputs_gatheredData"))
attribute = test_node.get_attribute("outputs_gatheredData")
db_value = database.outputs.gatheredData
| 1,605 | Python | 44.885713 | 95 | 0.680997 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/tests/TestOgnDeformer1_CPU.py | import os
import omni.kit.test
import omni.graph.core as og
import omni.graph.core.tests as ogts
from omni.graph.core.tests.omnigraph_test_utils import _TestGraphAndNode
from omni.graph.core.tests.omnigraph_test_utils import _test_clear_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_setup_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_verify_scene
class TestOgn(ogts.OmniGraphTestCase):
TEST_DATA = [
{
'inputs': [
['inputs:points', [[2.0, -2.0, 3.0]], False],
],
'outputs': [
['outputs:points', [[2.0, -2.0, -2.73895]], False],
],
},
]
async def test_generated(self):
test_info = _TestGraphAndNode()
controller = og.Controller()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
test_info = await _test_setup_scene(self, controller, "/TestGraph", "TestNode_omni_graph_examples_cpp_Deformer1", "omni.graph.examples.cpp.Deformer1", test_run, test_info)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.examples.cpp.Deformer1 User test case #{i+1}")
async def test_vectorized_generated(self):
test_info = _TestGraphAndNode()
controller = og.Controller()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
test_info = await _test_setup_scene(self, controller, "/TestGraph", "TestNode_omni_graph_examples_cpp_Deformer1","omni.graph.examples.cpp.Deformer1", test_run, test_info, 16)
await controller.evaluate(test_info.graph)
_test_verify_scene(self, controller, test_run, test_info, f"omni.graph.examples.cpp.Deformer1 User test case #{i+1}", 16)
async def test_thread_safety(self):
import omni.kit
# Generate multiple instances of the test setup to run them concurrently
instance_setup = dict()
for n in range(24):
instance_setup[f"/TestGraph_{n}"] = _TestGraphAndNode()
for i, test_run in enumerate(self.TEST_DATA):
await _test_clear_scene(self, test_run)
for (key, test_info) in instance_setup.items():
test_info = await _test_setup_scene(self, og.Controller(allow_exists_prim=True), key, "TestNode_omni_graph_examples_cpp_Deformer1", "omni.graph.examples.cpp.Deformer1", test_run, test_info)
self.assertEqual(len(og.get_all_graphs()), 24)
# We want to evaluate all graphs concurrently. Kick them all.
# Evaluate multiple times to skip 2 serial frames and increase chances for a race condition.
for _ in range(10):
await omni.kit.app.get_app().next_update_async()
for (key, test_instance) in instance_setup.items():
_test_verify_scene(self, og.Controller(), test_run, test_info, f"omni.graph.examples.cpp.Deformer1 User test case #{i+1}, instance{key}")
async def test_data_access(self):
from omni.graph.examples.cpp.ogn.OgnDeformer1_CPUDatabase import OgnDeformer1_CPUDatabase
test_file_name = "OgnDeformer1_CPUTemplate.usda"
usd_path = os.path.join(os.path.dirname(__file__), "usd", test_file_name)
if not os.path.exists(usd_path):
self.assertTrue(False, f"{usd_path} not found for loading test")
(result, error) = await ogts.load_test_file(usd_path)
self.assertTrue(result, f'{error} on {usd_path}')
test_node = og.Controller.node("/TestGraph/Template_omni_graph_examples_cpp_Deformer1")
database = OgnDeformer1_CPUDatabase(test_node)
self.assertTrue(test_node.is_valid())
node_type_name = test_node.get_type_name()
self.assertEqual(og.GraphRegistry().get_node_type_version(node_type_name), 1)
def _attr_error(attribute: og.Attribute, usd_test: bool) -> str:
test_type = "USD Load" if usd_test else "Database Access"
return f"{node_type_name} {test_type} Test - {attribute.get_name()} value error"
self.assertTrue(test_node.get_attribute_exists("inputs:multiplier"))
attribute = test_node.get_attribute("inputs:multiplier")
db_value = database.inputs.multiplier
expected_value = 0.7
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("inputs:points"))
attribute = test_node.get_attribute("inputs:points")
db_value = database.inputs.points
expected_value = []
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("inputs:wavelength"))
attribute = test_node.get_attribute("inputs:wavelength")
db_value = database.inputs.wavelength
expected_value = 50.0
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("outputs:points"))
attribute = test_node.get_attribute("outputs:points")
db_value = database.outputs.points
| 5,501 | Python | 49.477064 | 205 | 0.674968 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/tests/TestOgnIK.py | import os
import omni.kit.test
import omni.graph.core as og
import omni.graph.core.tests as ogts
from omni.graph.core.tests.omnigraph_test_utils import _TestGraphAndNode
from omni.graph.core.tests.omnigraph_test_utils import _test_clear_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_setup_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_verify_scene
class TestOgn(ogts.OmniGraphTestCase):
async def test_data_access(self):
from omni.graph.examples.cpp.ogn.OgnIKDatabase import OgnIKDatabase
test_file_name = "OgnIKTemplate.usda"
usd_path = os.path.join(os.path.dirname(__file__), "usd", test_file_name)
if not os.path.exists(usd_path):
self.assertTrue(False, f"{usd_path} not found for loading test")
(result, error) = await ogts.load_test_file(usd_path)
self.assertTrue(result, f'{error} on {usd_path}')
test_node = og.Controller.node("/TestGraph/Template_omni_graph_examples_cpp_SimpleIk")
database = OgnIKDatabase(test_node)
self.assertTrue(test_node.is_valid())
node_type_name = test_node.get_type_name()
self.assertEqual(og.GraphRegistry().get_node_type_version(node_type_name), 1)
def _attr_error(attribute: og.Attribute, usd_test: bool) -> str:
test_type = "USD Load" if usd_test else "Database Access"
return f"{node_type_name} {test_type} Test - {attribute.get_name()} value error"
self.assertTrue(test_node.get_attribute_exists("inputs:goal"))
attribute = test_node.get_attribute("inputs:goal")
db_value = database.inputs.goal
expected_value = [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]]
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("state:ankle"))
attribute = test_node.get_attribute("state:ankle")
db_value = database.state.ankle
self.assertTrue(test_node.get_attribute_exists("state:hip"))
attribute = test_node.get_attribute("state:hip")
db_value = database.state.hip
self.assertTrue(test_node.get_attribute_exists("state:knee"))
attribute = test_node.get_attribute("state:knee")
db_value = database.state.knee
| 2,484 | Python | 47.725489 | 113 | 0.674718 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/tests/TestOgnSimpleGather.py | import omni.kit.test
import omni.graph.core as og
import omni.graph.core.tests as ogts
class TestOgn(ogts.OmniGraphTestCase):
async def test_data_access(self):
from omni.graph.examples.cpp.ogn.OgnSimpleGatherDatabase import OgnSimpleGatherDatabase
(_, (test_node,), _, _) = og.Controller.edit("/TestGraph", {
og.Controller.Keys.CREATE_NODES: ("Template_omni_graph_examples_cpp_SimpleGather", "omni.graph.examples.cpp.SimpleGather")
})
database = OgnSimpleGatherDatabase(test_node)
self.assertTrue(test_node.is_valid())
node_type_name = test_node.get_type_name()
self.assertEqual(og.GraphRegistry().get_node_type_version(node_type_name), 1)
def _attr_error(attribute: og.Attribute, usd_test: bool) -> str:
test_type = "USD Load" if usd_test else "Database Access"
return f"{node_type_name} {test_type} Test - {attribute.get_name()} value error"
self.assertTrue(test_node.get_attribute_exists("inputs:input0"))
attribute = test_node.get_attribute("inputs:input0")
db_value = database.inputs.input0
expected_value = []
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("inputs:multiplier"))
attribute = test_node.get_attribute("inputs:multiplier")
db_value = database.inputs.multiplier
expected_value = 0.0
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("outputs:output0"))
attribute = test_node.get_attribute("outputs:output0")
db_value = database.outputs.output0
| 1,727 | Python | 44.473683 | 134 | 0.676896 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/tests/TestOgnDeformerTimeBased.py | import os
import omni.kit.test
import omni.graph.core as og
import omni.graph.core.tests as ogts
from omni.graph.core.tests.omnigraph_test_utils import _TestGraphAndNode
from omni.graph.core.tests.omnigraph_test_utils import _test_clear_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_setup_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_verify_scene
class TestOgn(ogts.OmniGraphTestCase):
async def test_data_access(self):
from omni.graph.examples.cpp.ogn.OgnDeformerTimeBasedDatabase import OgnDeformerTimeBasedDatabase
test_file_name = "OgnDeformerTimeBasedTemplate.usda"
usd_path = os.path.join(os.path.dirname(__file__), "usd", test_file_name)
if not os.path.exists(usd_path):
self.assertTrue(False, f"{usd_path} not found for loading test")
(result, error) = await ogts.load_test_file(usd_path)
self.assertTrue(result, f'{error} on {usd_path}')
test_node = og.Controller.node("/TestGraph/Template_omni_graph_examples_cpp_DeformerTimeBased")
database = OgnDeformerTimeBasedDatabase(test_node)
self.assertTrue(test_node.is_valid())
node_type_name = test_node.get_type_name()
self.assertEqual(og.GraphRegistry().get_node_type_version(node_type_name), 1)
def _attr_error(attribute: og.Attribute, usd_test: bool) -> str:
test_type = "USD Load" if usd_test else "Database Access"
return f"{node_type_name} {test_type} Test - {attribute.get_name()} value error"
self.assertTrue(test_node.get_attribute_exists("inputs:multiplier"))
attribute = test_node.get_attribute("inputs:multiplier")
db_value = database.inputs.multiplier
expected_value = 1
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("inputs:points"))
attribute = test_node.get_attribute("inputs:points")
db_value = database.inputs.points
expected_value = []
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("inputs:time"))
attribute = test_node.get_attribute("inputs:time")
db_value = database.inputs.time
expected_value = 0.0
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("inputs:wavelength"))
attribute = test_node.get_attribute("inputs:wavelength")
db_value = database.inputs.wavelength
expected_value = 1
actual_value = og.Controller.get(attribute)
ogts.verify_values(expected_value, actual_value, _attr_error(attribute, True))
ogts.verify_values(expected_value, db_value, _attr_error(attribute, False))
self.assertTrue(test_node.get_attribute_exists("outputs:points"))
attribute = test_node.get_attribute("outputs:points")
db_value = database.outputs.points
| 3,450 | Python | 50.507462 | 105 | 0.695072 |
omniverse-code/kit/exts/omni.graph.examples.cpp/omni/graph/examples/cpp/ogn/tests/TestOgnCompound.py | import os
import omni.kit.test
import omni.graph.core as og
import omni.graph.core.tests as ogts
from omni.graph.core.tests.omnigraph_test_utils import _TestGraphAndNode
from omni.graph.core.tests.omnigraph_test_utils import _test_clear_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_setup_scene
from omni.graph.core.tests.omnigraph_test_utils import _test_verify_scene
class TestOgn(ogts.OmniGraphTestCase):
async def test_data_access(self):
from omni.graph.examples.cpp.ogn.OgnCompoundDatabase import OgnCompoundDatabase
test_file_name = "OgnCompoundTemplate.usda"
usd_path = os.path.join(os.path.dirname(__file__), "usd", test_file_name)
if not os.path.exists(usd_path):
self.assertTrue(False, f"{usd_path} not found for loading test")
(result, error) = await ogts.load_test_file(usd_path)
self.assertTrue(result, f'{error} on {usd_path}')
test_node = og.Controller.node("/TestGraph/Template_omni_graph_examples_cpp_Compound")
database = OgnCompoundDatabase(test_node)
self.assertTrue(test_node.is_valid())
node_type_name = test_node.get_type_name()
self.assertEqual(og.GraphRegistry().get_node_type_version(node_type_name), 1)
def _attr_error(attribute: og.Attribute, usd_test: bool) -> str:
test_type = "USD Load" if usd_test else "Database Access"
return f"{node_type_name} {test_type} Test - {attribute.get_name()} value error"
| 1,496 | Python | 47.290321 | 94 | 0.703209 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.